--- Makefile.patch.orig Mon Jan 24 21:29:42 2005 +++ Makefile.patch Thu Dec 28 15:03:32 2006 @@ -13,7 +13,7 @@ binm1: \ binm1.sh conf-qmail cat binm1.sh \ -@@ -1536,12 +1540,12 @@ +@@ -1536,13 +1540,13 @@ timeoutwrite.o ip.o ipme.o ipalloc.o control.o constmap.o received.o \ date822fmt.o now.o qmail.o cdb.a fd.a wait.a datetime.a getln.a \ open.a sig.a case.a env.a stralloc.a alloc.a substdio.a error.a str.a \ @@ -21,10 +21,11 @@ +fs.a auto_qmail.o base64.o socket.lib ./load qmail-smtpd rcpthosts.o commands.o timeoutread.o \ timeoutwrite.o ip.o ipme.o ipalloc.o control.o constmap.o \ + tls.o ssl_timeoutio.o ndelay.a -L/usr/local/ssl/lib -lssl -lcrypto \ received.o date822fmt.o now.o qmail.o cdb.a fd.a wait.a \ datetime.a getln.a open.a sig.a case.a env.a stralloc.a \ - alloc.a substdio.a error.a str.a fs.a auto_qmail.o `cat \ -+ alloc.a substdio.a error.a str.a fs.a auto_qmail.o base64.o `cat \ ++ alloc.a substdio.a error.a str.a fs.a auto_qmail.o base64.o `cat \ socket.lib` qmail-smtpd.0: \ --- qmail-smtpd.c.patch.orig Mon Jan 24 21:29:42 2005 +++ qmail-smtpd.c.patch Thu Dec 28 16:56:05 2006 @@ -38,14 +38,6 @@ stralloc greeting = {0}; -@@ -76,6 +91,7 @@ - smtp_greet("221 "); out("\r\n"); flush(); _exit(0); - } - -+char *protocol; - char *remoteip; - char *remotehost; - char *remoteinfo; @@ -109,7 +125,6 @@ if (liphostok == -1) die_control(); if (control_readint(&timeout,"control/timeoutsmtpd") == -1) die_control(); @@ -54,14 +46,6 @@ if (rcpthosts_init() == -1) die_control(); bmfok = control_readfile(&bmf,"control/badmailfrom",0); -@@ -122,6 +137,7 @@ - if (x) { scan_ulong(x,&u); databytes = u; } - if (!(databytes + 1)) --databytes; - -+ protocol = "SMTP"; - remoteip = env_get("TCPREMOTEIP"); - if (!remoteip) remoteip = "unknown"; - local = env_get("TCPLOCALHOST"); @@ -219,8 +235,70 @@ int seenmail = 0; @@ -133,24 +117,29 @@ void smtp_helo(arg) char *arg; { -@@ -229,7 +307,16 @@ - } +@@ -229,13 +307,21 @@ void smtp_ehlo(arg) char *arg; { -- smtp_greet("250-"); out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n"); + #ifdef TLS + struct stat st; + #endif + char size[FMT_ULONG]; + size[fmt_ulong(size,(unsigned int) databytes)] = 0; -+ smtp_greet("250-"); + smtp_greet("250-"); + #ifdef TLS + if (!ssl && (stat("control/servercert.pem",&st) == 0)) + out("\r\n250-STARTTLS"); + #endif +- out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n"); + out("\r\n250-PIPELINING\r\n250-8BITMIME\r\n"); -+ out("250-SIZE "); out(size); out("\r\n"); +#ifdef CRAM_MD5 -+ out("250 AUTH LOGIN PLAIN CRAM-MD5\r\n"); ++ out("250-AUTH LOGIN PLAIN CRAM-MD5\r\n"); +#else -+ out("250 AUTH LOGIN PLAIN\r\n"); ++ out("250-AUTH LOGIN PLAIN\r\n"); +#endif ++ out("250 SIZE "); out(size); out("\r\n"); seenmail = 0; dohelo(arg); } - void smtp_rset() @@ -240,6 +327,9 @@ void smtp_mail(arg) char *arg; { @@ -161,16 +150,7 @@ flagbarf = bmfcheck(); seenmail = 1; if (!stralloc_copys(&rcptto,"")) die_nomem(); -@@ -378,7 +468,7 @@ - qp = qmail_qp(&qqt); - out("354 go ahead\r\n"); - -- received(&qqt,"SMTP",local,remoteip,remotehost,remoteinfo,fakehelo); -+ received(&qqt,protocol,local,remoteip,remotehost,remoteinfo,fakehelo); - blast(&hops); - hops = (hops >= MAXHOPS); - if (hops) qmail_fail(&qqt); -@@ -388,16 +478,242 @@ +@@ -388,7 +478,7 @@ qqx = qmail_close(&qqt); if (!*qqx) { acceptmessage(qp); return; } if (hops) { out("554 too many hops, this message is looping (#5.4.6)\r\n"); return; } @@ -179,7 +159,9 @@ if (*qqx == 'D') out("554 "); else out("451 "); out(qqx + 1); out("\r\n"); - } +@@ -388,10 +478,236 @@ + + #endif +/* this file is too long ----------------------------------------- SMTP AUTH */ +