-
Notifications
You must be signed in to change notification settings - Fork 0
/
aab15b1fea8a6c48953bf152a334d6a1840184c3-smtp-auth.log
354 lines (354 loc) · 10.7 KB
/
aab15b1fea8a6c48953bf152a334d6a1840184c3-smtp-auth.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
rm -rf notqmail-aab15b1fea8a6c48953bf152a334d6a1840184c3-smtp-auth
git -C notqmail.git fetch origin aab15b1fea8a6c48953bf152a334d6a1840184c3
From https://github.com/notqmail/notqmail
* branch aab15b1fea8a6c48953bf152a334d6a1840184c3 -> FETCH_HEAD
git -C notqmail.git archive --prefix=notqmail-aab15b1fea8a6c48953bf152a334d6a1840184c3-smtp-auth/ aab15b1fea8a6c48953bf152a334d6a1840184c3 | tar xf -
cd notqmail-aab15b1fea8a6c48953bf152a334d6a1840184c3-smtp-auth; patch -f -p 1 <../patch/smtp-auth.patch
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|FILES.auth
|= TARGETS
|= Makefile
|= qmail-smtpd.c
|= qmail-smtpd.8
|
|Added files:
|
|& base64.c
|& base64.h
|
|Informational files:
|
|% install_auth.sh (Installation shell script)
|% README.auth
|% README.auth.old (old description of SMTP Auth)
|+++ Makefile 2004-04-03
|--- .././qmail-1.03/Makefile Mon Jun 15 12:53:16 1998
|+++ ../qmail-1.03.043/Makefile Fri Dec 5 14:58:06 2003
--------------------------
No file to patch. Skipping...
Hunk #1 ignored at 136.
Hunk #2 ignored at 1540.
Hunk #3 ignored at 1557.
3 out of 3 hunks ignored--saving rejects to qmail-1.03.043/Makefile.rej
Can't create qmail-1.03.043/Makefile.rej, output is in /tmp/patchryQHqyxjJia: No such file or directory
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|======================================
|
|
|History:
|--------
|
|This patch is based on Krzysztof Dabrowski's qmail-smtpd-auth-0.31 patch
|which itself uses "Mrs. Brisby's" initial code.
|Version 0.41 of this patch fixes the "CAPS-LOCK" typo announcing
|'CRAM_MD5' instead of 'CRAM-MD5' (german keyboard) - tx to Mike Garrison.
|Version 0.42 fixes the '421 unable to read controls (#4.3.0)' problem
|(can't read control/morercpthosts.cdb) because FD 3 was already closed - tx Richard Lyons.
|Version 0.43 fixes the ba64decode() failure in case CRAM_MD5 is not enabled - tx Vladimir Zidar.
|
|
|Scope:
|------
|
|This patch supports partly RFC 2554 "SMTP Service Extension for Authentication".
|For more technical details see: http://www.fehcom.de/qmail/docu/smtpauth.html.
|
|
|Installation:
|-------------
|
|* Untar the source in the qmail-1.03 home direcotry.
|* Run ./install_auth.
|* Modify the compile time option "#define CRAM_MD5" to your needs.
|* Re-make qmail.
|
|
|Setup:
|------
|
|In order to use SMTP Authentication you have to use a 'Pluggable Authentication Module'
|PAM to be called by qmail-smtpd; typically
|
| /var/qmail/bin/qmail-smtpd /bin/checkpassword true 2>&1
|
|Since qmail-smtpd does not run as root, checkpassword has to be made sticky.
|There is no need to include additionally the hostname in the call.
|In order to compute the CRAM-MD5 challenge, qmail-smtpd uses the 'tcplocalhost' information.
|
|
|Changes wrt. Krysztof Dabrowski's patch:
|----------------------------------------
|
|* Avoid the 'hostname' in the call of the PAM.
|* Confirm to Dan Bernstein's checkpassword interface even for CRAM-MD5.
|* Doesn't close FD 2; thus not inhibiting logging to STDERR.
|* Fixed bugs in base64.c.
|* Modified unconditional close of FD 3 in order to sustain reading of 'control/morecpthosts.cdb'.
|
|
|Erwin Hoffmann - Cologne 2004-04-03 (www.fehcom.de)
|
|
|+++ TARGETS 2004-04-03
|--- .././qmail-1.03/TARGETS Mon Jun 15 12:53:16 1998
|+++ ../qmail-1.03.043/TARGETS Mon Dec 8 13:37:41 2003
--------------------------
No file to patch. Skipping...
Hunk #1 ignored at 10.
1 out of 1 hunks ignored--saving rejects to qmail-1.03.043/TARGETS.rej
Can't create qmail-1.03.043/TARGETS.rej, output is in /tmp/patchryQHqyxjJia: No such file or directory
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|#include "stralloc.h"
|#include "substdio.h"
|#include "str.h"
|
|static char *b64alpha =
| "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|#define B64PAD '='
|
|/* returns 0 ok, 1 illegal, -1 problem */
|
|int b64decode(in,l,out)
|const unsigned char *in;
|int l;
|stralloc *out; /* not null terminated */
|{
| int p = 0;
| int n;
| unsigned int x;
| int i, j;
| char *s;
| unsigned char b[3];
|
| if (l == 0)
| {
| if (!stralloc_copys(out,"")) return -1;
| return 0;
| }
|
| while(in[l-1] == B64PAD) {
| p ++;
| l--;
| }
|
| n = (l + p) / 4;
| out->len = (n * 3) - p;
| if (!stralloc_ready(out,out->len)) return -1;
| s = out->s;
|
| for(i = 0; i < n - 1 ; i++) {
| x = 0;
| for(j = 0; j < 4; j++) {
| if(in[j] >= 'A' && in[j] <= 'Z')
| x = (x << 6) + (unsigned int)(in[j] - 'A' + 0);
| else if(in[j] >= 'a' && in[j] <= 'z')
| x = (x << 6) + (unsigned int)(in[j] - 'a' + 26);
| else if(in[j] >= '0' && in[j] <= '9')
| x = (x << 6) + (unsigned int)(in[j] - '0' + 52);
| else if(in[j] == '+')
| x = (x << 6) + 62;
| else if(in[j] == '/')
| x = (x << 6) + 63;
| else if(in[j] == '=')
| x = (x << 6);
| }
|
| s[2] = (unsigned char)(x & 255); x >>= 8;
| s[1] = (unsigned char)(x & 255); x >>= 8;
| s[0] = (unsigned char)(x & 255); x >>= 8;
| s += 3; in += 4;
| }
|
| x = 0;
| for(j = 0; j < 4; j++) {
| if(in[j] >= 'A' && in[j] <= 'Z')
| x = (x << 6) + (unsigned int)(in[j] - 'A' + 0);
| else if(in[j] >= 'a' && in[j] <= 'z')
| x = (x << 6) + (unsigned int)(in[j] - 'a' + 26);
| else if(in[j] >= '0' && in[j] <= '9')
| x = (x << 6) + (unsigned int)(in[j] - '0' + 52);
| else if(in[j] == '+')
| x = (x << 6) + 62;
| else if(in[j] == '/')
| x = (x << 6) + 63;
| else if(in[j] == '=')
| x = (x << 6);
| }
|
| b[2] = (unsigned char)(x & 255); x >>= 8;
| b[1] = (unsigned char)(x & 255); x >>= 8;
| b[0] = (unsigned char)(x & 255); x >>= 8;
|
| for(i = 0; i < 3 - p; i++)
| s[i] = b[i];
|
| return 0;
|}
|
|int b64encode(in,out)
|stralloc *in;
|stralloc *out; /* not null terminated */
|{
| unsigned char a, b, c;
| int i;
| char *s;
|
| if (in->len == 0)
| {
| if (!stralloc_copys(out,"")) return -1;
| return 0;
| }
|
| if (!stralloc_ready(out,in->len / 3 * 4 + 4)) return -1;
| s = out->s;
|
| for (i = 0;i < in->len;i += 3) {
| a = in->s[i];
| b = i + 1 < in->len ? in->s[i + 1] : 0;
| c = i + 2 < in->len ? in->s[i + 2] : 0;
|
| *s++ = b64alpha[a >> 2];
| *s++ = b64alpha[((a & 3 ) << 4) | (b >> 4)];
|
| if (i + 1 >= in->len) *s++ = B64PAD;
| else *s++ = b64alpha[((b & 15) << 2) | (c >> 6)];
|
| if (i + 2 >= in->len) *s++ = B64PAD;
| else *s++ = b64alpha[c & 63];
| }
| out->len = s - out->s;
| return 0;
|}
|#define BASE64_H
|
|extern int b64decode();
|extern int b64encode();
|
|#endif
|#
|# qmail-smtpd AUTH (UN)INSTALL Script (install_auth.sh)
|# -----------------------------------------------------
|#
|# Purpose: To install and uninstall the qmail-smtpd Authentication Patch
|#
|# Parameters: -u (uninstall)
|# VRF (Version to be uninstalled)
|#
|# Usage: ./install_auth.sh [-u] [Version]
|#
|# Installation: ./install_auth.sh
|# Uninstallation: ./install_auth.sh -u 105
|#
|# Return Codes: 0 - Patches applied successfully
|# 1 - Original QMAIL files not found (Patch not extracted in QMAIL source directory)
|# 2 - Patch files not found
|#
|# Output: install_auth.log
|#
|# History: 1.0.0 - Erwin Hoffmann - Initial release
|#
|#---------------------------------------------------------------------------------------
|#
|DATE=$(date)
|LOCDIR=${PWD}
|QMAILHOME=$(head -1 conf-qmail)
|SOLARIS=$(sh ./find-systype.sh | grep -ciq "SunOS")
|LOGFILE=auth.log
|TARGETS=FILES.auth
|IFSKEEP=${IFS}
|REL=043 # Should be identical to qmail-smtpd AUTH level
|BUILD=2004094213621
|
|
|if [ $# -eq 0 ] ; then
|
| echo "Installing qmail-smtpd AUTH $REL (Build $BUILD) at $DATE <<<" | tee -a $LOGFILE 2>&1
|
| for FILE in $(grep "^= " ${TARGETS} | awk '{print $2}'); do
| echo "Targeting file $FILE ..." | tee -a $LOGFILE 2>&1
| if [ -s ${FILE} ] ; then
| cp ${FILE} ${FILE}.$REL | tee -a $LOGFILE 2>&1
| echo "--> ${FILE} copied to ${FILE}.$REL" | tee -a $LOGFILE 2>&1
| else
| echo "${FILE} not found !"
| exit 1
| fi
| if [ -s ${FILE}.patch ] ; then
| if [ ${SOLARIS} -gt 0 ]; then
| echo "--> Patching qmail source file ${FILE} for Solaris ...." | tee -a $LOGFILE 2>&1
| patch -i ${FILE}.patch ${FILE} 2>&1 | tee -a $LOGFILE
| else
| echo "--> Patching qmail source file ${FILE} ...." | tee -a $LOGFILE 2>&1
| patch ${FILE} ${FILE}.patch 2>&1 | tee -a $LOGFILE
| fi
| else
| echo "!! ${FILE}.patch not found !"
| exit 2
| fi
| done
|
|
| echo "Copying documentation and samples to ${QMAILHOME}/doc/ ..." | tee -a $LOGFILE 2>&1
|
| cp -v README.auth* ${QMAILHOME}/doc/ | tee -a $LOGFILE 2>&1
| echo ""
| echo "If you dont wont CRAM-MD5 suport disable '#define CRAM_MD5' in qmail-smtpd !"
| echo "Installation of qmail-smtpd AUTH $REL (Build $BUILD) finished at $DATE <<<" | tee -a $LOGFILE 2>&1
|
|# Now go for the uninstallation....
|
|elif [ "$1" = "-u" ] ; then
|
|# Get the Version Number from INPUT
|
| if [ $# -eq 2 ] ; then
| REL=$2
| fi
|
| echo "De-installing qmail-smtpd AUTH $REL (Build $BUILD) at $DATE <<<" | tee -a $LOGFILE 2>&1
|
| for FILE in $(grep "^= " ${TARGETS} | awk '{print $2}'); do
| echo "Targeting file $FILE ..." | tee -a $LOGFILE 2>&1
| if [ -s ${FILE}.$REL ] ; then
| mv ${FILE}.$REL ${FILE} | tee -a $LOGFILE 2>&1
| touch ${FILE}
| echo "--> ${FILE}.$REL moved to ${FILE}" | tee -a $LOGFILE 2>&1
| else
| echo "!! ${FILE}.$REL not found !"
| fi
| done
| echo "De-installation of qmail-smtpd AUTH $REL (Build $BUILD) finished at $DATE <<<" | tee -a $LOGFILE 2>&1
|fi
|
|exit 0
|+++ qmail-smtpd.8 2004-04-03
|--- .././qmail-1.03/qmail-smtpd.8 Mon Jun 15 12:53:16 1998
|+++ ../qmail-1.03.043/qmail-smtpd.8 Mon Dec 8 13:50:32 2003
--------------------------
No file to patch. Skipping...
Hunk #1 ignored at 23.
1 out of 1 hunks ignored--saving rejects to qmail-1.03.043/qmail-smtpd.8.rej
Can't create qmail-1.03.043/qmail-smtpd.8.rej, output is in /tmp/patchryQHqyxjJia: No such file or directory
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|+++ qmail-smtpd.c 2004-04-03
|--- .././qmail-1.03/qmail-smtpd.c Mon Jun 15 12:53:16 1998
|+++ ../qmail-1.03.043/qmail-smtpd.c Sat Apr 3 10:49:01 2004
--------------------------
No file to patch. Skipping...
Hunk #1 ignored at 23.
Hunk #2 ignored at 63.
Hunk #3 ignored at 243.
Hunk #4 ignored at 414.
Hunk #5 ignored at 654.
5 out of 5 hunks ignored--saving rejects to qmail-1.03.043/qmail-smtpd.c.rej
Can't create qmail-1.03.043/qmail-smtpd.c.rej, output is in /tmp/patchryQHqyxjJia: No such file or directory
done
*** Error 1 in . (Makefile:33 'notqmail-aab15b1fea8a6c48953bf152a334d6a1840184c3-smtp-auth')