summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2003-11-30 11:32:06 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2003-11-30 11:32:06 +0000
commit4d7347143c8b03a6847268b32809bcd249fe97c6 (patch)
tree3c28a690be26f6516822f8ad0b1f2778019306b9 /net-mail/qmail
parentuse unpack_pdv to be cleaner (diff)
downloadgentoo-2-4d7347143c8b03a6847268b32809bcd249fe97c6.tar.gz
gentoo-2-4d7347143c8b03a6847268b32809bcd249fe97c6.tar.bz2
gentoo-2-4d7347143c8b03a6847268b32809bcd249fe97c6.zip
This build is hardmasked for initial testing.
== Feature changes: Added more control over daemon launching, including new control over logging systems. Added more configuration checks for sanity. Simplified all daemon start scripts using a new launcher - qmail-config-system. Added variable to control qmail-pop3d maildir location. == Bugs fixed: holdremote feature request - #31542 auth-after-TLS only - #31426 noauthcram option - #33818 pop3d fix for evolution - #34646 == Patches: netscape progress bar fix: http://www.qmail.org/netscape-progress.patch update of 0.0.0.0 patch: http://www.suspectclass.com/~sgifford/qmail/qmail-1.03-0.0.0.0-0.2.patch ignore -N opts to sendmail: http://www-dt.e-technik.uni-dortmund.de/~ma/djb/qmail/sendmail-ignore-N.patch accept-5xx responses REDIFFED: http://www.qmail.org/accept-5xx.patch pop3d-stat REDIFFED: http://www.dataloss.nl/software/patches/qmail-pop3d-stat.patch envrecip REDIFFED: http://www.qcc.ca/~charlesc/software/misc/nullenvsender-recipcount.patch
Diffstat (limited to 'net-mail/qmail')
-rw-r--r--net-mail/qmail/ChangeLog49
-rw-r--r--net-mail/qmail/Manifest39
-rw-r--r--net-mail/qmail/files/1.03-r14/auth-after-tls-only.patch81
-rw-r--r--net-mail/qmail/files/1.03-r14/maildir-quota-fix.patch13
-rw-r--r--net-mail/qmail/files/1.03-r14/nullenvsender-recipcount.tls.patch43
-rw-r--r--net-mail/qmail/files/1.03-r14/qmail-1.03-accept-5xx.tls.patch20
-rw-r--r--net-mail/qmail/files/1.03-r14/qmail-1.03-qregex-memleak-fix.patch15
-rw-r--r--net-mail/qmail/files/1.03-r14/qmail-pop3d-capa-outputfix.patch13
-rw-r--r--net-mail/qmail/files/1.03-r14/qmail-pop3d-stat.tls.patch24
-rw-r--r--net-mail/qmail/files/1.03-r14/qmail-smtpd-esmtp-size-gentoo.patch81
-rw-r--r--net-mail/qmail/files/1.03-r14/qmail-smtpd-relay-reject.gentoo.patch41
-rw-r--r--net-mail/qmail/files/1.03-r14/smtp-auth-close3.patch24
-rw-r--r--net-mail/qmail/files/99qmail4
-rw-r--r--net-mail/qmail/files/conf-common47
-rw-r--r--net-mail/qmail/files/conf-pop3d29
-rw-r--r--net-mail/qmail/files/conf-qmqpd15
-rw-r--r--net-mail/qmail/files/conf-qmtpd18
-rw-r--r--net-mail/qmail/files/conf-send6
-rw-r--r--net-mail/qmail/files/conf-smtpd37
-rw-r--r--net-mail/qmail/files/config-sanity-check29
-rw-r--r--net-mail/qmail/files/digest-qmail-1.03-r1423
-rw-r--r--net-mail/qmail/files/dot_qmail3
-rw-r--r--net-mail/qmail/files/errno.patch38
-rw-r--r--net-mail/qmail/files/mkservercert55
-rw-r--r--net-mail/qmail/files/qmail-config-system26
-rw-r--r--net-mail/qmail/files/qmail-genrsacert.sh33
-rw-r--r--net-mail/qmail/files/rc6
-rw-r--r--net-mail/qmail/files/run-qmailpop3d16
-rw-r--r--net-mail/qmail/files/run-qmailpop3dlog6
-rw-r--r--net-mail/qmail/files/run-qmailqmqpd17
-rw-r--r--net-mail/qmail/files/run-qmailqmqpdlog6
-rw-r--r--net-mail/qmail/files/run-qmailqmtpd17
-rw-r--r--net-mail/qmail/files/run-qmailqmtpdlog6
-rw-r--r--net-mail/qmail/files/run-qmailsend4
-rw-r--r--net-mail/qmail/files/run-qmailsendlog4
-rw-r--r--net-mail/qmail/files/run-qmailsmtpd17
-rw-r--r--net-mail/qmail/files/run-qmailsmtpdlog6
-rw-r--r--net-mail/qmail/files/servercert.cnf37
-rw-r--r--net-mail/qmail/qmail-1.03-r14.ebuild460
39 files changed, 1406 insertions, 2 deletions
diff --git a/net-mail/qmail/ChangeLog b/net-mail/qmail/ChangeLog
index 80d7af2cc7d2..f359ee92aac7 100644
--- a/net-mail/qmail/ChangeLog
+++ b/net-mail/qmail/ChangeLog
@@ -1,6 +1,53 @@
# ChangeLog for net-mail/qmail
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/ChangeLog,v 1.50 2003/11/30 03:00:20 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/ChangeLog,v 1.51 2003/11/30 11:32:06 robbat2 Exp $
+
+*qmail-1.03-r14 (30 Nov 2003)
+
+ 30 Nov 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r14.ebuild,
+ files/99qmail, files/conf-common, files/conf-pop3d, files/conf-qmqpd,
+ files/conf-qmtpd, files/conf-send, files/conf-smtpd,
+ files/config-sanity-check, files/dot_qmail, files/errno.patch,
+ files/mkservercert, files/qmail-config-system, files/qmail-genrsacert.sh,
+ files/rc, files/run-qmailpop3d, files/run-qmailpop3dlog,
+ files/run-qmailqmqpd, files/run-qmailqmqpdlog, files/run-qmailqmtpd,
+ files/run-qmailqmtpdlog, files/run-qmailsend, files/run-qmailsendlog,
+ files/run-qmailsmtpd, files/run-qmailsmtpdlog, files/servercert.cnf,
+ files/1.03-r14/auth-after-tls-only.patch,
+ files/1.03-r14/maildir-quota-fix.patch,
+ files/1.03-r14/nullenvsender-recipcount.tls.patch,
+ files/1.03-r14/qmail-1.03-accept-5xx.tls.patch,
+ files/1.03-r14/qmail-1.03-qregex-memleak-fix.patch,
+ files/1.03-r14/qmail-pop3d-capa-outputfix.patch,
+ files/1.03-r14/qmail-pop3d-stat.tls.patch,
+ files/1.03-r14/qmail-smtpd-esmtp-size-gentoo.patch,
+ files/1.03-r14/qmail-smtpd-relay-reject.gentoo.patch,
+ files/1.03-r14/smtp-auth-close3.patch:
+ This build is hardmasked for initial testing.
+ == Feature changes:
+ Added more control over daemon launching, including new control over logging
+ systems.
+ Added more configuration checks for sanity.
+ Simplified all daemon start scripts using a new launcher -
+ qmail-config-system.
+ Added variable to control qmail-pop3d maildir location.
+ == Bugs fixed:
+ holdremote feature request - #31542
+ auth-after-TLS only - #31426
+ noauthcram option - #33818
+ pop3d fix for evolution - #34646
+ == Patches:
+ netscape progress bar fix: http://www.qmail.org/netscape-progress.patch
+ update of 0.0.0.0 patch:
+ http://www.suspectclass.com/~sgifford/qmail/qmail-1.03-0.0.0.0-0.2.patch
+ ignore -N opts to sendmail:
+ http://www-dt.e-technik.uni-dortmund.de/~ma/djb/qmail/sendmail-ignore-N.patch
+ accept-5xx responses REDIFFED:
+ http://www.qmail.org/accept-5xx.patch
+ pop3d-stat REDIFFED:
+ http://www.dataloss.nl/software/patches/qmail-pop3d-stat.patch
+ envrecip REDIFFED:
+ http://www.qcc.ca/~charlesc/software/misc/nullenvsender-recipcount.patch
29 Nov 2003; Robin H. Johnson <robbat2@gentoo.org>
files/1.03-r13/conf-smtpd:
diff --git a/net-mail/qmail/Manifest b/net-mail/qmail/Manifest
index 0278673fd51a..c00d65dc30f7 100644
--- a/net-mail/qmail/Manifest
+++ b/net-mail/qmail/Manifest
@@ -1,22 +1,49 @@
+MD5 84af234fe4f0b1b29e0646142da80c0d qmail-1.03-r14.ebuild 15446
MD5 ded2ff2bdb5763a3cca002f79425be66 qmail-1.03-r11.ebuild 11395
MD5 bc20b8ab3977f5ae84b74e3c6eec2f3b qmail-1.03-r9.ebuild 9963
MD5 4c1f85da35d1c41f674d9cbaed5b1bad qmail-1.03-r13.ebuild 14026
MD5 4ec9b420e902b04f70b810720a5d5bd7 qmail-1.03-r10.ebuild 11151
MD5 42789d45c1d7895767ef8d7007ac5caf qmail-1.03-r8.ebuild 8114
MD5 4ce79aa111f45b13f820f0906f22f9ee qmail-1.03-r12.ebuild 13624
-MD5 b56c28abaa0818a7a1884a4a784013f9 ChangeLog 12153
+MD5 82323e3ce4207d35919fdd28d25fe689 ChangeLog 14356
MD5 ff596e74b015e067a180fc78855aa87a metadata.xml 360
+MD5 7cef93d17272617ee2a206f747a6a211 files/rc 298
MD5 e0686e52df7f0c840a7ac2bfe1fd291a files/tcp.qmqp.sample 337
+MD5 4f401744e1ad82230892801dfbb4fdea files/conf-send 241
+MD5 06a5e9ab375d4e1f9d5a6ef8aca07bb1 files/run-qmailpop3d 884
+MD5 7d5d147a0de65804853eea4acb9317ae files/run-qmailqmqpd 849
+MD5 b0dfeda637c69fbeca57ed134e1a0584 files/run-qmailqmtpd 849
+MD5 7ce55ad15e6d15f34168840d3638c49d files/run-qmailsmtpd 849
+MD5 180a513f34e3f00abc609672a190072c files/99qmail 137
+MD5 c47d861aeef098d12d022d44c27386b5 files/errno.patch 850
MD5 946a715ffdd5e6d2d29c6fdfb29376dd files/tcp.smtp.sample 3726
MD5 734ea9dfff4513984d2d69123ce54fb8 files/gencert.sh 224
+MD5 10754dc29b2f81fa95228da94f431883 files/run-qmailqmqpdlog 321
+MD5 b1962e5ec0c37df2fb47f2c00648079e files/run-qmailqmtpdlog 321
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 bda652bf331978ad291ad0cef31167dc files/qmail-genrsacert.sh 1170
MD5 1fa33b460954492678129c60520e9cba files/digest-qmail-1.03-r10 442
MD5 d6b150617bc5d76374fe010fc2902923 files/digest-qmail-1.03-r11 764
MD5 a1ac3318481064fc73553bec0cb8d554 files/digest-qmail-1.03-r12 1496
MD5 7078e735b0f3b50c8a3a7d08aa160aa3 files/digest-qmail-1.03-r13 1359
+MD5 8e2958f246aa212be1658f74d677338f files/digest-qmail-1.03-r14 1564
+MD5 c369664bce0646b3d323d08f9ba5b8ce files/dot_qmail 82
+MD5 38f0bbb199ac59e1e5b239f9db6f78ee files/run-qmailsmtpdlog 321
+MD5 a9a0316d46abee790cdae161a595f87c files/conf-pop3d 1212
+MD5 77e5d77ee07503b5635d7ae32d0867f9 files/conf-qmqpd 470
+MD5 4b8681487ba234b51333c6e67d878f0d files/conf-qmtpd 562
+MD5 776bd8c07655f8b2d155bb73408530db files/servercert.cnf 1103
+MD5 75a0493ec2aceeb0cbcda02bdd505f3c files/conf-smtpd 1707
+MD5 3cb0d3a7547cb19050acc9ef855ada29 files/qmail-config-system 1081
+MD5 5ddcb673977385f4bfdc93a2d4e65162 files/run-qmailsendlog 143
+MD5 7e6dbdfa1e3c30491d076eba152822ce files/mkservercert 1434
MD5 76d218a258e2ec859ab80c377351afce files/tcp.qmtp.sample 370
+MD5 446d7027c0074b55826e0f4f6b009ca6 files/conf-common 1666
+MD5 f53c011853eb0d5e84f30fbec63896f7 files/config-sanity-check 1077
+MD5 234779ce9c01a8cd0b993014cabea622 files/run-qmailsend 171
+MD5 cf8c81a38a8301796877ca0257a09828 files/run-qmailpop3dlog 321
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
@@ -130,3 +157,13 @@ MD5 e316a51ae24c697944e54a52aa6e84ea files/1.03-r13/config-sanity-check 814
MD5 d3997795df512803e6a27b5486d2b81e files/1.03-r13/qmail-smtpd-relay-reject.gentoo.patch 1433
MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03-r13/run-qmailsend 29
MD5 0e97c0b031776f40cacdfbf3114af574 files/1.03-r13/run-qmailpop3dlog 97
+MD5 cc5c84d3a0837007b8af4a1f2e657872 files/1.03-r14/auth-after-tls-only.patch 2151
+MD5 518aef241cd482233a3c07608e12276c files/1.03-r14/qmail-1.03-accept-5xx.tls.patch 882
+MD5 d45baac78eaa8ebcde16214655d05d21 files/1.03-r14/maildir-quota-fix.patch 547
+MD5 bed3133c1737dd9bc3c67e07f8bc65d8 files/1.03-r14/smtp-auth-close3.patch 728
+MD5 9fa1fc2153d5a4659ddf02d9e3a1f9ba files/1.03-r14/qmail-pop3d-stat.tls.patch 750
+MD5 b8f5d6adfb941c184715695cc58a5c72 files/1.03-r14/nullenvsender-recipcount.tls.patch 1616
+MD5 d046c053c7dd353891dd6778000890bf files/1.03-r14/qmail-pop3d-capa-outputfix.patch 424
+MD5 a8bfc3cf2c69e8e46b07a357a8572e5e files/1.03-r14/qmail-1.03-qregex-memleak-fix.patch 498
+MD5 2a725c31201c59077cd389486407624f files/1.03-r14/qmail-smtpd-esmtp-size-gentoo.patch 2131
+MD5 d3997795df512803e6a27b5486d2b81e files/1.03-r14/qmail-smtpd-relay-reject.gentoo.patch 1433
diff --git a/net-mail/qmail/files/1.03-r14/auth-after-tls-only.patch b/net-mail/qmail/files/1.03-r14/auth-after-tls-only.patch
new file mode 100644
index 000000000000..603d6677c9bd
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r14/auth-after-tls-only.patch
@@ -0,0 +1,81 @@
+diff -urbBw qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
+--- qmail-1.03.orig/qmail-smtpd.c 2003-11-30 00:09:49.000000000 -0800
++++ qmail-1.03/qmail-smtpd.c 2003-11-30 00:20:43.000000000 -0800
+@@ -175,6 +175,7 @@
+ int err_noauth() { out("504 auth type unimplemented (#5.5.1)\r\n"); return -1; }
+ int err_authabrt() { out("501 auth exchange cancelled (#5.0.0)\r\n"); return -1; }
+ int err_input() { out("501 malformed auth input (#5.5.4)\r\n"); return -1; }
++int err_wantstarttls() { out("530 Must issue a STARTTLS command first (#5.7.0)\r\n"); return -1; };
+
+ stralloc greeting = {0};
+
+@@ -480,19 +481,30 @@
+ size_buf[fmt_ulong(size_buf,(unsigned long) databytes)] = 0;
+ out("\r\n250-SIZE "); out(size_buf);
+ }
++
++void smtp_authout() {
++#ifdef AUTHCRAM
++ out("\r\n250-AUTH LOGIN CRAM-MD5 PLAIN"
++ "\r\n250-AUTH=LOGIN CRAM-MD5 PLAIN");
++#else //AUTHCRAM
++ out("\r\n250-AUTH LOGIN PLAIN"
++ "\r\n250-AUTH=LOGIN PLAIN");
++#endif //AUTHCRAM
++}
++
+ void smtp_ehlo(arg) char *arg;
+ {
+ smtp_greet("250-");
+-#ifdef AUTHCRAM
+- out("\r\n250-AUTH LOGIN CRAM-MD5 PLAIN");
+- out("\r\n250-AUTH=LOGIN CRAM-MD5 PLAIN");
+-#else
+- out("\r\n250-AUTH LOGIN PLAIN");
+- out("\r\n250-AUTH=LOGIN PLAIN");
+-#endif
+ #ifdef TLS
+ if (!ssl) out("\r\n250-STARTTLS");
+-#endif
++#endif //TLS
++
++#ifdef TLS && TLS_BEFORE_AUTH
++ if(ssl) smtp_authout();
++#else // TLS && TLS_BEFORE_AUTH
++ smtp_authout();
++#endif // TLS && TLS_BEFORE_AUTH
++
+ smtp_size();
+ out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n");
+ seenmail = 0; dohelo(arg);
+@@ -879,6 +891,9 @@
+ {
+ int r;
+
++#ifdef TLS && TLS_BEFORE_AUTH
++ if (!ssl) return err_wantstarttls();
++#endif
+ if (*arg) {
+ if (r = b64decode(arg,str_len(arg),&user) == 1) return err_input();
+ }
+@@ -903,6 +918,9 @@
+ {
+ int r, id = 0;
+
++#ifdef TLS && TLS_BEFORE_AUTH
++ if (!ssl) return err_wantstarttls();
++#endif
+ if (*arg) {
+ if (r = b64decode(arg,str_len(arg),&slop) == 1) return err_input();
+ }
+@@ -929,6 +947,10 @@
+ int i, r;
+ char *s;
+
++#ifdef TLS && TLS_BEFORE_AUTH
++ if (!ssl) return err_wantstarttls();
++#endif
++
+ s = unique;
+ s += fmt_uint(s,getpid());
+ *s++ = '.';
diff --git a/net-mail/qmail/files/1.03-r14/maildir-quota-fix.patch b/net-mail/qmail/files/1.03-r14/maildir-quota-fix.patch
new file mode 100644
index 000000000000..808d3aca5790
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r14/maildir-quota-fix.patch
@@ -0,0 +1,13 @@
+diff -ur qmail-1.03.orig/overmaildirquota.c qmail-1.03/overmaildirquota.c
+--- qmail-1.03.orig/overmaildirquota.c 2003-08-28 18:44:46.000000000 -0700
++++ qmail-1.03/overmaildirquota.c 2003-08-28 18:48:06.000000000 -0700
+@@ -12,8 +12,7 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+
+-static const char rcsid[]="$Id: overquota.c,v 1.0 2002/06/09 16:21:05 mr
+-sam Exp $";
++static const char rcsid[]="$Id: maildir-quota-fix.patch,v 1.1 2003/11/30 11:32:06 robbat2 Exp $";
+
+
+ int user_over_maildirquota( const char *dir, const char *q)
diff --git a/net-mail/qmail/files/1.03-r14/nullenvsender-recipcount.tls.patch b/net-mail/qmail/files/1.03-r14/nullenvsender-recipcount.tls.patch
new file mode 100644
index 000000000000..d3ce73f172f8
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r14/nullenvsender-recipcount.tls.patch
@@ -0,0 +1,43 @@
+diff -urwBb qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
+--- qmail-1.03.orig/qmail-smtpd.c 2003-11-30 01:36:49.000000000 -0800
++++ qmail-1.03/qmail-smtpd.c 2003-11-30 01:39:31.000000000 -0800
+@@ -153,6 +153,7 @@
+ void err_brt() { out("550 sorry, this message is not deliverable (#5.7.1)\r\n"); }
+ void err_bmt() { out("533 sorry, your envelope recipient has been denied (#5.7.1)\r\n"); }
+ void err_nogateway() { out("553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)\r\n"); }
++void err_badbounce() { out("550 sorry, bounce messages should have a single envelope recipient (#5.7.1)\r\n"); }
+ #ifdef TLS
+ void err_nogwcert() { out("553 no valid cert for gatewaying (#5.7.1)\r\n"); }
+ #endif
+@@ -470,6 +471,7 @@
+ int flagbrt; /* defined if any bad rcpts */
+ stralloc mailfrom = {0};
+ stralloc rcptto = {0};
++int recipcount;
+
+ void smtp_helo(arg) char *arg;
+ {
+@@ -524,6 +526,7 @@
+ if (!stralloc_copys(&rcptto,"")) die_nomem();
+ if (!stralloc_copys(&mailfrom,addr.s)) die_nomem();
+ if (!stralloc_0(&mailfrom)) die_nomem();
++ recipcount = 0;
+ out("250 ok\r\n");
+ }
+ #ifdef TLS
+@@ -608,6 +611,7 @@
+ if (!stralloc_cats(&rcptto,"T")) die_nomem();
+ if (!stralloc_cats(&rcptto,addr.s)) die_nomem();
+ if (!stralloc_0(&rcptto)) die_nomem();
++ recipcount++;
+ out("250 ok\r\n");
+ }
+
+@@ -726,6 +730,7 @@
+
+ if (!seenmail) { err_wantmail(); return; }
+ if (!rcptto.len) { err_wantrcpt(); return; }
++ if (mailfrom.len == 1 && recipcount > 1) { err_badbounce(); return; }
+ if (flagbrt) { err_brt(); return; }
+ seenmail = 0;
+ if (databytes) bytestooverflow = databytes + 1;
diff --git a/net-mail/qmail/files/1.03-r14/qmail-1.03-accept-5xx.tls.patch b/net-mail/qmail/files/1.03-r14/qmail-1.03-accept-5xx.tls.patch
new file mode 100644
index 000000000000..edc9f337a519
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r14/qmail-1.03-accept-5xx.tls.patch
@@ -0,0 +1,20 @@
+diff -urbBw qmail-1.03.orig/qmail-remote.c qmail-1.03/qmail-remote.c
+--- qmail-1.03.orig/qmail-remote.c 2003-11-30 01:24:58.000000000 -0800
++++ qmail-1.03/qmail-remote.c 2003-11-30 01:32:11.000000000 -0800
+@@ -382,10 +382,14 @@
+ substdio_put(&smtpto,helohost.s,helohost.len);
+ substdio_puts(&smtpto,"\r\n");
+ substdio_flush(&smtpto);
+- if (smtpcode() != 250) quit("ZConnected to "," but my name was rejected");
++ code = smtpcode();
++ if (code >= 500) quit("DConnected to "," but my name was rejected");
++ if (code != 250) quit("ZConnected to "," but my name was rejected");
+ }
+ #else
+- if (smtpcode() != 250) quit("ZConnected to "," but my name was rejected");
++ code = smtpcode();
++ if (code >= 500) quit("DConnected to "," but my name was rejected");
++ if (code != 250) quit("ZConnected to "," but my name was rejected");
+ #endif
+
+ /* SMTP AUTH client */
diff --git a/net-mail/qmail/files/1.03-r14/qmail-1.03-qregex-memleak-fix.patch b/net-mail/qmail/files/1.03-r14/qmail-1.03-qregex-memleak-fix.patch
new file mode 100644
index 000000000000..8ab940f6dc72
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r14/qmail-1.03-qregex-memleak-fix.patch
@@ -0,0 +1,15 @@
+diff -urBbw qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
+--- qmail-1.03.orig/qmail-smtpd.c 2003-11-30 00:51:16.000000000 -0800
++++ qmail-1.03/qmail-smtpd.c 2003-11-30 00:50:54.000000000 -0800
+@@ -397,8 +397,9 @@
+ int j = 0;
+ int x = 0;
+ int negate = 0;
+- stralloc bmb = {0};
+- stralloc curregex = {0};
++ static stralloc bmb = {0};
++ static stralloc curregex = {0};
++ bmb.len = curregex.len = 0;
+
+ if (which == BMCHECK_BMF) {
+ if (!stralloc_copy(&bmb,&bmf)) die_nomem();
diff --git a/net-mail/qmail/files/1.03-r14/qmail-pop3d-capa-outputfix.patch b/net-mail/qmail/files/1.03-r14/qmail-pop3d-capa-outputfix.patch
new file mode 100644
index 000000000000..784d8fdfbcd0
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r14/qmail-pop3d-capa-outputfix.patch
@@ -0,0 +1,13 @@
+diff -urbBw qmail-1.03.orig/qmail-pop3d.c qmail-1.03/qmail-pop3d.c
+--- qmail-1.03.orig/qmail-pop3d.c 2003-11-30 00:35:33.000000000 -0800
++++ qmail-1.03/qmail-pop3d.c 2003-11-30 00:38:47.000000000 -0800
+@@ -314,7 +314,8 @@
+
+ void pop3_capa(arg) char *arg;
+ {
+- puts("+OK Capability list follows\r\n"
++ substdio_puts(&ssout,
++ "+OK Capability list follows\r\n"
+ "TOP\r\n"
+ "UIDL\r\n"
+ "LAST\r\n"
diff --git a/net-mail/qmail/files/1.03-r14/qmail-pop3d-stat.tls.patch b/net-mail/qmail/files/1.03-r14/qmail-pop3d-stat.tls.patch
new file mode 100644
index 000000000000..8fd5c0abcbe2
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r14/qmail-pop3d-stat.tls.patch
@@ -0,0 +1,24 @@
+diff -urBbw qmail-1.03.orig/qmail-pop3d.c qmail-1.03/qmail-pop3d.c
+--- qmail-1.03.orig/qmail-pop3d.c 2003-11-30 01:41:34.000000000 -0800
++++ qmail-1.03/qmail-pop3d.c 2003-11-30 01:47:44.000000000 -0800
+@@ -150,12 +150,17 @@
+ void pop3_stat()
+ {
+ int i;
++ int realnumm;
+ unsigned long total;
+
+- total = 0;
+- for (i = 0;i < numm;++i) if (!m[i].flagdeleted) total += m[i].size;
++ total = realnumm = 0;
++ for (i = 0;i < numm;++i)
++ if (!m[i].flagdeleted) {
++ total += m[i].size;
++ ++realnumm;
++ }
+ substdio_puts(&ssout,"+OK ");
+- put(strnum,fmt_uint(strnum,numm));
++ put(strnum,fmt_uint(strnum,realnumm));
+ substdio_puts(&ssout," ");
+ put(strnum,fmt_ulong(strnum,total));
+ substdio_puts(&ssout,"\r\n");
diff --git a/net-mail/qmail/files/1.03-r14/qmail-smtpd-esmtp-size-gentoo.patch b/net-mail/qmail/files/1.03-r14/qmail-smtpd-esmtp-size-gentoo.patch
new file mode 100644
index 000000000000..3409116d57ab
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r14/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-09-01 21:47:32.000000000 -0700
++++ qmail-1.03/qmail-smtpd.c 2003-09-01 21:48:36.000000000 -0700
+@@ -117,6 +117,7 @@
+ void err_nogwcert() { out("553 no valid cert for gatewaying (#5.7.1)\r\n"); }
+ #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_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); }
+ void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); }
+@@ -296,6 +297,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 bmcheck(which) int which;
+ {
+ int i = 0;
+@@ -351,6 +386,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("\r\n250-SIZE "); out(size_buf);
++}
+ void smtp_ehlo(arg) char *arg;
+ {
+ smtp_greet("250-");
+@@ -364,6 +405,7 @@
+ #ifdef TLS
+ if (!ssl) out("\r\n250-STARTTLS");
+ #endif
++ smtp_size();
+ out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n");
+ seenmail = 0; dohelo(arg);
+ }
+@@ -375,6 +417,7 @@
+ void smtp_mail(arg) char *arg;
+ {
+ if (!addrparse(arg)) { err_syntax(); return; }
++ if (databytes && !sizelimit(arg)) { err_size(); return; }
+ if (bmfok) flagbarfbmf = bmcheck(BMCHECK_BMF);
+ seenmail = 1;
+ if (!stralloc_copys(&rcptto,"")) die_nomem();
diff --git a/net-mail/qmail/files/1.03-r14/qmail-smtpd-relay-reject.gentoo.patch b/net-mail/qmail/files/1.03-r14/qmail-smtpd-relay-reject.gentoo.patch
new file mode 100644
index 000000000000..e6aab720418c
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r14/qmail-smtpd-relay-reject.gentoo.patch
@@ -0,0 +1,41 @@
+diff -ur -x '*.*orig' qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
+--- qmail-1.03.orig/qmail-smtpd.c 2003-09-01 21:51:08.000000000 -0700
++++ qmail-1.03/qmail-smtpd.c 2003-09-01 21:52:12.000000000 -0700
+@@ -119,6 +119,7 @@
+ 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"); }
+ void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); }
+ void err_noop() { out("250 ok\r\n"); }
+@@ -374,6 +375,21 @@
+ return r;
+ }
+
++int addrrelay()
++{
++ int j;
++ j = addr.len;
++ while(--j >= 0)
++ if (addr.s[j] == '@') break;
++ if (j < 0) j = addr.len;
++ while(--j >= 0) {
++ if (addr.s[j] == '@') return 1;
++ if (addr.s[j] == '%') return 1;
++ if (addr.s[j] == '!') return 1;
++ }
++ return 0;
++}
++
+
+ int seenmail = 0;
+ int flagbarfbmf; /* defined if seenmail */
+@@ -434,6 +450,7 @@
+ void smtp_rcpt(arg) char *arg; {
+ if (!seenmail) { err_wantmail(); return; }
+ if (!addrparse(arg)) { err_syntax(); return; }
++ if (addrrelay()) { err_relay(); return; }
+ if ((!flagbarfbmf) && (bmtok)) { flagbarfbmt = bmcheck(BMCHECK_BMT); }
+ if (flagbarfbmf) {
+ strerr_warn4("qmail-smtpd: badmailfrom: ",mailfrom.s," at ",remoteip,0);
diff --git a/net-mail/qmail/files/1.03-r14/smtp-auth-close3.patch b/net-mail/qmail/files/1.03-r14/smtp-auth-close3.patch
new file mode 100644
index 000000000000..e259bbf27977
--- /dev/null
+++ b/net-mail/qmail/files/1.03-r14/smtp-auth-close3.patch
@@ -0,0 +1,24 @@
+diff -ur qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
+--- qmail-1.03.orig/qmail-smtpd.c 2003-08-11 20:37:16.000000000 -0700
++++ qmail-1.03/qmail-smtpd.c 2003-08-11 20:39:52.000000000 -0700
+@@ -519,14 +519,18 @@
+ if (!stralloc_0(&resp)) die_nomem();
+
+ if (fd_copy(2,1) == -1) return err_pipe();
+- close(3);
++ //close(3);
+ if (pipe(pi) == -1) return err_pipe();
+- if (pi[0] != 3) return err_pipe();
++ //if (pi[0] != 3) return err_pipe();
+ switch(child = fork()) {
+ case -1:
+ return err_fork();
+ case 0:
+ close(pi[1]);
++ if (pi[0] != 3) {
++ close(3);
++ if (0 > dup2(pi[0],3)) _exit(1);
++ }
+ sig_pipedefault();
+ execvp(*childargs, childargs);
+ _exit(1);
diff --git a/net-mail/qmail/files/99qmail b/net-mail/qmail/files/99qmail
new file mode 100644
index 000000000000..d9d929e4892b
--- /dev/null
+++ b/net-mail/qmail/files/99qmail
@@ -0,0 +1,4 @@
+PATH="/var/qmail/bin"
+ROOTPATH="/var/qmail/bin"
+CONFIG_PROTECT="/var/qmail/control /var/qmail/alias"
+QMAIL_CONTROLDIR=/var/qmail/control
diff --git a/net-mail/qmail/files/conf-common b/net-mail/qmail/files/conf-common
new file mode 100644
index 000000000000..60566a2f37a9
--- /dev/null
+++ b/net-mail/qmail/files/conf-common
@@ -0,0 +1,47 @@
+# Common Configuration file for all qmail daemons
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/conf-common,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+
+# Qmail User IDS to run daemons as
+QMAILDUID=`id -u qmaild`
+NOFILESGID=`id -g qmaild`
+QMAILLUID=`id -u qmaill`
+
+# Qmail Control Dir (this is actually set in /etc/env.d/99qmail)
+#QMAIL_CONTROLDIR=/var/qmail/control
+
+# Host and port to listen on
+# We listen on the IPv4 local ip by default
+TCPSERVER_HOST=0.0.0.0
+TCPSERVER_PORT=${SERVICE}
+
+# you do not need to specify -x, -c, -u or -g in this variable as those are
+# added later
+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
+SOFTLIMIT_OPTS="-m 8000000"
+
+# We don't have anything to set QMAILQUEUE to at the moment, so we leave it alone
+#QMAILQUEUE=""
+
+# tcpserver maximum concurrency, defaults to 40 in tcpserver
+# this controls the maximum number of incoming connections that it will accept
+[ -e ${QMAIL_CONTROLDIR}/concurrencyincoming ] && MAXCONN=$(<${QMAIL_CONTROLDIR}/concurrencyincoming) || MAXCONN=40
+
+# logging directives
+LOG_OPTS="t" # 't' is for timestamp
+LOG_MAXSIZE=2500000 # defalts to '99999' if empty
+LOG_MAXCOUNT=10 # defaults to '10' if empty
+
+# build LOG_OPTS from this
+[ -n "${LOG_MAXSIZE}" ] && LOG_OPTS="${LOG_OPTS} s${LOG_MAXSIZE}"
+[ -n "${LOG_MAXCOUNT}" ] && LOG_OPTS="${LOG_OPTS} s${LOG_MAXCOUNT}"
+
+# directory to log to
+LOG_DEST=/var/log/qmail/qmail-${SERVICE}d
+
+# BIG FAT WARNING:
+# If you disable this by uncommenting it you will turn _off_ the configuration
+# sanity check do so at your own risk!
+#QMAIL_DISABLE_SANITY_CHECK=1
diff --git a/net-mail/qmail/files/conf-pop3d b/net-mail/qmail/files/conf-pop3d
new file mode 100644
index 000000000000..528e052dbf5f
--- /dev/null
+++ b/net-mail/qmail/files/conf-pop3d
@@ -0,0 +1,29 @@
+# Configuration file for qmail-pop3d
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/conf-pop3d,v 1.1 2003/11/30 11:32:06 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"
+
+# The name of the maildir in each user's directory.
+# This should be the same thing that defaultdelivery points to
+QMAIL_MAILDIR=".maildir"
diff --git a/net-mail/qmail/files/conf-qmqpd b/net-mail/qmail/files/conf-qmqpd
new file mode 100644
index 000000000000..06726b382614
--- /dev/null
+++ b/net-mail/qmail/files/conf-qmqpd
@@ -0,0 +1,15 @@
+# Configuration file for qmail-qmqpd
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/conf-qmqpd,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+
+# Stuff to run before tcpserver
+#QMAIL_TCPSERVER_PRE=""
+# Stuff to run qmail-qmqpd
+#QMAIL_QMQP_PRE=""
+# 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/conf-qmtpd b/net-mail/qmail/files/conf-qmtpd
new file mode 100644
index 000000000000..348b730967a9
--- /dev/null
+++ b/net-mail/qmail/files/conf-qmtpd
@@ -0,0 +1,18 @@
+# Configuration file for qmail-qmtpd
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/conf-qmtpd,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+
+# For more information on making your servers talk QMTP
+# see http://cr.yp.to/im/mxps.html
+
+# Stuff to run before tcpserver
+#QMAIL_TCPSERVER_PRE=""
+# Stuff to run qmail-qmtpd
+#QMAIL_QMTP_PRE=""
+# 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/conf-send b/net-mail/qmail/files/conf-send
new file mode 100644
index 000000000000..8ddf4c3620ad
--- /dev/null
+++ b/net-mail/qmail/files/conf-send
@@ -0,0 +1,6 @@
+# Configuration file for qmail-send
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/conf-send,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+
+# directory to log to
+# override conf-common on this
+LOG_DEST=/var/log/qmail/qmail-send
diff --git a/net-mail/qmail/files/conf-smtpd b/net-mail/qmail/files/conf-smtpd
new file mode 100644
index 000000000000..a66b7f177844
--- /dev/null
+++ b/net-mail/qmail/files/conf-smtpd
@@ -0,0 +1,37 @@
+# Configuration file for qmail-smtpd
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/conf-smtpd,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+
+# Stuff to run before tcpserver
+#QMAIL_TCPSERVER_PRE=""
+# Stuff to run qmail-smtpd
+#QMAIL_SMTP_PRE=""
+# 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"
+
+# If you are interested in providing POP or IMAP before SMTP type relaying,
+# emerge relay-ctrl, then uncomment the next 2 lines
+#QMAIL_TCPSERVER_PRE="${QMAIL_TCPSERVER_PRE} envdir /etc/relay-ctrl relay-ctrl-chdir"
+#QMAIL_SMTP_PRE="${QMAIL_SMTP_PRE} relay-ctrl-check"
+# In /etc/courier-imap/authdaemonrc add the next line to the end:
+#authmodulelist="${authmodulelist} relay-ctrl-allow"
+# Then in /etc/courier-imap/{imapd,imapd-ssl,pop3d,pop3d-ssl}
+# Add this at the end
+#PRERUN="${PRERUN} envdir /etc/relay-ctrl relay-ctrl-chdir"
+
+# 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 four lines to enable SMTP-AUTH
+#QMAIL_SMTP_AUTHHOST=$(<${QMAIL_CONTROLDIR}/me)
+#[ -z "${QMAIL_SMTP_POST}" ] && QMAIL_SMTP_POST=/bin/true
+#QMAIL_SMTP_CHECKPASSWORD="/bin/cmd5checkpw"
+#QMAIL_SMTP_POST="${QMAIL_SMTP_AUTHHOST} ${QMAIL_SMTP_CHECKPASSWORD} ${QMAIL_SMTP_POST}"
diff --git a/net-mail/qmail/files/config-sanity-check b/net-mail/qmail/files/config-sanity-check
new file mode 100644
index 000000000000..aad068af2a44
--- /dev/null
+++ b/net-mail/qmail/files/config-sanity-check
@@ -0,0 +1,29 @@
+#!/bin/sh
+# Configuration Sanity Checking for qmail
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/config-sanity-check,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+# This is intended solely to stop qmail eating up all your hard disk space with logs
+
+CONFIG_SANITY_GOOD=1
+
+# check simple stuff first
+if [ -z "${QMAILDUID}" -o -z "${NOFILESGID}" -o -z "${SERVICE}" -o -z "${QMAILLUID}" ]; then
+ echo "SERVICE(${SERVICE}), QMAILDUID(${QMAILDUID}), NOFILESGID(${NOFILESGID}) or QMAILLUID(${QMAILLUID}) is unset in $0"
+ CONFIG_SANITY_GOOD=0
+fi
+
+if [ -z "${LOG_OPTS}" -o -z "${LOG_DEST}" ]; then
+ echo "Error in logging setup!"
+ CONFIG_SANITY_GOOD=0
+fi
+
+if [ ! -f ${QMAIL_CONTROLDIR}/rcpthosts -a -z "${QMAIL_DISABLE_SANITY_CHECK}" -a "${SERVICE}" = "smtp" ]; then
+ echo "No /var/qmail/control/rcpthosts!"
+ echo "Refusing to start SMTP listener because it'll create an open relay"
+ CONFIG_SANITY_GOOD=0
+fi
+
+if [ ! "${CONFIG_SANITY_GOOD}" -eq "1" ]; then
+ echo "Some error detected, sleeping for 30 seconds for safety"
+ sleep 30s
+ exit 1
+fi
diff --git a/net-mail/qmail/files/digest-qmail-1.03-r14 b/net-mail/qmail/files/digest-qmail-1.03-r14
new file mode 100644
index 000000000000..fd809f9a6e41
--- /dev/null
+++ b/net-mail/qmail/files/digest-qmail-1.03-r14
@@ -0,0 +1,23 @@
+MD5 622f65f982e380dbe86e6574f3abcb7c qmail-1.03.tar.gz 220668
+MD5 5a8d7a5863b0c56236af945dedd45754 qmailqueue-patch 2510
+MD5 39b6f70f65056472ff97ab40c1dba7b4 big-todo.103.patch 5546
+MD5 1d5b0aafb651ce2ad02aac6af80758c0 qmail-link-sync.patch 1403
+MD5 2ff58c3570870a8ff9a1d9eb9aec05a6 big-concurrency.patch 9331
+MD5 999e360e4b1571663b995ce51f6e056e qmail-1.03-0.0.0.0-0.2.patch 734
+MD5 4e1f2d8315e7e2a5482798c9d19fac4d sendmail-flagf.patch 863
+MD5 122664c38338e5ec35fcac43f33d6927 qmail-1.03-qmtpc.patch 6197
+MD5 24fc1a33089faf12e00b127cd659f317 qmail-smtpd-relay-reject 1230
+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 9140ad2b03017145cd7963c84bb24f16 qmail-103.patch 2104
+MD5 83bf5c4a4aade3c6c15faa9665ccfb71 qregex-starttls-2way-auth.patch 63825
+MD5 1d8b89607d35bfa409f8cfe6d23bc554 qmail-remote-auth-patch-doc.txt 1287
+MD5 fc00be3edc2827f1c93112d7d5147122 qmail-gentoo-1.03-r12-badrcptto-morebadrcptto-accdias.diff.bz2 4524
+MD5 58d912de1ede57062fa8a3e2e0e75abf qmail-popupnofd2close.patch 401
+MD5 d7151dcbeb02eea1c24c1dedffe20e0b qmail-1.03-reread-concurrency.2.patch 1129
+MD5 ad597c93426c0938fdb36d853fbcf40d 08-capa.diff 1323
+MD5 00084ddd52a3665b65f2db20a773b382 qmail-hold-1.03.pat.gz 1596
+MD5 68e7697fd61d7cd9a5a7dc88ce2ecd47 netscape-progress.patch 1457
+MD5 598aca7a3a99426d1f49079172986b31 sendmail-ignore-N.patch 636
diff --git a/net-mail/qmail/files/dot_qmail b/net-mail/qmail/files/dot_qmail
new file mode 100644
index 000000000000..81a15fc5c50c
--- /dev/null
+++ b/net-mail/qmail/files/dot_qmail
@@ -0,0 +1,3 @@
+# Uncomment the next line for .forward support
+#|dot-forward .forward
+./.maildir/
diff --git a/net-mail/qmail/files/errno.patch b/net-mail/qmail/files/errno.patch
new file mode 100644
index 000000000000..f9b77b91e065
--- /dev/null
+++ b/net-mail/qmail/files/errno.patch
@@ -0,0 +1,38 @@
+% diff -u3 error.h.orig error.h
+--- error.h.orig 1998-06-15 06:53:16.000000000 -0400
++++ error.h 2002-12-24 20:28:40.000000000 -0500
+@@ -1,7 +1,7 @@
+ #ifndef ERROR_H
+ #define ERROR_H
+
+-extern int errno;
++#include <errno.h>
+
+ extern int error_intr;
+ extern int error_nomem;
+
+
+% diff -u3 dns.c.orig dns.c
+--- dns.c.orig 2002-08-09 19:20:48.000000000 -0400
++++ dns.c 2002-12-24 20:42:46.000000000 -0500
+@@ -7,8 +7,6 @@
+ #include <errno.h>
+ extern int res_query();
+ extern int res_search();
+-extern int errno;
+-extern int h_errno;
+ #include "ip.h"
+ #include "ipalloc.h"
+ #include "fmt.h"
+
+
+% diff -u3 cdb_seek.c.orig cdb_seek.c
+--- cdb_seek.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ cdb_seek.c 2002-12-24 20:42:52.000000000 -0500
+@@ -1,6 +1,5 @@
+ #include <sys/types.h>
+ #include <errno.h>
+-extern int errno;
+ #include "cdb.h"
+
+ #ifndef SEEK_SET
diff --git a/net-mail/qmail/files/mkservercert b/net-mail/qmail/files/mkservercert
new file mode 100644
index 000000000000..da1470c74bc4
--- /dev/null
+++ b/net-mail/qmail/files/mkservercert
@@ -0,0 +1,55 @@
+#! /bin/sh
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/mkservercert,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+# Self-signed certificate generator for Qmail under Gentoo
+# Robin H. Johnson <robbat2@gentoo.org> - October 17, 2003
+# Based on mkimapdcert from courier-imap.
+
+test -x /usr/bin/openssl || exit 0
+source /sbin/functions.sh
+
+filedir="/var/qmail/control"
+pemfile="${filedir}/servercert.pem"
+randfile="${filedir}/servercert.rand"
+conffile="${filedir}/servercert.cnf"
+
+# file details for pemfile
+mode="0640"
+uid="qmaild"
+gid="qmail"
+
+# expire on certifcate
+days="365"
+
+if test -f $pemfile
+then
+ eerror "$pemfile already exists."
+ exit 1
+fi
+
+ewarn "Please customize ${conffile} before continuing!"
+einfo "Press ENTER to continue, or CTRL-C to stop now."
+read
+
+# setup the temp file
+cp /dev/null $pemfile
+chmod 600 $pemfile
+chown root $pemfile
+
+cleanup() {
+ rm -f $pemfile
+ rm -f $randfile
+ exit 1
+}
+
+dd if=/dev/urandom of=${randfile} bs=64 count=1 2>/dev/null
+chmod 600 ${randfile}
+einfo "Creating self-signed certificate"
+/usr/bin/openssl req -new -x509 -days ${days} -nodes \
+ -config ${conffile} -out $pemfile -keyout $pemfile -rand ${randfile} || cleanup
+einfo "Certificate details"
+/usr/bin/openssl x509 -subject -dates -fingerprint -noout -in $pemfile || cleanup
+chown ${uid}:${gid} ${pemfile}
+chmod ${mode} ${pemfile}
+#qmail needs an extra item
+ln -s ${pemfile} ${filedir}/clientcert.pem
+rm -f $randfile
diff --git a/net-mail/qmail/files/qmail-config-system b/net-mail/qmail/files/qmail-config-system
new file mode 100644
index 000000000000..655afca1da54
--- /dev/null
+++ b/net-mail/qmail/files/qmail-config-system
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Configuration System for Qmail
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/qmail-config-system,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+# This is a configuration system to make using and controlling the interesting parts of the qmail behavior simple
+# The only variable that needs to be set before running this is $SERVICE
+
+# this is to inherit QMAIL_CONTROLDIR
+. /etc/profile
+
+# now run
+# grab the common configuration
+[ -s ${QMAIL_CONTROLDIR}/conf-common ] && source ${QMAIL_CONTROLDIR}/conf-common
+
+# grab the per-service configuration
+[ -s ${QMAIL_CONTROLDIR}/conf-${SERVICE}d ] && source ${QMAIL_CONTROLDIR}/conf-${SERVICE}d
+# special case for qmail-send
+[ "${SERVICE}" = "send" -a -s ${QMAIL_CONTROLDIR}/conf-send ] && source ${QMAIL_CONTROLDIR}/conf-send
+
+# you may want to disable this at some point, so I give you the choice here
+if [ -s /var/qmail/bin/config-sanity-check -a -z "${QMAIL_DISABLE_SANITY_CHECK}" ]; then
+ source /var/qmail/bin/config-sanity-check
+else
+ echo "Failed to find sanity checker!"
+ sleep 30s
+ exit 1
+fi
diff --git a/net-mail/qmail/files/qmail-genrsacert.sh b/net-mail/qmail/files/qmail-genrsacert.sh
new file mode 100644
index 000000000000..b2df706edb63
--- /dev/null
+++ b/net-mail/qmail/files/qmail-genrsacert.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/qmail-genrsacert.sh,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+# Robin H. Johnson <robbat2@gentoo.org> - October 17, 2003
+# This file generates the static temporary RSA keys needed for qmail to encrypt messages
+# It should be run from a crontab, once a day is ok on low load machines, but
+# if you do lots of mail, once per hour is more reasonable
+# if you do NOT create the rsa512.pem, qmail will generate it on the fly for
+# each connection, which can be VERY slow.
+
+if [ -z "${ROOT}" -o "${ROOT}" = "/" ]; then
+confdir=/var/qmail/control
+else
+confdir=${ROOT}/var/qmail/control
+fi
+pemfile="${confdir}/rsa512.pem"
+tmpfile="${confdir}/rsa512.pem.tmp"
+
+# this is the number of bits in the key
+# it should be a power of 2 ideally
+# and it must be more than 64!
+bits="512"
+
+# the key should be 0600
+# which is readable by qmaild only!
+umaskvalue="0077"
+uid="qmaild"
+gid="qmail"
+
+umask ${umaskvalue} ;
+# we need to make sure that all of the operations succeed
+/usr/bin/openssl genrsa -out ${tmpfile} ${bits} 2>/dev/null && \
+/bin/chown ${uid}:${gid} ${tmpfile} && \
+/bin/mv -f ${tmpfile} ${pemfile}
diff --git a/net-mail/qmail/files/rc b/net-mail/qmail/files/rc
new file mode 100644
index 000000000000..c20b2b8a09fd
--- /dev/null
+++ b/net-mail/qmail/files/rc
@@ -0,0 +1,6 @@
+#!/bin/sh
+# gentoo qmail rc file to start qmail-start and thus qmail-send
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/rc,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+
+exec env - PATH="/var/qmail/bin:$PATH" \
+ qmail-start "`grep -v '^#' /var/qmail/control/defaultdelivery`"
diff --git a/net-mail/qmail/files/run-qmailpop3d b/net-mail/qmail/files/run-qmailpop3d
new file mode 100644
index 000000000000..4578df832d76
--- /dev/null
+++ b/net-mail/qmail/files/run-qmailpop3d
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's POP3 daemon
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/run-qmailpop3d,v 1.1 2003/11/30 11:32:06 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
+SERVICE=pop3
+source /var/qmail/bin/qmail-config-system && \
+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 ${QMAIL_MAILDIR} 2>&1
diff --git a/net-mail/qmail/files/run-qmailpop3dlog b/net-mail/qmail/files/run-qmailpop3dlog
new file mode 100644
index 000000000000..41a7c1a29d21
--- /dev/null
+++ b/net-mail/qmail/files/run-qmailpop3dlog
@@ -0,0 +1,6 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's POP3 daemon (logging)
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/run-qmailpop3dlog,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+SERVICE=pop3
+source /var/qmail/bin/qmail-config-system && \
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog ${LOG_OPTS} ${LOG_DEST}
diff --git a/net-mail/qmail/files/run-qmailqmqpd b/net-mail/qmail/files/run-qmailqmqpd
new file mode 100644
index 000000000000..cbe6edf8ce00
--- /dev/null
+++ b/net-mail/qmail/files/run-qmailqmqpd
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's QMQP daemon
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/run-qmailqmqpd,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+#
+# If you need to edit this file, please look at editing conf-qmqpd 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
+SERVICE=qmqp
+source /var/qmail/bin/qmail-config-system && \
+exec /usr/bin/softlimit ${SOFTLIMIT_OPTS} \
+ ${QMAIL_TCPSERVER_PRE} \
+ /usr/bin/tcpserver ${TCPSERVER_OPTS} -x /etc/tcp.${SERVICE}.cdb \
+ -c ${MAXCONN} -u ${QMAILDUID} -g ${NOFILESGID} \
+ ${TCPSERVER_HOST} ${TCPSERVER_PORT} \
+ ${QMAIL_QMQP_PRE} /var/qmail/bin/qmail-${SERVICE}d ${QMAIL_QMQP_POST} \
+ 2>&1
diff --git a/net-mail/qmail/files/run-qmailqmqpdlog b/net-mail/qmail/files/run-qmailqmqpdlog
new file mode 100644
index 000000000000..a4bf91459e4c
--- /dev/null
+++ b/net-mail/qmail/files/run-qmailqmqpdlog
@@ -0,0 +1,6 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's QMQP daemon (logging)
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/run-qmailqmqpdlog,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+SERVICE=qmqp
+source /var/qmail/bin/qmail-config-system && \
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog ${LOG_OPTS} ${LOG_DEST}
diff --git a/net-mail/qmail/files/run-qmailqmtpd b/net-mail/qmail/files/run-qmailqmtpd
new file mode 100644
index 000000000000..2f26b18278d9
--- /dev/null
+++ b/net-mail/qmail/files/run-qmailqmtpd
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's QMTP daemon
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/run-qmailqmtpd,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+#
+# If you need to edit this file, please look at editing conf-qmtpd 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
+SERVICE=qmtp
+source /var/qmail/bin/qmail-config-system && \
+exec /usr/bin/softlimit ${SOFTLIMIT_OPTS} \
+ ${QMAIL_TCPSERVER_PRE} \
+ /usr/bin/tcpserver ${TCPSERVER_OPTS} -x /etc/tcp.${SERVICE}.cdb \
+ -c ${MAXCONN} -u ${QMAILDUID} -g ${NOFILESGID} \
+ ${TCPSERVER_HOST} ${TCPSERVER_PORT} \
+ ${QMAIL_QMTP_PRE} /var/qmail/bin/qmail-${SERVICE}d ${QMAIL_QMTP_POST} \
+ 2>&1
diff --git a/net-mail/qmail/files/run-qmailqmtpdlog b/net-mail/qmail/files/run-qmailqmtpdlog
new file mode 100644
index 000000000000..fb2160dcb223
--- /dev/null
+++ b/net-mail/qmail/files/run-qmailqmtpdlog
@@ -0,0 +1,6 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's QMTP daemon (logging)
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/run-qmailqmtpdlog,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+SERVICE=qmtp
+source /var/qmail/bin/qmail-config-system && \
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog ${LOG_OPTS} ${LOG_DEST}
diff --git a/net-mail/qmail/files/run-qmailsend b/net-mail/qmail/files/run-qmailsend
new file mode 100644
index 000000000000..296a5fb3d613
--- /dev/null
+++ b/net-mail/qmail/files/run-qmailsend
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Gentoo qmail rc booter
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/run-qmailsend,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+exec /var/qmail/rc
diff --git a/net-mail/qmail/files/run-qmailsendlog b/net-mail/qmail/files/run-qmailsendlog
new file mode 100644
index 000000000000..1578e3875c14
--- /dev/null
+++ b/net-mail/qmail/files/run-qmailsendlog
@@ -0,0 +1,4 @@
+#!/bin/sh
+SERVICE=send
+source /var/qmail/bin/qmail-config-system && \
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog ${LOG_OPTS} ${LOG_DEST}
diff --git a/net-mail/qmail/files/run-qmailsmtpd b/net-mail/qmail/files/run-qmailsmtpd
new file mode 100644
index 000000000000..f062ab8df56d
--- /dev/null
+++ b/net-mail/qmail/files/run-qmailsmtpd
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's SMTP daemon
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/run-qmailsmtpd,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+#
+# If you need to edit this file, please look at editing conf-smtpd 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
+SERVICE=smtp
+source /var/qmail/bin/qmail-config-system && \
+exec /usr/bin/softlimit ${SOFTLIMIT_OPTS} \
+ ${QMAIL_TCPSERVER_PRE} \
+ /usr/bin/tcpserver ${TCPSERVER_OPTS} -x /etc/tcp.${SERVICE}.cdb \
+ -c ${MAXCONN} -u ${QMAILDUID} -g ${NOFILESGID} \
+ ${TCPSERVER_HOST} ${TCPSERVER_PORT} \
+ ${QMAIL_SMTP_PRE} /var/qmail/bin/qmail-${SERVICE}d ${QMAIL_SMTP_POST} \
+ 2>&1
diff --git a/net-mail/qmail/files/run-qmailsmtpdlog b/net-mail/qmail/files/run-qmailsmtpdlog
new file mode 100644
index 000000000000..c353bc2c68df
--- /dev/null
+++ b/net-mail/qmail/files/run-qmailsmtpdlog
@@ -0,0 +1,6 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's SMTP daemon (logging)
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/run-qmailsmtpdlog,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+SERVICE=smtp
+source /var/qmail/bin/qmail-config-system && \
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog ${LOG_OPTS} ${LOG_DEST}
diff --git a/net-mail/qmail/files/servercert.cnf b/net-mail/qmail/files/servercert.cnf
new file mode 100644
index 000000000000..9034266475a1
--- /dev/null
+++ b/net-mail/qmail/files/servercert.cnf
@@ -0,0 +1,37 @@
+# $Header: /var/cvsroot/gentoo-x86/net-mail/qmail/files/servercert.cnf,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+# Robin H. Johnson <robbat2@gentoo.org> - October 17, 2003
+# This is the openssl config file to generate keys for qmail
+# It is read by mkservercert
+
+[ req ]
+# you can increase this value, but be aware that it will make things much slower
+# this should be a power of 2!
+default_bits = 1024
+# leave the rest of these alone!
+encrypt_key = yes
+distinguished_name = req_dn
+x509_extensions = cert_type
+prompt = no
+
+[ req_dn ]
+# 2-Letter ISO country code
+C=US
+# FULL name of state/province/district
+# NO abbreviations!
+ST=Alabama
+# FULL name of city
+# NO abbreviations!
+L=Mobile
+# Full Name of your organization
+# NO abbreviations!
+O=Foobar Systems
+# Leave this alone unless specifically need to change it!
+OU=Automatically-generated Qmail SMTP SSL key
+# This should be a FQDN that resolves to the IP of your server
+CN=localhost
+# This should be the email address for the administrator of the server
+emailAddress=postmaster@localhost
+
+# Leave this alone!
+[ cert_type ]
+nsCertType = server
diff --git a/net-mail/qmail/qmail-1.03-r14.ebuild b/net-mail/qmail/qmail-1.03-r14.ebuild
new file mode 100644
index 000000000000..af0d8956b152
--- /dev/null
+++ b/net-mail/qmail/qmail-1.03-r14.ebuild
@@ -0,0 +1,460 @@
+# 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-r14.ebuild,v 1.1 2003/11/30 11:32:06 robbat2 Exp $
+
+inherit eutils fixheadtails
+
+IUSE="ssl noauthcram notlsbeforeauth"
+DESCRIPTION="A modern replacement for sendmail which uses maildirs and includes SSL/TLS, AUTH SMTP, and queue optimization"
+HOMEPAGE="http://www.qmail.org/
+ http://members.elysium.pl/brush/qmail-smtpd-auth/
+ http://www.jedi.claranet.fr/qmail-tuning.html"
+SRC_URI="mirror://qmail/qmail-1.03.tar.gz
+ mirror://qmail/qmailqueue-patch
+ http://qmail.null.dk/big-todo.103.patch
+ http://www.jedi.claranet.fr/qmail-link-sync.patch
+ mirror://qmail/big-concurrency.patch
+ http://www.suspectclass.com/~sgifford/qmail/qmail-1.03-0.0.0.0-0.2.patch
+ http://david.acz.org/software/sendmail-flagf.patch
+ mirror://qmail/qmail-1.03-qmtpc.patch
+ http://qmail.goof.com/qmail-smtpd-relay-reject
+ 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
+ http://www.ckdhr.com/ckd/qmail-103.patch
+ http://www.arda.homeunix.net/store/qmail/qregex-starttls-2way-auth.patch
+ http://www.soffian.org/downloads/qmail/qmail-remote-auth-patch-doc.txt
+ mirror://gentoo/qmail-gentoo-1.03-r12-badrcptto-morebadrcptto-accdias.diff.bz2
+ http://www.dataloss.nl/software/patches/qmail-popupnofd2close.patch
+ http://js.hu/package/qmail/qmail-1.03-reread-concurrency.2.patch
+ http://www.mcmilk.de/qmail/dl/djb-qmail/patches/08-capa.diff
+ http://www.leverton.org/qmail-hold-1.03.pat.gz
+ mirror://qmail/netscape-progress.patch
+ http://www-dt.e-technik.uni-dortmund.de/~ma/djb/qmail/sendmail-ignore-N.patch
+ "
+# broken stuffs
+#http://www.qcc.ca/~charlesc/software/misc/nullenvsender-recipcount.patch
+#http://www.dataloss.nl/software/patches/qmail-pop3d-stat.patch
+
+SLOT="0"
+LICENSE="as-is"
+KEYWORDS="x86 ppc sparc alpha ~arm ~hppa ~mips"
+DEPEND="virtual/glibc
+ sys-apps/groff
+ ssl? ( >=dev-libs/openssl-0.9.6g )
+ >=net-mail/queue-fix-1.4-r1"
+
+RDEPEND="!virtual/mta
+ virtual/glibc
+ >=sys-apps/ucspi-tcp-0.88
+ >=sys-apps/daemontools-0.76-r1
+ >=net-mail/checkpassword-0.90
+ >=net-mail/cmd5checkpw-0.22
+ >=net-mail/dot-forward-0.71
+ >=net-mail/queue-fix-1.4-r1"
+
+PROVIDE="virtual/mta
+ virtual/mda"
+
+S=${WORKDIR}/${P}
+
+src_unpack() {
+ # unpack the initial stuff
+ unpack ${P}.tar.gz
+
+ # This makes life easy
+ EPATCH_OPTS="-d ${S}"
+
+ # this patch merges a few others already
+ EPATCH_SINGLE_MSG="Adding SMTP AUTH (2 way), Qregex and STARTTLS support" \
+ epatch ${DISTDIR}/qregex-starttls-2way-auth.patch
+ # bug #30570
+ EPATCH_SINGLE_MSG="Fixing a memory leak in Qregex support" \
+ epatch ${FILESDIR}/${PVR}/qmail-1.03-qregex-memleak-fix.patch
+
+ # Fixes a problem when utilizing "morercpthosts"
+ epatch ${FILESDIR}/${PVR}/smtp-auth-close3.patch
+
+ # patch so an alternate queue processor can be used
+ # i.e. - qmail-scanner
+ EPATCH_SINGLE_MSG="Adding QMAILQUEUE support" \
+ epatch ${DISTDIR}/qmailqueue-patch
+
+ # a patch for faster queue processing
+ EPATCH_SINGLE_MSG="Patching for large queues" \
+ epatch ${DISTDIR}/big-todo.103.patch
+
+ # Support for remote hosts that have QMTP
+ 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
+ epatch ${DISTDIR}/qmail-local-tabs.patch
+
+ # Account for Linux filesystems lack of a synchronus link()
+ epatch ${DISTDIR}/qmail-link-sync.patch
+
+ # Increase limits for large mail systems
+ epatch ${DISTDIR}/big-concurrency.patch
+
+ # Treat 0.0.0.0 as a local address
+ epatch ${DISTDIR}/qmail-1.03-0.0.0.0-0.2.patch
+
+ # Let the system decide how to define errno
+ epatch ${FILESDIR}/errno.patch
+
+ # holdremote support
+ # pre-process to remove the header added upstream
+ zcat ${DISTDIR}/qmail-hold-1.03.pat.gz | sed '123,150d' >${T}/qmail-hold-1.03.patch
+ epatch ${T}/qmail-hold-1.03.patch
+
+ # make the qmail 'sendmail' binary behave like sendmail's for -f
+ epatch ${DISTDIR}/sendmail-flagf.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
+ # fix a typo in the patch
+ epatch ${FILESDIR}/${PVR}/maildir-quota-fix.patch
+
+ # Apply patch for local timestamps.
+ # This will make the emails headers be written in localtime rather than GMT
+ # If you really want, uncomment it yourself, as mail really should be in GMT
+ epatch ${DISTDIR}/qmail-date-localtime.patch.txt
+
+ # 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
+
+ # Apply patch to add ESMTP SIZE support to qmail-smtpd
+ # 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 ${FILESDIR}/${PVR}/qmail-smtpd-esmtp-size-gentoo.patch
+
+ #TODO TEST
+ # Reject some bad relaying attempts
+ # gentoo bug #18064
+ epatch ${FILESDIR}/${PVR}/qmail-smtpd-relay-reject.gentoo.patch
+
+ #TODO TEST HEAVILY AS THIS PATCH WAS CUSTOM FIXED
+ # provide badrcptto support
+ # as per bug #17283
+ # patch re-diffed from original at http://sys.pro.br/files/badrcptto-morebadrcptto-accdias.diff.bz2
+ epatch ${DISTDIR}/qmail-gentoo-1.03-r12-badrcptto-morebadrcptto-accdias.diff.bz2
+
+ # bug #31426
+ # original submission by shadow@ines.ro, cleaned up by robbat2@gentoo.org
+ # only allows AUTH after STARTTLS, if compiled TLS && TLS_BEFORE_AUTH defines
+ epatch ${FILESDIR}/${PVR}/auth-after-tls-only.patch
+
+ EPATCH_SINGLE_MSG="Enable stderr logging from checkpassword programs" \
+ epatch ${DISTDIR}/qmail-popupnofd2close.patch
+ EPATCH_SINGLE_MSG="Allow qmail to re-read concurrency limits on HUP" \
+ epatch ${DISTDIR}/qmail-1.03-reread-concurrency.2.patch
+ EPATCH_SINGLE_MSG="Add support for CAPA in POP3d" \
+ epatch ${DISTDIR}/08-capa.diff
+ EPATCH_SINGLE_MSG="Fixing output bug in CAPA-enabled POP3d" \
+ epatch ${FILESDIR}/${PVR}/qmail-pop3d-capa-outputfix.patch
+ EPATCH_SINGLE_MSG="Fixing netscape progress bar bug with POP3d" \
+ epatch ${DISTDIR}/netscape-progress.patch
+
+ EPATCH_SINGLE_MSG="Making the sendmail binary ignore -N options for compatibility" \
+ epatch ${DISTDIR}/sendmail-ignore-N.patch
+
+ # rediff of original at http://www.qmail.org/accept-5xx.patch
+ epatch ${FILESDIR}/${PVR}/qmail-1.03-accept-5xx.tls.patch
+
+ # rediffed from original at http://www.qcc.ca/~charlesc/software/misc/nullenvsender-recipcount.patch
+ # because of TLS
+ EPATCH_SINGLE_MSG="Refuse messages from the null envelope sender if they have more than one envelope recipient" \
+ epatch ${FILESDIR}/${PVR}/nullenvsender-recipcount.tls.patch
+
+ # rediffed from original at http://www.dataloss.nl/software/patches/qmail-pop3d-stat.patch
+ # because of TLS
+ EPATCH_SINGLE_MSG="qmail-pop3d reports erroneous figures on STAT after a DELE" \
+ epatch ${FILESDIR}/${PVR}/qmail-pop3d-stat.tls.patch
+
+ echo -n "${CC} ${CFLAGS}" >${S}/conf-cc
+ if use ssl; then
+ einfo "Enabling SSL/TLS functionality"
+ echo -n ' -DTLS ' >>${S}/conf-cc
+
+ # from bug #31426
+ if ! use notlsbeforeauth; then
+ einfo "Enabling STARTTLS before SMTP AUTH"
+ echo -n '-DTLS_BEFORE_AUTH ' >>${S}/conf-cc
+ else
+ einfo "Disabling STARTTLS before SMTP AUTH"
+ fi
+
+ fi
+
+ # fix bug #33818
+ if use noauthcram; then
+ einfo "Disabling AUTHCRAM support"
+ sed -e 's,^#define AUTHCRAM$,//&,' -i ${S}/qmail-smtpd.c
+ else
+ einfo "Enabling AUTHCRAM support"
+ fi
+
+ echo -n "${CC} ${LDFLAGS}" > ${S}/conf-ld
+ echo -n "500" > ${S}/conf-spawn
+
+ # fix coreutils messup
+ ht_fix_file ${S}/Makefile
+
+}
+
+src_compile() {
+ emake it man || die
+}
+
+src_install() {
+
+ einfo "Setting up directory hierarchy ..."
+
+ diropts -m 755 -o root -g qmail
+ dodir /var/qmail
+
+ for i in bin boot control
+ do
+ dodir /var/qmail/${i}
+ done
+
+ keepdir /var/qmail/users
+
+ diropts -m 755 -o alias -g qmail
+ dodir /var/qmail/alias
+
+ einfo "Installing the qmail software ..."
+
+ insopts -o root -g qmail -m 755
+ insinto /var/qmail/boot
+ doins home home+df proc proc+df binm1 binm1+df binm2 \
+ binm2+df binm3 binm3+df
+
+ dodoc FAQ UPGRADE SENDMAIL INSTALL* TEST* REMOVE* PIC* SECURITY
+ dodoc SYSDEPS TARGETS THANKS THOUGHTS TODO VERSION README* \
+ ${DISTDIR}/qmail-remote-auth-patch-doc.txt
+
+ insinto /var/qmail/bin
+ insopts -o qmailq -g qmail -m 4711
+ doins qmail-queue
+
+ insopts -o root -g qmail -m 700
+ doins qmail-lspawn qmail-start qmail-newu qmail-newmrh
+
+ insopts -o root -g qmail -m 711
+ doins qmail-getpw qmail-local qmail-remote qmail-rspawn \
+ qmail-clean qmail-send splogger qmail-pw2u
+
+ insopts -o root -g qmail -m 755
+ doins qmail-inject predate datemail mailsubj qmail-showctl \
+ qmail-qread qmail-qstat qmail-tcpto qmail-tcpok qmail-pop3d \
+ qmail-popup qmail-qmqpc qmail-qmqpd qmail-qmtpd qmail-smtpd \
+ sendmail tcp-env qreceipt qsmhook qbiff forward preline \
+ condredirect bouncesaying except maildirmake maildir2mbox \
+ maildirwatch qail elq pinq config-fast qmail-newbrt
+
+ into /usr
+ einfo "Installing manpages"
+ doman *.[1-8]
+
+ # use the correct maildirmake
+ # the courier-imap one has some extensions that are nicer
+ [ -e /usr/bin/maildirmake ] && \
+ MAILDIRMAKE="/usr/bin/maildirmake" || \
+ MAILDIRMAKE="${D}/var/qmail/bin/maildirmake"
+
+ einfo "Adding env.d entry for qmail"
+ dodir /etc/env.d
+ insinto /etc/env.d
+ doins ${FILESDIR}/99qmail
+
+ einfo "Creating sendmail replacement ..."
+ diropts -m 755
+ dodir /usr/sbin /usr/lib
+ dosym /var/qmail/bin/sendmail /usr/sbin/sendmail
+ dosym /var/qmail/bin/sendmail /usr/lib/sendmail
+
+ einfo "Setting up the default aliases ..."
+ diropts -m 700 -o alias -g qmail
+ ${MAILDIRMAKE} ${D}/var/qmail/alias/.maildir
+ # for good measure
+ keepdir /var/qmail/alias/.maildir/{cur,new,tmp}
+
+ for i in mailer-daemon postmaster root
+ do
+ if [ ! -f ${ROOT}/var/qmail/alias/.qmail-${i} ]; then
+ touch ${D}/var/qmail/alias/.qmail-${i}
+ fowners alias:qmail /var/qmail/alias/.qmail-${i}
+ fi
+ done
+
+ einfo "Setting up maildirs by default in the account skeleton ..."
+ diropts -m 755 -o root -g root
+ insinto /etc/skel
+ newins ${FILESDIR}/dot_qmail .qmail.sample
+ fperms 644 /etc/skel/.qmail.sample
+ ${MAILDIRMAKE} ${D}/etc/skel/.maildir
+ # for good measure
+ keepdir /etc/skel/.maildir/{cur,new,tmp}
+
+ einfo "Setting up all services (send, smtp, qmtp, qmqp, pop3) ..."
+ insopts -o root -g root -m 755
+ diropts -m 755 -o root -g root
+ dodir /var/qmail/supervise
+
+ for i in send smtpd qmtpd qmqpd pop3d; do
+ insopts -o root -g root -m 755
+ diropts -m 755 -o root -g root
+ dodir /var/qmail/supervise/qmail-${i}{,/log}
+ diropts -m 755 -o qmaill
+ keepdir /var/log/qmail/qmail-${i}
+ fperms +t /var/qmail/supervise/qmail-${i}{,/log}
+ insinto /var/qmail/supervise/qmail-${i}
+ newins ${FILESDIR}/run-qmail${i} run
+ insinto /var/qmail/supervise/qmail-${i}/log
+ newins ${FILESDIR}/run-qmail${i}log run
+ done
+
+ insinto /etc
+ for i in smtp qmtp qmqp pop3; do
+ newins ${FILESDIR}/tcp.${i}.sample tcp.${i}
+ done
+
+ einfo "Installing the qmail startup file ..."
+ insinto /var/qmail
+ insopts -o root -g root -m 755
+ doins ${FILESDIR}/rc
+
+ einfo "Insalling some stock configuration files"
+ insinto /var/qmail/control
+ insopts -o root -g root -m 644
+ doins ${FILESDIR}/conf-*
+ newins ${FILESDIR}/dot_qmail defaultdelivery
+ use ssl && doins ${FILESDIR}/servercert.cnf
+
+ einfo "Configuration sanity checker and launcher"
+ into /var/qmail
+ insopts -o root -g root -m 644
+ dobin ${FILESDIR}/config-sanity-check
+ dobin ${FILESDIR}/qmail-config-system
+
+ if use ssl; then
+ einfo "SSL Certificate creation script"
+ dobin ${FILESDIR}/mkservercert
+ einfo "RSA key generation cronjob"
+ insinto /etc/cron.hourly
+ doins ${FILESDIR}/qmail-genrsacert.sh
+ chmod +x ${D}/etc/cron.hourly/qmail-genrsacert.sh
+
+ # for some files
+ keepdir /var/qmail/control/tlshosts/
+ fi
+}
+
+rootmailfixup() {
+ # so you can check mail as root easily
+ local TMPCMD="ln -sf /var/qmail/alias/.maildir/ ${ROOT}/root/.maildir"
+ if [ -d "${ROOT}/root/.maildir" ] && [ ! -L "${ROOT}/root/.maildir" ] ; then
+ einfo "Previously the qmail ebuilds created /root/.maildir/ but not"
+ einfo "mail was every delivered there. If the directory does not"
+ einfo "contain any mail, please delete it and run:"
+ einfo "${TMPCMD}"
+ else
+ ${TMPCMD}
+ fi
+ chown -R alias:qmail ${ROOT}/var/qmail/alias/.maildir 2>/dev/null
+}
+
+buildtcprules() {
+ for i in smtp qmtp qmqp pop3; do
+ # please note that we don't check if it exists
+ # as we want it to make the cdb files anyway!
+ cat ${ROOT}etc/tcp.${i} 2>/dev/null | tcprules ${ROOT}etc/tcp.${i}.cdb ${ROOT}etc/.tcp.${i}.tmp
+ done
+}
+
+pkg_postinst() {
+
+ einfo "Setting up the message queue hierarchy ..."
+ # queue-fix makes life easy!
+ /var/qmail/bin/queue-fix ${ROOT}/var/qmail/queue >/dev/null
+
+ rootmailfixup
+ buildtcprules
+
+ # for good measure
+ env-update
+
+ einfo "To setup qmail to run out-of-the-box on your system, run:"
+ einfo "ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config"
+ echo
+ einfo "To start qmail at boot you have to add svscan to your startup"
+ einfo "and create the following links:"
+ einfo "ln -s /var/qmail/supervise/qmail-send /service/qmail-send"
+ einfo "ln -s /var/qmail/supervise/qmail-smtpd /service/qmail-smtpd"
+ echo
+ einfo "To start the pop3 server as well, create the following link:"
+ einfo "ln -s /var/qmail/supervise/qmail-pop3d /service/qmail-pop3d"
+ echo
+ einfo "Additionally, the QMTP and QMQP protocols are supported, "
+ einfo "and can be started as:"
+ einfo "ln -s /var/qmail/supervise/qmail-qmtpd /service/qmail-qmtpd"
+ einfo "ln -s /var/qmail/supervise/qmail-qmqpd /service/qmail-qmqpd"
+ echo
+ einfo "Additionally, if you wish to run qmail right now, you should "
+ einfo "run this before anything else:"
+ einfo "source /etc/profile"
+}
+
+pkg_config() {
+
+ # avoid some weird locale problems
+ export LC_ALL="C"
+
+ if [ ${ROOT} = "/" ] ; then
+ if [ ! -f ${ROOT}var/qmail/control/me ] ; then
+ export qhost=`hostname --fqdn`
+ ${ROOT}var/qmail/bin/config-fast $qhost
+ fi
+ else
+ ewarn "Skipping some configuration as it MUST be run on the final host"
+ fi
+
+ 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`
+ TCPSTRING=":allow,RELAYCLIENT=\"\",RBLSMTPD=\"\""
+ for ip in $LOCALIPS; do
+ myline="${ip}${TCPSTRING}"
+ for proto in smtp qmtp qmqp; do
+ f="${ROOT}etc/tcp.${proto}"
+ egrep -q "${myline}" ${f} || echo "${myline}" >>${f}
+ done
+ done
+
+ buildtcprules
+
+ if use ssl; then
+ ${ROOT}etc/cron.daily/qmail-genrsacert.sh
+ einfo "Creating a self-signed ssl-certificate:"
+ /var/qmail/bin/mkservercert
+ einfo "If you want to have a properly signed certificate "
+ einfo "instead, do the following:"
+ einfo "openssl req -new -nodes -out req.pem \\"
+ einfo "-config /var/qmail/control/servercert.cnf \\"
+ einfo "-keyout /var/qmail/control/servercert.pem"
+ 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
+}
+