summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2003-08-13 11:36:17 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2003-08-13 11:36:17 +0000
commit261ef8dc3f8977477944586cbc1457f83a9c3a48 (patch)
tree97c699243239ed1d64bbc6b6f0ffd2a06cef8574 /net-mail/qmail
parentAdd support for oversize DNS, working badrcptto, trim large bounce messages. ... (diff)
downloadhistorical-261ef8dc3f8977477944586cbc1457f83a9c3a48.tar.gz
historical-261ef8dc3f8977477944586cbc1457f83a9c3a48.tar.bz2
historical-261ef8dc3f8977477944586cbc1457f83a9c3a48.zip
Add support for oversize DNS, working badrcptto, trim large bounce messages. Disable SSL as a bug is in it presently. Add better sample files for /etc/tcp.smtp et al.
Diffstat (limited to 'net-mail/qmail')
-rw-r--r--net-mail/qmail/Manifest37
-rw-r--r--net-mail/qmail/files/1.03-r12/badrcptto-morebadrcptto-accdias-gentoo564
-rw-r--r--net-mail/qmail/files/1.03-r12/conf-common4
-rw-r--r--net-mail/qmail/files/1.03-r12/conf-pop3d25
-rw-r--r--net-mail/qmail/files/1.03-r12/conf-qmqpd5
-rw-r--r--net-mail/qmail/files/1.03-r12/conf-qmtpd5
-rw-r--r--net-mail/qmail/files/1.03-r12/conf-smtpd14
-rw-r--r--net-mail/qmail/files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch81
-rw-r--r--net-mail/qmail/files/1.03-r12/run-qmailpop3d25
-rw-r--r--net-mail/qmail/files/digest-qmail-1.03-r122
-rw-r--r--net-mail/qmail/files/gencert.sh4
-rw-r--r--net-mail/qmail/files/tcp.pop3.sample7
-rw-r--r--net-mail/qmail/files/tcp.qmqp.sample8
-rw-r--r--net-mail/qmail/files/tcp.qmtp.sample8
-rw-r--r--net-mail/qmail/files/tcp.smtp.sample83
-rw-r--r--net-mail/qmail/qmail-1.03-r12.ebuild55
16 files changed, 880 insertions, 47 deletions
diff --git a/net-mail/qmail/Manifest b/net-mail/qmail/Manifest
index 6282597bc5a8..7a736f92a5ae 100644
--- a/net-mail/qmail/Manifest
+++ b/net-mail/qmail/Manifest
@@ -2,19 +2,31 @@ MD5 4bf70f21528928c670477f76bd375237 qmail-1.03-r11.ebuild 11431
MD5 3bdf6864e9399d20c8d786be23d7d34f qmail-1.03-r9.ebuild 9990
MD5 d1d239c08fb007430de3a84e0a5de524 qmail-1.03-r10.ebuild 11180
MD5 173fcf74cb0fb3fd6df5a3c842cd6d41 qmail-1.03-r8.ebuild 8142
-MD5 a823e41ec7b9353c7b28c5daadf445c1 qmail-1.03-r12.ebuild 12919
-MD5 3d55f5cbd30b42c07a2191315d858f3f ChangeLog 8529
+MD5 adc831135c76d281c484ada4a2de4e24 qmail-1.03-r12.ebuild 12657
+MD5 8900494a0d691ef3e3feb3c0328c6794 ChangeLog 9179
MD5 ff596e74b015e067a180fc78855aa87a metadata.xml 360
-MD5 7430fb40cf83664e7f0cdc9a80050c25 tmp/badrcptto-morebadrcptto-accdias.diff.bz2 4788
-MD5 1c4518f780d231bde9745cdd0fa313b2 tmp/qmail-limit-bounce-size.patch.txt 1753
-MD5 d566e8bd99b33efee0194e855b8d6995 tmp/qmail-date-localtime.patch.txt 2603
+MD5 29d91d57aeac05c48034a0e9984ffb79 tmp/tmp 3120
+MD5 4128b18b027f83b5e4880137cd1f1963 tmp/badrcptto-morebadrcptto-accdias.diff.part1 1231
+MD5 9b79f4030bf99d53c842b472ae264133 tmp/badrcptto-morebadrcptto-accdias.diff.part2 1237
+MD5 111c52f4468c7d5d0e97ffbbd50ea3b8 tmp/badrcptto-morebadrcptto-accdias.diff.part3 2273
+MD5 d0cfd6b2cd24c3136043a1d76c0cce38 tmp/badrcptto-morebadrcptto-accdias.diff.part4 1163
+MD5 77ffc3109ccd8929e33b6bb1d80fe943 tmp/badrcptto-morebadrcptto-accdias.diff.part5 2026
+MD5 679e65462cd88a33be5ebd92309ff92e tmp/badrcptto-morebadrcptto-accdias.diff.part6 2434
+MD5 5e5ad4e08dd8bf246035369b41d493e0 tmp/badrcptto-morebadrcptto-accdias.diff.part7 910
+MD5 00abef19f5d299cc55c829181b92b67d tmp/badrcptto-morebadrcptto-accdias.diff.part8 5249
+MD5 5202f2994ead63bc76d0aa9f0294d31e tmp/badrcptto-morebadrcptto-accdias.diff.part9 391
+MD5 addfbd0553d012d3a593099ac3abee0c tmp/todo.list 836
MD5 ada6695a0138163b46bef433b643ac86 tmp/badrcptto-morebadrcptto-accdias.diff 16965
-MD5 7553829a93411cdaffce31a29323697f tmp/qmail-maildir++.patch 43510
+MD5 e0686e52df7f0c840a7ac2bfe1fd291a files/tcp.qmqp.sample 337
+MD5 946a715ffdd5e6d2d29c6fdfb29376dd files/tcp.smtp.sample 3726
+MD5 734ea9dfff4513984d2d69123ce54fb8 files/gencert.sh 224
MD5 5897cb300c3233c91c7e221c8b4b8501 files/digest-qmail-1.03-r8 245
MD5 48a1e168db29ab4e6c57f1ac135ee2bf files/digest-qmail-1.03-r9 323
+MD5 55b519379b1330f57110fa6d60982cff files/tcp.pop3.sample 285
MD5 1fa33b460954492678129c60520e9cba files/digest-qmail-1.03-r10 442
MD5 d6b150617bc5d76374fe010fc2902923 files/digest-qmail-1.03-r11 764
MD5 3b7fe7fb44e5c6bf9e5c979dd1b1ca5c files/digest-qmail-1.03-r12 1110
+MD5 76d218a258e2ec859ab80c377351afce files/tcp.qmtp.sample 370
MD5 f42a779e5c708c2d7bf38de66dfb93f5 files/1.03-r8/rc 108
MD5 71aa0894c118dda3405f1f847944158c files/1.03-r8/qmail-queue.patch 1512
MD5 aa0823cdce32c502c856664c8b0ce775 files/1.03-r8/run-qmailsmtpd 231
@@ -73,7 +85,7 @@ MD5 c4dfed6db3b0b96b84bc7eb6c22aec08 files/1.03-r11/conf-common 836
MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03-r11/run-qmailsend 29
MD5 0e97c0b031776f40cacdfbf3114af574 files/1.03-r11/run-qmailpop3dlog 97
MD5 f42a779e5c708c2d7bf38de66dfb93f5 files/1.03-r12/rc 108
-MD5 88f15101dd4bc36b52d13f336713e716 files/1.03-r12/run-qmailpop3d 221
+MD5 008a160422e1d3e166ea6209e7586ebb files/1.03-r12/run-qmailpop3d 1122
MD5 1fcc8023bbdc64001e792c4bcf3da57d files/1.03-r12/run-qmailqmqpd 1111
MD5 48a655613e62090f387363b19e2d16ee files/1.03-r12/run-qmailqmtpd 1111
MD5 03441b007f4cb66ceaceb2c9b6d7fbfb files/1.03-r12/run-qmailsmtpd 1111
@@ -85,12 +97,15 @@ MD5 a993cab8b077162680bb09fa8e5ed896 files/1.03-r12/bad-rcpt-noisy-patch 10388
MD5 795f633858c0919b6e201cf2b845779e files/1.03-r12/run-qmailqmtpdlog 97
MD5 b24f4dbd450d2d4eddc75ba19cebb915 files/1.03-r12/dot_qmail 34
MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03-r12/run-qmailsmtpdlog 97
-MD5 c405feee8a1cf55d49f6b9b2f6a1094e files/1.03-r12/conf-qmqpd 377
-MD5 de5dd10da85322890de21e18507bf7fb files/1.03-r12/conf-qmtpd 469
-MD5 c4bd9f4cc4a7f1eadec12da3bdb63465 files/1.03-r12/conf-smtpd 1424
+MD5 98c5a7c23416baf7c086b93ed586eb81 files/1.03-r12/conf-pop3d 1071
+MD5 53f8a798a9a11ef0352581244a7c1ad4 files/1.03-r12/conf-qmqpd 470
+MD5 7e3617ddb00abaa780f29cfdb838fd16 files/1.03-r12/conf-qmtpd 562
+MD5 1d7e48b17ef49117c4f975adf4757bf1 files/1.03-r12/conf-smtpd 1709
MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03-r12/run-qmailsendlog 96
+MD5 2989c6fc4e70a9cc18580b3d83ce33fc files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch 2043
MD5 fc7391f02934a9c75a92dce36229d590 files/1.03-r12/qmail-control 858
-MD5 fea7374599ee92b4533fd8802e3c5fc3 files/1.03-r12/conf-common 1097
+MD5 dda736a7fb5a56209abead6e840252e8 files/1.03-r12/badrcptto-morebadrcptto-accdias-gentoo 19322
+MD5 2eb76f26c4ae70595f013d34519a41b8 files/1.03-r12/conf-common 1094
MD5 9027a1cbc134fd8fcbdf54280fb625b4 files/1.03-r12/config-sanity-check 773
MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03-r12/run-qmailsend 29
MD5 0e97c0b031776f40cacdfbf3114af574 files/1.03-r12/run-qmailpop3dlog 97
diff --git a/net-mail/qmail/files/1.03-r12/badrcptto-morebadrcptto-accdias-gentoo b/net-mail/qmail/files/1.03-r12/badrcptto-morebadrcptto-accdias-gentoo
new file mode 100644
index 000000000000..601dfd5fb262
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r12/badrcptto-morebadrcptto-accdias-gentoo
@@ -0,0 +1,564 @@
+diff -ur qmail-1.03.orig/Makefile qmail-1.03/Makefile
+--- qmail-1.03.orig/Makefile 2003-08-12 21:33:21.000000000 -0700
++++ qmail-1.03/Makefile 2003-08-12 21:34:08.000000000 -0700
+@@ -807,7 +807,7 @@
+ predate datemail mailsubj qmail-upq qmail-showctl qmail-newu \
+ qmail-pw2u qmail-qread qmail-qstat qmail-tcpto qmail-tcpok \
+ qmail-pop3d qmail-popup qmail-qmqpc qmail-qmqpd qmail-qmtpd \
+-qmail-smtpd sendmail tcp-env qmail-newmrh config config-fast dnscname \
++qmail-smtpd sendmail tcp-env qmail-newmrh qmail-newbrt config config-fast dnscname \
+ dnsptr dnsip dnsmxip dnsfq hostname ipmeprint qreceipt qsmhook qbiff \
+ forward preline condredirect bouncesaying except maildirmake \
+ maildir2mbox maildirwatch qail elq pinq idedit install-big install \
+@@ -963,7 +963,7 @@
+ man: \
+ qmail-local.0 qmail-lspawn.0 qmail-getpw.0 qmail-remote.0 \
+ qmail-rspawn.0 qmail-clean.0 qmail-send.0 qmail-start.0 splogger.0 \
+-qmail-queue.0 qmail-inject.0 mailsubj.0 qmail-showctl.0 qmail-newu.0 \
++qmail-queue.0 qmail-inject.0 mailsubj.0 qmail-showctl.0 qmail-newbrt.0 qmail-newu.0 \
+ qmail-pw2u.0 qmail-qread.0 qmail-qstat.0 qmail-tcpto.0 qmail-tcpok.0 \
+ qmail-pop3d.0 qmail-popup.0 qmail-qmqpc.0 qmail-qmqpd.0 qmail-qmtpd.0 \
+ qmail-smtpd.0 tcp-env.0 qmail-newmrh.0 qreceipt.0 qbiff.0 forward.0 \
+@@ -1280,6 +1280,31 @@
+ uint32.h substdio.h
+ ./compile qmail-newmrh.c
+
++qmail-newbrt: \
++load qmail-newbrt.o cdbmss.o getln.a open.a cdbmake.a seek.a case.a \
++stralloc.a alloc.a strerr.a substdio.a error.a str.a auto_qmail.o
++ ./load qmail-newbrt cdbmss.o getln.a open.a cdbmake.a \
++ seek.a case.a stralloc.a alloc.a strerr.a substdio.a \
++ error.a str.a auto_qmail.o
++
++qmail-newbrt.o: \
++compile qmail-newbrt.c strerr.h stralloc.h gen_alloc.h substdio.h \
++getln.h exit.h readwrite.h open.h auto_qmail.h cdbmss.h cdbmake.h \
++uint32.h substdio.h
++ ./compile qmail-newbrt.c
++
++qmail-newbrt.0: \
++qmail-newbrt.8
++ nroff -man qmail-newbrt.8 > qmail-newbrt.0
++
++qmail-newbrt.8: \
++qmail-newbrt.9 conf-break conf-spawn
++ cat qmail-newbrt.9 \
++ | sed s}QMAILHOME}"`head -1 conf-qmail`"}g \
++ | sed s}BREAK}"`head -1 conf-break`"}g \
++ | sed s}SPAWN}"`head -1 conf-spawn`"}g \
++ > qmail-newbrt.8
++
+ qmail-newu: \
+ load qmail-newu.o cdbmss.o getln.a open.a seek.a cdbmake.a case.a \
+ stralloc.a alloc.a substdio.a error.a str.a auto_qmail.o
+diff -ur qmail-1.03.orig/TARGETS qmail-1.03/TARGETS
+--- qmail-1.03.orig/TARGETS 2003-08-12 21:33:21.000000000 -0700
++++ qmail-1.03/TARGETS 2003-08-12 21:34:08.000000000 -0700
+@@ -237,6 +237,8 @@
+ cdbmake_add.o
+ cdbmake.a
+ qmail-newu
++qmail-newbrt.o
++qmail-newbrt
+ qmail-pw2u.o
+ qmail-pw2u
+ qmail-qread.o
+@@ -349,6 +351,8 @@
+ qmail-inject.0
+ mailsubj.0
+ qmail-showctl.0
++qmail-newbrt.8
++qmail-newbrt.0
+ qmail-newu.8
+ qmail-newu.0
+ qmail-pw2u.8
+diff -ur qmail-1.03.orig/hier.c qmail-1.03/hier.c
+--- qmail-1.03.orig/hier.c 2003-08-12 21:33:19.000000000 -0700
++++ qmail-1.03/hier.c 2003-08-12 21:34:08.000000000 -0700
+@@ -111,6 +111,7 @@
+ c(auto_qmail,"bin","qmail-clean",auto_uido,auto_gidq,0711);
+ c(auto_qmail,"bin","qmail-send",auto_uido,auto_gidq,0711);
+ c(auto_qmail,"bin","splogger",auto_uido,auto_gidq,0711);
++ c(auto_qmail,"bin","qmail-newbrt",auto_uido,auto_gidq,0700);
+ c(auto_qmail,"bin","qmail-newu",auto_uido,auto_gidq,0700);
+ c(auto_qmail,"bin","qmail-newmrh",auto_uido,auto_gidq,0700);
+ c(auto_qmail,"bin","qmail-pw2u",auto_uido,auto_gidq,0711);
+@@ -223,6 +224,8 @@
+ c(auto_qmail,"man/cat8","qmail-inject.0",auto_uido,auto_gidq,0644);
+ c(auto_qmail,"man/man8","qmail-showctl.8",auto_uido,auto_gidq,0644);
+ c(auto_qmail,"man/cat8","qmail-showctl.0",auto_uido,auto_gidq,0644);
++ c(auto_qmail,"man/man8","qmail-newbrt.8",auto_uido,auto_gidq,0644);
++ c(auto_qmail,"man/cat8","qmail-newbrt.0",auto_uido,auto_gidq,0644);
+ c(auto_qmail,"man/man8","qmail-newmrh.8",auto_uido,auto_gidq,0644);
+ c(auto_qmail,"man/cat8","qmail-newmrh.0",auto_uido,auto_gidq,0644);
+ c(auto_qmail,"man/man8","qmail-newu.8",auto_uido,auto_gidq,0644);
+diff -ur qmail-1.03.orig/install-big.c qmail-1.03/install-big.c
+--- qmail-1.03.orig/install-big.c 1998-06-15 03:53:16.000000000 -0700
++++ qmail-1.03/install-big.c 2003-08-12 21:34:08.000000000 -0700
+@@ -109,6 +109,7 @@
+ c(auto_qmail,"bin","qmail-clean",auto_uido,auto_gidq,0711);
+ c(auto_qmail,"bin","qmail-send",auto_uido,auto_gidq,0711);
+ c(auto_qmail,"bin","splogger",auto_uido,auto_gidq,0711);
++ c(auto_qmail,"bin","qmail-newbrt",auto_uido,auto_gidq,0700);
+ c(auto_qmail,"bin","qmail-newu",auto_uido,auto_gidq,0700);
+ c(auto_qmail,"bin","qmail-newmrh",auto_uido,auto_gidq,0700);
+ c(auto_qmail,"bin","qmail-pw2u",auto_uido,auto_gidq,0711);
+@@ -221,6 +222,8 @@
+ c(auto_qmail,"man/cat8","qmail-inject.0",auto_uido,auto_gidq,0644);
+ c(auto_qmail,"man/man8","qmail-showctl.8",auto_uido,auto_gidq,0644);
+ c(auto_qmail,"man/cat8","qmail-showctl.0",auto_uido,auto_gidq,0644);
++ c(auto_qmail,"man/man8","qmail-newmbrt.8",auto_uido,auto_gidq,0644);
++ c(auto_qmail,"man/cat8","qmail-newmbrt.0",auto_uido,auto_gidq,0644);
+ c(auto_qmail,"man/man8","qmail-newmrh.8",auto_uido,auto_gidq,0644);
+ c(auto_qmail,"man/cat8","qmail-newmrh.0",auto_uido,auto_gidq,0644);
+ c(auto_qmail,"man/man8","qmail-newu.8",auto_uido,auto_gidq,0644);
+Only in qmail-1.03: qmail-newbrt.9
+Only in qmail-1.03: qmail-newbrt.c
+diff -ur qmail-1.03.orig/qmail-showctl.c qmail-1.03/qmail-showctl.c
+--- qmail-1.03.orig/qmail-showctl.c 1998-06-15 03:53:16.000000000 -0700
++++ qmail-1.03/qmail-showctl.c 2003-08-12 21:34:08.000000000 -0700
+@@ -215,6 +215,27 @@
+ }
+
+ do_lst("badmailfrom","Any MAIL FROM is allowed.",""," not accepted in MAIL FROM.");
++
++ if (do_lst("badrcptto","Any RCPT TO is allowed."," not accepted in RCPT TO ","."))
++ do_lst("morebadrcptto","No effect."," no accepted in RCPT TO ",".");
++ else
++ do_lst("morebadrcptto","No badrcptto; morebadrcpto is irrelevant.","No badrcptto; doesn't matter that morebadrcptto has ",".");
++ /* XXX: check badrcptto.cdb contents */
++ substdio_puts(subfdout,"\nmorebadrcptto.cdb: ");
++ if (stat("morebadrcptto",&stmrh) == -1)
++ if (stat("morebadrcptto.cdb",&stmrhcdb) == -1)
++ substdio_puts(subfdout,"(Default.) No effect.\n");
++ else
++ substdio_puts(subfdout,"Oops! morebadrcptto.cdb exists but morebadrcptto doesn't.\n");
++ else
++ if (stat("morebadrcptto.cdb",&stmrhcdb) == -1)
++ substdio_puts(subfdout,"Oops! morebadrcptto exists but morebadrcptto.cdb doesn't.\n");
++ else
++ if (stmrh.st_mtime > stmrhcdb.st_mtime)
++ substdio_puts(subfdout,"Oops! morebadrcptto.cdb is older than morebadrcptto.\n");
++ else
++ substdio_puts(subfdout,"Modified recently enough; hopefully up to date.\n");
++
+ do_str("bouncefrom",0,"MAILER-DAEMON","Bounce user name is ");
+ do_str("bouncehost",1,"bouncehost","Bounce host name is ");
+ do_int("concurrencylocal","10","Local concurrency is ","");
+@@ -268,6 +289,7 @@
+ if (str_equal(d->d_name,"bouncefrom")) continue;
+ if (str_equal(d->d_name,"bouncehost")) continue;
+ if (str_equal(d->d_name,"badmailfrom")) continue;
++ if (str_equal(d->d_name,"badrcptto")) continue;
+ if (str_equal(d->d_name,"bouncefrom")) continue;
+ if (str_equal(d->d_name,"bouncehost")) continue;
+ if (str_equal(d->d_name,"concurrencylocal")) continue;
+@@ -283,6 +305,8 @@
+ if (str_equal(d->d_name,"localiphost")) continue;
+ if (str_equal(d->d_name,"locals")) continue;
+ if (str_equal(d->d_name,"me")) continue;
++ if (str_equal(d->d_name,"morebadrcptto")) continue;
++ if (str_equal(d->d_name,"morebadrcptto.cdb")) continue;
+ if (str_equal(d->d_name,"morercpthosts")) continue;
+ if (str_equal(d->d_name,"morercpthosts.cdb")) continue;
+ if (str_equal(d->d_name,"percenthack")) continue;
+diff -ur qmail-1.03.orig/qmail-smtpd.8 qmail-1.03/qmail-smtpd.8
+--- qmail-1.03.orig/qmail-smtpd.8 2003-08-12 21:33:19.000000000 -0700
++++ qmail-1.03/qmail-smtpd.8 2003-08-12 21:34:08.000000000 -0700
+@@ -92,6 +92,13 @@
+ the client-presented certificates during a TLS-encrypted session.
+
+ .TP 5
++.I badrcptto
++Unacceptable envelope recipient addresses.
++.B qmail-smtpd
++will reject every recipient address for a message
++if the envelope recipient address is listed in
++.IR badrcptto .
++.TP 5
+ .I databytes
+ Maximum number of bytes allowed in a message,
+ or 0 for no limit.
+@@ -139,6 +146,23 @@
+ This is done before
+ .IR rcpthosts .
+ .TP 5
++.I morebadrcptto
++Extra not allowed RCPT TO addresses.
++If
++.I badrcptto
++and
++.I morebadrcptto
++both exist,
++.I morebardrcptto
++is effectively appended to
++.IR badrcptto .
++
++You must run
++.B qmail-newbrt
++whenever
++.I morebadrcptto
++changes.
++.TP 5
+ .I morercpthosts
+ Extra allowed RCPT domains.
+ If
+diff -ur qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
+--- qmail-1.03.orig/qmail-smtpd.c 2003-08-12 21:33:22.000000000 -0700
++++ qmail-1.03/qmail-smtpd.c 2003-08-13 00:25:13.000000000 -0700
+@@ -25,12 +25,19 @@
+ #include "commands.h"
+ #include "wait.h"
+ #include "fd.h"
++#include "cdb.h"
+
+ #define AUTHCRAM
+ #define MAXHOPS 100
+ unsigned int databytes = 0;
+ int timeout = 1200;
+
++char *remoteip;
++char *remotehost;
++char *remoteinfo;
++char *local;
++char *relayclient;
++
+ const char *protocol = "SMTP";
+
+ #ifdef TLS
+@@ -59,17 +66,52 @@
+ char ssoutbuf[512];
+ substdio ssout = SUBSTDIO_FDBUF(safewrite,1,ssoutbuf,sizeof ssoutbuf);
+
++/* write errors to stderr */
++char erroutbuf[512];
++substdio errout = SUBSTDIO_FDBUF(safewrite,2,erroutbuf,sizeof erroutbuf);
++
+ void flush() { substdio_flush(&ssout); }
+ void out(s) char *s; { substdio_puts(&ssout,s); }
+
++void eflush() { substdio_flush(&errout); }
++void eout(s) char *s; { substdio_puts(&errout,s); }
++void enew() { substdio_puts(&errout,"qmail-smtpd: "); }
++
+ void die_read() { _exit(1); }
+-void die_alarm() { out("451 timeout (#4.4.2)\r\n"); flush(); _exit(1); }
+-void die_nomem() { out("421 out of memory (#4.3.0)\r\n"); flush(); _exit(1); }
+-void die_control() { out("421 unable to read controls (#4.3.0)\r\n"); flush(); _exit(1); }
+-void die_ipme() { out("421 unable to figure out my IP addresses (#4.3.0)\r\n"); flush(); _exit(1); }
+-void straynewline() { out("451 See http://pobox.com/~djb/docs/smtplf.html.\r\n"); flush(); _exit(1); }
++
++void die_alarm()
++{
++ enew(); eout("Connection to "); eout(remoteip); eout(" timed out.\n");
++ out("451 timeout (#4.4.2)\r\n"); flush(); eflush(); _exit(1);
++}
++void die_nomem()
++{
++ enew(); eout("Out of memory while connected to "); eout(remoteip); eout("!\n");
++ out("421 out of memory (#4.3.0)\r\n"); flush(); eflush(); _exit(1);
++}
++void die_control( char* msg )
++{
++ enew();
++ if(msg) { eout("("); eout(msg); eout(") "); }
++ eout("Unable to read controls!\n");
++ out("421 unable to read controls (#4.3.0)\r\n"); flush(); eflush();
++ _exit(1);
++}
++void die_ipme()
++{
++ enew(); eout("Unable to figure out my IP addresses!\n");
++ out("421 unable to figure out my IP addresses (#4.3.0)\r\n"); flush();
++ eflush(); _exit(1);
++}
++void straynewline()
++{
++ enew(); eout("Stray newline from "); eout(remoteip); eout(".\n");
++ out("451 See http://pobox.com/~djb/docs/smtplf.html.\r\n"); flush();
++ eflush(); _exit(1);
++}
+
+ void err_bmf() { out("553 sorry, your envelope sender is in my badmailfrom list (#5.7.1)\r\n"); }
++void err_brt() { out("550 sorry, this message is not deliverable (#5.7.1)\r\n"); }
+ #ifndef TLS
+ void err_nogateway() { out("553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)\r\n"); }
+ #else
+@@ -116,12 +158,6 @@
+ smtp_greet("221 "); out("\r\n"); flush(); _exit(0);
+ }
+
+-char *remoteip;
+-char *remotehost;
+-char *remoteinfo;
+-char *local;
+-char *relayclient;
+-
+ stralloc helohost = {0};
+ char *fakehelo; /* pointer into helohost, or 0 */
+
+@@ -136,28 +172,43 @@
+ int bmfok = 0;
+ stralloc bmf = {0};
+ struct constmap mapbmf;
++int brtok = 0;
++stralloc brt = {0};
++struct constmap mapbrt;
++int fdmbrt;
+
+ void setup()
+ {
+ char *x;
+ unsigned long u;
+
+- if (control_init() == -1) die_control();
++ if (control_init() == -1) die_control("control_init == -1");
+ if (control_rldef(&greeting,"control/smtpgreeting",1,(char *) 0) != 1)
+- die_control();
++ die_control("control/smtpgreeting bad");
+ liphostok = control_rldef(&liphost,"control/localiphost",1,(char *) 0);
+- if (liphostok == -1) die_control();
+- if (control_readint(&timeout,"control/timeoutsmtpd") == -1) die_control();
++ if (liphostok == -1) die_control("control/localiphost bad");
++ if (control_readint(&timeout,"control/timeoutsmtpd") == -1) die_control("control/timeoutsmtpd bad");
+ if (timeout <= 0) timeout = 1;
+
+- if (rcpthosts_init() == -1) die_control();
++ if (rcpthosts_init() == -1) die_control("rcpthosts_init == -1");
+
+ bmfok = control_readfile(&bmf,"control/badmailfrom",0);
+- if (bmfok == -1) die_control();
++ if (bmfok == -1) die_control("control/badmailfrom bad");
+ if (bmfok)
+ if (!constmap_init(&mapbmf,bmf.s,bmf.len,0)) die_nomem();
++
++ brtok = control_readfile(&brt,"control/badrcptto",0);
++ if (brtok == -1) die_control("control/badrcptto bad");
++ if (brtok)
++ if (!constmap_init(&mapbrt,brt.s,brt.len,0)) die_nomem();
+
+- if (control_readint(&databytes,"control/databytes") == -1) die_control();
++ fdmbrt = -1;
++ fdmbrt = open_read("control/morebadrcptto.cdb");
++ if (fdmbrt != -1) { enew(); eout("morebadrcptto != -1\n"); eflush(); }
++ if (fdmbrt == -1) if (errno != error_noent) { die_control("control/morebadrcptto.cdb inaccessible"); };
++
++
++ if (control_readint(&databytes,"control/databytes") == -1) die_control("control/databytes bad");
+ x = env_get("DATABYTES");
+ if (x) { scan_ulong(x,&u); databytes = u; }
+ if (!(databytes + 1)) --databytes;
+@@ -276,6 +327,14 @@
+ return 1;
+ }
+
++static void log_deny(m,f,t) char *m,*f,*t;
++{
++ enew(); eout(m); eout(" check failed ("); eout(f); eout(") -> (");
++ eout(t); eout(") ["); eout(remoteip); eout("] (HELO ");
++ eout(helohost.s); eout(")\n");
++ eflush();
++}
++
+ int bmfcheck()
+ {
+ int j;
+@@ -287,11 +346,24 @@
+ return 0;
+ }
+
++int brtcheck()
++{
++ int j;
++ if (brtok) if (constmap(&mapbrt,addr.s,addr.len - 1)) return 1;
++ if (fdmbrt != -1 ) {
++ uint32 dlen;
++ j = cdb_seek(fdmbrt, addr.s, addr.len - 1, &dlen);
++ if (j == -1) die_control("brtcheck failed (cdb_seek)");
++ if (j) return j;
++ }
++ return 0;
++}
++
+ int addrallowed()
+ {
+ int r;
+ r = rcpthosts(addr.s,str_len(addr.s));
+- if (r == -1) die_control();
++ if (r == -1) die_control("addrallowed failed");
+ #ifdef TLS
+ if (r == 0) if (tls_verify()) r = -2;
+ #endif
+@@ -316,6 +388,7 @@
+
+ int seenmail = 0;
+ int flagbarf; /* defined if seenmail */
++int flagbrt; /* defined if any bad rcpts */
+ stralloc mailfrom = {0};
+ stralloc rcptto = {0};
+
+@@ -376,6 +449,10 @@
+ }
+ else
+ if (!addrallowed()) { err_nogateway(); return; }
++ if (!env_get("RELAYCLIENT") && brtcheck()) {
++ flagbrt = 1;
++ log_deny("BAD RCPT TO", mailfrom.s,addr.s);
++ }
+ if (!stralloc_cats(&rcptto,"T")) die_nomem();
+ if (!stralloc_cats(&rcptto,addr.s)) die_nomem();
+ if (!stralloc_0(&rcptto)) die_nomem();
+@@ -495,6 +572,7 @@
+
+ if (!seenmail) { err_wantmail(); return; }
+ if (!rcptto.len) { err_wantrcpt(); return; }
++ if (flagbrt) { err_brt(); return; }
+ seenmail = 0;
+ if (databytes) bytestooverflow = databytes + 1;
+ if (qmail_open(&qqt) == -1) { err_qqt(); return; }
+@@ -810,7 +888,7 @@
+ constmap_free(&mapclients);
+ }
+ case 0: alloc_free(clients.s); return 0;
+- case -1: die_control();
++ case -1: die_control("tls_verify failed");
+ }
+
+ if (ssl_timeoutrehandshake(timeout, ssl_rfd, ssl_wfd, ssl) <= 0) {
+@@ -892,7 +970,7 @@
+ ciphers = env_get("TLSCIPHERS");
+ if (!ciphers) {
+ if (control_readfile(&saciphers, "control/tlsserverciphers") == -1)
+- { SSL_free(myssl); die_control(); }
++ { SSL_free(myssl); die_control("control/tlsserverciphers bad"); }
+ if (saciphers.len) { /* convert all '\0's except the last one to ':' */
+ int i;
+ for (i = 0; i < saciphers.len - 1; ++i)
+@@ -959,7 +1037,7 @@
+ childargs = argv + 2;
+
+ sig_pipeignore();
+- if (chdir(auto_qmail) == -1) die_control();
++ if (chdir(auto_qmail) == -1) die_control("chdir failed");
+ setup();
+ if (ipme_init() != 1) die_ipme();
+ smtp_greet("220 ");
+diff -urN qmail-1.03.orig/qmail-newbrt.9 qmail-1.03/qmail-newbrt.9
+--- qmail-1.03.orig/qmail-newbrt.9 1969-12-31 21:00:00.000000000 -0300
++++ qmail-1.03/qmail-newbrt.9 2003-04-28 02:32:33.000000000 -0300
+@@ -0,0 +1,41 @@
++.TH qmail-newbrt 8
++.SH NAME
++qmail-newbrt \- prepare morebadrcptto for qmail-smtpd
++.SH SYNOPSIS
++.B qmail-newbrt
++.SH DESCRIPTION
++.B qmail-newbrt
++reads the instructions in
++.B QMAILHOME/control/morebadrcptto
++and writes them into
++.B QMAILHOME/control/morebadrcptto.cdb
++in a binary format suited
++for quick access by
++.BR qmail-smtpd .
++
++If there is a problem with
++.BR control/morebadrcptto ,
++.B qmail-newbrt
++complains and leaves
++.B control/morebadrcptto.cdb
++alone.
++
++.B qmail-newbrt
++ensures that
++.B control/morebadrcptto.cdb
++is updated atomically,
++so
++.B qmail-smtpd
++never has to wait for
++.B qmail-newbrt
++to finish.
++However,
++.B qmail-newbrt
++makes no attempt to protect against two simultaneous updates of
++.BR control/morebadrcptto.cdb .
++
++The binary
++.B control/morebadrcptto.cdb
++format is portable across machines.
++.SH "SEE ALSO"
++qmail-smtpd(8)
+diff -urN qmail-1.03.orig/qmail-newbrt.c qmail-1.03/qmail-newbrt.c
+--- qmail-1.03.orig/qmail-newbrt.c 1969-12-31 21:00:00.000000000 -0300
++++ qmail-1.03/qmail-newbrt.c 2003-04-28 01:54:33.000000000 -0300
+@@ -0,0 +1,70 @@
++#include "strerr.h"
++#include "stralloc.h"
++#include "substdio.h"
++#include "getln.h"
++#include "exit.h"
++#include "readwrite.h"
++#include "open.h"
++#include "auto_qmail.h"
++#include "cdbmss.h"
++
++#define FATAL "qmail-newbrt: fatal: "
++
++void die_read()
++{
++ strerr_die2sys(111,FATAL,"unable to read control/morebadrcptto: ");
++}
++void die_write()
++{
++ strerr_die2sys(111,FATAL,"unable to write to control/morebadrcptto.tmp: ");
++}
++
++char inbuf[1024];
++substdio ssin;
++
++int fd;
++int fdtemp;
++
++struct cdbmss cdbmss;
++stralloc line = {0};
++int match;
++
++void main()
++{
++ umask(033);
++ if (chdir(auto_qmail) == -1)
++ strerr_die4sys(111,FATAL,"unable to chdir to ",auto_qmail,": ");
++
++ fd = open_read("control/morebadrcptto");
++ if (fd == -1) die_read();
++
++ substdio_fdbuf(&ssin,read,fd,inbuf,sizeof inbuf);
++
++ fdtemp = open_trunc("control/morebadrcptto.tmp");
++ if (fdtemp == -1) die_write();
++
++ if (cdbmss_start(&cdbmss,fdtemp) == -1) die_write();
++
++ for (;;) {
++ if (getln(&ssin,&line,&match,'\n') != 0) die_read();
++ case_lowerb(line.s,line.len);
++ while (line.len) {
++ if (line.s[line.len - 1] == ' ') { --line.len; continue; }
++ if (line.s[line.len - 1] == '\n') { --line.len; continue; }
++ if (line.s[line.len - 1] == '\t') { --line.len; continue; }
++ if (line.s[0] != '#')
++ if (cdbmss_add(&cdbmss,line.s,line.len,"",0) == -1)
++ die_write();
++ break;
++ }
++ if (!match) break;
++ }
++
++ if (cdbmss_finish(&cdbmss) == -1) die_write();
++ if (fsync(fdtemp) == -1) die_write();
++ if (close(fdtemp) == -1) die_write(); /* NFS stupidity */
++ if (rename("control/morebadrcptto.tmp","control/morebadrcptto.cdb") == -1)
++ strerr_die2sys(111,FATAL,"unable to move control/morebadrcpto.tmp to control/morebadrcptto.cdb");
++
++ _exit(0);
++}
diff --git a/net-mail/qmail/files/1.03-r12/conf-common b/net-mail/qmail/files/1.03-r12/conf-common
index d2c82ec1fa41..f2d1bc8fede8 100644
--- a/net-mail/qmail/files/1.03-r12/conf-common
+++ b/net-mail/qmail/files/1.03-r12/conf-common
@@ -1,5 +1,5 @@
# Common Configuration file for all qmail daemons
-# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r12/conf-common,v 1.2 2003/08/12 05:47:14 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r12/conf-common,v 1.3 2003/08/13 11:36:10 robbat2 Exp $
# Qmail User IDS to run daemons as
QMAILDUID=`id -u qmaild`
@@ -15,7 +15,7 @@ TCPSERVER_PORT=${SERVICE}
# you do not need to specify -x, -c, -u or -g in this variable as those are
# added later
-TCPSERVER_OPTS="-H -R -v"
+TCPSERVER_OPTS="-p -v"
# we limit data and stack segments to 8mbytes, you may need to raise this if
# you are using a filter in QMAILQUEUE
diff --git a/net-mail/qmail/files/1.03-r12/conf-pop3d b/net-mail/qmail/files/1.03-r12/conf-pop3d
new file mode 100644
index 000000000000..a828b6af3901
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r12/conf-pop3d
@@ -0,0 +1,25 @@
+# Configuration file for qmail-pop3d
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r12/conf-pop3d,v 1.1 2003/08/13 11:36:10 robbat2 Exp $
+
+# Stuff to run before tcpserver
+#QMAIL_TCPSERVER_PRE=""
+# Stuff to run before the authenticator
+#QMAIL_POP3_PREAUTH=""
+# Stuff to run after the user has authenticated successfully
+#QMAIL_POP3_POSTAUTH=""
+
+# this should contain the FQDN of your server
+# by default it pulls the value from qmail
+# which should be correct
+QMAIL_POP3_POP3HOST="$(<${QMAIL_CONTROLDIR}/me)"
+
+# If you want POP3 before SMTP, and you are using this POP3 daemon
+# uncomment the next two lines
+#QMAIL_TCPSERVER_PRE="${QMAIL_TCPSERVER_PRE} envdir /etc/relay-ctrl relay-ctrl-chdir"
+#QMAIL_POP3_POSTAUTH="${QMAIL_POP3_POSTAUTH} /usr/bin/relay-ctrl-allow"
+
+# This controls what password authentication tool POP3 uses
+# It must support DJB's checkpassword interface (http://cr.yp.to/checkpwd.html)
+QMAIL_POP3_CHECKPASSWORD="/bin/checkpassword"
+# cmd5checkpw only validates passwords from /etc/poppasswd
+#QMAIL_POP3_CHECKPASSWORD="/bin/cmd5checkpw"
diff --git a/net-mail/qmail/files/1.03-r12/conf-qmqpd b/net-mail/qmail/files/1.03-r12/conf-qmqpd
index d851dc8691c0..28fad491d655 100644
--- a/net-mail/qmail/files/1.03-r12/conf-qmqpd
+++ b/net-mail/qmail/files/1.03-r12/conf-qmqpd
@@ -1,5 +1,5 @@
# Configuration file for qmail-qmqpd
-# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r12/conf-qmqpd,v 1.2 2003/08/12 05:47:14 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r12/conf-qmqpd,v 1.3 2003/08/13 11:36:10 robbat2 Exp $
# Stuff to run before tcpserver
#QMAIL_TCPSERVER_PRE=""
@@ -8,5 +8,8 @@
# Stuff to after qmail-qmqpd
#QMAIL_QMQP_POST=""
+# this turns off the IDENT grab attempt on connecting
+TCPSERVER_OPTS="${TCPSERVER_OPTS} -R"
+
# I don't trust /etc/services to have obscure ports
TCPSERVER_PORT=628
diff --git a/net-mail/qmail/files/1.03-r12/conf-qmtpd b/net-mail/qmail/files/1.03-r12/conf-qmtpd
index 1579aeefb464..94e46956768a 100644
--- a/net-mail/qmail/files/1.03-r12/conf-qmtpd
+++ b/net-mail/qmail/files/1.03-r12/conf-qmtpd
@@ -1,5 +1,5 @@
# Configuration file for qmail-qmtpd
-# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r12/conf-qmtpd,v 1.2 2003/08/12 05:47:14 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r12/conf-qmtpd,v 1.3 2003/08/13 11:36:10 robbat2 Exp $
# For more information on making your servers talk QMTP
# see http://cr.yp.to/im/mxps.html
@@ -11,5 +11,8 @@
# Stuff to after qmail-qmtpd
#QMAIL_QMTP_POST=""
+# this turns off the IDENT grab attempt on connecting
+TCPSERVER_OPTS="${TCPSERVER_OPTS} -R"
+
# I don't trust /etc/services to have obscure ports
TCPSERVER_PORT=209
diff --git a/net-mail/qmail/files/1.03-r12/conf-smtpd b/net-mail/qmail/files/1.03-r12/conf-smtpd
index a75bb7bed352..9b86b1b9cad5 100644
--- a/net-mail/qmail/files/1.03-r12/conf-smtpd
+++ b/net-mail/qmail/files/1.03-r12/conf-smtpd
@@ -1,5 +1,5 @@
# Configuration file for qmail-smtpd
-# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r12/conf-smtpd,v 1.2 2003/08/12 05:47:14 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r12/conf-smtpd,v 1.3 2003/08/13 11:36:10 robbat2 Exp $
# Stuff to run before tcpserver
#QMAIL_TCPSERVER_PRE=""
@@ -8,6 +8,9 @@
# Stuff to after qmail-smtpd
#QMAIL_SMTP_POST=""
+# this turns off the IDENT grab attempt on connecting
+TCPSERVER_OPTS="${TCPSERVER_OPTS} -R"
+
# You might want to use rblsmtpd with this, but you need to fill in a RBL server here first
# see http://cr.yp.to/ucspi-tcp/rblsmtpd.html for more details
#QMAIL_SMTP_PRE="${QMAIL_SMTP_PRE} rblsmtpd -r RBL-SERVER"
@@ -24,8 +27,11 @@
# This next block is for SMTP-AUTH
# This provides the LOGIN, PLAIN and CRAM-MD5 types
+# the 'cmd5checkpw' used in $QMAIL_SMTP_AUTHCHECKPASSWORD supports CRAM-MD5
+# and reads it's data from /etc/poppasswd
# see the manpage for cmd5checkpw for details on the passwords
-# uncomment the next three lines to enable it
-#SMTPAUTH_HOST=$(<${QMAIL_CONTROLDIR}/me)
+# uncomment the next four lines to enable SMTP-AUTH
+#QMAIL_SMTP_AUTHHOST=$(<${QMAIL_CONTROLDIR}/me)
#[ -z "${QMAIL_SMTP_POST}" ] && QMAIL_SMTP_POST=/bin/true
-#QMAIL_SMTP_POST="${SMTPAUTH_HOST} /bin/cmd5checkpw ${QMAIL_SMTP_POST}"
+#QMAIL_SMTP_CHECKPASSWORD="/bin/cmd5checkpw"
+#QMAIL_SMTP_POST="${QMAIL_SMTP_AUTHHOST} ${QMAIL_SMTP_CHECKPASSWORD} ${QMAIL_SMTP_POST}"
diff --git a/net-mail/qmail/files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch b/net-mail/qmail/files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch
new file mode 100644
index 000000000000..a960ab503e37
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch
@@ -0,0 +1,81 @@
+diff -ur qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
+--- qmail-1.03.orig/qmail-smtpd.c 2003-08-12 19:54:02.000000000 -0700
++++ qmail-1.03/qmail-smtpd.c 2003-08-12 20:00:30.000000000 -0700
+@@ -81,6 +81,7 @@
+ }
+ #endif
+ void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); }
++void err_size() { out("552 sorry, that message size exceeds my databytes limit (#5.3.4)\r\n"); }
+ void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); }
+ void err_relay() { out("553 we don't relay (#5.7.1)\r\n"); }
+ void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); }
+@@ -241,6 +242,40 @@
+ return 1;
+ }
+
++int sizelimit(arg)
++char *arg;
++{
++ int i;
++ long r;
++ unsigned long sizebytes = 0;
++
++ i = str_chr(arg,'<');
++ if (arg[i])
++ arg += i + 1;
++ else {
++ arg += str_chr(arg,':');
++ if (*arg == ':') ++arg;
++ while (*arg == ' ') ++arg;
++ }
++
++ arg += str_chr(arg,' ');
++ if (*arg == ' ') while (*arg == ' ') ++arg;
++ else return 1;
++
++ i = str_chr(arg,'=');
++ arg[i] = 0;
++ if (case_equals(arg,"SIZE")) {
++ arg += i;
++ while (*++arg && *arg > 47 && *arg < 58) {
++ sizebytes *= 10;
++ sizebytes += *arg - 48;
++ }
++ r = databytes - sizebytes;
++ if (r < 0) return 0;
++ }
++ return 1;
++}
++
+ int bmfcheck()
+ {
+ int j;
+@@ -289,6 +324,12 @@
+ smtp_greet("250 "); out("\r\n");
+ seenmail = 0; dohelo(arg);
+ }
++char size_buf[FMT_ULONG];
++void smtp_size()
++{
++ size_buf[fmt_ulong(size_buf,(unsigned long) databytes)] = 0;
++ out("250 SIZE "); out(size_buf); out("\r\n");
++}
+ /* ESMTP extensions are published here */
+ void smtp_ehlo(arg) char *arg;
+ {
+@@ -304,6 +345,7 @@
+ out("\r\n250-AUTH=LOGIN PLAIN");
+ #endif
+ out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n");
++ smtp_size();
+ seenmail = 0; dohelo(arg);
+ }
+ void smtp_rset()
+@@ -314,6 +356,7 @@
+ void smtp_mail(arg) char *arg;
+ {
+ if (!addrparse(arg)) { err_syntax(); return; }
++ if (databytes && !sizelimit(arg)) { err_size(); return; }
+ flagbarf = bmfcheck();
+ seenmail = 1;
+ if (!stralloc_copys(&rcptto,"")) die_nomem();
diff --git a/net-mail/qmail/files/1.03-r12/run-qmailpop3d b/net-mail/qmail/files/1.03-r12/run-qmailpop3d
index 174d47ad310f..bd7061790bd8 100644
--- a/net-mail/qmail/files/1.03-r12/run-qmailpop3d
+++ b/net-mail/qmail/files/1.03-r12/run-qmailpop3d
@@ -1,6 +1,23 @@
#!/bin/sh
-exec /usr/bin/softlimit -m 2000000 \
- /usr/bin/tcpserver -v -p -x /etc/tcp.smtp.cdb \
- 0 pop-3 /var/qmail/bin/qmail-popup `hostname --fqdn`
- /bin/checkpassword /var/qmail/bin/qmail-pop3d .maildir 2>&1
+# Gentoo Startup script for qmail's POP3 daemon
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/1.03-r12/run-qmailpop3d,v 1.2 2003/08/13 11:36:10 robbat2 Exp $
+#
+# If you need to edit this file, please look at editing conf-pop3d and
+# conf-common first. If you still need to change this file, you should
+# probably file a bug on the bugzilla saying what you wanted to change so that
+# modification can be make possible via the configuration files
+
+# This is to make life easier
+SERVICE=pop3
+
+[ -s ${QMAIL_CONTROLDIR}/conf-common ] && source ${QMAIL_CONTROLDIR}/conf-common
+[ -s ${QMAIL_CONTROLDIR}/conf-${SERVICE}d ] && source ${QMAIL_CONTROLDIR}/conf-${SERVICE}d
+[ -s /var/qmail/bin/config-sanity-check ] && source /var/qmail/bin/config-sanity-check
+
+exec /usr/bin/softlimit ${SOFTLIMIT_OPTS} \
+ /usr/bin/tcpserver ${TCPSERVER_OPTS} -x /etc/tcp.${SERVICE}.cdb -c ${MAXCONN} \
+ ${TCPSERVER_HOST} ${TCPSERVER_PORT} \
+ ${QMAIL_POP3_PREAUTH} /var/qmail/bin/qmail-popup ${QMAIL_POP3_POP3HOST} \
+ ${QMAIL_POP3_CHECKPASSWORD} ${QMAIL_POP3_POSTAUTH} \
+ /var/qmail/bin/qmail-pop3d .maildir 2>&1
diff --git a/net-mail/qmail/files/digest-qmail-1.03-r12 b/net-mail/qmail/files/digest-qmail-1.03-r12
index 3eecf944067f..78fc1da08f42 100644
--- a/net-mail/qmail/files/digest-qmail-1.03-r12
+++ b/net-mail/qmail/files/digest-qmail-1.03-r12
@@ -13,3 +13,5 @@ MD5 ed5c0ddb6a5cc0386b1e04ced71d26ad qmail-local-tabs.patch 505
MD5 7553829a93411cdaffce31a29323697f qmail-maildir++.patch 43510
MD5 d566e8bd99b33efee0194e855b8d6995 qmail-date-localtime.patch.txt 2603
MD5 1c4518f780d231bde9745cdd0fa313b2 qmail-limit-bounce-size.patch.txt 1753
+MD5 313166573c0c56f45c3979f9808df526 qmail-smtpd-esmtp-size.diff.txt 2463
+MD5 9140ad2b03017145cd7963c84bb24f16 qmail-103.patch 2104
diff --git a/net-mail/qmail/files/gencert.sh b/net-mail/qmail/files/gencert.sh
new file mode 100644
index 000000000000..e9ee99f3df1c
--- /dev/null
+++ b/net-mail/qmail/files/gencert.sh
@@ -0,0 +1,4 @@
+umask 0077 ;
+/usr/bin/openssl genrsa -out /var/qmail/control/rsa512.new 512 >/dev/null 2>&1 && \
+chown qmaild.qmail /var/qmail/control/rsa512.new && \
+/bin/mv -f /var/qmail/control/rsa512.new /var/qmail/control/rsa512.pem
diff --git a/net-mail/qmail/files/tcp.pop3.sample b/net-mail/qmail/files/tcp.pop3.sample
new file mode 100644
index 000000000000..12405307c5f3
--- /dev/null
+++ b/net-mail/qmail/files/tcp.pop3.sample
@@ -0,0 +1,7 @@
+# to update the database after changing this file, run:
+# tcprules /etc/tcp.pop3.cdb /etc/.tcp.pop3.tmp < /etc/tcp.pop3
+# Allow any client to connect to us via POP3
+# If people are abusing POP3 such as denial-of-service on POP3,
+# you can add their ips here to block them out
+:allow
+
diff --git a/net-mail/qmail/files/tcp.qmqp.sample b/net-mail/qmail/files/tcp.qmqp.sample
new file mode 100644
index 000000000000..e8536f1f3163
--- /dev/null
+++ b/net-mail/qmail/files/tcp.qmqp.sample
@@ -0,0 +1,8 @@
+# to update the database after changing this file, run:
+# tcprules /etc/tcp.qmqp.cdb /etc/.tcp.qmqp.tmp < /etc/tcp.qmqp
+# QMQP is a bulk protocol
+# and we don't want spam to ever come by it
+# and it is intended to go between a few servers only
+# so we don't trust any default people with it
+# see /etc/tcp.smtp.rules for more info
+:deny
diff --git a/net-mail/qmail/files/tcp.qmtp.sample b/net-mail/qmail/files/tcp.qmtp.sample
new file mode 100644
index 000000000000..825c3f11f1c0
--- /dev/null
+++ b/net-mail/qmail/files/tcp.qmtp.sample
@@ -0,0 +1,8 @@
+# to update the database after changing this file, run:
+# tcprules /etc/tcp.qmtp.cdb /etc/.tcp.qmtp.tmp < /etc/tcp.qmtp
+# We trust QMTP connections just as SMTP by default
+# see /etc/tcp.smtp.rules for more info
+# allow relaying from localhost
+127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD=""
+# everybody else is not allowed to relay, and is subject to RBLSMTPD checks
+:allow
diff --git a/net-mail/qmail/files/tcp.smtp.sample b/net-mail/qmail/files/tcp.smtp.sample
new file mode 100644
index 000000000000..5f339073c49e
--- /dev/null
+++ b/net-mail/qmail/files/tcp.smtp.sample
@@ -0,0 +1,83 @@
+# to update the database after changing this file, run:
+# tcprules /etc/tcp.smtp.cdb /etc/.tcp.smtp.tmp < /etc/tcp.smtp
+#------------------------------------------------------
+# DESCRIPTION OF THE RULES TO REMIND ME OF HOW THIS FILE WORKS
+#
+# If you set 'allow', this means that our mail server will allow
+# the specified IP range to make a TCP connection to our server
+#
+# If you set 'deny', this means that our mail server will not allow
+# the specified IP range to make a TCP connection to our server
+#
+# If you set RELAYCLIENT="", this means that the listed IP range is
+# allowed to relay mail through our server
+#
+# If you dont set RELAYCLIENT="", this means that the listed IP range
+# will not be able to relay mail through our server
+#
+# If you set RBLSMTPD="", this means that the listed IP ranges will
+# not be checked against any of the RBL databases
+#
+# If you set RBLSMTPD="some text here", this means that an RBL lookup
+# wont be performed, but the mail will be rejected with the specified
+# text as a 4xx temp error message
+#
+# If you set RBLSMTPD="-some text here", this means that an RBL lookup
+# wont be performed, but the mail will be rejected with the specified
+# text as a 5xx perm error message
+#
+# If you do not set RBLSMTPD="" or ="some text", then an RBL lookup
+# will be performed. If the lookup is successful, then RBLSMTPD will
+# return your custom error message (as specified in the -r parameter
+# in smtpd supervise script)
+#
+#-----------------------------------------------------
+# HERE ARE THE RULES! :
+#-----------------------------------------------------
+# BYPASS OPEN RELAY CHECKING FOR THESE IPS :
+#
+# These IPs are ones that we have setup so that they arent RBL checked.
+# We have done this because these particular servers are RBL listed,
+# and for whatever reason they can't/won't fix their open relay problem,
+# and we still want to be able to receive mail from them.
+#
+# reminder text goes here for this entry so we know the story...
+#111.111.111.111:allow,RBLSMTPD=""
+# reminder text goes here for this entry so we know the story...
+#222.222.222.222:allow,RBLSMTPD=""
+#
+#-----------------------------------------------------------------
+# DONT ALLOW THESE IPS TO SEND MAIL TO US :
+#
+# mailXX.offermail.net connecting regularly and sending invalid
+# format messages causing exit with status 256 (bare linefeed normally)
+# entry added 15/12/2001
+# after looking at the mail coming from these servers it was found to be spam
+#216.242.75.100-116:allow,RBLSMTPD="-Connections from this IP have been banned."
+#
+# heaps of spam from replyto of *@freeamateurhotties.com dec2001
+#64.228.127.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
+#154.20.94.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
+#209.151.132.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
+#216.18.85.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
+#
+#-----------------------------------------------------------------
+# ALLOW THESE IPS TO RELAY MAIL THROUGH OUR SERVER
+#
+# Local class-c's from our LAN are allowed to relay,
+# and we wont bother doing any RBL checking.
+#123.123.123.:allow,RELAYCLIENT="",RBLSMTPD=""
+#123.111.111.:allow,RELAYCLIENT="",RBLSMTPD=""
+#
+# Connections from localhost are allowed to relay
+# (because the WebMail server runs on localhost),
+# and obviously there is no point trying to perform an RBL check.
+127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD=""
+#
+#-----------------------------------------------------------------
+# ALLOW EVERYONE ELSE TO SEND US MAIL
+#
+# Everyone else can make connections to our server,
+# but not allowed to relay
+# RBL lookups are performed
+:allow
diff --git a/net-mail/qmail/qmail-1.03-r12.ebuild b/net-mail/qmail/qmail-1.03-r12.ebuild
index 100b0d521a67..b4710991f4e4 100644
--- a/net-mail/qmail/qmail-1.03-r12.ebuild
+++ b/net-mail/qmail/qmail-1.03-r12.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/qmail-1.03-r12.ebuild,v 1.4 2003/08/13 02:45:40 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/qmail-1.03-r12.ebuild,v 1.5 2003/08/13 11:36:10 robbat2 Exp $
inherit eutils
@@ -23,7 +23,8 @@ SRC_URI="mirror://qmail/qmail-1.03.tar.gz
mirror://gentoo/qmail-local-tabs.patch
http://www.shupp.org/patches/qmail-maildir++.patch
ftp://ftp.pipeline.com.au/pipeint/sources/linux/WebMail/qmail-date-localtime.patch.txt
- ftp://ftp.pipeline.com.au/pipeint/sources/linux/WebMail/qmail-limit-bounce-size.patch.txt"
+ ftp://ftp.pipeline.com.au/pipeint/sources/linux/WebMail/qmail-limit-bounce-size.patch.txt
+ http://www.ckdhr.com/ckd/qmail-103.patch"
SLOT="0"
LICENSE="as-is"
@@ -87,6 +88,10 @@ src_unpack() {
EPATCH_SINGLE_MSG="Adding support for remote QMTP hosts" \
epatch ${DISTDIR}/qmail-1.03-qmtpc.patch
+ # Large TCP DNS replies confuse it sometimes
+ EPATCH_SINGLE_MSG="Adding support for oversize DNS" \
+ epatch ${DISTDIR}/qmail-103.patch
+
# Fix for tabs in .qmail bug noted at
# http://www.ornl.gov/its/archives/mailing-lists/qmail/2000/10/msg00696.html
# gentoo bug #24293
@@ -111,12 +116,6 @@ src_unpack() {
# gentoo bug #18064
epatch ${DISTDIR}/qmail-smtpd-relay-reject
- # provide badrcptto support
- # as per bug #17283
- # patch re-diffed from original at http://www.iecc.com/bad-rcpt-noisy-patch.txt
- # presently this breaks qmail so it is disabled
- #epatch ${FILESDIR}/${PV}-${PR}/bad-rcpt-noisy-patch
-
# Apply patch to make qmail-local and qmail-pop3d compatible with the
# maildir++ quota system that is used by vpopmail and courier-imap
epatch ${DISTDIR}/qmail-maildir++.patch
@@ -130,10 +129,22 @@ src_unpack() {
# This helps your server to be able to reject excessively large messages
# "up front", rather than waiting the whole message to arrive and then
# bouncing it because it exceeded your databytes setting
+ #epatch ${DISTDIR}/qmail-smtpd-esmtp-size.diff.txt
+ epatch ${FILESDIR}/${PV}-${PR}/qmail-smtpd-esmtp-size-gentoo.patch
+
+ # Apply patch to trim large bouncing messages down greatly reduces traffic
+ # when multiple bounces occur (As in with spam)
epatch ${DISTDIR}/qmail-limit-bounce-size.patch.txt
+
+ # provide badrcptto support
+ # as per bug #17283
+ # patch re-diffed from original at http://sys.pro.br/files/badrcptto-morebadrcptto-accdias.diff.bz2
+ # presently this breaks qmail so it is disabled
+ epatch ${FILESDIR}/${PV}-${PR}/badrcptto-morebadrcptto-accdias-gentoo
- echo -n "${CC} ${CFLAGS}" >>${S}/conf-cc
- use ssl && echo -n '-DTLS' >>${S}/conf-cc
+ echo -n "${CC} ${CFLAGS}" >${S}/conf-cc
+ ewarn "TLS support is disabled due to a bug in the patch presently"
+ #use ssl && echo -n ' -DTLS' >>${S}/conf-cc
echo -n "${CC} ${LDFLAGS}" > ${S}/conf-ld
echo -n "500" > ${S}/conf-spawn
@@ -248,6 +259,8 @@ src_install() {
newins ${FILESDIR}/${PV}-${PR}/run-qmail${i} run
insinto /var/qmail/supervise/qmail-${i}/log
newins ${FILESDIR}/${PV}-${PR}/run-qmail${i}log run
+ insinto /etc
+ [ -f ${FILESDIR}/tcp.${i}.sample ] && newins ${FILESDIR}/tcp.${i}.sample /etc/tcp.${i}
done
einfo "Installing the qmail startup file ..."
@@ -270,6 +283,7 @@ src_install() {
into /var/qmail
insopts -o root -g root -m 644
dobin ${FILESDIR}/${PV}-${PR}/config-sanity-check
+
}
pkg_postinst() {
@@ -324,24 +338,18 @@ pkg_config() {
einfo "Accepting relaying by default from all ips configured on this machine."
LOCALIPS=`/sbin/ifconfig | grep inet | cut -d' ' -f 12 -s | cut -b 6-20`
- [ -e ${ROOT}/etc/tcp.smtp ] && TCPSMTP_EXISTS=1 || TCPSMTP_EXISTS=
- [ -e ${ROOT}/etc/tcp.qmtp ] && TCPQMTP_EXISTS=1 || TCPQMTP_EXISTS=
- [ -e ${ROOT}/etc/tcp.qmqp ] && TCPQMQP_EXISTS=1 || TCPQMQP_EXISTS=
+ TCPSTRING=":allow,RELAYCLIENT=\"\",RBLSMTPD=\"\""
for ip in $LOCALIPS; do
- [ -z "${TCPSMTP_EXISTS}" ] && echo "$ip:allow,RELAYCLIENT=\"\"" >> ${ROOT}/etc/tcp.smtp
- [ -z "${TCPQMTP_EXISTS}" ] && echo "$ip:allow,RELAYCLIENT=\"\"" >> ${ROOT}/etc/tcp.qmtp
- [ -z "${TCPQMQP_EXISTS}" ] && echo "$ip:allow,RELAYCLIENT=\"\"" >> ${ROOT}/etc/tcp.qmqp
+ echo "${ip}${TCPSTRING}" >> ${ROOT}/etc/tcp.smtp
+ echo "${ip}${TCPSTRING}" >> ${ROOT}/etc/tcp.qmtp
+ echo "${ip}${TCPSTRING}" >> ${ROOT}/etc/tcp.qmqp
done
- [ -z "${TCPSMTP_EXISTS}" ] && echo ":allow" >> ${ROOT}/etc/tcp.smtp
- [ -z "${TCPQMTP_EXISTS}" ] && echo ":allow" >> ${ROOT}/etc/tcp.qmtp
- [ -z "${TCPQMQP_EXISTS}" ] && echo ":deny" >> ${ROOT}/etc/tcp.qmqp
- for i in smtp qmtp qmqp; do
- tcprules ${ROOT}/etc/tcp.${i}.cdb ${ROOT}/etc/.tcp.${i}.tmp < ${ROOT}/etc/tcp.${i}
+ for i in smtp qmtp qmqp pop3; do
+ [ -f ${ROOT}/etc/tcp.${i}.cdb ] && tcprules ${ROOT}/etc/tcp.${i}.cdb ${ROOT}/etc/.tcp.${i}.tmp < ${ROOT}/etc/tcp.${i}
done
- if [ `use ssl` ]; then
- if [ ! -f ${ROOT}/var/qmail/control/servercert.pem ]; then
+ if use ssl && [ ! -f ${ROOT}/var/qmail/control/servercert.pem ]; then
echo "Creating a self-signed ssl-cert:"
/usr/bin/openssl req -new -x509 -nodes -out ${ROOT}/var/qmail/control/servercert.pem -days 366 -keyout ${ROOT}/var/qmail/control/servercert.pem
chmod 640 ${ROOT}/var/qmail/control/servercert.pem
@@ -357,5 +365,4 @@ pkg_config() {
einfo "Send req.pem to your CA to obtain signed_req.pem, and do:"
einfo "cat signed_req.pem >> /var/qmail/control/servercert.pem"
fi
- fi
}