diff options
author | 2004-05-30 10:50:14 +0000 | |
---|---|---|
committer | 2004-05-30 10:50:14 +0000 | |
commit | 13d0f538508e5d7908ca674d170032f0c880abff (patch) | |
tree | 677be2c0d4a23bc7664d7fa147976c40aa90a498 /mail-mta | |
parent | Version bump #49608 by Daniel Webert. (diff) | |
download | historical-13d0f538508e5d7908ca674d170032f0c880abff.tar.gz historical-13d0f538508e5d7908ca674d170032f0c880abff.tar.bz2 historical-13d0f538508e5d7908ca674d170032f0c880abff.zip |
move net-mail/qmail to mail-mta/qmail.
Diffstat (limited to 'mail-mta')
177 files changed, 10758 insertions, 0 deletions
diff --git a/mail-mta/qmail-ldap/Manifest b/mail-mta/qmail-ldap/Manifest new file mode 100644 index 000000000000..8f41e1539423 --- /dev/null +++ b/mail-mta/qmail-ldap/Manifest @@ -0,0 +1,95 @@ +MD5 087b87cc7dd74ff26dc1a736242a5c7d qmail-ldap-1.03-r2.ebuild 11830 +MD5 3284b256c9f15891691944b3a82cb8ad qmail-ldap-1.03-r4.ebuild 11413 +MD5 69f21d4b54a21fa9eeb2cdd96d0ac578 qmail-ldap-1.03-r1.ebuild 11627 +MD5 ef6b9f796f1a2f39872cd6e4ac8c38a9 ChangeLog 2483 +MD5 4a171dbfed7df6a76dbddfc18db344d7 metadata.xml 490 +MD5 84fc9b544908f8cee34941d527e2a007 qmail-ldap-1.03-r3.ebuild 10730 +MD5 f42a779e5c708c2d7bf38de66dfb93f5 files/rc 108 +MD5 931b3ed00571e8e2a22b550fcd1d7137 files/qmail-queue.patch.bz2 722 +MD5 b7e7c96254dabacdec5bf5904957c7b2 files/tcp.qmqp.sample 399 +MD5 3866e15deb8a69d44cacb5b3680d1b61 files/qmail-linksync.patch.bz2 687 +MD5 cdeca5e6a3d82ed7b85e372433576bb2 files/samples.ldif 821 +MD5 820848b92884db5bdd3030e57bf21d07 files/gentoo.patch 1419 +MD5 e59223e5e1882318ecec8cc9eb9d43de files/tcp.smtp.sample 3777 +MD5 0078aede689ce77bc32e32124a5e7fbb files/homedir.patch.bz2 527 +MD5 1dcd3bb9666d5015bca6b7eb33478542 files/errno.patch.bz2 401 +MD5 d779786aab66f97f6e7e4785ca89a636 files/tcp.pop3.sample 335 +MD5 b69ae80155ab4d0555b66a79ae5ab95d files/digest-qmail-ldap-1.03-r1 452 +MD5 d2f6c625c3a73be4262b616e0e2d132c files/digest-qmail-ldap-1.03-r2 337 +MD5 61a73bd4ce3f9bd360b73b791799f4d8 files/digest-qmail-ldap-1.03-r3 263 +MD5 1ed104f44042105b6382472be18e1a26 files/digest-qmail-ldap-1.03-r4 275 +MD5 c378c5845848ee31d70f0d05cbcf86be files/dot_qmail 12 +MD5 8af1f30a164fbdec0d51d11ef82dcaa9 files/tls.patch.bz2 406 +MD5 13bd1b1b40e0f20ce43d86d2f4b65e82 files/tcp.qmtp.sample 432 +MD5 34387b954bf87d51388de4df127ce99b files/qmail-control 806 +MD5 b66cf6234bb37ddd8731676b201fa7e4 files/qmail-link-sync-gentoo.patch 1532 +MD5 d24fa37b58967d2d8022c84c88148ed6 files/control/file 41 +MD5 04f43d57aee8dc0b8e2465eeb7035e2b files/control/ldapbasedn 19 +MD5 368c62b8d7c7636b14b8efadbd6ffb76 files/control/ldaplogin 41 +MD5 eb6ed326fe4b42303e2ff32aabe581ab files/control/defaultdomain 13 +MD5 0dbac736b055522776d091c24a941b38 files/control/ldapmessagestore 21 +MD5 40d7e85fdd014acc169817b5dc1c43da files/control/ldappassword 26 +MD5 91929a0ba1be35ed2656fc733674c210 files/control/ldapgid 5 +MD5 0ce18f24e2bb34b7680aaf80ab44ec56 files/control/ldapuid 6 +MD5 eb6ed326fe4b42303e2ff32aabe581ab files/control/defaulthost 13 +MD5 b8419160170a41ae01abab13a3b887df files/control/ldapserver 10 +MD5 4a4e6ef110d83f712d5df669e7ca3a0b files/control/dirmaker 24 +MD5 897316929176464ebc9ad085f31e7284 files/control/ldaplocaldelivery 2 +MD5 44f0ea3c13cabc96782b1e26042865c4 files/control/defaultdelivery 11 +MD5 99265fec7ddb774069ae45afb9c010ca files/supervise/run-qmailpop3d 451 +MD5 cc0cf4631ac9d86397660f91c62332b2 files/supervise/run-qmailsmtpd 270 +MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/supervise/run-qmailsmtpdlog 97 +MD5 834dad5113515d0f00981fdc1d07fa84 files/supervise/run-qmailsendlog 96 +MD5 23a2babf3049fe012de21c17e550b3e5 files/supervise/run-qmailsend 29 +MD5 34f7022d4bda6c19752a878f8da7289b files/supervise/run-qmailpop3dlog 100 +MD5 9fc8ba8582cf5e04f67ee32ad9c8a967 files/1.03-r2/samples.ldif 1215 +MD5 6c0f741d2f9a7cc5e6b346d435ab0e64 files/1.03-r3/rc 117 +MD5 c29aa8c1b6c593c48a0f74ff7a912264 files/1.03-r3/run-qmailpop3d 1180 +MD5 146d016d054575f8b0f2f99b72cf49d5 files/1.03-r3/run-qmailqmqpd 1169 +MD5 aea305bddb7cfd72782adb923e900280 files/1.03-r3/run-qmailqmtpd 1169 +MD5 ac4e591bf98be5530cf988b6211e8a86 files/1.03-r3/run-qmailsmtpd 1169 +MD5 180a513f34e3f00abc609672a190072c files/1.03-r3/99qmail 137 +MD5 249138d56492deb0f856849bc002e46a files/1.03-r3/run-qmailqmqpdlog 97 +MD5 795f633858c0919b6e201cf2b845779e files/1.03-r3/run-qmailqmtpdlog 97 +MD5 fb9d0c92ba188e43e74fc1dbd8947775 files/1.03-r3/qmail-genrsacert.sh 1174 +MD5 c369664bce0646b3d323d08f9ba5b8ce files/1.03-r3/dot_qmail 82 +MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03-r3/run-qmailsmtpdlog 97 +MD5 7ae967553c1b103ffab42db62412092a files/1.03-r3/conf-pop3d 1075 +MD5 14079baa6cb7772ef91bef20e8e48ec1 files/1.03-r3/conf-qmqpd 474 +MD5 85a13aeb196e73ae8efb1d48525bb372 files/1.03-r3/conf-qmtpd 566 +MD5 84b59e13ba2d3e089b4585007ed5d28c files/1.03-r3/servercert.cnf 1107 +MD5 247b9246d87b9626cb29ce1be103d292 files/1.03-r3/conf-smtpd 1711 +MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03-r3/run-qmailsendlog 96 +MD5 1d22ba6bd7fe6ab3774369c54c6df571 files/1.03-r3/mkservercert 1438 +MD5 f0d77e0ac982dfd42fc5f98c7acc7eff files/1.03-r3/qmail-control 862 +MD5 4e67fa006dc001ac844fb3ac94a9f2e2 files/1.03-r3/conf-common 1098 +MD5 083722e80551ea4a234e52193014058f files/1.03-r3/config-sanity-check 818 +MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03-r3/run-qmailsend 29 +MD5 0e97c0b031776f40cacdfbf3114af574 files/1.03-r3/run-qmailpop3dlog 97 +MD5 6c0f741d2f9a7cc5e6b346d435ab0e64 files/1.03-r4/rc 117 +MD5 40f8600a40c96ad605e7052f3c2b51f3 files/1.03-r4/run-qmailpop3d 1215 +MD5 61f5ca0e8c29e06b4680acf7e8334ec5 files/1.03-r4/run-qmailqmqpd 1202 +MD5 b2aec7c03ee431298659825d0e1db79b files/1.03-r4/run-qmailqmtpd 1202 +MD5 d869eb1d7e5d6873f19d8e01ad02ec20 files/1.03-r4/run-qmailsmtpd 1202 +MD5 180a513f34e3f00abc609672a190072c files/1.03-r4/99qmail 137 +MD5 f8d9b2ba720f81dfbc8bd3b25cd90b75 files/1.03-r4/gentoo.patch 2204 +MD5 249138d56492deb0f856849bc002e46a files/1.03-r4/run-qmailqmqpdlog 97 +MD5 795f633858c0919b6e201cf2b845779e files/1.03-r4/run-qmailqmtpdlog 97 +MD5 bdc2e438c21a9efb9ed0506118d1ac0d files/1.03-r4/pipehack.patch.bz2 372 +MD5 a9c3dd67123c26417ba3eee1c2b77209 files/1.03-r4/qmail-genrsacert.sh 1174 +MD5 c369664bce0646b3d323d08f9ba5b8ce files/1.03-r4/dot_qmail 82 +MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03-r4/run-qmailsmtpdlog 97 +MD5 f510c04dc6e347c4ee4088ca96367bc4 files/1.03-r4/conf-pop3d 1132 +MD5 a9b30eaadb5980175b7bbe524131f7b1 files/1.03-r4/conf-qmqpd 527 +MD5 56c112daa7053e0fd22f9249874d2f95 files/1.03-r4/conf-qmtpd 619 +MD5 4cd0a281b499306d94dd4acec28b9445 files/1.03-r4/servercert.cnf 1107 +MD5 2354313bc390c31a3bf5a9d4cb31364d files/1.03-r4/conf-smtpd 1801 +MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03-r4/run-qmailsendlog 96 +MD5 b8d9b7212aa8b0d3dadf492fb23339c6 files/1.03-r4/tls.patch.bz2 479 +MD5 0da9b3194754235284f123d54b9ccc64 files/1.03-r4/mkservercert 1438 +MD5 34b9db6570c7f0960f53f30506ccb1db files/1.03-r4/qmail.schema 3545 +MD5 1c7b417a25946a70e4f4b9423cfe4deb files/1.03-r4/qmail-control 862 +MD5 b967346754515cf8366684503a6934c3 files/1.03-r4/conf-common 1159 +MD5 0523ac94a446037cf4fe55d939a5a465 files/1.03-r4/config-sanity-check 818 +MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03-r4/run-qmailsend 29 +MD5 0e97c0b031776f40cacdfbf3114af574 files/1.03-r4/run-qmailpop3dlog 97 diff --git a/mail-mta/qmail-mysql/Manifest b/mail-mta/qmail-mysql/Manifest new file mode 100644 index 000000000000..7902ba3bdd2c --- /dev/null +++ b/mail-mta/qmail-mysql/Manifest @@ -0,0 +1,48 @@ +MD5 5ee8d6815d700a1640cb2a2d346f189b qmail-mysql-1.03-r13.ebuild 14066 +MD5 92f082b6d5344d882ba2c761db65d7f6 qmail-mysql-1.03.ebuild 8435 +MD5 f235b67e9aeb32d18b3f61e222f3016d ChangeLog 2317 +MD5 5721b86fd871bdfab77231abc6e02f68 metadata.xml 161 +MD5 e0686e52df7f0c840a7ac2bfe1fd291a files/tcp.qmqp.sample 337 +MD5 02b7d10943e7640a9e4bc684a0c2ed1a files/digest-qmail-mysql-1.03-r13 1446 +MD5 946a715ffdd5e6d2d29c6fdfb29376dd files/tcp.smtp.sample 3726 +MD5 55b519379b1330f57110fa6d60982cff files/tcp.pop3.sample 285 +MD5 7dbe164188aa14fd05fa2c26d1095a9a files/digest-qmail-mysql-1.03 385 +MD5 76d218a258e2ec859ab80c377351afce files/tcp.qmtp.sample 370 +MD5 f42a779e5c708c2d7bf38de66dfb93f5 files/1.03/rc 108 +MD5 aa0823cdce32c502c856664c8b0ce775 files/1.03/run-qmailsmtpd 231 +MD5 5cb0c8c4c9feeee55362d77a99076c2f files/1.03/99qmail 44 +MD5 c47d861aeef098d12d022d44c27386b5 files/1.03/errno.patch 850 +MD5 b24f4dbd450d2d4eddc75ba19cebb915 files/1.03/defaultdelivery 34 +MD5 c378c5845848ee31d70f0d05cbcf86be files/1.03/dot_qmail 12 +MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03/run-qmailsmtpdlog 97 +MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03/run-qmailsendlog 96 +MD5 bfb155ffb0b884e9b62003b2fd47a0a6 files/1.03/qmail-control 812 +MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03/run-qmailsend 29 +MD5 6c0f741d2f9a7cc5e6b346d435ab0e64 files/1.03-r13/rc 117 +MD5 e44346ddbb073775f16bc96fdbf3d28b files/1.03-r13/run-qmailpop3d 1182 +MD5 a00264ab43249e1844a36f7af7396a84 files/1.03-r13/run-qmailqmqpd 1171 +MD5 f09f71dba9c75500e439b18c92585887 files/1.03-r13/run-qmailqmtpd 1171 +MD5 1661a51319c2b0acee830ff1afdde589 files/1.03-r13/run-qmailsmtpd 1171 +MD5 180a513f34e3f00abc609672a190072c files/1.03-r13/99qmail 137 +MD5 c47d861aeef098d12d022d44c27386b5 files/1.03-r13/errno.patch 850 +MD5 8d177d9ecd8e5e0ec2eb89dfeaed1eac files/1.03-r13/maildir-quota-fix.patch 547 +MD5 bed3133c1737dd9bc3c67e07f8bc65d8 files/1.03-r13/smtp-auth-close3.patch 728 +MD5 249138d56492deb0f856849bc002e46a files/1.03-r13/run-qmailqmqpdlog 97 +MD5 795f633858c0919b6e201cf2b845779e files/1.03-r13/run-qmailqmtpdlog 97 +MD5 df40676483bd1d3ad47efce0c0890ae9 files/1.03-r13/qmail-genrsacert.sh 1176 +MD5 c369664bce0646b3d323d08f9ba5b8ce files/1.03-r13/dot_qmail 82 +MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03-r13/run-qmailsmtpdlog 97 +MD5 21e903115b437ab8bf80bd421f395d20 files/1.03-r13/conf-pop3d 1077 +MD5 556e5c4b0a5cb44b06906d40315eb003 files/1.03-r13/conf-qmqpd 476 +MD5 3b9c95cc820cd6305111c4a679c9b699 files/1.03-r13/conf-qmtpd 568 +MD5 32e7e6aa8906f8adda16c0addcf06059 files/1.03-r13/servercert.cnf 1109 +MD5 3784ae157ab963297381f6b4641d559b files/1.03-r13/conf-smtpd 1715 +MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03-r13/run-qmailsendlog 96 +MD5 527bd550408bdf44f74c8f1848c98cb2 files/1.03-r13/mkservercert 1440 +MD5 2a725c31201c59077cd389486407624f files/1.03-r13/qmail-smtpd-esmtp-size-gentoo.patch 2131 +MD5 b0349d8d417d48a7e6ba68c57235824c files/1.03-r13/qmail-control 864 +MD5 5d9ab1dcd266faecef92921394411056 files/1.03-r13/conf-common 1100 +MD5 a0a031cd2dfff99b52de094a5d2ff234 files/1.03-r13/config-sanity-check 820 +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 diff --git a/mail-mta/qmail/ChangeLog b/mail-mta/qmail/ChangeLog new file mode 100644 index 000000000000..0e402bb5ae15 --- /dev/null +++ b/mail-mta/qmail/ChangeLog @@ -0,0 +1,379 @@ +# ChangeLog for net-mail/qmail +# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/ChangeLog,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + + 28 May 2004; Robin H. Johnson <robbat2@gentoo.org> metadata.xml: + Update metadata.xml. + + 13 May 2004; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r10.ebuild, + qmail-1.03-r11.ebuild, qmail-1.03-r12.ebuild, qmail-1.03-r13.ebuild, + qmail-1.03-r14.ebuild, qmail-1.03-r15.ebuild: + fix bug #39265 + + 10 Apr 2004; Joshua Kinard <kumba@gentoo.org> qmail-1.03-r15.ebuild: + Marked stable on mips. + + 25 Mar 2004; Joshua Kinard <kumba@gentoo.org> qmail-1.03-r15.ebuild: + Added ~mips to KEYWORDS. + + 08 Mar 2004; Jon Portnoy <avenj@gentoo.org> qmail-1.03-r15.ebuild : + Stable on AMD64. + + 28 Feb 2004; Robin Johnson,,604-339-5621,604-298-8414 <robbat2@gentoo.org> + qmail-1.03-r13.ebuild, files/1.03-r13/qmail-control: + fix bugs #41955, #43223 + + 18 Feb 2004; Aron Griffis <agriffis@gentoo.org> qmail-1.03-r15.ebuild: + stable on ia64 + + 29 Jan 2004; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r10.ebuild, + qmail-1.03-r8.ebuild, qmail-1.03-r9.ebuild: + fix bug #39808, touching .keep files obsolete. + + 28 Jan 2004; Jon Portnoy <avenj@gentoo.org> qmail-1.03-r15.ebuild : + AMD64 keywords. + + 24 Jan 2004; Robin H. Johnson <robbat2@gentoo.org> : + recreate digests + +*qmail-1.03-r15 (22 Jan 2004) + + 22 Jan 2004; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r15.ebuild, + files/config-sanity-check: + fix sanity-checker more, and minor typo in -r15 ebuild + + 20 Jan 2004; Robin H. Johnson <robbat2@gentoo.org> + files/1.03-r15/qmail-pop3d-top-outputfix.patch: + note to self, remember to cvs add new direcoryies ;-). fixes #38826 + + 20 Jan 2004; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild, + qmail-1.03-r13.ebuild, qmail-1.03-r14.ebuild, files/conf-common, + files/config-sanity-check, files/run-qmailpop3d, files/run-qmailqmqpd, + files/run-qmailqmtpd, files/run-qmailsmtpd, files/tcp.pop3.sample, + files/tcp.qmqp.sample, files/tcp.qmtp.sample, files/tcp.smtp.sample, + files/1.03-r10/tls-patch.txt, + files/1.03-r9/qmail-1.03-starttls-smtp-auth.patch: + head/tails fixes in some patches. massive update of tcprule stuff, moved to + /etc/tcprules.d/ in new versions (the config file checks the new location + first before falling back to the old location). -r15 does the move to the new + tcprules location. fix bug #34646 (again) in -r15. fixed #36721 in all recent + ebuilds. fixed #38771 in main config stuff. + + 15 Dec 2003; <spider@gentoo.org> files/gencert.sh, + files/1.03-r8/qmail-1.03-starttls-smtp-auth.patch: + A few more issues of : instead of . in chown + + 30 Nov 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r14.ebuild, + files/1.03-r14/qmail-gentoo-branding.patch, + files/1.03-r14/qmail-qmailqueue-docs.patch: + add gentoo branding patch and patch to add docs for QMAILQUEUE + + 30 Nov 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r14.ebuild: + forgot to put in unstable + +*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: + fix weird pre/post bug in conf-smtpd + + 28 Nov 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r13.ebuild: + tcprule building fix + + 27 Nov 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r13.ebuild: + move to stable + + 06 Nov 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r10.ebuild, + qmail-1.03-r11.ebuild, qmail-1.03-r12.ebuild, qmail-1.03-r13.ebuild, + qmail-1.03-r8.ebuild, qmail-1.03-r9.ebuild: + : instead of . for chown + +*qmail-1.03-r13 (27 Oct 2003) + + 27 Oct 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r13.ebuild, + files/1.03-r13/99qmail, files/1.03-r13/conf-common, + files/1.03-r13/conf-pop3d, files/1.03-r13/conf-qmqpd, + files/1.03-r13/conf-qmtpd, files/1.03-r13/conf-smtpd, + files/1.03-r13/config-sanity-check, files/1.03-r13/dot_qmail, + files/1.03-r13/errno.patch, files/1.03-r13/maildir-quota-fix.patch, + files/1.03-r13/mkservercert, files/1.03-r13/qmail-control, + files/1.03-r13/qmail-genrsacert.sh, + files/1.03-r13/qmail-smtpd-esmtp-size-gentoo.patch, + files/1.03-r13/qmail-smtpd-relay-reject.gentoo.patch, files/1.03-r13/rc, + files/1.03-r13/run-qmailpop3d, files/1.03-r13/run-qmailpop3dlog, + files/1.03-r13/run-qmailqmqpd, files/1.03-r13/run-qmailqmqpdlog, + files/1.03-r13/run-qmailqmtpd, files/1.03-r13/run-qmailqmtpdlog, + files/1.03-r13/run-qmailsend, files/1.03-r13/run-qmailsendlog, + files/1.03-r13/run-qmailsmtpd, files/1.03-r13/run-qmailsmtpdlog, + files/1.03-r13/servercert.cnf, files/1.03-r13/smtp-auth-close3.patch: + add new -r13 that makes ssl stuff easier, in preperation for the HOWTO document + + 23 Sep 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild: + install all the manpages + + 23 Sep 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild: + add more patches from bug #29485 + + 23 Sep 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild: + fix coreutils issue, finalize badrcptto patch. + + 20 Sep 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild, + files/1.03-r12/dot_qmail, files/1.03-r12/rc: + fix bugs #28257, #28258 + + 11 Sep 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild: + fix bug #28256 + + 02 Sep 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild, + files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch, + files/1.03-r12/qmail-smtpd-relay-reject.gentoo.patch: + more work in progres on -r12, nearly completed, ready for limited testing now + + 01 Sep 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild: + more tweaks to r12 + + 31 Aug 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild, + files/1.03-r12/config-sanity-check, files/1.03-r12/maildir-quota-fix.patch, + files/1.03-r12/qmail-remote-auth-login.patch, files/1.03-r12/run-qmailpop3d, + files/1.03-r12/run-qmailqmqpd, files/1.03-r12/run-qmailqmtpd, + files/1.03-r12/run-qmailsmtpd: + more work in progress on -r12 + + 13 Aug 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild, + files/gencert.sh, files/tcp.pop3.sample, files/tcp.qmqp.sample, + files/tcp.qmtp.sample, files/tcp.smtp.sample, + files/1.03-r12/badrcptto-morebadrcptto-accdias-gentoo, + files/1.03-r12/conf-common, files/1.03-r12/conf-pop3d, + files/1.03-r12/conf-qmqpd, files/1.03-r12/conf-qmtpd, + files/1.03-r12/conf-smtpd, + files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch, + files/1.03-r12/run-qmailpop3d: + 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. + + 12 Aug 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild: + Add support for maildir++, ESMTP SIZE, localtime (commented out) from bug + #26506. Add more cleanups and a fix for a possible local glitch in pkg_config. + + 12 Aug 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild: + Temporarily remove the bad-rcpt-noisy-patch patch as it is breaking some + configs + + 11 Aug 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild, + files/1.03-r12/conf-common, files/1.03-r12/conf-qmqpd, + files/1.03-r12/conf-qmtpd, files/1.03-r12/conf-smtpd, + files/1.03-r12/config-sanity-check, files/1.03-r12/run-qmailqmqpd, + files/1.03-r12/run-qmailqmtpd, files/1.03-r12/run-qmailsmtpd, + files/1.03-r12/smtp-auth-close3.patch: + fix bug #23658, add SMTP-AUTH stubs to conf-smtpd, seperate the sanity check, + allow easier configuration of all options. Install config files with correct + permissions, prevent the pkg_config from destroying old data. Bug #17283 done. + +*qmail-1.03-r12 (11 Aug 2003) + + 11 Aug 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r12.ebuild, + files/1.03-r12/99qmail, files/1.03-r12/conf-common, + files/1.03-r12/conf-qmqpd, files/1.03-r12/conf-qmtpd, + files/1.03-r12/conf-smtpd, files/1.03-r12/defaultdelivery, + files/1.03-r12/dot_qmail, files/1.03-r12/errno.patch, + files/1.03-r12/qmail-control, files/1.03-r12/rc, + files/1.03-r12/run-qmailpop3d, files/1.03-r12/run-qmailpop3dlog, + files/1.03-r12/run-qmailqmqpd, files/1.03-r12/run-qmailqmqpdlog, + files/1.03-r12/run-qmailqmtpd, files/1.03-r12/run-qmailqmtpdlog, + files/1.03-r12/run-qmailsend, files/1.03-r12/run-qmailsendlog, + files/1.03-r12/run-qmailsmtpd, files/1.03-r12/run-qmailsmtpdlog, + files/1.03-r12/smtp-auth-close3.patch: + Use queue-fix for building the queue, and remove default use of rblsmtpd. + Add an example for relay-ctrl in conf-smtpd. + + 06 Aug 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r11.ebuild, + files/1.03-r11/conf-common: + forgot a -z fix! + + 06 Aug 2003; Robin H. Johnson <robbat2@gentoo.org> + files/1.03-r10/run-qmailpop3d: + fix bug #25998 + + 06 Aug 2003; Robin H. Johnson <robbat2@gentoo.org> + files/1.03-r11/conf-common: + ensure we explictly use the ipv4 tcpserver address + + 06 Aug 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r11.ebuild, + files/1.03-r11/99qmail, files/1.03-r11/conf-common, + files/1.03-r11/run-qmailqmqpd, files/1.03-r11/run-qmailqmtpd, + files/1.03-r11/run-qmailsmtpd: + fix up undefined shell variable bug and clean up the ebuild a little + +*qmail-1.03-r11 (05 Aug 2003) + + 05 Aug 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-1.03-r11.ebuild, + files/1.03-r11/99qmail, files/1.03-r11/conf-common, + files/1.03-r11/conf-qmqpd, files/1.03-r11/conf-qmtpd, + files/1.03-r11/conf-smtpd, files/1.03-r11/defaultdelivery, + files/1.03-r11/dot_qmail, files/1.03-r11/errno.patch, + files/1.03-r11/qmail-control, files/1.03-r11/rc, + files/1.03-r11/run-qmailpop3d, files/1.03-r11/run-qmailpop3dlog, + files/1.03-r11/run-qmailqmqpd, files/1.03-r11/run-qmailqmqpdlog, + files/1.03-r11/run-qmailqmtpd, files/1.03-r11/run-qmailqmtpdlog, + files/1.03-r11/run-qmailsend, files/1.03-r11/run-qmailsendlog, + files/1.03-r11/run-qmailsmtpd, files/1.03-r11/run-qmailsmtpdlog, + files/1.03-r11/smtp-auth-close3.patch, metadata.xml: + Prepare for new release of qmail, this is NOT ready for wide testing in + ~anything yet. /var/qmail/alias is now in CONFIG_PROTECT as well. Update + metadata.xml to say I'm handling it now. Added QMTP and QMQP support and + many more patches. + + 31 Jul 2003; Seemant Kulleen <seemant@gentoo.org> qmail-1.03-r10.ebuild: + changed epatch to patch, because the dry-run on tls.patch.bz2 seems to fail. + + 27 Jul 2003; Nick Hadaway <raker@gentoo.org> qmail-1.03-r10.ebuild: + Integrated the qmail-pop3d build into this. It was just the creation + of the qmail-pop3d directories and a note for creating the link into + /service. The qmail-pop3d build will remain in portage until a r11 + is released with a note to just re-install -r10 to add the pop3 + portion. + + 24 Jul 2003; Nick Hadaway <raker@gentoo.org> qmail-1.03-r10.ebuild: + Fixed a typo in the ebuild as noted on bug #25204. + + 09 Jul 2003; Nick Hadaway <raker@gentoo.org> qmail-1.03-r10.ebuild: + Changed hostname to hostname --fqdn in pkg_config. Thanks to + Torsten on bug #23214 for bringing this change to light. + + 12 Jun 2003; <msterret@gentoo.org> qmail-1.03-r8.ebuild: + fix Header + +*qmail-1.03-r10 (01 Feb 2003) + + 16 Mar 2003; Will Woods <wwoods@gentoo.org> qmail-1.03-r10.ebuild, + qmail-1.03-r8.ebuild: + Added alpha keywords + + 21 Feb 2003; Nick Hadaway <raker@gentoo.org> qmail-1.03-r10.ebuild : + Small fix0r so .qmail-* files aren't overwritten if they exist from + a previous installation. + + 17 Feb 2003; Nick Hadaway <raker@gentoo.org> qmail-1.03-r10.ebuild, + files/1.03-r10/smtp-auth-close3.patch : + Added a patch for a smtp auth and morercpthosts problem. + + 15 Feb 2003; Nick Hadaway <raker@gentoo.org> qmail-1.03-r10.ebuild : + Removed ext_todo and added big-todo and the qmailqueue patch. + Thanks Psi-Jack for doing lotsa testing! + + 11 Feb 2003; Nick Hadaway <raker@gentoo.org> qmail-1.03-r10.ebuild : + Only touch alias files if they don't already exist as suggested + by Sascha Silbe on bug #13014 and add the EXTTODO doc to explain + qmail-todo's purpose. + + 04 Feb 2003; Nick Hadaway <raker@gentoo.org> qmail-1.03-r10.ebuild : + Moved the ssl cert creation to pkg_config() and it only goes through + the cert creation if the file doesn't already exist. Thanks vapier. + Added a patch for 0.0.0.0 addresses and errno detection. + + 02 Feb 2003; Nick Hadaway <raker@gentoo.org> qmail-1.03-r10.ebuild : + Added a missing qmail-todo. Thanks to shadow@ines.ro on bug #14963 + for catching this so quickly. + + 01 Feb 2003; Nick Hadaway <raker@gentoo.org> qmail-1.03-r10.ebuild, + files/digest-qmail-1.03-r10, files/tls.patch, files/tls.txt : + Ebuild rework on the patch side. I will add mysql and ldap support + as I work through patch conflicts. TLS + EHLO patch, SMTP AUTH, + big-concurrency, ext/reiserfs non-synchronus link() fix, and the + ext_todo-20030105 queue optimization patch are currently included. + Now includes /var/qmail/bin in ROOTPATH and PATH. + + 06 Dec 2002; Rodney Rees <manson@gentoo.org> : changed sparc ~sparc keywords + +*qmail-1.03-r9 (11 Sep 2002) + + 23 Nov 2002; Nick Hadaway <raker@gentoo.org> qmail-1.03-r9.ebuild : + Cosmetic fix to only unpack ldap patch if ldap in USE. + + 19 Nov 2002; Nick Hadaway <raker@gentoo.org> qmail-1.03-r9.ebuild : + Added fix for ssl enabled builds as noted in bug #10961. Thanks to + Andrey Ulanov for noticing the problem. + + 27 Sep 2002; Nick Hadaway <raker@gentoo.org> + files/1.03-r9/run-qmailsmtpd : + Changed softlimit from 2MB to 8MB due to the ssl enabled ucspi-tcp. + + 11 Sep 2002; Nick Hadaway <raker@gentoo.org> qmail-1.03-r9.ebuild, + files/digest-qmail-1.03-r9, + files/1.03-r9/qmail-1.03-starttls-smtp-auth.patch : + New qmail ebuild. Added ldap support, and tls+auth support. The + patches both cannot be applied at the same time as they conflict. + Please test! + +*qmail-1.03-r8 (10 Jun 2002) + + 27 Sep 2002; Nick Hadaway <raker@gentoo.org> + files/1.03-r8/run-qmailsmtpd : + Changed softlimit from 2MB to 8MB due to the ssl enabled ucspi-tcp. + + 10 June 2002; Grant Goodyear <bangert@gentoo.org> qmail-1.03-r8.ebuild : + Added qmail-queue patch for qmail-scanner, closing bug #3416. + +*qmail-1.03-r7 (1 Feb 2002) + + 12 May 2002; Thilo Bangert <bangert@gentoo.org> qmail-1.03-r7.ebuild : + fixed location for dns patch. added new digest to reflect the change + + 19 Mar 2002; G.Bevin <gbevin@gentoo.org> qmail-1.03-r7.ebuild : + Added net-mail/dot-forward to RDEPEND + + 1 Feb 2002; G.Bevin <gbevin@gentoo.org> qmail-1.03-r7.ebuild : + Prevent qmail from being installed alongside another mta. + + 1 Feb 2002; G.Bevin <gbevin@gentoo.org> ChangeLog : + Added initial ChangeLog which should be updated whenever the package is + updated in any way. This changelog is targetted to users. This means that the + comments should well explained and written in clean English. The details about + writing correct changelogs are explained in the skel.ChangeLog file which you + can find in the root directory of the portage repository. diff --git a/mail-mta/qmail/Manifest b/mail-mta/qmail/Manifest new file mode 100644 index 000000000000..0037c0b6f280 --- /dev/null +++ b/mail-mta/qmail/Manifest @@ -0,0 +1,174 @@ +MD5 a9861c68aff16484cb0dd54ad4a04aa9 qmail-1.03-r14.ebuild 15820 +MD5 e8c5a0cd841fcca2ff5197d374dde0e4 qmail-1.03-r11.ebuild 11420 +MD5 40dbdd9ca2b51992977411e3c4d81268 qmail-1.03-r9.ebuild 9929 +MD5 e955f700d396a591f62a0ec2ed8110f5 qmail-1.03-r13.ebuild 14101 +MD5 90ac8e379a8a902749cc11616b788ee6 qmail-1.03-r15.ebuild 16704 +MD5 d6052d1ad252fd3479ded85a7e10515f qmail-1.03-r10.ebuild 11122 +MD5 9e6dc0559e71bc77845de4dad063c15d qmail-1.03-r8.ebuild 8081 +MD5 fb7f946627759ac0497f40d96588ab16 qmail-1.03-r12.ebuild 13706 +MD5 4754da8d6f7132c97928bed5814b4f1d ChangeLog 17194 +MD5 9d0c568ea32cf6b45797c6e7c82b4a67 metadata.xml 280 +MD5 f96a54108b7424f342dd4842e81faded files/rc 280 +MD5 b7e7c96254dabacdec5bf5904957c7b2 files/tcp.qmqp.sample 399 +MD5 a1e75cbf0641c6b7e46d65bf18d0b230 files/conf-send 231 +MD5 93271f453b804aad4d18295f6c9cbe20 files/run-qmailpop3d 879 +MD5 abe0797b503c37496de26600e66ba69d files/run-qmailqmqpd 838 +MD5 8d0a79bdf62efae2a38fbeeba9c31b07 files/run-qmailqmtpd 838 +MD5 742827d247521e2f83585cc3ae313a30 files/run-qmailsmtpd 838 +MD5 180a513f34e3f00abc609672a190072c files/99qmail 137 +MD5 c47d861aeef098d12d022d44c27386b5 files/errno.patch 850 +MD5 fe86ebf974cc7cb1aaddff8311ae89bc files/tcp.smtp.sample 4166 +MD5 c8254c53c104004d5beecb39ca689d48 files/gencert.sh 224 +MD5 a1055496a70da2503c2d4450173986e8 files/run-qmailqmqpdlog 315 +MD5 94abb3e1aa9d5a2ac36f456ba280b2fc files/run-qmailqmtpdlog 315 +MD5 5897cb300c3233c91c7e221c8b4b8501 files/digest-qmail-1.03-r8 245 +MD5 48a1e168db29ab4e6c57f1ac135ee2bf files/digest-qmail-1.03-r9 323 +MD5 d779786aab66f97f6e7e4785ca89a636 files/tcp.pop3.sample 335 +MD5 ca6aeea255e98bd6299d4dad7210f702 files/qmail-genrsacert.sh 1161 +MD5 1fa33b460954492678129c60520e9cba files/digest-qmail-1.03-r10 442 +MD5 d6b150617bc5d76374fe010fc2902923 files/digest-qmail-1.03-r11 764 +MD5 0d96233f19a26e578c44e9d87f9e80eb files/digest-qmail-1.03-r12 1359 +MD5 0d96233f19a26e578c44e9d87f9e80eb files/digest-qmail-1.03-r13 1359 +MD5 cb4bafe4fe0260c575331b93a17e831b files/digest-qmail-1.03-r14 1564 +MD5 cb4bafe4fe0260c575331b93a17e831b files/digest-qmail-1.03-r15 1564 +MD5 c369664bce0646b3d323d08f9ba5b8ce files/dot_qmail 82 +MD5 e2b140f39c4c3ead9a2938d9cd76c64c files/run-qmailsmtpdlog 315 +MD5 cca7c2ce6c9ccca7b66d048c7b8a414d files/conf-pop3d 1203 +MD5 970c230f9437fcde1208922f70fe0415 files/conf-qmqpd 461 +MD5 9ed528d9a2d72ced76918a8f78230311 files/conf-qmtpd 553 +MD5 6a49fb195eb17fbc94e6cab03c69c076 files/servercert.cnf 1094 +MD5 96c459e51d803ca23347659f630f6035 files/conf-smtpd 1698 +MD5 f2f14137576a5e9ef84b238a1fca195e files/qmail-config-system 1072 +MD5 5ddcb673977385f4bfdc93a2d4e65162 files/run-qmailsendlog 143 +MD5 c652123d54a3e3ed23e3d82402d26015 files/mkservercert 1425 +MD5 2d3271eba444e0c0ad2bd39626ba9156 files/tcp.qmtp.sample 821 +MD5 66164c6538c0789e41cbd49a634200e4 files/conf-common 2327 +MD5 91912ff4f3b4053569ad2ee804558eb4 files/config-sanity-check 1219 +MD5 847b3a15e477ae827b858dc1dac0a70d files/run-qmailsend 164 +MD5 5a93e311295c730f28fbb29b5ed590a8 files/run-qmailpop3dlog 315 +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 +MD5 b24f4dbd450d2d4eddc75ba19cebb915 files/1.03-r8/defaultdelivery 34 +MD5 f5508c8f592c8f7ce7dcfc4c5ed797d6 files/1.03-r8/qmail-1.03-starttls-smtp-auth.patch 41786 +MD5 c378c5845848ee31d70f0d05cbcf86be files/1.03-r8/dot_qmail 12 +MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03-r8/run-qmailsmtpdlog 97 +MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03-r8/run-qmailsendlog 96 +MD5 abc975ae7274a2b5332231ba3f78db76 files/1.03-r8/qmail-linksync.patch 1363 +MD5 77490d2c33be1d63ca8dfa129569b48e files/1.03-r8/qmail-control 799 +MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03-r8/run-qmailsend 29 +MD5 71aa0894c118dda3405f1f847944158c files/1.03-r9/qmail-queue.patch 1512 +MD5 aa0823cdce32c502c856664c8b0ce775 files/1.03-r9/run-qmailsmtpd 231 +MD5 b24f4dbd450d2d4eddc75ba19cebb915 files/1.03-r9/defaultdelivery 34 +MD5 f5508c8f592c8f7ce7dcfc4c5ed797d6 files/1.03-r9/qmail-1.03-starttls-smtp-auth.patch 41786 +MD5 c378c5845848ee31d70f0d05cbcf86be files/1.03-r9/dot_qmail 12 +MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03-r9/run-qmailsmtpdlog 97 +MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03-r9/run-qmailsendlog 96 +MD5 abc975ae7274a2b5332231ba3f78db76 files/1.03-r9/qmail-linksync.patch 1363 +MD5 5e2b78e0fcdd06a7bf94bd28c0620da6 files/1.03-r9/qmail-control 799 +MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03-r9/run-qmailsend 29 +MD5 f42a779e5c708c2d7bf38de66dfb93f5 files/1.03-r10/rc 108 +MD5 ec7a73ba2bca7d6dd54ba92cf13136c9 files/1.03-r10/run-qmailpop3d 223 +MD5 aa0823cdce32c502c856664c8b0ce775 files/1.03-r10/run-qmailsmtpd 231 +MD5 5cb0c8c4c9feeee55362d77a99076c2f files/1.03-r10/99qmail 44 +MD5 c47d861aeef098d12d022d44c27386b5 files/1.03-r10/errno.patch 850 +MD5 3933f961a8a65da65afaa65d22b075ef files/1.03-r10/smtp-auth-close3.patch 535 +MD5 f7956b079a66a93e321d86071dd21d20 files/1.03-r10/tls-patch.txt 5803 +MD5 b24f4dbd450d2d4eddc75ba19cebb915 files/1.03-r10/defaultdelivery 34 +MD5 c378c5845848ee31d70f0d05cbcf86be files/1.03-r10/dot_qmail 12 +MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03-r10/run-qmailsmtpdlog 97 +MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03-r10/run-qmailsendlog 96 +MD5 dd5158b78a3878d78a68878f1910e0e4 files/1.03-r10/tls.patch.bz2 10458 +MD5 8450d09cd69ccfede01fc30a3b821d46 files/1.03-r10/qmail-control 800 +MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03-r10/run-qmailsend 29 +MD5 0e97c0b031776f40cacdfbf3114af574 files/1.03-r10/run-qmailpop3dlog 97 +MD5 f42a779e5c708c2d7bf38de66dfb93f5 files/1.03-r11/rc 108 +MD5 88f15101dd4bc36b52d13f336713e716 files/1.03-r11/run-qmailpop3d 221 +MD5 2f110e27392d0ed6ba55d836c390e691 files/1.03-r11/run-qmailqmqpd 611 +MD5 dd55f8bfa444c07533725f67cb67dc50 files/1.03-r11/run-qmailqmtpd 611 +MD5 12c2c3e9a03275a8e701b7719707f37a files/1.03-r11/run-qmailsmtpd 611 +MD5 180a513f34e3f00abc609672a190072c files/1.03-r11/99qmail 137 +MD5 c47d861aeef098d12d022d44c27386b5 files/1.03-r11/errno.patch 850 +MD5 3933f961a8a65da65afaa65d22b075ef files/1.03-r11/smtp-auth-close3.patch 535 +MD5 249138d56492deb0f856849bc002e46a files/1.03-r11/run-qmailqmqpdlog 97 +MD5 795f633858c0919b6e201cf2b845779e files/1.03-r11/run-qmailqmtpdlog 97 +MD5 b24f4dbd450d2d4eddc75ba19cebb915 files/1.03-r11/defaultdelivery 34 +MD5 c378c5845848ee31d70f0d05cbcf86be files/1.03-r11/dot_qmail 12 +MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03-r11/run-qmailsmtpdlog 97 +MD5 3c8fd1daa3348423eca334bdb1b24669 files/1.03-r11/conf-qmqpd 484 +MD5 7d1a5e91c21c0e78d738afb460adfba2 files/1.03-r11/conf-qmtpd 576 +MD5 5b2334c4a3d2490abec42ad84b398162 files/1.03-r11/conf-smtpd 338 +MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03-r11/run-qmailsendlog 96 +MD5 ad8477dc1ab506c430ce40b3f3746e9f files/1.03-r11/qmail-control 848 +MD5 60622116b5b3f17230d4c04effceddaf 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 6c0f741d2f9a7cc5e6b346d435ab0e64 files/1.03-r12/rc 117 +MD5 958dd0d045548089d64305a6b0bc28a1 files/1.03-r12/run-qmailpop3d 1176 +MD5 4e9ee330c99e96e4b3cafef7e0ca7574 files/1.03-r12/run-qmailqmqpd 1165 +MD5 61c9df030e0a19ca5cc9124b660992e7 files/1.03-r12/run-qmailqmtpd 1165 +MD5 03c9b9dfb173e691b6c13fb5e1d7fa49 files/1.03-r12/run-qmailsmtpd 1165 +MD5 180a513f34e3f00abc609672a190072c files/1.03-r12/99qmail 137 +MD5 c47d861aeef098d12d022d44c27386b5 files/1.03-r12/errno.patch 850 +MD5 598b04b6274ef4d946a60a5d30fd95ff files/1.03-r12/qmail-remote-auth-login.patch 7504 +MD5 3eb989291a872a5ff2f5d40d6eba92d8 files/1.03-r12/maildir-quota-fix.patch 547 +MD5 bed3133c1737dd9bc3c67e07f8bc65d8 files/1.03-r12/smtp-auth-close3.patch 728 +MD5 249138d56492deb0f856849bc002e46a files/1.03-r12/run-qmailqmqpdlog 97 +MD5 a993cab8b077162680bb09fa8e5ed896 files/1.03-r12/bad-rcpt-noisy-patch 10388 +MD5 795f633858c0919b6e201cf2b845779e files/1.03-r12/run-qmailqmtpdlog 97 +MD5 c369664bce0646b3d323d08f9ba5b8ce files/1.03-r12/dot_qmail 82 +MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03-r12/run-qmailsmtpdlog 97 +MD5 1c3bb43790dedd94ff262dd62df96d0e files/1.03-r12/conf-pop3d 1071 +MD5 d041aaacb52ad362f31261ae9b6aee7d files/1.03-r12/conf-qmqpd 470 +MD5 6bcaeec84cc0944598bc878be2440304 files/1.03-r12/conf-qmtpd 562 +MD5 cde8043f5e58cd20ddfd6ef088ceaa98 files/1.03-r12/conf-smtpd 1709 +MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03-r12/run-qmailsendlog 96 +MD5 2a725c31201c59077cd389486407624f files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch 2131 +MD5 847810e07e15171857df9ef6a1a1f9bc files/1.03-r12/qmail-control 848 +MD5 dda736a7fb5a56209abead6e840252e8 files/1.03-r12/badrcptto-morebadrcptto-accdias-gentoo 19322 +MD5 d4eb13844209f943ef9c5970de871830 files/1.03-r12/conf-common 1094 +MD5 34adc148cab4c8a592c4115846640344 files/1.03-r12/config-sanity-check 814 +MD5 d3997795df512803e6a27b5486d2b81e files/1.03-r12/qmail-smtpd-relay-reject.gentoo.patch 1433 +MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03-r12/run-qmailsend 29 +MD5 0e97c0b031776f40cacdfbf3114af574 files/1.03-r12/run-qmailpop3dlog 97 +MD5 6c0f741d2f9a7cc5e6b346d435ab0e64 files/1.03-r13/rc 117 +MD5 5421172c41e91768c86ec4057851d1fa files/1.03-r13/run-qmailpop3d 1176 +MD5 d4537d7afa372ed1828c92f10b9e7c19 files/1.03-r13/run-qmailqmqpd 1165 +MD5 555399912e59d573d0fef78107842973 files/1.03-r13/run-qmailqmtpd 1165 +MD5 0c8912a02ef4a90625ac4cfda8dddce4 files/1.03-r13/run-qmailsmtpd 1165 +MD5 180a513f34e3f00abc609672a190072c files/1.03-r13/99qmail 137 +MD5 c47d861aeef098d12d022d44c27386b5 files/1.03-r13/errno.patch 850 +MD5 3eb989291a872a5ff2f5d40d6eba92d8 files/1.03-r13/maildir-quota-fix.patch 547 +MD5 bed3133c1737dd9bc3c67e07f8bc65d8 files/1.03-r13/smtp-auth-close3.patch 728 +MD5 249138d56492deb0f856849bc002e46a files/1.03-r13/run-qmailqmqpdlog 97 +MD5 795f633858c0919b6e201cf2b845779e files/1.03-r13/run-qmailqmtpdlog 97 +MD5 54d31f52c48e2bf19f7f2dc6a6a64908 files/1.03-r13/qmail-genrsacert.sh 1170 +MD5 c369664bce0646b3d323d08f9ba5b8ce files/1.03-r13/dot_qmail 82 +MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03-r13/run-qmailsmtpdlog 97 +MD5 239004b8afba1e8f57022fed73da98a6 files/1.03-r13/conf-pop3d 1071 +MD5 da638353546a2b55054bf466863003a0 files/1.03-r13/conf-qmqpd 470 +MD5 3bb15e1ae60c70c42b06aa2ed0e666e6 files/1.03-r13/conf-qmtpd 562 +MD5 e57f6bb8edcd305c61d530a40e9755ce files/1.03-r13/servercert.cnf 1103 +MD5 1a8f1d3d7355eccd09e0f7066671d277 files/1.03-r13/conf-smtpd 1707 +MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03-r13/run-qmailsendlog 96 +MD5 9f47bd621b273dab86283c0b91c656bb files/1.03-r13/mkservercert 1434 +MD5 2a725c31201c59077cd389486407624f files/1.03-r13/qmail-smtpd-esmtp-size-gentoo.patch 2131 +MD5 cf911aa7dcc6044b7ce457a94c716505 files/1.03-r13/qmail-control 856 +MD5 a35ee23ca22db351b7be0a97a1fb9fdf files/1.03-r13/conf-common 1094 +MD5 05ee30d630250efbea71cee3ad60e179 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 3eb989291a872a5ff2f5d40d6eba92d8 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 34a2e22386f4d11874e33b38576a7958 files/1.03-r14/qmail-gentoo-branding.patch 375 +MD5 a91645f4af61ce981e01ef84bc2ae7b6 files/1.03-r14/qmail-qmailqueue-docs.patch 1085 +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 +MD5 82945c7eee4a2bd8be0b9b9718114a7d files/1.03-r15/qmail-pop3d-top-outputfix.patch 574 diff --git a/mail-mta/qmail/files/1.03-r10/99qmail b/mail-mta/qmail/files/1.03-r10/99qmail new file mode 100644 index 000000000000..d17f5d7dbee9 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/99qmail @@ -0,0 +1,2 @@ +PATH=/var/qmail/bin +ROOTPATH=/var/qmail/bin diff --git a/mail-mta/qmail/files/1.03-r10/defaultdelivery b/mail-mta/qmail/files/1.03-r10/defaultdelivery new file mode 100644 index 000000000000..d0ef7de8b590 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/defaultdelivery @@ -0,0 +1,2 @@ +|dot-forward .forward +./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r10/dot_qmail b/mail-mta/qmail/files/1.03-r10/dot_qmail new file mode 100644 index 000000000000..7c9e5d08f067 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/dot_qmail @@ -0,0 +1 @@ +./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r10/errno.patch b/mail-mta/qmail/files/1.03-r10/errno.patch new file mode 100644 index 000000000000..f9b77b91e065 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/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/mail-mta/qmail/files/1.03-r10/qmail-control b/mail-mta/qmail/files/1.03-r10/qmail-control new file mode 100644 index 000000000000..811a5fa51673 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/qmail-control @@ -0,0 +1,30 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r10/qmail-control,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +opts="start stop restart reload" + +start() { + ebegin "Starting qmail mta ..." + svc -u /var/qmail/supervise/* + eend $? + ebegin "Starting qmail mta logging ..." + svc -u /var/qmail/supervise/*/log + eend $? +} + +stop() { + ebegin "Stopping qmail mta ..." + svc -d /var/qmail/supervise/* + eend $? + ebegin "Stopping qmail mta logging ..." + svc -d /var/qmail/supervise/*/log + eend $? +} + +reload() { + ebegin "Reloading 'locals' and 'virtualdomains' control files." + svc -h /var/qmail/supervise/qmail-send + eend $? +} diff --git a/mail-mta/qmail/files/1.03-r10/rc b/mail-mta/qmail/files/1.03-r10/rc new file mode 100644 index 000000000000..a7bbdc986766 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/rc @@ -0,0 +1,4 @@ +#!/bin/sh + +exec env - PATH="/var/qmail/bin:$PATH" \ + qmail-start "`cat /var/qmail/control/defaultdelivery`" diff --git a/mail-mta/qmail/files/1.03-r10/run-qmailpop3d b/mail-mta/qmail/files/1.03-r10/run-qmailpop3d new file mode 100644 index 000000000000..acf14ac43ae2 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/run-qmailpop3d @@ -0,0 +1,6 @@ +#!/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 + diff --git a/mail-mta/qmail/files/1.03-r10/run-qmailpop3dlog b/mail-mta/qmail/files/1.03-r10/run-qmailpop3dlog new file mode 100644 index 000000000000..b1fcb8f4af22 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/run-qmailpop3dlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-pop3d diff --git a/mail-mta/qmail/files/1.03-r10/run-qmailsend b/mail-mta/qmail/files/1.03-r10/run-qmailsend new file mode 100644 index 000000000000..8dbd3adf524f --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/run-qmailsend @@ -0,0 +1,2 @@ +#!/bin/sh +exec /var/qmail/rc diff --git a/mail-mta/qmail/files/1.03-r10/run-qmailsendlog b/mail-mta/qmail/files/1.03-r10/run-qmailsendlog new file mode 100644 index 000000000000..5ff50d1e7711 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/run-qmailsendlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-send diff --git a/mail-mta/qmail/files/1.03-r10/run-qmailsmtpd b/mail-mta/qmail/files/1.03-r10/run-qmailsmtpd new file mode 100644 index 000000000000..9733e11e154a --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/run-qmailsmtpd @@ -0,0 +1,6 @@ +#!/bin/sh +QMAILDUID=`id -u qmaild` +NOFILESGID=`id -g qmaild` +exec /usr/bin/softlimit -m 8000000 \ + /usr/bin/tcpserver -H -R -v -p -x /etc/tcp.smtp.cdb \ + -u $QMAILDUID -g $NOFILESGID 0 smtp rblsmtpd /var/qmail/bin/qmail-smtpd 2>&1 diff --git a/mail-mta/qmail/files/1.03-r10/run-qmailsmtpdlog b/mail-mta/qmail/files/1.03-r10/run-qmailsmtpdlog new file mode 100644 index 000000000000..2d9546146583 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/run-qmailsmtpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-smtpd diff --git a/mail-mta/qmail/files/1.03-r10/smtp-auth-close3.patch b/mail-mta/qmail/files/1.03-r10/smtp-auth-close3.patch new file mode 100644 index 000000000000..82fda701fd12 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/smtp-auth-close3.patch @@ -0,0 +1,20 @@ +--- qmail-smtpd.c.orig Sat Jan 18 09:13:50 2003 ++++ qmail-smtpd.c Sat Jan 18 19:51:09 2003 +@@ -459,14 +459,14 @@ + if (!stralloc_0(&resp)) die_nomem(); + + if (fd_copy(2,1) == -1) return err_pipe(); +- close(3); + if (pipe(pi) == -1) return err_pipe(); +- if (pi[0] != 3) return err_pipe(); + switch(child = fork()) { + case -1: + return err_fork(); + case 0: + close(pi[1]); ++ close(3); ++ if (0 > dup2(pi[0],3)) _exit(1); + sig_pipedefault(); + execvp(*childargs, childargs); + _exit(1); + diff --git a/mail-mta/qmail/files/1.03-r10/tls-patch.txt b/mail-mta/qmail/files/1.03-r10/tls-patch.txt new file mode 100644 index 000000000000..11b29a778f89 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/tls-patch.txt @@ -0,0 +1,105 @@ +Frederik Vermeulen <qmail-tls akrul inoa.net> 20021228 +http://inoa.net/qmail/qmail-1.03-tls.patch + +This patch implements RFC2487 in qmail. This means you can +get SSL or TLS encrypted and authenticated SMTP between +the MTAs and from MUA to MTA. +The code is considered experimental (but has worked for +many since its first release on 1999-03-21). + +Usage: - install OpenSSL-0.9.6g http://www.openssl.org/ + (any 0.9.6 version is presumed to work) + - apply patch to qmail-1.03 http://www.qmail.org/ + The patches to qmail-remote.c + and qmail-smtpd.c can be applied separately. + - provide a server certificate in /var/qmail/control/servercert.pem. + "make cert" makes a self-signed certificate. + "make cert-req" makes a certificate request. + Note: you can add the CA certificate and intermediate + certs to the end of servercert.pem. + - replace qmail-smtpd and/or qmail-remote binary + - verify operation (header information should show + something like + "Received [..] with DES-CBC3-SHA encrypted SMTP;") + If you don't have a server to test with, you can test + by sending mail to tag-ping@tbs-internet.com, + which will bounce your mail. + +Optional: - when DEBUG is defined, some extra TLS info will be logged + - qmail-remote will authenticate with the certificate in + /var/qmail/control/clientcert.pem. By preference this is + the same as servercert.pem, where nsCertType should be + == server,client or be a generic certificate (no usage specified). + - when a 512 RSA key is provided in /var/qmail/control/rsa512.pem, + this key will be used instead of on-the-fly generation by + qmail-smtpd. Periodical replacement can be done by crontab: + 01 01 * * * umask 0077; /usr/local/ssl/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 + - server authentication: + qmail-remote requires authentication from servers for which + /var/qmail/control/tlshosts/host.dom.ain.pem exists. + The .pem file contains the validating CA certificates + (or self-signed server certificate). + CommonName has to match. + WARNING: this option may cause mail to be delayed, bounced, + doublebounced, and lost. + - client authentication: + when relay rules would reject an incoming mail, + qmail-smtpd can allow the mail based on a presented cert. + Certs are verified against a CA list in + /var/qmail/control/clientca.pem (eg. http://www.modssl.org/ + source/cvs/exp/mod_ssl/pkg.mod_ssl/pkg.sslcfg/ca-bundle.crt) + and the cert email-address has to match a line in + /var/qmail/control/tlsclients. This email-address is logged + in the headers. + - cipher selection: + qmail-remote: + openssl cipher string (`man ciphers`) read from + /var/qmail/control/tlsclientciphers + qmail-smtpd: + openssl cipher string read from TLSCIPHERS environment variable + (can vary based on client IP address e.g.) + or if that is not available /var/qmail/control/tlsserverciphers + - smtps (deprecated SMTP over TLS via port 465): + qmail-remote: when connecting to port 465 + qmail-smtpd: when SMTPS environment variable is not empty + +Caveats: - do a `make clean` after patching + - binaries dynamically linked with current openssl versions need + recompilation when the shared openssl libs are upgraded. + - this patch could conflict with other patches (notably those + replacing \n with \r\n, which is a bad idea on encrypted links). + - some broken servers have a problem with TLSv1 compatibility. + Uncomment the line where we set the SSL_OP_NO_TLSv1 option. + - needs working /dev/urandom (or EGD for openssl versions >0.9.7) + for seeding random number generator. + - packagers should make sure that installing without a valid + servercert is impossible + - when applied in combination with AUTH patch, AUTH patch + should be applied first and first part of this patch + will fail. This error can be ignored. Packagers should + cut the first 12 lines of this patch to make a happy + patch + +Copyright: GPL + Links with OpenSSL + Inspiration and code from examples in SSLeay (E. Young + <eay@cryptsoft.com> and T. Hudson <tjh@cryptsoft.com>), + stunnel (M. Trojnara <mtrojnar@ddc.daewoo.com.pl>), + Postfix/TLS (L. Jaenicke <Lutz.Jaenicke@aet.tu-cottbus.de>), + modssl (R. Engelschall <rse@engelschall.com>), + openssl examples of E. Rescorla <ekr@rtfm.com>. + Debug code, tlscipher selection, many feature suggestions, + French docs https://www.TBS-internet.com/ssl/qmail-tls.html + from Jean-Philippe Donnio <tag-ssl@tbs-internet.com>. + Openssl usage consulting from B. M"oller <bmoeller@acm.org>. + Bug report from A. Dustman <adustman@comstar.net>. + Ssl_timeoutio functions (non-blocking io, timeouts), smtps, + auth, qmtp, mxps patch compatibility, man pages, code cleanup, + improved error reporting, RFC2595 server identity check + from A. Meltzer <albertikm (a) hotmail.com>. + Bug report from Niall Richard Murphy, Tim Helton. + +Bug reports: mailto:<jos-tls@kotnet.org> diff --git a/mail-mta/qmail/files/1.03-r10/tls.patch.bz2 b/mail-mta/qmail/files/1.03-r10/tls.patch.bz2 Binary files differnew file mode 100644 index 000000000000..ee9d912da088 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r10/tls.patch.bz2 diff --git a/mail-mta/qmail/files/1.03-r11/99qmail b/mail-mta/qmail/files/1.03-r11/99qmail new file mode 100644 index 000000000000..d9d929e4892b --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/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/mail-mta/qmail/files/1.03-r11/conf-common b/mail-mta/qmail/files/1.03-r11/conf-common new file mode 100644 index 000000000000..74feee564b53 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/conf-common @@ -0,0 +1,25 @@ +#!/bin/sh +# Configuration file for all qmail daemons +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r11/conf-common,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +# Qmail User IDS to run daemons as +QMAILDUID=`id -u qmaild` +NOFILESGID=`id -g qmaild` + +# 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} + +# tcpserver maximum concurrency, defaults to 40 in tcpserver +[ -e ${QMAIL_CONTROLDIR}/concurrencyincoming ] && MAXCONN=$(<${QMAIL_CONTROLDIR}/concurrencyincoming) || MAXCONN=40 + +# A quick sanity check +if [ -z "${QMAILDUID}" -o -z "${NOFILESGID}" -o -z "${SERVICE}" ]; then + echo SERVICE, QMAILDUID or NOFILESGID is unset in + echo $0 + exit 1 +fi diff --git a/mail-mta/qmail/files/1.03-r11/conf-qmqpd b/mail-mta/qmail/files/1.03-r11/conf-qmqpd new file mode 100644 index 000000000000..1ff7d86d4fac --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/conf-qmqpd @@ -0,0 +1,18 @@ +#!/bin/sh +# Configuration file for qmail-qmqpd +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r11/conf-qmqpd,v 1.1 2004/05/30 10:50:13 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="" + +# We don't have anything to set QMAILQUEUE to at the moment, so we leave it alone +#QMAILQUEUE="" + +# I don't trust /etc/services to have everything... +TCPSERVER_PORT=628 diff --git a/mail-mta/qmail/files/1.03-r11/conf-qmtpd b/mail-mta/qmail/files/1.03-r11/conf-qmtpd new file mode 100644 index 000000000000..d276a8d13a25 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/conf-qmtpd @@ -0,0 +1,21 @@ +#!/bin/sh +# Configuration file for qmail-qmtpd +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r11/conf-qmtpd,v 1.1 2004/05/30 10:50:13 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="" + +# We don't have anything to set QMAILQUEUE to at the moment, so we leave it alone +#QMAILQUEUE="" + +# I don't trust /etc/services to have everything... +TCPSERVER_PORT=209 diff --git a/mail-mta/qmail/files/1.03-r11/conf-smtpd b/mail-mta/qmail/files/1.03-r11/conf-smtpd new file mode 100644 index 000000000000..2f398c4222e5 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/conf-smtpd @@ -0,0 +1,16 @@ +#!/bin/sh + +# Stuff to run before tcpserver +QMAIL_TCPSERVER_PRE="" + +# Stuff to run qmail-smtpd +QMAIL_SMTP_PRE="rblsmtpd" + +# Stuff to after qmail-smtpd +QMAIL_SMTP_POST="" + +# We don't have anything to set QMAILQUEUE to at the moment, so we leave it alone +#QMAILQUEUE="" + +# I don't trust /etc/services to have everything... +TCPSERVER_PORT=25 diff --git a/mail-mta/qmail/files/1.03-r11/defaultdelivery b/mail-mta/qmail/files/1.03-r11/defaultdelivery new file mode 100644 index 000000000000..d0ef7de8b590 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/defaultdelivery @@ -0,0 +1,2 @@ +|dot-forward .forward +./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r11/dot_qmail b/mail-mta/qmail/files/1.03-r11/dot_qmail new file mode 100644 index 000000000000..7c9e5d08f067 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/dot_qmail @@ -0,0 +1 @@ +./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r11/errno.patch b/mail-mta/qmail/files/1.03-r11/errno.patch new file mode 100644 index 000000000000..f9b77b91e065 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/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/mail-mta/qmail/files/1.03-r11/qmail-control b/mail-mta/qmail/files/1.03-r11/qmail-control new file mode 100644 index 000000000000..73b9bba7d713 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/qmail-control @@ -0,0 +1,30 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r11/qmail-control,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +opts="start stop restart reload" + +start() { + ebegin "Starting qmail mta ..." + svc -u /service/qmail-{smtpd,send,qmqp,qmtp} + eend $? + ebegin "Starting qmail mta logging ..." + svc -u /service/qmail-{smtpd,send,qmqp,qmtp}/log + eend $? +} + +stop() { + ebegin "Stopping qmail mta ..." + svc -d /service/qmail-{smtpd,send,qmqp,qmtp} + eend $? + ebegin "Stopping qmail mta logging ..." + svc -d /service/qmail-{smtpd,send,qmqp,qmtp}/log + eend $? +} + +reload() { + ebegin "Reloading 'locals' and 'virtualdomains' control files." + svc -h /service/qmail-send + eend $? +} diff --git a/mail-mta/qmail/files/1.03-r11/rc b/mail-mta/qmail/files/1.03-r11/rc new file mode 100644 index 000000000000..a7bbdc986766 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/rc @@ -0,0 +1,4 @@ +#!/bin/sh + +exec env - PATH="/var/qmail/bin:$PATH" \ + qmail-start "`cat /var/qmail/control/defaultdelivery`" diff --git a/mail-mta/qmail/files/1.03-r11/run-qmailpop3d b/mail-mta/qmail/files/1.03-r11/run-qmailpop3d new file mode 100644 index 000000000000..174d47ad310f --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/run-qmailpop3d @@ -0,0 +1,6 @@ +#!/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 + diff --git a/mail-mta/qmail/files/1.03-r11/run-qmailpop3dlog b/mail-mta/qmail/files/1.03-r11/run-qmailpop3dlog new file mode 100644 index 000000000000..b1fcb8f4af22 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/run-qmailpop3dlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-pop3d diff --git a/mail-mta/qmail/files/1.03-r11/run-qmailqmqpd b/mail-mta/qmail/files/1.03-r11/run-qmailqmqpd new file mode 100644 index 000000000000..e936de18973a --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/run-qmailqmqpd @@ -0,0 +1,17 @@ +#!/bin/sh + +# This is to make life easier +SERVICE=qmqp + +# We run this afterwards to allow appending of values etc. +[ -s ${QMAIL_CONTROLDIR}/conf-common ] && source ${QMAIL_CONTROLDIR}/conf-common +[ -s ${QMAIL_CONTROLDIR}/conf-${SERVICE}d ] && source ${QMAIL_CONTROLDIR}/conf-${SERVICE}d + +# Now run it all +exec /usr/bin/softlimit -m 8000000 \ + ${QMAIL_TCPSERVER_PRE} \ + /usr/bin/tcpserver -H -R -v -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/mail-mta/qmail/files/1.03-r11/run-qmailqmqpdlog b/mail-mta/qmail/files/1.03-r11/run-qmailqmqpdlog new file mode 100644 index 000000000000..d759fbcbcfe1 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/run-qmailqmqpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-qmqpd diff --git a/mail-mta/qmail/files/1.03-r11/run-qmailqmtpd b/mail-mta/qmail/files/1.03-r11/run-qmailqmtpd new file mode 100644 index 000000000000..d22c977593f0 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/run-qmailqmtpd @@ -0,0 +1,17 @@ +#!/bin/sh + +# This is to make life easier +SERVICE=qmtp + +# We run this afterwards to allow appending of values etc. +[ -s ${QMAIL_CONTROLDIR}/conf-common ] && source ${QMAIL_CONTROLDIR}/conf-common +[ -s ${QMAIL_CONTROLDIR}/conf-${SERVICE}d ] && source ${QMAIL_CONTROLDIR}/conf-${SERVICE}d + +# Now run it all +exec /usr/bin/softlimit -m 8000000 \ + ${QMAIL_TCPSERVER_PRE} \ + /usr/bin/tcpserver -H -R -v -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/mail-mta/qmail/files/1.03-r11/run-qmailqmtpdlog b/mail-mta/qmail/files/1.03-r11/run-qmailqmtpdlog new file mode 100644 index 000000000000..413a217d7de6 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/run-qmailqmtpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-qmtpd diff --git a/mail-mta/qmail/files/1.03-r11/run-qmailsend b/mail-mta/qmail/files/1.03-r11/run-qmailsend new file mode 100644 index 000000000000..8dbd3adf524f --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/run-qmailsend @@ -0,0 +1,2 @@ +#!/bin/sh +exec /var/qmail/rc diff --git a/mail-mta/qmail/files/1.03-r11/run-qmailsendlog b/mail-mta/qmail/files/1.03-r11/run-qmailsendlog new file mode 100644 index 000000000000..5ff50d1e7711 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/run-qmailsendlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-send diff --git a/mail-mta/qmail/files/1.03-r11/run-qmailsmtpd b/mail-mta/qmail/files/1.03-r11/run-qmailsmtpd new file mode 100644 index 000000000000..8ee797b566fb --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/run-qmailsmtpd @@ -0,0 +1,17 @@ +#!/bin/sh + +# This is to make life easier +SERVICE=smtp + +# We run this afterwards to allow appending of values etc. +[ -s ${QMAIL_CONTROLDIR}/conf-common ] && source ${QMAIL_CONTROLDIR}/conf-common +[ -s ${QMAIL_CONTROLDIR}/conf-${SERVICE}d ] && source ${QMAIL_CONTROLDIR}/conf-${SERVICE}d + +# Now run it all +exec /usr/bin/softlimit -m 8000000 \ + ${QMAIL_TCPSERVER_PRE} \ + /usr/bin/tcpserver -H -R -v -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/mail-mta/qmail/files/1.03-r11/run-qmailsmtpdlog b/mail-mta/qmail/files/1.03-r11/run-qmailsmtpdlog new file mode 100644 index 000000000000..2d9546146583 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/run-qmailsmtpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-smtpd diff --git a/mail-mta/qmail/files/1.03-r11/smtp-auth-close3.patch b/mail-mta/qmail/files/1.03-r11/smtp-auth-close3.patch new file mode 100644 index 000000000000..82fda701fd12 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r11/smtp-auth-close3.patch @@ -0,0 +1,20 @@ +--- qmail-smtpd.c.orig Sat Jan 18 09:13:50 2003 ++++ qmail-smtpd.c Sat Jan 18 19:51:09 2003 +@@ -459,14 +459,14 @@ + if (!stralloc_0(&resp)) die_nomem(); + + if (fd_copy(2,1) == -1) return err_pipe(); +- close(3); + if (pipe(pi) == -1) return err_pipe(); +- if (pi[0] != 3) return err_pipe(); + switch(child = fork()) { + case -1: + return err_fork(); + case 0: + close(pi[1]); ++ close(3); ++ if (0 > dup2(pi[0],3)) _exit(1); + sig_pipedefault(); + execvp(*childargs, childargs); + _exit(1); + diff --git a/mail-mta/qmail/files/1.03-r12/99qmail b/mail-mta/qmail/files/1.03-r12/99qmail new file mode 100644 index 000000000000..d9d929e4892b --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/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/mail-mta/qmail/files/1.03-r12/bad-rcpt-noisy-patch b/mail-mta/qmail/files/1.03-r12/bad-rcpt-noisy-patch new file mode 100644 index 000000000000..576d6c410dcb --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/bad-rcpt-noisy-patch @@ -0,0 +1,328 @@ +This is a noissy "badrcptto" patch for systems that have a lot +of addresses they want to reject, and want to log what happens + +Addresses to reject go in control/badrcptto and control/morebadrcptto, +one per line, just like badmailfrom. control/morebadrcptto is +compiled into control/morebadrcptto.cdb with the new program +qmail-newbrt. I'd suggest putting all of your bad addresses into +morebadrcptto since it's a lot faster to look something up in a CDB +than in a text file. + +Whenever qmail-smtp rejects a message or otherwise fails, it writes a +descriptive message to stderr, which if you're running under +daemontools should end up in the log file. The logging code is +adapted from an older anti-spam patch contributed to qmail.org. + +Unlike the previous badrcptto patch, this one does not reject the +message at RCPT TO time. Instead, it waits until the DATA command to +issue a 550 rejection. This has two effects: one is to deter +dictionary attackers which are perversely encouraged by RCPT TO +rejections. (If some of the addresses are bad, the rest must be +good.) The other is that if a message has a mixture of bad and good +addresses, the message will be rejected anyway. That's a feature, +since in my experience, any message addressed to a spam-only address +is spam even if it's also addressed to legit addresses. + +This version also does not let you list domains in the badrcptto +files. There's no point in doing so, since all domains not in +rcpthosts are rejected, anyway. + +This patch contains the entire new source file for qmail-newbrt.c as +a diff against an empty file. If patch gets mad at you, just create +the empty file. + +No warranty expressed or implied. If you find bugs, feel free to fix +them and please send me the fix. + +John Levine, johnl@iecc.com, 4/03 + + +diff -u qmail-1.03-dist/Makefile qmail-1.03/Makefile +--- qmail-1.03-dist/Makefile Mon Jun 15 06:53:16 1998 ++++ qmail-1.03/Makefile Wed Apr 9 01:30:20 2003 +@@ -803,7 +803,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 \ +@@ -1241,6 +1241,19 @@ + 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-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 -u qmail-1.03-dist/qmail-newbrt.c qmail-1.03/qmail-newbrt.c +--- qmail-1.03-dist/qmail-newbrt.c Wed Apr 9 16:31:27 2003 ++++ qmail-1.03/qmail-newbrt.c Wed Apr 9 16:18:50 2003 +@@ -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 -u qmail-1.03-dist/qmail-smtpd.c.orig qmail-1.03/qmail-smtpd.c +--- qmail-1.03-dist/qmail-smtpd.c.orig 2003-08-11 22:23:06.000000000 -0700 ++++ qmail-1.03/qmail-smtpd.c 2003-08-11 22:26:10.000000000 -0700 +@@ -25,12 +25,20 @@ + #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 +67,50 @@ + 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() ++{ ++ enew(); 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 +@@ -115,12 +156,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 */ + +@@ -135,6 +170,10 @@ + int bmfok = 0; + stralloc bmf = {0}; + struct constmap mapbmf; ++int brtok = 0; ++stralloc brt = {0}; ++struct constmap mapbrt; ++int fdmbrt; + + void setup() + { +@@ -155,7 +194,16 @@ + if (bmfok == -1) die_control(); + 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(); ++ if (brtok) ++ if (!constmap_init(&mapbrt,brt.s,brt.len,0)) die_nomem(); + ++ fdmbrt = open_read("control/morebadrcptto.cdb"); ++ if (fdmbrt == -1) if (errno != error_noent) die_control(); ++ ++ + if (control_readint(&databytes,"control/databytes") == -1) die_control(); + x = env_get("DATABYTES"); + if (x) { scan_ulong(x,&u); databytes = u; } +@@ -241,6 +289,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; +@@ -252,6 +308,19 @@ + return 0; + } + ++int brtcheck() ++{ ++ int j; ++ if (brtok) if (constmap(&mapbrt,addr.s,addr.len - 1)) return 1; ++ if (fdmbrt) { ++ uint32 dlen; ++ j = cdb_seek(fdmbrt, addr.s, addr.len - 1, &dlen); ++ if (j == -1) die_control(); ++ if (j) return j; ++ } ++ return 0; ++} ++ + int addrallowed() + { + int r; +@@ -281,6 +350,7 @@ + + int seenmail = 0; + int flagbarf; /* defined if seenmail */ ++int flagbrt; /* defined if any bad rcpts */ + stralloc mailfrom = {0}; + stralloc rcptto = {0}; + +@@ -333,6 +403,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(); +@@ -452,6 +526,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; } diff --git a/mail-mta/qmail/files/1.03-r12/badrcptto-morebadrcptto-accdias-gentoo b/mail-mta/qmail/files/1.03-r12/badrcptto-morebadrcptto-accdias-gentoo new file mode 100644 index 000000000000..601dfd5fb262 --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/1.03-r12/conf-common b/mail-mta/qmail/files/1.03-r12/conf-common new file mode 100644 index 000000000000..7280235a61dd --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/conf-common @@ -0,0 +1,29 @@ +# Common Configuration file for all qmail daemons +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/conf-common,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +# Qmail User IDS to run daemons as +QMAILDUID=`id -u qmaild` +NOFILESGID=`id -g qmaild` + +# 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 diff --git a/mail-mta/qmail/files/1.03-r12/conf-pop3d b/mail-mta/qmail/files/1.03-r12/conf-pop3d new file mode 100644 index 000000000000..3db082128837 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/conf-pop3d @@ -0,0 +1,25 @@ +# Configuration file for qmail-pop3d +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/conf-pop3d,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/1.03-r12/conf-qmqpd b/mail-mta/qmail/files/1.03-r12/conf-qmqpd new file mode 100644 index 000000000000..7fd25cdb7f3f --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/conf-qmqpd @@ -0,0 +1,15 @@ +# Configuration file for qmail-qmqpd +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/conf-qmqpd,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/1.03-r12/conf-qmtpd b/mail-mta/qmail/files/1.03-r12/conf-qmtpd new file mode 100644 index 000000000000..78a7b84897e3 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/conf-qmtpd @@ -0,0 +1,18 @@ +# Configuration file for qmail-qmtpd +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/conf-qmtpd,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/1.03-r12/conf-smtpd b/mail-mta/qmail/files/1.03-r12/conf-smtpd new file mode 100644 index 000000000000..b83821012fad --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/conf-smtpd @@ -0,0 +1,37 @@ +# Configuration file for qmail-smtpd +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/conf-smtpd,v 1.1 2004/05/30 10:50:13 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_POST="${QMAIL_SMTP_POST} 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/mail-mta/qmail/files/1.03-r12/config-sanity-check b/mail-mta/qmail/files/1.03-r12/config-sanity-check new file mode 100644 index 000000000000..c1b85b9459ca --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/config-sanity-check @@ -0,0 +1,23 @@ +#!/bin/sh +# Configuration Sanity Checking for qmail +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/config-sanity-check,v 1.1 2004/05/30 10:50:13 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}" ]; then + echo "SERVICE(${SERVICE}), QMAILDUID(${QMAILDUID}) or NOFILESGID(${NOFILESGID}) is unset in $0" + CONFIG_SANITY_GOOD=0 +fi + +# now make sure we are are on a port that is resolable to a port number +if [ -z "`getent services ${TCPSERVER_PORT}`" ]; then + 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/mail-mta/qmail/files/1.03-r12/dot_qmail b/mail-mta/qmail/files/1.03-r12/dot_qmail new file mode 100644 index 000000000000..81a15fc5c50c --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/dot_qmail @@ -0,0 +1,3 @@ +# Uncomment the next line for .forward support +#|dot-forward .forward +./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r12/errno.patch b/mail-mta/qmail/files/1.03-r12/errno.patch new file mode 100644 index 000000000000..f9b77b91e065 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/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/mail-mta/qmail/files/1.03-r12/maildir-quota-fix.patch b/mail-mta/qmail/files/1.03-r12/maildir-quota-fix.patch new file mode 100644 index 000000000000..3d38a477f5a1 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/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 2004/05/30 10:50:13 robbat2 Exp $"; + + + int user_over_maildirquota( const char *dir, const char *q) diff --git a/mail-mta/qmail/files/1.03-r12/qmail-control b/mail-mta/qmail/files/1.03-r12/qmail-control new file mode 100644 index 000000000000..b623ae51726a --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/qmail-control @@ -0,0 +1,30 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/qmail-control,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +opts="start stop restart reload" + +start() { + ebegin "Starting qmail mta ..." + svc -u /service/qmail-{smtpd,send,qmqp,qmtp} + eend $? + ebegin "Starting qmail mta logging ..." + svc -u /service/qmail-{smtpd,send,qmqp,qmtp}/log + eend $? +} + +stop() { + ebegin "Stopping qmail mta ..." + svc -d /service/qmail-{smtpd,send,qmqp,qmtp} + eend $? + ebegin "Stopping qmail mta logging ..." + svc -d /service/qmail-{smtpd,send,qmqp,qmtp}/log + eend $? +} + +reload() { + ebegin "Reloading 'locals' and 'virtualdomains' control files." + svc -h /service/qmail-send + eend $? +} diff --git a/mail-mta/qmail/files/1.03-r12/qmail-remote-auth-login.patch b/mail-mta/qmail/files/1.03-r12/qmail-remote-auth-login.patch new file mode 100644 index 000000000000..f819973e5987 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/qmail-remote-auth-login.patch @@ -0,0 +1,218 @@ +This was found at http://www.ornl.gov/cts/archives/mailing-lists/qmail/2002/03/msg00091.html + +-------------------------------------------------------------------------------- +[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] +qmail-remote auth login patch + +-------------------------------------------------------------------------------- + +To: qmail@xxxxxxxxxxxxx +Subject: qmail-remote auth login patch +From: Robert Sander <gurubert@xxxxxxxxxxx> +Date: Sun, 03 Mar 2002 22:21:43 +0100 +Delivered-to: mailing list qmail@list.cr.yp.to +Mailing-List: contact qmail-help@list.cr.yp.to; run by ezmlm +User-Agent: Mutt/1.3.27i + +-------------------------------------------------------------------------------- + +Hi! + +I made this patch because my ISP switched to AUTH LOGIN on his SMTP +relay. It is very quick'n'dirty and works only for AUTH LOGIN. I just +needed that. It is based on the non-working qmail-remote AUTH patch on +www.qmail.org/top.html and the qmail-smtpd auth patch from +http://members.elysium.pl/brush/qmail-smtpd-auth/. You need base64.c and +base64.h from that patch because my implementation uses the b64encode function +provided there. + +It works for me, no guarantee... + +The username and password for the remote smtp relay are stored in +/var/qmail/control/smtproutes separated with spaces after the entry for +the relay server. For example: + +:relay.provider.com username password + +Password has to be stored in cleartext. + +Greetings +-- +Robert Sander "Is it Friday yet?" + @Home http://www.gurubert.de/ + +diff -ru qmail-1.03.orig/Makefile qmail-1.03/Makefile +--- qmail-1.03.orig/Makefile Sun Mar 3 22:03:18 2002 ++++ qmail-1.03/Makefile Sun Mar 3 21:39:53 2002 +@@ -1445,12 +1445,12 @@ + load qmail-remote.o control.o constmap.o timeoutread.o timeoutwrite.o \ + timeoutconn.o tcpto.o now.o dns.o ip.o ipalloc.o ipme.o quote.o \ + ndelay.a case.a sig.a open.a lock.a seek.a getln.a stralloc.a alloc.a \ +-substdio.a error.a str.a fs.a auto_qmail.o dns.lib socket.lib ++substdio.a error.a str.a fs.a auto_qmail.o base64.o dns.lib socket.lib + ./load qmail-remote control.o constmap.o timeoutread.o \ + timeoutwrite.o timeoutconn.o tcpto.o now.o dns.o ip.o \ + ipalloc.o ipme.o quote.o ndelay.a case.a sig.a open.a \ + lock.a seek.a getln.a stralloc.a alloc.a substdio.a error.a \ +- str.a fs.a auto_qmail.o `cat dns.lib` `cat socket.lib` ++ str.a fs.a auto_qmail.o base64.o `cat dns.lib` `cat socket.lib` + + qmail-remote.0: \ + qmail-remote.8 +diff -ru qmail-1.03.orig/qmail-remote.c qmail-1.03/qmail-remote.c +--- qmail-1.03.orig/qmail-remote.c Mon Jun 15 12:53:16 1998 ++++ qmail-1.03/qmail-remote.c Sun Mar 3 22:09:36 2002 +@@ -28,6 +28,7 @@ + #include "timeoutconn.h" + #include "timeoutread.h" + #include "timeoutwrite.h" ++#include "base64.h" + + #define HUGESMTPTEXT 5000 + +@@ -43,6 +44,10 @@ + struct constmap maproutes; + stralloc host = {0}; + stralloc sender = {0}; ++stralloc auth_smtp_user = {0}; ++stralloc auth_smtp_pass = {0}; ++stralloc auth_b64_user = {0}; ++stralloc auth_b64_pass = {0}; + + saa reciplist = {0}; + +@@ -85,6 +90,16 @@ + Sorry. Although I'm listed as a best-preference MX or A for that host,\n\ + it isn't in my control/locals file, so I don't treat it as local. (#5.4.6)\n"); + zerodie(); } ++void auth_user_not_set() { ++ out("Kuser and password not set, continuing without authentication.\n"); ++ zero(); ++ substdio_flush(subfdoutsmall); ++} ++void no_supported_auth() { ++ out("Kno supported AUTH method found, continuing without authentication.\n"); ++ zero(); ++ substdio_flush(subfdoutsmall); ++} + + void outhost() + { +@@ -216,24 +231,72 @@ + + stralloc recip = {0}; + ++void mail_without_auth() ++{ ++ substdio_puts(&smtpto,"MAIL FROM:<"); ++ substdio_put(&smtpto,sender.s,sender.len); ++ substdio_puts(&smtpto,">\r\n"); ++ substdio_flush(&smtpto); ++} ++ + void smtp() + { + unsigned long code; + int flagbother; +- int i; ++ int i, j; + + if (smtpcode() != 220) quit("ZConnected to "," but greeting failed"); +- +- substdio_puts(&smtpto,"HELO "); ++ ++ substdio_puts(&smtpto,"EHLO "); + 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"); +- +- substdio_puts(&smtpto,"MAIL FROM:<"); +- substdio_put(&smtpto,sender.s,sender.len); +- substdio_puts(&smtpto,">\r\n"); +- substdio_flush(&smtpto); ++ if (smtpcode() != 250) { ++ substdio_puts(&smtpto,"HELO "); ++ 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"); ++ } ++ i = 0; ++ if (auth_smtp_user.len && auth_smtp_pass.len) { ++ while((i += str_chr(smtptext.s+i,'\n') + 1) && ++ (i+8 < smtptext.len) && ++ str_diffn(smtptext.s+i+4,"AUTH",4)); ++ if (((i+9 < smtptext.len) && ++ (str_diffn(smtptext.s+i+9," ",1) || ++ str_diffn(smtptext.s+i+9,"=",1))) && ++ ( i += str_chr(smtptext.s+i,'L') + 1 ) && ++ str_diffn(smtptext.s+i+1,"OGIN",4)) { ++ ++ if (b64encode(&auth_smtp_user,&auth_b64_user)) quit("ZConnected to "," but unable to base64encode user"); ++ if (b64encode(&auth_smtp_pass,&auth_b64_pass)) quit("ZConnected to "," but unable to base64encode pass"); ++ ++ substdio_puts(&smtpto,"AUTH LOGIN\r\n"); ++ substdio_flush(&smtpto); ++ if (smtpcode() != 334) quit("ZConnected to "," but authentication was rejected (AUTH LOGIN)"); ++ substdio_put(&smtpto,auth_b64_user.s,auth_b64_user.len); ++ substdio_puts(&smtpto,"\r\n"); ++ substdio_flush(&smtpto); ++ if (smtpcode() != 334) quit("ZConnected to "," but authentication was rejected (username)"); ++ substdio_put(&smtpto,auth_b64_pass.s,auth_b64_pass.len); ++ substdio_puts(&smtpto,"\r\n"); ++ substdio_flush(&smtpto); ++ if (smtpcode() != 235) quit("ZConnected to "," but authentication was rejected (password)"); ++ substdio_puts(&smtpto,"MAIL FROM:<"); ++ substdio_put(&smtpto,sender.s,sender.len); ++ substdio_puts(&smtpto,"> AUTH=<"); ++ substdio_put(&smtpto,sender.s,sender.len); ++ substdio_puts(&smtpto,">\r\n"); ++ substdio_flush(&smtpto); ++ } else { ++ no_supported_auth(); ++ mail_without_auth(); ++ } ++ } else { ++ auth_user_not_set(); ++ mail_without_auth(); ++ } + code = smtpcode(); + if (code >= 500) quit("DConnected to "," but sender was rejected"); + if (code >= 400) quit("ZConnected to "," but sender was rejected"); +@@ -331,7 +394,7 @@ + char **argv; + { + static ipalloc ip = {0}; +- int i; ++ int i,j; + unsigned long random; + char **recips; + unsigned long prefme; +@@ -347,6 +410,9 @@ + + if (!stralloc_copys(&host,argv[1])) temp_nomem(); + ++ if (!stralloc_copys(&auth_smtp_user,"")) temp_nomem(); ++ if (!stralloc_copys(&auth_smtp_pass,"")) temp_nomem(); ++ + relayhost = 0; + for (i = 0;i <= host.len;++i) + if ((i == 0) || (i == host.len) || (host.s[i] == '.')) +@@ -355,6 +421,16 @@ + if (relayhost && !*relayhost) relayhost = 0; + + if (relayhost) { ++ i = str_chr(relayhost,' '); ++ if (relayhost[i]) { ++ j = str_chr(relayhost + i + 1,' '); ++ if (relayhost[j]) { ++ relayhost[i] = 0; ++ relayhost[i + j + 1] = 0; ++ if (!stralloc_copys(&auth_smtp_user,relayhost + i + 1)) temp_nomem(); ++ if (!stralloc_copys(&auth_smtp_pass,relayhost + i + j + 2)) temp_nomem(); ++ } ++ } + i = str_chr(relayhost,':'); + if (relayhost[i]) { + scan_ulong(relayhost + i + 1,&port); diff --git a/mail-mta/qmail/files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch b/mail-mta/qmail/files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch new file mode 100644 index 000000000000..3409116d57ab --- /dev/null +++ b/mail-mta/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-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/mail-mta/qmail/files/1.03-r12/qmail-smtpd-relay-reject.gentoo.patch b/mail-mta/qmail/files/1.03-r12/qmail-smtpd-relay-reject.gentoo.patch new file mode 100644 index 000000000000..e6aab720418c --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/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/mail-mta/qmail/files/1.03-r12/rc b/mail-mta/qmail/files/1.03-r12/rc new file mode 100644 index 000000000000..74b00778dc60 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/rc @@ -0,0 +1,4 @@ +#!/bin/sh + +exec env - PATH="/var/qmail/bin:$PATH" \ + qmail-start "`grep -v '^#' /var/qmail/control/defaultdelivery`" diff --git a/mail-mta/qmail/files/1.03-r12/run-qmailpop3d b/mail-mta/qmail/files/1.03-r12/run-qmailpop3d new file mode 100644 index 000000000000..d5f3c49183c5 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/run-qmailpop3d @@ -0,0 +1,26 @@ +#!/bin/sh +# Gentoo Startup script for qmail's POP3 daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/run-qmailpop3d,v 1.1 2004/05/30 10:50:13 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 + +# this is to inherit QMAIL_CONTROLDIR +. /etc/profile + +[ -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/mail-mta/qmail/files/1.03-r12/run-qmailpop3dlog b/mail-mta/qmail/files/1.03-r12/run-qmailpop3dlog new file mode 100644 index 000000000000..b1fcb8f4af22 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/run-qmailpop3dlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-pop3d diff --git a/mail-mta/qmail/files/1.03-r12/run-qmailqmqpd b/mail-mta/qmail/files/1.03-r12/run-qmailqmqpd new file mode 100644 index 000000000000..b05feeecfddf --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/run-qmailqmqpd @@ -0,0 +1,27 @@ +#!/bin/sh +# Gentoo Startup script for qmail's QMQP daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/run-qmailqmqpd,v 1.1 2004/05/30 10:50:13 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 + +# This is to make life easier +SERVICE=qmqp + +# this is to inherit QMAIL_CONTROLDIR +. /etc/profile + +[ -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 + +# Now run it all +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/mail-mta/qmail/files/1.03-r12/run-qmailqmqpdlog b/mail-mta/qmail/files/1.03-r12/run-qmailqmqpdlog new file mode 100644 index 000000000000..d759fbcbcfe1 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/run-qmailqmqpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-qmqpd diff --git a/mail-mta/qmail/files/1.03-r12/run-qmailqmtpd b/mail-mta/qmail/files/1.03-r12/run-qmailqmtpd new file mode 100644 index 000000000000..fd312de5e7c8 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/run-qmailqmtpd @@ -0,0 +1,27 @@ +#!/bin/sh +# Gentoo Startup script for qmail's QMTP daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/run-qmailqmtpd,v 1.1 2004/05/30 10:50:13 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 + +# This is to make life easier +SERVICE=qmtp + +# this is to inherit QMAIL_CONTROLDIR +. /etc/profile + +[ -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 + +# Now run it all +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/mail-mta/qmail/files/1.03-r12/run-qmailqmtpdlog b/mail-mta/qmail/files/1.03-r12/run-qmailqmtpdlog new file mode 100644 index 000000000000..413a217d7de6 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/run-qmailqmtpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-qmtpd diff --git a/mail-mta/qmail/files/1.03-r12/run-qmailsend b/mail-mta/qmail/files/1.03-r12/run-qmailsend new file mode 100644 index 000000000000..8dbd3adf524f --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/run-qmailsend @@ -0,0 +1,2 @@ +#!/bin/sh +exec /var/qmail/rc diff --git a/mail-mta/qmail/files/1.03-r12/run-qmailsendlog b/mail-mta/qmail/files/1.03-r12/run-qmailsendlog new file mode 100644 index 000000000000..5ff50d1e7711 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/run-qmailsendlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-send diff --git a/mail-mta/qmail/files/1.03-r12/run-qmailsmtpd b/mail-mta/qmail/files/1.03-r12/run-qmailsmtpd new file mode 100644 index 000000000000..7ba008fcb502 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/run-qmailsmtpd @@ -0,0 +1,27 @@ +#!/bin/sh +# Gentoo Startup script for qmail's SMTP daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/run-qmailsmtpd,v 1.1 2004/05/30 10:50:13 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 + +# This is to make life easier +SERVICE=smtp + +# this is to inherit QMAIL_CONTROLDIR +. /etc/profile + +[ -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 + +# Now run it all +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/mail-mta/qmail/files/1.03-r12/run-qmailsmtpdlog b/mail-mta/qmail/files/1.03-r12/run-qmailsmtpdlog new file mode 100644 index 000000000000..2d9546146583 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/run-qmailsmtpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-smtpd diff --git a/mail-mta/qmail/files/1.03-r12/smtp-auth-close3.patch b/mail-mta/qmail/files/1.03-r12/smtp-auth-close3.patch new file mode 100644 index 000000000000..e259bbf27977 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r12/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/mail-mta/qmail/files/1.03-r13/99qmail b/mail-mta/qmail/files/1.03-r13/99qmail new file mode 100644 index 000000000000..d9d929e4892b --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/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/mail-mta/qmail/files/1.03-r13/conf-common b/mail-mta/qmail/files/1.03-r13/conf-common new file mode 100644 index 000000000000..96e7175cdd4a --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/conf-common @@ -0,0 +1,29 @@ +# Common Configuration file for all qmail daemons +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/conf-common,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +# Qmail User IDS to run daemons as +QMAILDUID=`id -u qmaild` +NOFILESGID=`id -g qmaild` + +# 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 diff --git a/mail-mta/qmail/files/1.03-r13/conf-pop3d b/mail-mta/qmail/files/1.03-r13/conf-pop3d new file mode 100644 index 000000000000..fb93a1f47003 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/conf-pop3d @@ -0,0 +1,25 @@ +# Configuration file for qmail-pop3d +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/conf-pop3d,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/1.03-r13/conf-qmqpd b/mail-mta/qmail/files/1.03-r13/conf-qmqpd new file mode 100644 index 000000000000..c2c4d3916d8c --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/conf-qmqpd @@ -0,0 +1,15 @@ +# Configuration file for qmail-qmqpd +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/conf-qmqpd,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/1.03-r13/conf-qmtpd b/mail-mta/qmail/files/1.03-r13/conf-qmtpd new file mode 100644 index 000000000000..f50f1443c609 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/conf-qmtpd @@ -0,0 +1,18 @@ +# Configuration file for qmail-qmtpd +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/conf-qmtpd,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/1.03-r13/conf-smtpd b/mail-mta/qmail/files/1.03-r13/conf-smtpd new file mode 100644 index 000000000000..c66cd7551def --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/conf-smtpd @@ -0,0 +1,37 @@ +# Configuration file for qmail-smtpd +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/conf-smtpd,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/1.03-r13/config-sanity-check b/mail-mta/qmail/files/1.03-r13/config-sanity-check new file mode 100644 index 000000000000..6c098075da8a --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/config-sanity-check @@ -0,0 +1,23 @@ +#!/bin/sh +# Configuration Sanity Checking for qmail +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/config-sanity-check,v 1.1 2004/05/30 10:50:13 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}" ]; then + echo "SERVICE(${SERVICE}), QMAILDUID(${QMAILDUID}) or NOFILESGID(${NOFILESGID}) is unset in $0" + CONFIG_SANITY_GOOD=0 +fi + +# now make sure we are are on a port that is resolable to a port number +if [ -z "`getent services ${TCPSERVER_PORT}`" ]; then + 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/mail-mta/qmail/files/1.03-r13/dot_qmail b/mail-mta/qmail/files/1.03-r13/dot_qmail new file mode 100644 index 000000000000..81a15fc5c50c --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/dot_qmail @@ -0,0 +1,3 @@ +# Uncomment the next line for .forward support +#|dot-forward .forward +./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r13/errno.patch b/mail-mta/qmail/files/1.03-r13/errno.patch new file mode 100644 index 000000000000..f9b77b91e065 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/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/mail-mta/qmail/files/1.03-r13/maildir-quota-fix.patch b/mail-mta/qmail/files/1.03-r13/maildir-quota-fix.patch new file mode 100644 index 000000000000..3d38a477f5a1 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/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 2004/05/30 10:50:13 robbat2 Exp $"; + + + int user_over_maildirquota( const char *dir, const char *q) diff --git a/mail-mta/qmail/files/1.03-r13/mkservercert b/mail-mta/qmail/files/1.03-r13/mkservercert new file mode 100644 index 000000000000..0481407dc1c5 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/mkservercert @@ -0,0 +1,55 @@ +#! /bin/sh +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/mkservercert,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/1.03-r13/qmail-control b/mail-mta/qmail/files/1.03-r13/qmail-control new file mode 100644 index 000000000000..583fc1261eff --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/qmail-control @@ -0,0 +1,30 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/qmail-control,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +opts="start stop restart reload" + +start() { + ebegin "Starting qmail mta ..." + svc -u /service/qmail-{smtpd,send,qmqpd,qmtpd} + eend $? + ebegin "Starting qmail mta logging ..." + svc -u /service/qmail-{smtpd,send,qmqpd,qmtpd}/log + eend $? +} + +stop() { + ebegin "Stopping qmail mta ..." + svc -d /service/qmail-{smtpd,send,qmqpd,qmtpd} + eend $? + ebegin "Stopping qmail mta logging ..." + svc -d /service/qmail-{smtpd,send,qmqpd,qmtpd}/log + eend $? +} + +reload() { + ebegin "Reloading 'locals' and 'virtualdomains' control files." + svc -h /service/qmail-send + eend $? +} diff --git a/mail-mta/qmail/files/1.03-r13/qmail-genrsacert.sh b/mail-mta/qmail/files/1.03-r13/qmail-genrsacert.sh new file mode 100644 index 000000000000..3eb085b65ef2 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/qmail-genrsacert.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/qmail-genrsacert.sh,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/1.03-r13/qmail-smtpd-esmtp-size-gentoo.patch b/mail-mta/qmail/files/1.03-r13/qmail-smtpd-esmtp-size-gentoo.patch new file mode 100644 index 000000000000..3409116d57ab --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/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/mail-mta/qmail/files/1.03-r13/qmail-smtpd-relay-reject.gentoo.patch b/mail-mta/qmail/files/1.03-r13/qmail-smtpd-relay-reject.gentoo.patch new file mode 100644 index 000000000000..e6aab720418c --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/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/mail-mta/qmail/files/1.03-r13/rc b/mail-mta/qmail/files/1.03-r13/rc new file mode 100644 index 000000000000..74b00778dc60 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/rc @@ -0,0 +1,4 @@ +#!/bin/sh + +exec env - PATH="/var/qmail/bin:$PATH" \ + qmail-start "`grep -v '^#' /var/qmail/control/defaultdelivery`" diff --git a/mail-mta/qmail/files/1.03-r13/run-qmailpop3d b/mail-mta/qmail/files/1.03-r13/run-qmailpop3d new file mode 100644 index 000000000000..700a6e7c1c68 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/run-qmailpop3d @@ -0,0 +1,26 @@ +#!/bin/sh +# Gentoo Startup script for qmail's POP3 daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/run-qmailpop3d,v 1.1 2004/05/30 10:50:13 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 + +# this is to inherit QMAIL_CONTROLDIR +. /etc/profile + +[ -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/mail-mta/qmail/files/1.03-r13/run-qmailpop3dlog b/mail-mta/qmail/files/1.03-r13/run-qmailpop3dlog new file mode 100644 index 000000000000..b1fcb8f4af22 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/run-qmailpop3dlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-pop3d diff --git a/mail-mta/qmail/files/1.03-r13/run-qmailqmqpd b/mail-mta/qmail/files/1.03-r13/run-qmailqmqpd new file mode 100644 index 000000000000..735ffa71da32 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/run-qmailqmqpd @@ -0,0 +1,27 @@ +#!/bin/sh +# Gentoo Startup script for qmail's QMQP daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/run-qmailqmqpd,v 1.1 2004/05/30 10:50:13 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 + +# This is to make life easier +SERVICE=qmqp + +# this is to inherit QMAIL_CONTROLDIR +. /etc/profile + +[ -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 + +# Now run it all +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/mail-mta/qmail/files/1.03-r13/run-qmailqmqpdlog b/mail-mta/qmail/files/1.03-r13/run-qmailqmqpdlog new file mode 100644 index 000000000000..d759fbcbcfe1 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/run-qmailqmqpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-qmqpd diff --git a/mail-mta/qmail/files/1.03-r13/run-qmailqmtpd b/mail-mta/qmail/files/1.03-r13/run-qmailqmtpd new file mode 100644 index 000000000000..3b0c1eb03845 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/run-qmailqmtpd @@ -0,0 +1,27 @@ +#!/bin/sh +# Gentoo Startup script for qmail's QMTP daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/run-qmailqmtpd,v 1.1 2004/05/30 10:50:13 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 + +# This is to make life easier +SERVICE=qmtp + +# this is to inherit QMAIL_CONTROLDIR +. /etc/profile + +[ -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 + +# Now run it all +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/mail-mta/qmail/files/1.03-r13/run-qmailqmtpdlog b/mail-mta/qmail/files/1.03-r13/run-qmailqmtpdlog new file mode 100644 index 000000000000..413a217d7de6 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/run-qmailqmtpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-qmtpd diff --git a/mail-mta/qmail/files/1.03-r13/run-qmailsend b/mail-mta/qmail/files/1.03-r13/run-qmailsend new file mode 100644 index 000000000000..8dbd3adf524f --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/run-qmailsend @@ -0,0 +1,2 @@ +#!/bin/sh +exec /var/qmail/rc diff --git a/mail-mta/qmail/files/1.03-r13/run-qmailsendlog b/mail-mta/qmail/files/1.03-r13/run-qmailsendlog new file mode 100644 index 000000000000..5ff50d1e7711 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/run-qmailsendlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-send diff --git a/mail-mta/qmail/files/1.03-r13/run-qmailsmtpd b/mail-mta/qmail/files/1.03-r13/run-qmailsmtpd new file mode 100644 index 000000000000..661b9c508c27 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/run-qmailsmtpd @@ -0,0 +1,27 @@ +#!/bin/sh +# Gentoo Startup script for qmail's SMTP daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/run-qmailsmtpd,v 1.1 2004/05/30 10:50:13 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 + +# This is to make life easier +SERVICE=smtp + +# this is to inherit QMAIL_CONTROLDIR +. /etc/profile + +[ -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 + +# Now run it all +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/mail-mta/qmail/files/1.03-r13/run-qmailsmtpdlog b/mail-mta/qmail/files/1.03-r13/run-qmailsmtpdlog new file mode 100644 index 000000000000..2d9546146583 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/run-qmailsmtpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-smtpd diff --git a/mail-mta/qmail/files/1.03-r13/servercert.cnf b/mail-mta/qmail/files/1.03-r13/servercert.cnf new file mode 100644 index 000000000000..32bf6ace6d79 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/servercert.cnf @@ -0,0 +1,37 @@ +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/servercert.cnf,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/1.03-r13/smtp-auth-close3.patch b/mail-mta/qmail/files/1.03-r13/smtp-auth-close3.patch new file mode 100644 index 000000000000..e259bbf27977 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r13/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/mail-mta/qmail/files/1.03-r14/auth-after-tls-only.patch b/mail-mta/qmail/files/1.03-r14/auth-after-tls-only.patch new file mode 100644 index 000000000000..603d6677c9bd --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/1.03-r14/maildir-quota-fix.patch b/mail-mta/qmail/files/1.03-r14/maildir-quota-fix.patch new file mode 100644 index 000000000000..3d38a477f5a1 --- /dev/null +++ b/mail-mta/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 2004/05/30 10:50:13 robbat2 Exp $"; + + + int user_over_maildirquota( const char *dir, const char *q) diff --git a/mail-mta/qmail/files/1.03-r14/nullenvsender-recipcount.tls.patch b/mail-mta/qmail/files/1.03-r14/nullenvsender-recipcount.tls.patch new file mode 100644 index 000000000000..d3ce73f172f8 --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/1.03-r14/qmail-1.03-accept-5xx.tls.patch b/mail-mta/qmail/files/1.03-r14/qmail-1.03-accept-5xx.tls.patch new file mode 100644 index 000000000000..edc9f337a519 --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/1.03-r14/qmail-1.03-qregex-memleak-fix.patch b/mail-mta/qmail/files/1.03-r14/qmail-1.03-qregex-memleak-fix.patch new file mode 100644 index 000000000000..8ab940f6dc72 --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/1.03-r14/qmail-gentoo-branding.patch b/mail-mta/qmail/files/1.03-r14/qmail-gentoo-branding.patch new file mode 100644 index 000000000000..4f353b9e0c40 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r14/qmail-gentoo-branding.patch @@ -0,0 +1,11 @@ +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 01:41:34.000000000 -0800 ++++ qmail-1.03/qmail-smtpd.c 2003-11-30 13:35:43.000000000 -0800 +@@ -187,6 +187,7 @@ + } + void smtp_help() + { ++ out("214-Gentoo Linux __PF__\r\n"); + out("214 qmail home page: http://pobox.com/~djb/qmail.html\r\n"); + } + void smtp_quit() diff --git a/mail-mta/qmail/files/1.03-r14/qmail-pop3d-capa-outputfix.patch b/mail-mta/qmail/files/1.03-r14/qmail-pop3d-capa-outputfix.patch new file mode 100644 index 000000000000..784d8fdfbcd0 --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/1.03-r14/qmail-pop3d-stat.tls.patch b/mail-mta/qmail/files/1.03-r14/qmail-pop3d-stat.tls.patch new file mode 100644 index 000000000000..8fd5c0abcbe2 --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/1.03-r14/qmail-qmailqueue-docs.patch b/mail-mta/qmail/files/1.03-r14/qmail-qmailqueue-docs.patch new file mode 100644 index 000000000000..d4827a78ebcf --- /dev/null +++ b/mail-mta/qmail/files/1.03-r14/qmail-qmailqueue-docs.patch @@ -0,0 +1,31 @@ +diff -urBbw qmail-1.03.orig/qmail-log.5 qmail-1.03/qmail-log.5 +--- qmail-1.03.orig/qmail-log.5 1998-06-15 03:53:16.000000000 -0700 ++++ qmail-1.03/qmail-log.5 2003-11-30 13:36:00.000000000 -0800 +@@ -232,6 +232,11 @@ + is unable to queue a bounce message, + usually because the machine is almost out of memory. + It will try again later. ++This can also be caused by incorrect settings of ++.B $QMAILQUEUE ++or errors in a program or script which ++.B $QMAILQUEUE ++points to. + .TP + .B unable to stat ... + .B qmail-send +diff -urBbw qmail-1.03.orig/qmail-queue.8 qmail-1.03/qmail-queue.8 +--- qmail-1.03.orig/qmail-queue.8 1998-06-15 03:53:16.000000000 -0700 ++++ qmail-1.03/qmail-queue.8 2003-11-30 13:36:23.000000000 -0800 +@@ -40,6 +40,12 @@ + However, the recipients probably expect to see a proper header, + as described in + .BR qmail-header(5) . ++ ++Programs included with qmail which invoke ++.B qmail-queue ++will invoke the contents of ++.B $QMAILQUEUE ++instead, if that environment variable is set. + .SH "FILESYSTEM RESTRICTIONS" + .B qmail-queue + imposes two constraints on the queue structure: diff --git a/mail-mta/qmail/files/1.03-r14/qmail-smtpd-esmtp-size-gentoo.patch b/mail-mta/qmail/files/1.03-r14/qmail-smtpd-esmtp-size-gentoo.patch new file mode 100644 index 000000000000..3409116d57ab --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/1.03-r14/qmail-smtpd-relay-reject.gentoo.patch b/mail-mta/qmail/files/1.03-r14/qmail-smtpd-relay-reject.gentoo.patch new file mode 100644 index 000000000000..e6aab720418c --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/1.03-r14/smtp-auth-close3.patch b/mail-mta/qmail/files/1.03-r14/smtp-auth-close3.patch new file mode 100644 index 000000000000..e259bbf27977 --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/1.03-r15/qmail-pop3d-top-outputfix.patch b/mail-mta/qmail/files/1.03-r15/qmail-pop3d-top-outputfix.patch new file mode 100644 index 000000000000..cdc4a710b280 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r15/qmail-pop3d-top-outputfix.patch @@ -0,0 +1,15 @@ +diff -uBbwr qmail-1.03.orig/qmail-pop3d.c qmail-1.03/qmail-pop3d.c +--- qmail-1.03.orig/qmail-pop3d.c 2003-11-30 23:45:22.000000000 -0800 ++++ qmail-1.03/qmail-pop3d.c 2003-11-30 23:43:13.000000000 -0800 +@@ -312,9 +312,9 @@ + fd = open_read(m[i].fn); + if (fd == -1) { err_nosuch(); return; } + /* okay(); */ +- puts("+OK "); ++ substdio_puts(&ssout,"+OK "); + put(strnum,fmt_ulong(strnum,m[i].size)); +- puts(" octets\r\n"); ++ substdio_puts(&ssout," octets\r\n"); + flush(); + substdio_fdbuf(&ssmsg,read,fd,ssmsgbuf,sizeof(ssmsgbuf)); + blast(&ssmsg,limit); diff --git a/mail-mta/qmail/files/1.03-r8/defaultdelivery b/mail-mta/qmail/files/1.03-r8/defaultdelivery new file mode 100644 index 000000000000..d0ef7de8b590 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r8/defaultdelivery @@ -0,0 +1,2 @@ +|dot-forward .forward +./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r8/dot_qmail b/mail-mta/qmail/files/1.03-r8/dot_qmail new file mode 100644 index 000000000000..7c9e5d08f067 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r8/dot_qmail @@ -0,0 +1 @@ +./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r8/qmail-1.03-starttls-smtp-auth.patch b/mail-mta/qmail/files/1.03-r8/qmail-1.03-starttls-smtp-auth.patch new file mode 100644 index 000000000000..1a427fb55b62 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r8/qmail-1.03-starttls-smtp-auth.patch @@ -0,0 +1,1408 @@ + +A word of warning: the TLS part of this patch is not type-safe at +at least one point (hey, I didn't write it.) I don't think this +causes problems on i386 architectures, but it made qmail-smtpd +crash frequently on an Alpha. Commenting out the substdio_fdbuf(...); +call in qmail-smtpd appears to fix the issue. + +diff -urP qmail-1.03-vanilla/Makefile qmail-1.03-tls-auth/Makefile +--- qmail-1.03-vanilla/Makefile Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/Makefile Wed Jun 19 16:09:58 2002 +@@ -136,6 +136,10 @@ + compile auto_usera.c + ./compile auto_usera.c + ++base64.o: \ ++compile base64.c base64.h stralloc.h substdio.h str.h ++ ./compile base64.c ++ + binm1: \ + binm1.sh conf-qmail + cat binm1.sh \ +@@ -1446,7 +1450,8 @@ + timeoutwrite.o timeoutconn.o tcpto.o now.o dns.o ip.o \ + ipalloc.o ipme.o quote.o ndelay.a case.a sig.a open.a \ + lock.a seek.a getln.a stralloc.a alloc.a substdio.a error.a \ +- str.a fs.a auto_qmail.o `cat dns.lib` `cat socket.lib` ++ str.a fs.a auto_qmail.o `cat dns.lib` `cat socket.lib` \ ++ -lssl -lcrypto + + qmail-remote.0: \ + qmail-remote.8 +@@ -1536,13 +1541,13 @@ + timeoutwrite.o ip.o ipme.o ipalloc.o control.o constmap.o received.o \ + date822fmt.o now.o qmail.o cdb.a fd.a wait.a datetime.a getln.a \ + open.a sig.a case.a env.a stralloc.a alloc.a substdio.a error.a str.a \ +-fs.a auto_qmail.o socket.lib ++fs.a auto_qmail.o base64.o socket.lib + ./load qmail-smtpd rcpthosts.o commands.o timeoutread.o \ + timeoutwrite.o ip.o ipme.o ipalloc.o control.o constmap.o \ + received.o date822fmt.o now.o qmail.o cdb.a fd.a wait.a \ + datetime.a getln.a open.a sig.a case.a env.a stralloc.a \ +- alloc.a substdio.a error.a str.a fs.a auto_qmail.o `cat \ +- socket.lib` ++ alloc.a substdio.a error.a str.a fs.a auto_qmail.o base64.o `cat \ ++ socket.lib` -lssl -lcrypto + + qmail-smtpd.0: \ + qmail-smtpd.8 +@@ -1553,7 +1558,8 @@ + substdio.h alloc.h auto_qmail.h control.h received.h constmap.h \ + error.h ipme.h ip.h ipalloc.h ip.h gen_alloc.h ip.h qmail.h \ + substdio.h str.h fmt.h scan.h byte.h case.h env.h now.h datetime.h \ +-exit.h rcpthosts.h timeoutread.h timeoutwrite.h commands.h ++exit.h rcpthosts.h timeoutread.h timeoutwrite.h commands.h wait.h \ ++fd.h base64.h + ./compile qmail-smtpd.c + + qmail-start: \ +@@ -2139,3 +2145,23 @@ + wait_pid.o: \ + compile wait_pid.c error.h haswaitp.h + ./compile wait_pid.c ++ ++cert: ++ openssl req -new -x509 -nodes \ ++ -out /var/qmail/control/servercert.pem -days 366 \ ++ -keyout /var/qmail/control/servercert.pem ++ chmod 640 /var/qmail/control/servercert.pem ++ chown qmaild:qmail /var/qmail/control/servercert.pem ++ ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.pem ++ ++cert-req: ++ openssl req -new -nodes \ ++ -out req.pem \ ++ -keyout /var/qmail/control/servercert.pem ++ chmod 640 /var/qmail/control/servercert.pem ++ chown qmaild:qmail /var/qmail/control/servercert.pem ++ ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.pem ++ @echo ++ @echo "Send req.pem to your CA to obtain signed_req.pem, and do:" ++ @echo "cat signed_req.pem >> /var/qmail/control/servercert.pem" ++ +diff -urP qmail-1.03-vanilla/README.auth qmail-1.03-tls-auth/README.auth +--- qmail-1.03-vanilla/README.auth Wed Dec 31 18:00:00 1969 ++++ qmail-1.03-tls-auth/README.auth Wed Jun 19 15:31:37 2002 +@@ -0,0 +1,175 @@ ++*** Warning! Cuidado! Vorsicht! *** ++=================================== ++*** Version 0.30 of the patch changes the arguments which must be ++*** passed to qmail-smtpd. If you are upgrading from a previous ++*** version of the patch, take care to ensure your invocation of ++*** qmail-smtpd uses the correct arguments. Otherwise, your server ++*** may run as an open relay! ++=================================== ++*** Warning! Cuidado! Vorsicht! *** ++ ++ ++This patch adds ESMTP AUTH authentication protocol support to ++qmail-1.03. It's originally based on Mrs. Brisby's smtp-auth patch ++with many enhancements from Krzysztof Dabrowski <brush@elysium.pl>. ++ ++Beginning with version 0.30, the patch was completely rewritten to ++use only djb's string functions by Eric M. Johnston <emj@postal.net>. ++ ++You can always get the newest version from: ++http://members.elysium.pl/brush/qmail-smtpd-auth/ ++ ++To use all of it's functionality you will also have to obtain and ++install Krzysztof's cmd5checkpw utility available at: ++http://members.elysium.pl/brush/cmd5checkpw/ ++ ++If you need more information about SMTP-AUTH itself and the ++client/server support and configuration, visit: ++http://members.elysium.pl/brush/smtp-auth/ ++ ++--- ++ ++Detailed patch information: ++ ++This patch adds the ESMTP AUTH option to qmail-1.03, allowing the ++LOGIN, PLAIN, and CRAM-MD5 AUTH types. An appropriate checkpassword ++tool is necessary to support the authentication. See ++http://cr.yp.to/checkpwd.html for more information on the interface. ++Note that the checkpassword tool should support all of the AUTH types ++advertised by qmail-smtpd. ++ ++As reflected in the modified qmail-smtpd(8) man page, qmail-smtpd ++must be invoked with three arguments: hostname, checkprogram, and ++subprogram. If these arguments are missing, qmail-smtpd will still ++advertise availability of AUTH, but will fail with a permanent error ++when AUTH is used. ++ ++hostname is simply used to form the CRAM-MD5 challenge. qmail-smtpd ++invokes checkprogram, feeding it the username and password, in the ++case of LOGIN or PLAIN, or the username, challenge, and response, in ++the case of CRAM-MD5. If the user is permitted, checkprogram invokes ++subprogram, which just has to exit with a status of 0 for the user to ++be authenticated. Otherwise, checkprogram exits with a non-zero ++status. subprogram can usually be /usr/bin/true (or /bin/true, ++depending on your flavor of OS). ++ ++If the user is successfully authenticated, the RELAYCLIENT ++environment variable is effectively set for the SMTP session, and ++the TCPREMOTEINFO environment variable is set to the authenticated ++username, overriding any value that tcpserver may have set. The ++value of TCPREMOTEINFO is reflected in a Received header. ++ ++ ++How to install it: ++ ++Simply patch your qmail-1.03 distribution with the included patch ++file and recompile & install like usual. ++ ++The steps to do this are as follows (assuming your virgin ++qmail-1.03 install is in "../qmail-1.03"): ++ ++ cp README.auth base64.c base64.h ../qmail-1.03 ++ patch -d ../qmail-1.03 < auth.patch ++ ++Install qmail normally, with the exception of the new arguments ++to qmail-smtpd described elsewhere in this file. ++ ++Also obtain, unpack, compile and install the cmd5checkpw utility ++(or some other checkpassword utility) and add a sample account to ++/etc/poppasswd file. This file must be readable by the qmail-smtpd ++user, usually qmaild. ++ ++ ++How to use it: ++ ++*** Warning: In version 0.30 the arguments have changed from ++*** previous versions of qmail-smtpd-auth. Take care to make sure ++*** you update your startup scripts if updating! ++ ++If you're running qmail-smtpd from inetd, you'll want to do the ++following: ++ ++smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env tcp-env \ ++/var/qmail/bin/qmail-smtpd mail.acme.com /bin/cmd5checkpw /bin/true ++ ++Replace mail.acme.com with your hostname. The second argument to ++qmail-smtpd is your checkpassword utility (preferably cmd5checkpw ++or some alternative that can handle CRAM-MD5). The third argument ++is the executable that the checkpassword utility execs when ++authentication is successful. (Note that the location of "true" ++is OS dependent: you may need /usr/bin/true.) ++ ++Invocations using tcpserver will require analagous changes. Give ++your inetd a kill -HUP or restart tcpserver and away you go. ++ ++ ++Caveats: ++ ++Please note that as authentication needs vary wildly across ++installations, no effort has been made to make this patch work ``out ++of the box.'' You'll have to procure or develop your own ++checkpassword program. Also note that CRAM-MD5 will require you to ++keep plaintext passwords. You'll probably want to disable this AUTH ++type if you're just using /etc/passwd (keeping in mind that PLAIN and ++LOGIN aren't quite as safe over the wire) -- just undefine AUTHCRAM ++in qmail-smtpd. ++ ++Krzysztof Dabrowski's cmd5checkpw tool used as an example in this ++document supports the three AUTH types included in this patch. ++It's available at http://www.elysium.pl/members/brush/cmd5checkpw/. ++ ++This patch has been generated against the stock qmail 1.03 ++distribution. The results of combining this patch with others are ++unknown. ++ ++ ++Features: ++ ++This patch supports the following auth methods: LOGIN, PLAIN and ++CRAM-MD5. ++ ++ ++Compatibility: ++ ++The following MUA's are confirmed to work with this patch: ++ ++Eudora 4.2.2 - CRAM-MD5 ++Eudora 5.0.2 - CRAM-MD5 ++The Bat 1.39 - LOGIN & CRAM-MD5 ++Outlook Express 4 - LOGIN ++Outlook Express 5 - LOGIN ++Outlook 2000 - LOGIN ++Netscape 4.x - LOGIN & PLAIN ++Netscape 4.0x - LOGIN ++Pegasus Mail 3.1x - CRAM-MD5 ++ ++ ++Various compatibility issues: ++ ++Testing with Pegasus Mail 3.1 revealed that it requires the new style ++(RFC recommended) greeting message. Both styles are now enabled to ++maintain the highest degree of compatibility with various clients. ++This fix was suggested by David Harris <David.Harris@pmail.gen.nz>, ++the developer of Pegasus Mail. ++ ++ ++Acknowledgments: ++ ++This patch is based on work by Krzysztof Dabrowski at ++http://members.elysium.pl/brush/qmail-smtpd-auth/ and ``Mrs. Brisby'' ++at http://www.nimh.org/hacks/qmail-smtpd.c which has been further ++developed by Eric M. Johnston <emj@postal.net>. ++ ++--- ++ ++THIS SOFTWARE IS IN THE PUBLIC DOMAIN, IS PROVIDED BY THE AUTHOR ++``AS IS,'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE ++LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR ++BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ++WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE ++OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ++EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +diff -urP qmail-1.03-vanilla/TARGETS qmail-1.03-tls-auth/TARGETS +--- qmail-1.03-vanilla/TARGETS Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/TARGETS Wed Jun 19 15:30:20 2002 +@@ -250,6 +250,7 @@ + qmail-qmtpd.o + rcpthosts.o + qmail-qmtpd ++base64.o + qmail-smtpd.o + qmail-smtpd + sendmail.o +diff -urP qmail-1.03-vanilla/base64.c qmail-1.03-tls-auth/base64.c +--- qmail-1.03-vanilla/base64.c Wed Dec 31 18:00:00 1969 ++++ qmail-1.03-tls-auth/base64.c Wed Jun 19 15:29:53 2002 +@@ -0,0 +1,90 @@ ++#include "base64.h" ++#include "stralloc.h" ++#include "substdio.h" ++#include "str.h" ++ ++static char *b64alpha = ++ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; ++#define B64PAD '=' ++ ++/* returns 0 ok, 1 illegal, -1 problem */ ++ ++int b64decode(in,l,out) ++const unsigned char *in; ++int l; ++stralloc *out; /* not null terminated */ ++{ ++ int i, j; ++ unsigned char a[4]; ++ unsigned char b[3]; ++ char *s; ++ ++ if (l == 0) ++ { ++ if (!stralloc_copys(out,"")) return -1; ++ return 0; ++ } ++ ++ if (!stralloc_ready(out,l + 2)) return -1; /* XXX generous */ ++ s = out->s; ++ ++ for (i = 0;i < l;i += 4) { ++ for (j = 0;j < 4;j++) ++ if ((i + j) < l && in[i + j] != B64PAD) ++ { ++ a[j] = str_chr(b64alpha,in[i + j]); ++ if (a[j] > 63) return 1; ++ } ++ else a[j] = 0; ++ ++ b[0] = (a[0] << 2) | (a[1] >> 4); ++ b[1] = (a[1] << 4) | (a[2] >> 2); ++ b[2] = (a[2] << 6) | (a[3]); ++ ++ *s++ = b[0]; ++ ++ if (in[i + 1] == B64PAD) break; ++ *s++ = b[1]; ++ ++ if (in[i + 2] == B64PAD) break; ++ *s++ = b[2]; ++ } ++ out->len = s - out->s; ++ while (out->len && !out->s[out->len - 1]) --out->len; /* XXX avoid? */ ++ return 0; ++} ++ ++int b64encode(in,out) ++stralloc *in; ++stralloc *out; /* not null terminated */ ++{ ++ unsigned char a, b, c; ++ int i; ++ char *s; ++ ++ if (in->len == 0) ++ { ++ if (!stralloc_copys(out,"")) return -1; ++ return 0; ++ } ++ ++ if (!stralloc_ready(out,in->len / 3 * 4 + 4)) return -1; ++ s = out->s; ++ ++ for (i = 0;i < in->len;i += 3) { ++ a = in->s[i]; ++ b = i + 1 < in->len ? in->s[i + 1] : 0; ++ c = i + 2 < in->len ? in->s[i + 2] : 0; ++ ++ *s++ = b64alpha[a >> 2]; ++ *s++ = b64alpha[((a & 3 ) << 4) | (b >> 4)]; ++ ++ if (i + 1 >= in->len) *s++ = B64PAD; ++ else *s++ = b64alpha[((b & 15) << 2) | (c >> 6)]; ++ ++ if (i + 2 >= in->len) *s++ = B64PAD; ++ else *s++ = b64alpha[c & 63]; ++ } ++ out->len = s - out->s; ++ return 0; ++} +diff -urP qmail-1.03-vanilla/base64.h qmail-1.03-tls-auth/base64.h +--- qmail-1.03-vanilla/base64.h Wed Dec 31 18:00:00 1969 ++++ qmail-1.03-tls-auth/base64.h Wed Jun 19 15:29:53 2002 +@@ -0,0 +1,7 @@ ++#ifndef BASE64_H ++#define BASE64_H ++ ++extern int b64decode(); ++extern int b64encode(); ++ ++#endif +diff -urP qmail-1.03-vanilla/conf-cc qmail-1.03-tls-auth/conf-cc +--- qmail-1.03-vanilla/conf-cc Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/conf-cc Wed Jun 19 15:35:59 2002 +@@ -1,3 +1,3 @@ +-cc -O2 ++cc -O2 -DTLS -I/usr/local/ssl/include + + This will be used to compile .c files. +diff -urP qmail-1.03-vanilla/dns.c qmail-1.03-tls-auth/dns.c +--- qmail-1.03-vanilla/dns.c Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/dns.c Wed Jun 19 15:36:06 2002 +@@ -270,6 +270,14 @@ + { + int r; + struct ip_mx ix; ++#ifdef TLS ++ stralloc fqdn = {0}; ++ ++ if (!stralloc_copy(&fqdn,sa)) return DNS_MEM; ++ if (!stralloc_0(&fqdn)) return DNS_MEM; ++ ix.fqdn = fqdn.s; ++ alloc_free(fqdn); ++#endif + + if (!stralloc_copy(&glue,sa)) return DNS_MEM; + if (!stralloc_0(&glue)) return DNS_MEM; +@@ -330,6 +338,9 @@ + ix.pref = 0; + if (!glue.s[ip_scan(glue.s,&ix.ip)] || !glue.s[ip_scanbracket(glue.s,&ix.ip)]) + { ++#ifdef TLS ++ ix.fqdn = NULL; ++#endif + if (!ipalloc_append(ia,&ix)) return DNS_MEM; + return 0; + } +diff -urP qmail-1.03-vanilla/ipalloc.h qmail-1.03-tls-auth/ipalloc.h +--- qmail-1.03-vanilla/ipalloc.h Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/ipalloc.h Wed Jun 19 15:36:15 2002 +@@ -3,7 +3,12 @@ + + #include "ip.h" + ++#ifdef TLS ++#include "stralloc.h" ++struct ip_mx { struct ip_address ip; int pref; char *fqdn; } ; ++#else + struct ip_mx { struct ip_address ip; int pref; } ; ++#endif + + #include "gen_alloc.h" + +diff -urP qmail-1.03-vanilla/qmail-remote.c qmail-1.03-tls-auth/qmail-remote.c +--- qmail-1.03-vanilla/qmail-remote.c Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/qmail-remote.c Wed Jun 19 15:36:38 2002 +@@ -26,8 +26,18 @@ + #include "tcpto.h" + #include "readwrite.h" + #include "timeoutconn.h" ++#ifndef TLS + #include "timeoutread.h" + #include "timeoutwrite.h" ++#endif ++ ++#ifdef TLS ++#include <sys/stat.h> ++#include <openssl/ssl.h> ++SSL *ssl = NULL; ++ ++stralloc tlsclientciphers = {0}; ++#endif + + #define HUGESMTPTEXT 5000 + +@@ -107,17 +117,94 @@ + int smtpfd; + int timeout = 1200; + ++#ifdef TLS ++int flagtimedout = 0; ++void sigalrm() ++{ ++ flagtimedout = 1; ++} ++ ++int ssl_timeoutread(timeout,fd,buf,n) int timeout; int fd; char *buf; int n; ++{ ++ int r; int saveerrno; ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ alarm(timeout); ++ if (ssl) { ++ while(((r = SSL_read(ssl,buf,n)) <= 0) ++ && (SSL_get_error(ssl, r) == SSL_ERROR_WANT_READ)); ++ if (SSL_get_error(ssl, r) != SSL_ERROR_NONE) ++ {char buf[1024]; ++ ++ out("ZTLS connection to "); outhost(); out(" died: "); ++ SSL_load_error_strings(); ++ out(ERR_error_string(ERR_get_error(), buf)); out("\n"); ++ SSL_shutdown(ssl); ++ zerodie(); ++ } ++ }else r = read(fd,buf,n); ++ saveerrno = errno; ++ alarm(0); ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ errno = saveerrno; ++ return r; ++} ++ ++int ssl_timeoutwrite(timeout,fd,buf,n) int timeout; int fd; char *buf; int n; ++{ ++ int r; int saveerrno; ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ alarm(timeout); ++ if (ssl) { ++ while(((r = SSL_write(ssl,buf,n)) <= 0) ++ && (SSL_get_error(ssl, r) == SSL_ERROR_WANT_WRITE)); ++ if (SSL_get_error(ssl, r) != SSL_ERROR_NONE) ++ {char buf[1024]; ++ ++ out("ZTLS connection to "); outhost(); out(" died: "); ++ SSL_load_error_strings(); ++ out(ERR_error_string(ERR_get_error(), buf)); out("\n"); ++ SSL_shutdown(ssl); ++ zerodie(); ++ } ++ }else r = write(fd,buf,n); ++ saveerrno = errno; ++ alarm(0); ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ errno = saveerrno; ++ return r; ++} ++ ++static int client_cert_cb(SSL *s,X509 **x509, EVP_PKEY **pkey) ++{ ++ out("ZTLS found no client cert in control/clientcert.pem\n"); ++ zerodie(NULL,NULL); ++} ++ ++static int verify_cb(int ok, X509_STORE_CTX * ctx) ++{ ++ return (1); ++} ++#endif ++ + int saferead(fd,buf,len) int fd; char *buf; int len; + { + int r; ++#ifdef TLS ++ r = ssl_timeoutread(timeout,smtpfd,buf,len); ++#else + r = timeoutread(timeout,smtpfd,buf,len); ++#endif + if (r <= 0) dropped(); + return r; + } + int safewrite(fd,buf,len) int fd; char *buf; int len; + { + int r; ++#ifdef TLS ++ r = ssl_timeoutwrite(timeout,smtpfd,buf,len); ++#else + r = timeoutwrite(timeout,smtpfd,buf,len); ++#endif + if (r <= 0) dropped(); + return r; + } +@@ -186,6 +273,34 @@ + out(append); + out(".\n"); + outsmtptext(); ++ ++/* TAG */ ++#if defined(TLS) && defined(DEBUG) ++#define ONELINE_NAME(X) X509_NAME_oneline(X,NULL,0) ++ ++ if(ssl){ ++ X509 *peer; ++ ++ out("STARTTLS proto="); out(SSL_get_version(ssl)); ++ out("; cipher="); out(SSL_CIPHER_get_name(SSL_get_current_cipher(ssl))); ++ ++ /* we want certificate details */ ++ peer=SSL_get_peer_certificate(ssl); ++ if (peer != NULL) { ++ char *str; ++ ++ str=ONELINE_NAME(X509_get_subject_name(peer)); ++ out("; subject="); out(str); ++ OPENSSL_free(str); ++ str=ONELINE_NAME(X509_get_issuer_name(peer)); ++ out("; issuer="); out(str); ++ OPENSSL_free(str); ++ X509_free(peer); ++ } ++ out(";\n"); ++ } ++#endif ++ + zerodie(); + } + +@@ -216,20 +331,158 @@ + + stralloc recip = {0}; + ++#ifdef TLS ++void smtp(fqdn) ++char *fqdn; ++#else + void smtp() ++#endif + { + unsigned long code; + int flagbother; + int i; +- ++#ifdef TLS ++ int needtlsauth = 0; ++ SSL_CTX *ctx; ++ int saveerrno, r; ++ ++ stralloc servercert = {0}; ++ struct stat st; ++ if(fqdn){ ++ if(!stralloc_copys(&servercert, "control/tlshosts/")) temp_nomem(); ++ if(!stralloc_catb(&servercert, fqdn, str_len(fqdn))) temp_nomem(); ++ if(!stralloc_catb(&servercert, ".pem", 4)) temp_nomem(); ++ if(!stralloc_0(&servercert)) temp_nomem(); ++ if (stat(servercert.s,&st) == 0) needtlsauth = 1; ++ } ++#endif ++ + if (smtpcode() != 220) quit("ZConnected to "," but greeting failed"); + ++#ifdef TLS ++ substdio_puts(&smtpto,"EHLO "); ++#else + substdio_puts(&smtpto,"HELO "); ++#endif + substdio_put(&smtpto,helohost.s,helohost.len); + substdio_puts(&smtpto,"\r\n"); + substdio_flush(&smtpto); ++#ifdef TLS ++ if (smtpcode() != 250){ ++ substdio_puts(&smtpto,"HELO "); ++ 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"); ++ } ++#else + if (smtpcode() != 250) quit("ZConnected to "," but my name was rejected"); +- ++#endif ++ ++#ifdef TLS ++ i = 0; ++ while((i += str_chr(smtptext.s+i,'\n') + 1) && (i+12 < smtptext.len) && ++ str_diffn(smtptext.s+i+4,"STARTTLS\n",9)); ++ if (i+12 < smtptext.len) ++ { ++ substdio_puts(&smtpto,"STARTTLS\r\n"); ++ substdio_flush(&smtpto); ++ if (smtpcode() == 220) ++ { ++ SSL_library_init(); ++ if(!(ctx=SSL_CTX_new(SSLv23_client_method()))) ++ {char buf[1024]; ++ ++ out("ZTLS not available: error initializing ctx: "); ++ SSL_load_error_strings(); ++ out(ERR_error_string(ERR_get_error(), buf)); ++ out("\n"); ++ SSL_shutdown(ssl); ++ zerodie(); ++ } ++ if((stat("control/clientcert.pem", &st) == 0) && ++ ((SSL_CTX_use_RSAPrivateKey_file(ctx, "control/clientcert.pem", SSL_FILETYPE_PEM) <= 0) || ++ (SSL_CTX_use_certificate_chain_file(ctx, "control/clientcert.pem") <= 0) || ++ (SSL_CTX_check_private_key(ctx) <= 0))) ++ /* if there is a cert and it is bad, I fail ++ if there is no cert, I leave it to the other side to complain */ ++ SSL_CTX_set_client_cert_cb(ctx, client_cert_cb); ++ ++ /*SSL_CTX_set_options(ctx, SSL_OP_NO_TLSv1);*/ ++ SSL_CTX_set_cipher_list(ctx,tlsclientciphers.s); ++ ++ if (needtlsauth){ ++ if (!SSL_CTX_load_verify_locations(ctx, servercert.s, NULL)) ++ {out("ZTLS unable to load "); out(servercert.s); out("\n"); ++ zerodie();} ++ SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, verify_cb); ++ } ++ ++ if(!(ssl=SSL_new(ctx))) ++ {char buf[1024]; ++ ++ out("ZTLS not available: error initializing ssl: "); ++ SSL_load_error_strings(); ++ out(ERR_error_string(ERR_get_error(), buf)); ++ out("\n"); ++ SSL_shutdown(ssl); ++ zerodie(); ++ } ++ SSL_set_fd(ssl,smtpfd); ++ ++ alarm(timeout); ++ r = SSL_connect(ssl); saveerrno = errno; ++ alarm(0); ++ if (flagtimedout) ++ {out("ZTLS not available: connect timed out\n"); ++ zerodie();} ++ errno = saveerrno; ++ if (r<=0) ++ {char buf[1024]; ++ ++ out("ZTLS not available: connect failed: "); ++ SSL_load_error_strings(); ++ out(ERR_error_string(ERR_get_error(), buf)); ++ out("\n"); ++ SSL_shutdown(ssl); ++ zerodie(); ++ } ++ if (needtlsauth) ++ /* should also check alternate names */ ++ {char commonName[256]; ++ ++ if ((r=SSL_get_verify_result(ssl)) != X509_V_OK) ++ {out("ZTLS unable to verify server with "); ++ out(servercert.s); out(": "); ++ out(X509_verify_cert_error_string(r)); out("\n"); ++ zerodie(); ++ } ++ X509_NAME_get_text_by_NID(X509_get_subject_name( ++ SSL_get_peer_certificate(ssl)), ++ NID_commonName, commonName, 256); ++ if (strcasecmp(fqdn,commonName)){ ++ out("ZTLS connection to "); out(fqdn); ++ out(" wanted, certificate for "); out(commonName); ++ out(" received\n"); ++ zerodie();} ++ } ++ ++ substdio_puts(&smtpto,"EHLO "); ++ substdio_put(&smtpto,helohost.s,helohost.len); ++ substdio_puts(&smtpto,"\r\n"); ++ substdio_flush(&smtpto); ++ ++ if (smtpcode() != 250) ++ { ++ quit("ZTLS connected to "," but my name was rejected"); ++ } ++ } ++ } ++ if ((!ssl) && needtlsauth) ++ {out("ZNo TLS achieved while "); out(servercert.s); out(" exists.\n"); ++ quit();} ++#endif ++ + substdio_puts(&smtpto,"MAIL FROM:<"); + substdio_put(&smtpto,sender.s,sender.len); + substdio_puts(&smtpto,">\r\n"); +@@ -324,6 +577,11 @@ + case 1: + if (!constmap_init(&maproutes,routes.s,routes.len,1)) temp_nomem(); break; + } ++#ifdef TLS ++ if (control_rldef(&tlsclientciphers,"control/tlsclientciphers",0,"DEFAULT") != 1) ++ temp_control(); ++ if(!stralloc_0(&tlsclientciphers)) temp_nomem(); ++#endif + } + + void main(argc,argv) +@@ -338,7 +596,10 @@ + int flagallaliases; + int flagalias; + char *relayhost; +- ++ ++#ifdef TLS ++ sig_alarmcatch(sigalrm); ++#endif + sig_pipeignore(); + if (argc < 4) perm_usage(); + if (chdir(auto_qmail) == -1) temp_chdir(); +@@ -417,7 +678,11 @@ + if (timeoutconn(smtpfd,&ip.ix[i].ip,(unsigned int) port,timeoutconnect) == 0) { + tcpto_err(&ip.ix[i].ip,0); + partner = ip.ix[i].ip; ++#ifdef TLS ++ smtp(ip.ix[i].fqdn); /* does not return */ ++#else + smtp(); /* does not return */ ++#endif + } + tcpto_err(&ip.ix[i].ip,errno == error_timeout); + close(smtpfd); +diff -urP qmail-1.03-vanilla/qmail-smtpd.8 qmail-1.03-tls-auth/qmail-smtpd.8 +--- qmail-1.03-vanilla/qmail-smtpd.8 Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/qmail-smtpd.8 Wed Jun 19 15:30:20 2002 +@@ -3,6 +3,11 @@ + qmail-smtpd \- receive mail via SMTP + .SH SYNOPSIS + .B qmail-smtpd ++[ ++.I hostname ++.I checkprogram ++.I subprogram ++] + .SH DESCRIPTION + .B qmail-smtpd + receives mail messages via the Simple Mail Transfer Protocol (SMTP) +@@ -23,7 +28,29 @@ + header fields. + + .B qmail-smtpd +-supports ESMTP, including the 8BITMIME and PIPELINING options. ++supports ESMTP, including the 8BITMIME, PIPELINING, and AUTH options. ++ ++.B qmail-smtpd ++can accept LOGIN, PLAIN, and CRAM-MD5 AUTH types. It invokes ++.IR checkprogram , ++which reads on file descriptor 3 the username, a 0 byte, the password ++or challenge derived from ++.IR hostname , ++another 0 byte, a CRAM-MD5 response (if applicable to the AUTH type), ++and a final 0 byte. ++.I checkprogram ++invokes ++.I subprogram ++upon successful authentication, which should in turn return 0 to ++.BR qmail-smtpd , ++effectively setting the environment variables RELAYCLIENT and TCPREMOTEINFO ++(any supplied value replaced with the authenticated username). ++.B qmail-smtpd ++will reject the authentication attempt if it receives a nonzero return ++value from ++.I checkprogram ++or ++.IR subprogram . + .SH TRANSPARENCY + .B qmail-smtpd + converts the SMTP newline convention into the UNIX newline convention +@@ -177,3 +204,6 @@ + qmail-newmrh(8), + qmail-queue(8), + qmail-remote(8) ++.SH "HISTORY" ++The patch enabling the ESMTP AUTH option is not part of the standard ++qmail-1.03 distribution. +diff -urP qmail-1.03-vanilla/qmail-smtpd.c qmail-1.03-tls-auth/qmail-smtpd.c +--- qmail-1.03-vanilla/qmail-smtpd.c Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/qmail-smtpd.c Wed Jun 19 16:05:56 2002 +@@ -20,18 +20,75 @@ + #include "now.h" + #include "exit.h" + #include "rcpthosts.h" ++#ifndef TLS + #include "timeoutread.h" + #include "timeoutwrite.h" ++#endif + #include "commands.h" ++#include "wait.h" ++#include "fd.h" + ++#ifdef TLS ++#include <openssl/ssl.h> ++SSL *ssl = NULL; ++ ++stralloc clientcert = {0}; ++stralloc tlsserverciphers = {0}; ++#endif ++ ++#define AUTHCRAM + #define MAXHOPS 100 + unsigned int databytes = 0; + int timeout = 1200; + ++#ifdef TLS ++int flagtimedout = 0; ++void sigalrm() ++{ ++ flagtimedout = 1; ++} ++int ssl_timeoutread(timeout,fd,buf,n) int timeout; int fd; char *buf; int n; ++{ ++ int r; int saveerrno; ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ alarm(timeout); ++ if (ssl) { ++ while(((r = SSL_read(ssl,buf,n)) <= 0) ++ && (SSL_get_error(ssl, r) == SSL_ERROR_WANT_READ)); ++ }else r = read(fd,buf,n); ++ saveerrno = errno; ++ alarm(0); ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ errno = saveerrno; ++ return r; ++} ++ ++ ++int ssl_timeoutwrite(timeout,fd,buf,n) int timeout; int fd; char *buf; int n; ++{ ++ int r; int saveerrno; ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ alarm(timeout); ++ if (ssl) { ++ while(((r = SSL_write(ssl,buf,n)) <= 0) ++ && (SSL_get_error(ssl, r) == SSL_ERROR_WANT_WRITE)); ++ }else r = write(fd,buf,n); ++ saveerrno = errno; ++ alarm(0); ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ errno = saveerrno; ++ return r; ++} ++#endif ++ + int safewrite(fd,buf,len) int fd; char *buf; int len; + { + int r; ++#ifdef TLS ++ r = ssl_timeoutwrite(timeout,fd,buf,len); ++#else + r = timeoutwrite(timeout,fd,buf,len); ++#endif + if (r <= 0) _exit(1); + return r; + } +@@ -51,6 +108,9 @@ + + void err_bmf() { out("553 sorry, your envelope sender is in my badmailfrom list (#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"); } ++#ifdef TLS ++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_syntax() { out("555 syntax error (#5.5.4)\r\n"); } + void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); } +@@ -59,6 +119,15 @@ + void err_vrfy() { out("252 send some mail, i'll try my best\r\n"); } + void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); } + ++int err_child() { out("454 oops, problem with child and I can't auth (#4.3.0)\r\n"); return -1; } ++int err_fork() { out("454 oops, child won't start and I can't auth (#4.3.0)\r\n"); return -1; } ++int err_pipe() { out("454 oops, unable to open pipe and I can't auth (#4.3.0)\r\n"); return -1; } ++int err_write() { out("454 oops, unable to write pipe and I can't auth (#4.3.0)\r\n"); return -1; } ++void err_authd() { out("503 you're already authenticated (#5.5.0)\r\n"); } ++void err_authmail() { out("503 no auth during mail transaction (#5.5.0)\r\n"); } ++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; } + + stralloc greeting = {0}; + +@@ -81,6 +150,9 @@ + char *remoteinfo; + char *local; + char *relayclient; ++#ifdef TLS ++char *tlsciphers; ++#endif + + stralloc helohost = {0}; + char *fakehelo; /* pointer into helohost, or 0 */ +@@ -101,6 +173,9 @@ + { + char *x; + unsigned long u; ++#ifdef TLS ++ char *tlsciphers; ++#endif + + if (control_init() == -1) die_control(); + if (control_rldef(&greeting,"control/smtpgreeting",1,(char *) 0) != 1) +@@ -131,6 +206,17 @@ + if (!remotehost) remotehost = "unknown"; + remoteinfo = env_get("TCPREMOTEINFO"); + relayclient = env_get("RELAYCLIENT"); ++#ifdef TLS ++ if (tlsciphers = env_get("TLSCIPHERS")){ ++ if (!stralloc_copys(&tlsserverciphers,tlsciphers)) die_nomem(); ++ } ++ else { ++ if (control_rldef(&tlsserverciphers,"control/tlsserverciphers",0,"DEFAULT") != 1) ++ die_control(); ++ } ++ if (!stralloc_0(&tlsserverciphers)) die_nomem(); ++#endif ++ + dohelo(remotehost); + } + +@@ -229,7 +315,18 @@ + } + void smtp_ehlo(arg) char *arg; + { +- smtp_greet("250-"); out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n"); ++ 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 ++ out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n"); + seenmail = 0; dohelo(arg); + } + void smtp_rset() +@@ -247,6 +344,12 @@ + if (!stralloc_0(&mailfrom)) die_nomem(); + out("250 ok\r\n"); + } ++#ifdef TLS ++static int verify_cb(int ok, X509_STORE_CTX * ctx) ++{ ++ return (1); ++} ++#endif + void smtp_rcpt(arg) char *arg; { + if (!seenmail) { err_wantmail(); return; } + if (!addrparse(arg)) { err_syntax(); return; } +@@ -257,7 +360,54 @@ + if (!stralloc_0(&addr)) die_nomem(); + } + else ++#ifndef TLS + if (!addrallowed()) { err_nogateway(); return; } ++#else ++ if (!addrallowed()) ++ { ++ if (ssl) ++ { STACK_OF(X509_NAME) *sk; ++ X509 *peercert; ++ stralloc tlsclients = {0}; ++ struct constmap maptlsclients; ++ int r; ++ ++ SSL_set_verify(ssl, ++ SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE, ++ verify_cb); ++ if ((sk = SSL_load_client_CA_file("control/clientca.pem")) == NULL) ++ { err_nogateway(); return; } ++ SSL_set_client_CA_list(ssl, sk); ++ if((control_readfile(&tlsclients,"control/tlsclients",0) != 1) || ++ !constmap_init(&maptlsclients,tlsclients.s,tlsclients.len,0)) ++ { err_nogateway(); return; } ++ ++ SSL_renegotiate(ssl); ++ SSL_do_handshake(ssl); ++ ssl->state = SSL_ST_ACCEPT; ++ SSL_do_handshake(ssl); ++ if ((r = SSL_get_verify_result(ssl)) != X509_V_OK) ++ {out("553 no valid cert for gatewaying: "); ++ out(X509_verify_cert_error_string(r)); ++ out(" (#5.7.1)\r\n"); ++ return; ++ } ++ ++ if (peercert = SSL_get_peer_certificate(ssl)) ++ {char emailAddress[256]; ++ ++ X509_NAME_get_text_by_NID(X509_get_subject_name( ++ SSL_get_peer_certificate(ssl)), ++ NID_pkcs9_emailAddress, emailAddress, 256); if (!stralloc_copys(&clientcert, emailAddress)) die_nomem(); ++ if (!constmap(&maptlsclients,clientcert.s,clientcert.len)) ++ { err_nogwcert(); return; } ++ relayclient = ""; ++ } ++ else { err_nogwcert(); return; } ++ } ++ else { err_nogateway(); return; } ++ } ++#endif + if (!stralloc_cats(&rcptto,"T")) die_nomem(); + if (!stralloc_cats(&rcptto,addr.s)) die_nomem(); + if (!stralloc_0(&rcptto)) die_nomem(); +@@ -269,7 +419,11 @@ + { + int r; + flush(); ++#ifdef TLS ++ r = ssl_timeoutread(timeout,fd,buf,len); ++#else + r = timeoutread(timeout,fd,buf,len); ++#endif + if (r == -1) if (errno == error_timeout) die_alarm(); + if (r <= 0) die_read(); + return r; +@@ -369,6 +523,9 @@ + int hops; + unsigned long qp; + char *qqx; ++#ifdef TLS ++ stralloc protocolinfo = {0}; ++#endif + + if (!seenmail) { err_wantmail(); return; } + if (!rcptto.len) { err_wantrcpt(); return; } +@@ -377,8 +534,20 @@ + if (qmail_open(&qqt) == -1) { err_qqt(); return; } + qp = qmail_qp(&qqt); + out("354 go ahead\r\n"); +- ++#ifdef TLS ++ if(ssl){ ++ if (!stralloc_copys(&protocolinfo, SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)))) die_nomem(); ++ if (!stralloc_catb(&protocolinfo, " encrypted SMTP", 15)) die_nomem(); ++ if (clientcert.len){ ++ if (!stralloc_catb(&protocolinfo," cert ", 6)) die_nomem(); ++ if (!stralloc_catb(&protocolinfo,clientcert.s, clientcert.len)) die_nomem(); ++ } ++ if (!stralloc_0(&protocolinfo)) die_nomem(); ++ } else if (!stralloc_copyb(&protocolinfo,"SMTP",5)) die_nomem(); ++ received(&qqt,protocolinfo.s,local,remoteip,remotehost,remoteinfo,case_diffs(remotehost,helohost.s) ? helohost.s : 0); ++#else + received(&qqt,"SMTP",local,remoteip,remotehost,remoteinfo,fakehelo); ++#endif + blast(&hops); + hops = (hops >= MAXHOPS); + if (hops) qmail_fail(&qqt); +@@ -393,23 +562,299 @@ + out(qqx + 1); + out("\r\n"); + } ++#ifdef TLS ++static RSA *tmp_rsa_cb(ssl,export,keylength) SSL *ssl; int export; int keylength; ++{ ++ RSA* rsa; ++ BIO* in; ++ ++ if (!export || keylength == 512) ++ if (in=BIO_new(BIO_s_file_internal())) ++ if (BIO_read_filename(in,"control/rsa512.pem") > 0) ++ if (rsa=PEM_read_bio_RSAPrivateKey(in,NULL,NULL,NULL)) ++ return rsa; ++ return (RSA_generate_key(export?keylength:512,RSA_F4,NULL,NULL)); ++} ++ ++void smtp_tls(arg) char *arg; ++{ ++ SSL_CTX *ctx; ++ ++ if (*arg) ++ {out("501 Syntax error (no parameters allowed) (#5.5.4)\r\n"); ++ return;} ++ ++ SSL_library_init(); ++ if(!(ctx=SSL_CTX_new(SSLv23_server_method()))) ++ {out("454 TLS not available: unable to initialize ctx (#4.3.0)\r\n"); ++ return;} ++ if(!SSL_CTX_use_RSAPrivateKey_file(ctx, "control/servercert.pem", SSL_FILETYPE_PEM)) ++ {out("454 TLS not available: missing RSA private key (#4.3.0)\r\n"); ++ return;} ++ if(!SSL_CTX_use_certificate_chain_file(ctx, "control/servercert.pem")) ++ {out("454 TLS not available: missing certificate (#4.3.0)\r\n"); ++ return;} ++ SSL_CTX_set_tmp_rsa_callback(ctx, tmp_rsa_cb); ++ SSL_CTX_set_cipher_list(ctx,tlsserverciphers.s); ++ SSL_CTX_load_verify_locations(ctx, "control/clientca.pem",NULL); ++ SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, verify_cb); ++ ++ out("220 ready for tls\r\n"); flush(); ++ ++ if(!(ssl=SSL_new(ctx))) die_read(); ++ SSL_set_fd(ssl,0); ++ if(SSL_accept(ssl)<=0) die_read(); ++ substdio_fdbuf(&ssout,SSL_write,ssl,ssoutbuf,sizeof(ssoutbuf)); ++ ++ remotehost = env_get("TCPREMOTEHOST"); ++ if (!remotehost) remotehost = "unknown"; ++ dohelo(remotehost); ++} ++#endif ++ ++ ++char unique[FMT_ULONG + FMT_ULONG + 3]; ++static stralloc authin = {0}; ++static stralloc user = {0}; ++static stralloc pass = {0}; ++static stralloc resp = {0}; ++static stralloc slop = {0}; ++char *hostname; ++char **childargs; ++substdio ssup; ++char upbuf[128]; ++int authd = 0; ++ ++int authgetl(void) { ++ int i; ++ ++ if (!stralloc_copys(&authin, "")) die_nomem(); ++ ++ for (;;) { ++ if (!stralloc_readyplus(&authin,1)) die_nomem(); /* XXX */ ++ i = substdio_get(&ssin,authin.s + authin.len,1); ++ if (i != 1) die_read(); ++ if (authin.s[authin.len] == '\n') break; ++ ++authin.len; ++ } ++ ++ if (authin.len > 0) if (authin.s[authin.len - 1] == '\r') --authin.len; ++ authin.s[authin.len] = 0; ++ ++ if (*authin.s == '*' && *(authin.s + 1) == 0) { return err_authabrt(); } ++ if (authin.len == 0) { return err_input(); } ++ return authin.len; ++} ++ ++int authenticate(void) ++{ ++ int child; ++ int wstat; ++ int pi[2]; ++ ++ if (!stralloc_0(&user)) die_nomem(); ++ if (!stralloc_0(&pass)) die_nomem(); ++ if (!stralloc_0(&resp)) die_nomem(); ++ ++ if (fd_copy(2,1) == -1) return err_pipe(); ++ close(3); ++ if (pipe(pi) == -1) return err_pipe(); ++ if (pi[0] != 3) return err_pipe(); ++ switch(child = fork()) { ++ case -1: ++ return err_fork(); ++ case 0: ++ close(pi[1]); ++ sig_pipedefault(); ++ execvp(*childargs, childargs); ++ _exit(1); ++ } ++ close(pi[0]); ++ ++ substdio_fdbuf(&ssup,write,pi[1],upbuf,sizeof upbuf); ++ if (substdio_put(&ssup,user.s,user.len) == -1) return err_write(); ++ if (substdio_put(&ssup,pass.s,pass.len) == -1) return err_write(); ++ if (substdio_put(&ssup,resp.s,resp.len) == -1) return err_write(); ++ if (substdio_flush(&ssup) == -1) return err_write(); ++ ++ close(pi[1]); ++ byte_zero(pass.s,pass.len); ++ byte_zero(upbuf,sizeof upbuf); ++ if (wait_pid(&wstat,child) == -1) return err_child(); ++ if (wait_crashed(wstat)) return err_child(); ++ if (wait_exitcode(wstat)) { sleep(5); return 1; } /* no */ ++ return 0; /* yes */ ++} ++ ++int auth_login(arg) char *arg; ++{ ++ int r; ++ ++ if (*arg) { ++ if (r = b64decode(arg,str_len(arg),&user) == 1) return err_input(); ++ } ++ else { ++ out("334 VXNlcm5hbWU6\r\n"); flush(); /* Username: */ ++ if (authgetl() < 0) return -1; ++ if (r = b64decode(authin.s,authin.len,&user) == 1) return err_input(); ++ } ++ if (r == -1) die_nomem(); ++ ++ out("334 UGFzc3dvcmQ6\r\n"); flush(); /* Password: */ ++ ++ if (authgetl() < 0) return -1; ++ if (r = b64decode(authin.s,authin.len,&pass) == 1) return err_input(); ++ if (r == -1) die_nomem(); ++ ++ if (!user.len || !pass.len) return err_input(); ++ return authenticate(); ++} ++ ++int auth_plain(arg) char *arg; ++{ ++ int r, id = 0; ++ ++ if (*arg) { ++ if (r = b64decode(arg,str_len(arg),&slop) == 1) return err_input(); ++ } ++ else { ++ out("334 \r\n"); flush(); ++ if (authgetl() < 0) return -1; ++ if (r = b64decode(authin.s,authin.len,&slop) == 1) return err_input(); ++ } ++ if (r == -1 || !stralloc_0(&slop)) die_nomem(); ++ while (slop.s[id]) id++; /* ignore authorize-id */ ++ ++ if (slop.len > id + 1) ++ if (!stralloc_copys(&user,slop.s + id + 1)) die_nomem(); ++ if (slop.len > id + user.len + 2) ++ if (!stralloc_copys(&pass,slop.s + id + user.len + 2)) die_nomem(); ++ ++ if (!user.len || !pass.len) return err_input(); ++ return authenticate(); ++} ++ ++#ifdef AUTHCRAM ++int auth_cram() ++{ ++ int i, r; ++ char *s; ++ ++ s = unique; ++ s += fmt_uint(s,getpid()); ++ *s++ = '.'; ++ s += fmt_ulong(s,(unsigned long) now()); ++ *s++ = '@'; ++ *s++ = 0; ++ ++ if (!stralloc_copys(&pass,"<")) die_nomem(); ++ if (!stralloc_cats(&pass,unique)) die_nomem(); ++ if (!stralloc_cats(&pass,hostname)) die_nomem(); ++ if (!stralloc_cats(&pass,">")) die_nomem(); ++ if (b64encode(&pass,&slop) < 0) die_nomem(); ++ if (!stralloc_0(&slop)) die_nomem(); ++ ++ out("334 "); ++ out(slop.s); ++ out("\r\n"); ++ flush(); ++ ++ if (authgetl() < 0) return -1; ++ if (r = b64decode(authin.s,authin.len,&slop) == 1) return err_input(); ++ if (r == -1 || !stralloc_0(&slop)) die_nomem(); ++ ++ i = str_chr(slop.s,' '); ++ s = slop.s + i; ++ while (*s == ' ') ++s; ++ slop.s[i] = 0; ++ if (!stralloc_copys(&user,slop.s)) die_nomem(); ++ if (!stralloc_copys(&resp,s)) die_nomem(); ++ ++ if (!user.len || !resp.len) return err_input(); ++ return authenticate(); ++} ++#endif ++ ++struct authcmd { ++ char *text; ++ int (*fun)(); ++} authcmds[] = { ++ { "login", auth_login } ++, { "plain", auth_plain } ++#ifdef AUTHCRAM ++, { "cram-md5", auth_cram } ++#endif ++, { 0, err_noauth } ++}; ++ ++void smtp_auth(arg) ++char *arg; ++{ ++ int i; ++ char *cmd = arg; ++ ++ if (!hostname || !*childargs) ++ { ++ out("503 auth not available (#5.3.3)\r\n"); ++ return; ++ } ++ if (authd) { err_authd(); return; } ++ if (seenmail) { err_authmail(); return; } ++ ++ if (!stralloc_copys(&user,"")) die_nomem(); ++ if (!stralloc_copys(&pass,"")) die_nomem(); ++ if (!stralloc_copys(&resp,"")) die_nomem(); ++ ++ i = str_chr(cmd,' '); ++ arg = cmd + i; ++ while (*arg == ' ') ++arg; ++ cmd[i] = 0; ++ ++ for (i = 0;authcmds[i].text;++i) ++ if (case_equals(authcmds[i].text,cmd)) break; ++ ++ switch (authcmds[i].fun(arg)) { ++ case 0: ++ authd = 1; ++ relayclient = ""; ++ remoteinfo = user.s; ++ if (!env_unset("TCPREMOTEINFO")) die_read(); ++ if (!env_put2("TCPREMOTEINFO",remoteinfo)) die_nomem(); ++ out("235 ok, go ahead (#2.0.0)\r\n"); ++ break; ++ case 1: ++ out("535 authorization failed (#5.7.0)\r\n"); ++ } ++} + + struct commands smtpcommands[] = { + { "rcpt", smtp_rcpt, 0 } + , { "mail", smtp_mail, 0 } + , { "data", smtp_data, flush } ++, { "auth", smtp_auth, flush } + , { "quit", smtp_quit, flush } + , { "helo", smtp_helo, flush } + , { "ehlo", smtp_ehlo, flush } + , { "rset", smtp_rset, 0 } + , { "help", smtp_help, flush } ++#ifdef TLS ++, { "starttls", smtp_tls, flush } ++#endif + , { "noop", err_noop, flush } + , { "vrfy", err_vrfy, flush } + , { 0, err_unimpl, flush } + } ; + +-void main() +-{ ++void main(argc,argv) ++int argc; ++char **argv; ++{ ++ hostname = argv[1]; ++ childargs = argv + 2; ++ ++#ifdef TLS ++ sig_alarmcatch(sigalrm); ++#endif + sig_pipeignore(); + if (chdir(auto_qmail) == -1) die_control(); + setup(); diff --git a/mail-mta/qmail/files/1.03-r8/qmail-control b/mail-mta/qmail/files/1.03-r8/qmail-control new file mode 100644 index 000000000000..aab3cc6a6be9 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r8/qmail-control @@ -0,0 +1,30 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r8/qmail-control,v 1.1 2004/05/30 10:50:14 robbat2 Exp $ + +opts="start stop restart reload" + +start() { + ebegin "Starting qmail mta ..." + svc -u /var/qmail/supervise/* + eend $? + ebegin "Starting qmail mta logging ..." + svc -u /var/qmail/supervise/*/log + eend $? +} + +stop() { + ebegin "Stopping qmail mta ..." + svc -d /var/qmail/supervise/* + eend $? + ebegin "Stopping qmail mta logging ..." + svc -d /var/qmail/supervise/*/log + eend $? +} + +reload() { + ebegin "Reloading 'locals' and 'virtualdomains' control files." + svc -h /var/qmail/supervise/qmail-send + eend $? +} diff --git a/mail-mta/qmail/files/1.03-r8/qmail-linksync.patch b/mail-mta/qmail/files/1.03-r8/qmail-linksync.patch new file mode 100644 index 000000000000..1b35f12aaa1f --- /dev/null +++ b/mail-mta/qmail/files/1.03-r8/qmail-linksync.patch @@ -0,0 +1,54 @@ +--- ../qmail-1.03.orig/qmail-local.c Mon Jun 15 12:53:16 1998 ++++ qmail-local.c Sun Jul 16 16:19:04 2000 +@@ -1,5 +1,6 @@ + #include <sys/types.h> + #include <sys/stat.h> ++#include <fcntl.h> + #include "readwrite.h" + #include "sig.h" + #include "env.h" +@@ -128,6 +129,9 @@ + if (close(fd) == -1) goto fail; /* NFS dorks */ + + if (link(fntmptph,fnnewtph) == -1) goto fail; ++ if ((fd = open(fnnewtph, O_RDONLY)) < 0 || ++ fsync(fd) < 0 || close(fd) < 0) goto fail; ++ + /* if it was error_exist, almost certainly successful; i hate NFS */ + tryunlinktmp(); _exit(0); + +--- ../qmail-1.03.orig/qmail-queue.c Mon Jun 15 12:53:16 1998 ++++ qmail-queue.c Sun Jul 16 16:19:33 2000 +@@ -1,5 +1,6 @@ + #include <sys/types.h> + #include <sys/stat.h> ++#include <fcntl.h> + #include "readwrite.h" + #include "sig.h" + #include "exit.h" +@@ -155,6 +156,7 @@ + { + unsigned int len; + char ch; ++ int fd; + + sig_blocknone(); + umask(033); +@@ -183,7 +185,7 @@ + todofn = fnnum("todo/",0); + intdfn = fnnum("intd/",0); + +- if (link(pidfn,messfn) == -1) die(64); ++ if (link(pidfn,messfn) == -1) die(64); + if (unlink(pidfn) == -1) die(63); + flagmademess = 1; + +@@ -248,6 +250,8 @@ + if (fsync(intdfd) == -1) die_write(); + + if (link(intdfn,todofn) == -1) die(66); ++ if ((fd = open(todofn, O_RDONLY)) < 0 || ++ fsync(fd) < 0 || close(fd) < 0) die(66); + + triggerpull(); + die(0); diff --git a/mail-mta/qmail/files/1.03-r8/qmail-queue.patch b/mail-mta/qmail/files/1.03-r8/qmail-queue.patch new file mode 100644 index 000000000000..4edd5fad86e5 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r8/qmail-queue.patch @@ -0,0 +1,49 @@ +diff -u qmail-1.03-orig/Makefile qmail-1.03/Makefile +--- qmail-1.03-orig/Makefile Mon Jun 15 04:53:16 1998 ++++ Makefile Tue Jan 19 10:52:24 1999 +@@ -1483,12 +1483,12 @@ + trigger.o fmtqfn.o quote.o now.o readsubdir.o qmail.o date822fmt.o \ + datetime.a case.a ndelay.a getln.a wait.a seek.a fd.a sig.a open.a \ + lock.a stralloc.a alloc.a substdio.a error.a str.a fs.a auto_qmail.o \ +-auto_split.o ++auto_split.o env.a + ./load qmail-send qsutil.o control.o constmap.o newfield.o \ + prioq.o trigger.o fmtqfn.o quote.o now.o readsubdir.o \ + qmail.o date822fmt.o datetime.a case.a ndelay.a getln.a \ + wait.a seek.a fd.a sig.a open.a lock.a stralloc.a alloc.a \ +- substdio.a error.a str.a fs.a auto_qmail.o auto_split.o ++ substdio.a error.a str.a fs.a auto_qmail.o auto_split.o env.a + + qmail-send.0: \ + qmail-send.8 +diff -u qmail-1.03-orig/qmail.c qmail-1.03/qmail.c +--- qmail-1.03-orig/qmail.c Mon Jun 15 04:53:16 1998 ++++ qmail.c Tue Jan 19 09:57:36 1999 +@@ -6,14 +6,25 @@ + #include "fd.h" + #include "qmail.h" + #include "auto_qmail.h" ++#include "env.h" + +-static char *binqqargs[2] = { "bin/qmail-queue", 0 } ; ++static char *binqqargs[2] = { 0, 0 } ; ++ ++static void setup_qqargs() ++{ ++ if(!binqqargs[0]) ++ binqqargs[0] = env_get("QMAILQUEUE"); ++ if(!binqqargs[0]) ++ binqqargs[0] = "bin/qmail-queue"; ++} + + int qmail_open(qq) + struct qmail *qq; + { + int pim[2]; + int pie[2]; ++ ++ setup_qqargs(); + + if (pipe(pim) == -1) return -1; + if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; } + diff --git a/mail-mta/qmail/files/1.03-r8/rc b/mail-mta/qmail/files/1.03-r8/rc new file mode 100644 index 000000000000..a7bbdc986766 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r8/rc @@ -0,0 +1,4 @@ +#!/bin/sh + +exec env - PATH="/var/qmail/bin:$PATH" \ + qmail-start "`cat /var/qmail/control/defaultdelivery`" diff --git a/mail-mta/qmail/files/1.03-r8/run-qmailsend b/mail-mta/qmail/files/1.03-r8/run-qmailsend new file mode 100644 index 000000000000..8dbd3adf524f --- /dev/null +++ b/mail-mta/qmail/files/1.03-r8/run-qmailsend @@ -0,0 +1,2 @@ +#!/bin/sh +exec /var/qmail/rc diff --git a/mail-mta/qmail/files/1.03-r8/run-qmailsendlog b/mail-mta/qmail/files/1.03-r8/run-qmailsendlog new file mode 100644 index 000000000000..5ff50d1e7711 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r8/run-qmailsendlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-send diff --git a/mail-mta/qmail/files/1.03-r8/run-qmailsmtpd b/mail-mta/qmail/files/1.03-r8/run-qmailsmtpd new file mode 100644 index 000000000000..9733e11e154a --- /dev/null +++ b/mail-mta/qmail/files/1.03-r8/run-qmailsmtpd @@ -0,0 +1,6 @@ +#!/bin/sh +QMAILDUID=`id -u qmaild` +NOFILESGID=`id -g qmaild` +exec /usr/bin/softlimit -m 8000000 \ + /usr/bin/tcpserver -H -R -v -p -x /etc/tcp.smtp.cdb \ + -u $QMAILDUID -g $NOFILESGID 0 smtp rblsmtpd /var/qmail/bin/qmail-smtpd 2>&1 diff --git a/mail-mta/qmail/files/1.03-r8/run-qmailsmtpdlog b/mail-mta/qmail/files/1.03-r8/run-qmailsmtpdlog new file mode 100644 index 000000000000..2d9546146583 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r8/run-qmailsmtpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-smtpd diff --git a/mail-mta/qmail/files/1.03-r9/defaultdelivery b/mail-mta/qmail/files/1.03-r9/defaultdelivery new file mode 100644 index 000000000000..d0ef7de8b590 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r9/defaultdelivery @@ -0,0 +1,2 @@ +|dot-forward .forward +./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r9/dot_qmail b/mail-mta/qmail/files/1.03-r9/dot_qmail new file mode 100644 index 000000000000..7c9e5d08f067 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r9/dot_qmail @@ -0,0 +1 @@ +./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r9/qmail-1.03-starttls-smtp-auth.patch b/mail-mta/qmail/files/1.03-r9/qmail-1.03-starttls-smtp-auth.patch new file mode 100644 index 000000000000..1a427fb55b62 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r9/qmail-1.03-starttls-smtp-auth.patch @@ -0,0 +1,1408 @@ + +A word of warning: the TLS part of this patch is not type-safe at +at least one point (hey, I didn't write it.) I don't think this +causes problems on i386 architectures, but it made qmail-smtpd +crash frequently on an Alpha. Commenting out the substdio_fdbuf(...); +call in qmail-smtpd appears to fix the issue. + +diff -urP qmail-1.03-vanilla/Makefile qmail-1.03-tls-auth/Makefile +--- qmail-1.03-vanilla/Makefile Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/Makefile Wed Jun 19 16:09:58 2002 +@@ -136,6 +136,10 @@ + compile auto_usera.c + ./compile auto_usera.c + ++base64.o: \ ++compile base64.c base64.h stralloc.h substdio.h str.h ++ ./compile base64.c ++ + binm1: \ + binm1.sh conf-qmail + cat binm1.sh \ +@@ -1446,7 +1450,8 @@ + timeoutwrite.o timeoutconn.o tcpto.o now.o dns.o ip.o \ + ipalloc.o ipme.o quote.o ndelay.a case.a sig.a open.a \ + lock.a seek.a getln.a stralloc.a alloc.a substdio.a error.a \ +- str.a fs.a auto_qmail.o `cat dns.lib` `cat socket.lib` ++ str.a fs.a auto_qmail.o `cat dns.lib` `cat socket.lib` \ ++ -lssl -lcrypto + + qmail-remote.0: \ + qmail-remote.8 +@@ -1536,13 +1541,13 @@ + timeoutwrite.o ip.o ipme.o ipalloc.o control.o constmap.o received.o \ + date822fmt.o now.o qmail.o cdb.a fd.a wait.a datetime.a getln.a \ + open.a sig.a case.a env.a stralloc.a alloc.a substdio.a error.a str.a \ +-fs.a auto_qmail.o socket.lib ++fs.a auto_qmail.o base64.o socket.lib + ./load qmail-smtpd rcpthosts.o commands.o timeoutread.o \ + timeoutwrite.o ip.o ipme.o ipalloc.o control.o constmap.o \ + received.o date822fmt.o now.o qmail.o cdb.a fd.a wait.a \ + datetime.a getln.a open.a sig.a case.a env.a stralloc.a \ +- alloc.a substdio.a error.a str.a fs.a auto_qmail.o `cat \ +- socket.lib` ++ alloc.a substdio.a error.a str.a fs.a auto_qmail.o base64.o `cat \ ++ socket.lib` -lssl -lcrypto + + qmail-smtpd.0: \ + qmail-smtpd.8 +@@ -1553,7 +1558,8 @@ + substdio.h alloc.h auto_qmail.h control.h received.h constmap.h \ + error.h ipme.h ip.h ipalloc.h ip.h gen_alloc.h ip.h qmail.h \ + substdio.h str.h fmt.h scan.h byte.h case.h env.h now.h datetime.h \ +-exit.h rcpthosts.h timeoutread.h timeoutwrite.h commands.h ++exit.h rcpthosts.h timeoutread.h timeoutwrite.h commands.h wait.h \ ++fd.h base64.h + ./compile qmail-smtpd.c + + qmail-start: \ +@@ -2139,3 +2145,23 @@ + wait_pid.o: \ + compile wait_pid.c error.h haswaitp.h + ./compile wait_pid.c ++ ++cert: ++ openssl req -new -x509 -nodes \ ++ -out /var/qmail/control/servercert.pem -days 366 \ ++ -keyout /var/qmail/control/servercert.pem ++ chmod 640 /var/qmail/control/servercert.pem ++ chown qmaild:qmail /var/qmail/control/servercert.pem ++ ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.pem ++ ++cert-req: ++ openssl req -new -nodes \ ++ -out req.pem \ ++ -keyout /var/qmail/control/servercert.pem ++ chmod 640 /var/qmail/control/servercert.pem ++ chown qmaild:qmail /var/qmail/control/servercert.pem ++ ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.pem ++ @echo ++ @echo "Send req.pem to your CA to obtain signed_req.pem, and do:" ++ @echo "cat signed_req.pem >> /var/qmail/control/servercert.pem" ++ +diff -urP qmail-1.03-vanilla/README.auth qmail-1.03-tls-auth/README.auth +--- qmail-1.03-vanilla/README.auth Wed Dec 31 18:00:00 1969 ++++ qmail-1.03-tls-auth/README.auth Wed Jun 19 15:31:37 2002 +@@ -0,0 +1,175 @@ ++*** Warning! Cuidado! Vorsicht! *** ++=================================== ++*** Version 0.30 of the patch changes the arguments which must be ++*** passed to qmail-smtpd. If you are upgrading from a previous ++*** version of the patch, take care to ensure your invocation of ++*** qmail-smtpd uses the correct arguments. Otherwise, your server ++*** may run as an open relay! ++=================================== ++*** Warning! Cuidado! Vorsicht! *** ++ ++ ++This patch adds ESMTP AUTH authentication protocol support to ++qmail-1.03. It's originally based on Mrs. Brisby's smtp-auth patch ++with many enhancements from Krzysztof Dabrowski <brush@elysium.pl>. ++ ++Beginning with version 0.30, the patch was completely rewritten to ++use only djb's string functions by Eric M. Johnston <emj@postal.net>. ++ ++You can always get the newest version from: ++http://members.elysium.pl/brush/qmail-smtpd-auth/ ++ ++To use all of it's functionality you will also have to obtain and ++install Krzysztof's cmd5checkpw utility available at: ++http://members.elysium.pl/brush/cmd5checkpw/ ++ ++If you need more information about SMTP-AUTH itself and the ++client/server support and configuration, visit: ++http://members.elysium.pl/brush/smtp-auth/ ++ ++--- ++ ++Detailed patch information: ++ ++This patch adds the ESMTP AUTH option to qmail-1.03, allowing the ++LOGIN, PLAIN, and CRAM-MD5 AUTH types. An appropriate checkpassword ++tool is necessary to support the authentication. See ++http://cr.yp.to/checkpwd.html for more information on the interface. ++Note that the checkpassword tool should support all of the AUTH types ++advertised by qmail-smtpd. ++ ++As reflected in the modified qmail-smtpd(8) man page, qmail-smtpd ++must be invoked with three arguments: hostname, checkprogram, and ++subprogram. If these arguments are missing, qmail-smtpd will still ++advertise availability of AUTH, but will fail with a permanent error ++when AUTH is used. ++ ++hostname is simply used to form the CRAM-MD5 challenge. qmail-smtpd ++invokes checkprogram, feeding it the username and password, in the ++case of LOGIN or PLAIN, or the username, challenge, and response, in ++the case of CRAM-MD5. If the user is permitted, checkprogram invokes ++subprogram, which just has to exit with a status of 0 for the user to ++be authenticated. Otherwise, checkprogram exits with a non-zero ++status. subprogram can usually be /usr/bin/true (or /bin/true, ++depending on your flavor of OS). ++ ++If the user is successfully authenticated, the RELAYCLIENT ++environment variable is effectively set for the SMTP session, and ++the TCPREMOTEINFO environment variable is set to the authenticated ++username, overriding any value that tcpserver may have set. The ++value of TCPREMOTEINFO is reflected in a Received header. ++ ++ ++How to install it: ++ ++Simply patch your qmail-1.03 distribution with the included patch ++file and recompile & install like usual. ++ ++The steps to do this are as follows (assuming your virgin ++qmail-1.03 install is in "../qmail-1.03"): ++ ++ cp README.auth base64.c base64.h ../qmail-1.03 ++ patch -d ../qmail-1.03 < auth.patch ++ ++Install qmail normally, with the exception of the new arguments ++to qmail-smtpd described elsewhere in this file. ++ ++Also obtain, unpack, compile and install the cmd5checkpw utility ++(or some other checkpassword utility) and add a sample account to ++/etc/poppasswd file. This file must be readable by the qmail-smtpd ++user, usually qmaild. ++ ++ ++How to use it: ++ ++*** Warning: In version 0.30 the arguments have changed from ++*** previous versions of qmail-smtpd-auth. Take care to make sure ++*** you update your startup scripts if updating! ++ ++If you're running qmail-smtpd from inetd, you'll want to do the ++following: ++ ++smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env tcp-env \ ++/var/qmail/bin/qmail-smtpd mail.acme.com /bin/cmd5checkpw /bin/true ++ ++Replace mail.acme.com with your hostname. The second argument to ++qmail-smtpd is your checkpassword utility (preferably cmd5checkpw ++or some alternative that can handle CRAM-MD5). The third argument ++is the executable that the checkpassword utility execs when ++authentication is successful. (Note that the location of "true" ++is OS dependent: you may need /usr/bin/true.) ++ ++Invocations using tcpserver will require analagous changes. Give ++your inetd a kill -HUP or restart tcpserver and away you go. ++ ++ ++Caveats: ++ ++Please note that as authentication needs vary wildly across ++installations, no effort has been made to make this patch work ``out ++of the box.'' You'll have to procure or develop your own ++checkpassword program. Also note that CRAM-MD5 will require you to ++keep plaintext passwords. You'll probably want to disable this AUTH ++type if you're just using /etc/passwd (keeping in mind that PLAIN and ++LOGIN aren't quite as safe over the wire) -- just undefine AUTHCRAM ++in qmail-smtpd. ++ ++Krzysztof Dabrowski's cmd5checkpw tool used as an example in this ++document supports the three AUTH types included in this patch. ++It's available at http://www.elysium.pl/members/brush/cmd5checkpw/. ++ ++This patch has been generated against the stock qmail 1.03 ++distribution. The results of combining this patch with others are ++unknown. ++ ++ ++Features: ++ ++This patch supports the following auth methods: LOGIN, PLAIN and ++CRAM-MD5. ++ ++ ++Compatibility: ++ ++The following MUA's are confirmed to work with this patch: ++ ++Eudora 4.2.2 - CRAM-MD5 ++Eudora 5.0.2 - CRAM-MD5 ++The Bat 1.39 - LOGIN & CRAM-MD5 ++Outlook Express 4 - LOGIN ++Outlook Express 5 - LOGIN ++Outlook 2000 - LOGIN ++Netscape 4.x - LOGIN & PLAIN ++Netscape 4.0x - LOGIN ++Pegasus Mail 3.1x - CRAM-MD5 ++ ++ ++Various compatibility issues: ++ ++Testing with Pegasus Mail 3.1 revealed that it requires the new style ++(RFC recommended) greeting message. Both styles are now enabled to ++maintain the highest degree of compatibility with various clients. ++This fix was suggested by David Harris <David.Harris@pmail.gen.nz>, ++the developer of Pegasus Mail. ++ ++ ++Acknowledgments: ++ ++This patch is based on work by Krzysztof Dabrowski at ++http://members.elysium.pl/brush/qmail-smtpd-auth/ and ``Mrs. Brisby'' ++at http://www.nimh.org/hacks/qmail-smtpd.c which has been further ++developed by Eric M. Johnston <emj@postal.net>. ++ ++--- ++ ++THIS SOFTWARE IS IN THE PUBLIC DOMAIN, IS PROVIDED BY THE AUTHOR ++``AS IS,'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE ++LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR ++BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ++WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE ++OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ++EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +diff -urP qmail-1.03-vanilla/TARGETS qmail-1.03-tls-auth/TARGETS +--- qmail-1.03-vanilla/TARGETS Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/TARGETS Wed Jun 19 15:30:20 2002 +@@ -250,6 +250,7 @@ + qmail-qmtpd.o + rcpthosts.o + qmail-qmtpd ++base64.o + qmail-smtpd.o + qmail-smtpd + sendmail.o +diff -urP qmail-1.03-vanilla/base64.c qmail-1.03-tls-auth/base64.c +--- qmail-1.03-vanilla/base64.c Wed Dec 31 18:00:00 1969 ++++ qmail-1.03-tls-auth/base64.c Wed Jun 19 15:29:53 2002 +@@ -0,0 +1,90 @@ ++#include "base64.h" ++#include "stralloc.h" ++#include "substdio.h" ++#include "str.h" ++ ++static char *b64alpha = ++ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; ++#define B64PAD '=' ++ ++/* returns 0 ok, 1 illegal, -1 problem */ ++ ++int b64decode(in,l,out) ++const unsigned char *in; ++int l; ++stralloc *out; /* not null terminated */ ++{ ++ int i, j; ++ unsigned char a[4]; ++ unsigned char b[3]; ++ char *s; ++ ++ if (l == 0) ++ { ++ if (!stralloc_copys(out,"")) return -1; ++ return 0; ++ } ++ ++ if (!stralloc_ready(out,l + 2)) return -1; /* XXX generous */ ++ s = out->s; ++ ++ for (i = 0;i < l;i += 4) { ++ for (j = 0;j < 4;j++) ++ if ((i + j) < l && in[i + j] != B64PAD) ++ { ++ a[j] = str_chr(b64alpha,in[i + j]); ++ if (a[j] > 63) return 1; ++ } ++ else a[j] = 0; ++ ++ b[0] = (a[0] << 2) | (a[1] >> 4); ++ b[1] = (a[1] << 4) | (a[2] >> 2); ++ b[2] = (a[2] << 6) | (a[3]); ++ ++ *s++ = b[0]; ++ ++ if (in[i + 1] == B64PAD) break; ++ *s++ = b[1]; ++ ++ if (in[i + 2] == B64PAD) break; ++ *s++ = b[2]; ++ } ++ out->len = s - out->s; ++ while (out->len && !out->s[out->len - 1]) --out->len; /* XXX avoid? */ ++ return 0; ++} ++ ++int b64encode(in,out) ++stralloc *in; ++stralloc *out; /* not null terminated */ ++{ ++ unsigned char a, b, c; ++ int i; ++ char *s; ++ ++ if (in->len == 0) ++ { ++ if (!stralloc_copys(out,"")) return -1; ++ return 0; ++ } ++ ++ if (!stralloc_ready(out,in->len / 3 * 4 + 4)) return -1; ++ s = out->s; ++ ++ for (i = 0;i < in->len;i += 3) { ++ a = in->s[i]; ++ b = i + 1 < in->len ? in->s[i + 1] : 0; ++ c = i + 2 < in->len ? in->s[i + 2] : 0; ++ ++ *s++ = b64alpha[a >> 2]; ++ *s++ = b64alpha[((a & 3 ) << 4) | (b >> 4)]; ++ ++ if (i + 1 >= in->len) *s++ = B64PAD; ++ else *s++ = b64alpha[((b & 15) << 2) | (c >> 6)]; ++ ++ if (i + 2 >= in->len) *s++ = B64PAD; ++ else *s++ = b64alpha[c & 63]; ++ } ++ out->len = s - out->s; ++ return 0; ++} +diff -urP qmail-1.03-vanilla/base64.h qmail-1.03-tls-auth/base64.h +--- qmail-1.03-vanilla/base64.h Wed Dec 31 18:00:00 1969 ++++ qmail-1.03-tls-auth/base64.h Wed Jun 19 15:29:53 2002 +@@ -0,0 +1,7 @@ ++#ifndef BASE64_H ++#define BASE64_H ++ ++extern int b64decode(); ++extern int b64encode(); ++ ++#endif +diff -urP qmail-1.03-vanilla/conf-cc qmail-1.03-tls-auth/conf-cc +--- qmail-1.03-vanilla/conf-cc Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/conf-cc Wed Jun 19 15:35:59 2002 +@@ -1,3 +1,3 @@ +-cc -O2 ++cc -O2 -DTLS -I/usr/local/ssl/include + + This will be used to compile .c files. +diff -urP qmail-1.03-vanilla/dns.c qmail-1.03-tls-auth/dns.c +--- qmail-1.03-vanilla/dns.c Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/dns.c Wed Jun 19 15:36:06 2002 +@@ -270,6 +270,14 @@ + { + int r; + struct ip_mx ix; ++#ifdef TLS ++ stralloc fqdn = {0}; ++ ++ if (!stralloc_copy(&fqdn,sa)) return DNS_MEM; ++ if (!stralloc_0(&fqdn)) return DNS_MEM; ++ ix.fqdn = fqdn.s; ++ alloc_free(fqdn); ++#endif + + if (!stralloc_copy(&glue,sa)) return DNS_MEM; + if (!stralloc_0(&glue)) return DNS_MEM; +@@ -330,6 +338,9 @@ + ix.pref = 0; + if (!glue.s[ip_scan(glue.s,&ix.ip)] || !glue.s[ip_scanbracket(glue.s,&ix.ip)]) + { ++#ifdef TLS ++ ix.fqdn = NULL; ++#endif + if (!ipalloc_append(ia,&ix)) return DNS_MEM; + return 0; + } +diff -urP qmail-1.03-vanilla/ipalloc.h qmail-1.03-tls-auth/ipalloc.h +--- qmail-1.03-vanilla/ipalloc.h Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/ipalloc.h Wed Jun 19 15:36:15 2002 +@@ -3,7 +3,12 @@ + + #include "ip.h" + ++#ifdef TLS ++#include "stralloc.h" ++struct ip_mx { struct ip_address ip; int pref; char *fqdn; } ; ++#else + struct ip_mx { struct ip_address ip; int pref; } ; ++#endif + + #include "gen_alloc.h" + +diff -urP qmail-1.03-vanilla/qmail-remote.c qmail-1.03-tls-auth/qmail-remote.c +--- qmail-1.03-vanilla/qmail-remote.c Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/qmail-remote.c Wed Jun 19 15:36:38 2002 +@@ -26,8 +26,18 @@ + #include "tcpto.h" + #include "readwrite.h" + #include "timeoutconn.h" ++#ifndef TLS + #include "timeoutread.h" + #include "timeoutwrite.h" ++#endif ++ ++#ifdef TLS ++#include <sys/stat.h> ++#include <openssl/ssl.h> ++SSL *ssl = NULL; ++ ++stralloc tlsclientciphers = {0}; ++#endif + + #define HUGESMTPTEXT 5000 + +@@ -107,17 +117,94 @@ + int smtpfd; + int timeout = 1200; + ++#ifdef TLS ++int flagtimedout = 0; ++void sigalrm() ++{ ++ flagtimedout = 1; ++} ++ ++int ssl_timeoutread(timeout,fd,buf,n) int timeout; int fd; char *buf; int n; ++{ ++ int r; int saveerrno; ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ alarm(timeout); ++ if (ssl) { ++ while(((r = SSL_read(ssl,buf,n)) <= 0) ++ && (SSL_get_error(ssl, r) == SSL_ERROR_WANT_READ)); ++ if (SSL_get_error(ssl, r) != SSL_ERROR_NONE) ++ {char buf[1024]; ++ ++ out("ZTLS connection to "); outhost(); out(" died: "); ++ SSL_load_error_strings(); ++ out(ERR_error_string(ERR_get_error(), buf)); out("\n"); ++ SSL_shutdown(ssl); ++ zerodie(); ++ } ++ }else r = read(fd,buf,n); ++ saveerrno = errno; ++ alarm(0); ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ errno = saveerrno; ++ return r; ++} ++ ++int ssl_timeoutwrite(timeout,fd,buf,n) int timeout; int fd; char *buf; int n; ++{ ++ int r; int saveerrno; ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ alarm(timeout); ++ if (ssl) { ++ while(((r = SSL_write(ssl,buf,n)) <= 0) ++ && (SSL_get_error(ssl, r) == SSL_ERROR_WANT_WRITE)); ++ if (SSL_get_error(ssl, r) != SSL_ERROR_NONE) ++ {char buf[1024]; ++ ++ out("ZTLS connection to "); outhost(); out(" died: "); ++ SSL_load_error_strings(); ++ out(ERR_error_string(ERR_get_error(), buf)); out("\n"); ++ SSL_shutdown(ssl); ++ zerodie(); ++ } ++ }else r = write(fd,buf,n); ++ saveerrno = errno; ++ alarm(0); ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ errno = saveerrno; ++ return r; ++} ++ ++static int client_cert_cb(SSL *s,X509 **x509, EVP_PKEY **pkey) ++{ ++ out("ZTLS found no client cert in control/clientcert.pem\n"); ++ zerodie(NULL,NULL); ++} ++ ++static int verify_cb(int ok, X509_STORE_CTX * ctx) ++{ ++ return (1); ++} ++#endif ++ + int saferead(fd,buf,len) int fd; char *buf; int len; + { + int r; ++#ifdef TLS ++ r = ssl_timeoutread(timeout,smtpfd,buf,len); ++#else + r = timeoutread(timeout,smtpfd,buf,len); ++#endif + if (r <= 0) dropped(); + return r; + } + int safewrite(fd,buf,len) int fd; char *buf; int len; + { + int r; ++#ifdef TLS ++ r = ssl_timeoutwrite(timeout,smtpfd,buf,len); ++#else + r = timeoutwrite(timeout,smtpfd,buf,len); ++#endif + if (r <= 0) dropped(); + return r; + } +@@ -186,6 +273,34 @@ + out(append); + out(".\n"); + outsmtptext(); ++ ++/* TAG */ ++#if defined(TLS) && defined(DEBUG) ++#define ONELINE_NAME(X) X509_NAME_oneline(X,NULL,0) ++ ++ if(ssl){ ++ X509 *peer; ++ ++ out("STARTTLS proto="); out(SSL_get_version(ssl)); ++ out("; cipher="); out(SSL_CIPHER_get_name(SSL_get_current_cipher(ssl))); ++ ++ /* we want certificate details */ ++ peer=SSL_get_peer_certificate(ssl); ++ if (peer != NULL) { ++ char *str; ++ ++ str=ONELINE_NAME(X509_get_subject_name(peer)); ++ out("; subject="); out(str); ++ OPENSSL_free(str); ++ str=ONELINE_NAME(X509_get_issuer_name(peer)); ++ out("; issuer="); out(str); ++ OPENSSL_free(str); ++ X509_free(peer); ++ } ++ out(";\n"); ++ } ++#endif ++ + zerodie(); + } + +@@ -216,20 +331,158 @@ + + stralloc recip = {0}; + ++#ifdef TLS ++void smtp(fqdn) ++char *fqdn; ++#else + void smtp() ++#endif + { + unsigned long code; + int flagbother; + int i; +- ++#ifdef TLS ++ int needtlsauth = 0; ++ SSL_CTX *ctx; ++ int saveerrno, r; ++ ++ stralloc servercert = {0}; ++ struct stat st; ++ if(fqdn){ ++ if(!stralloc_copys(&servercert, "control/tlshosts/")) temp_nomem(); ++ if(!stralloc_catb(&servercert, fqdn, str_len(fqdn))) temp_nomem(); ++ if(!stralloc_catb(&servercert, ".pem", 4)) temp_nomem(); ++ if(!stralloc_0(&servercert)) temp_nomem(); ++ if (stat(servercert.s,&st) == 0) needtlsauth = 1; ++ } ++#endif ++ + if (smtpcode() != 220) quit("ZConnected to "," but greeting failed"); + ++#ifdef TLS ++ substdio_puts(&smtpto,"EHLO "); ++#else + substdio_puts(&smtpto,"HELO "); ++#endif + substdio_put(&smtpto,helohost.s,helohost.len); + substdio_puts(&smtpto,"\r\n"); + substdio_flush(&smtpto); ++#ifdef TLS ++ if (smtpcode() != 250){ ++ substdio_puts(&smtpto,"HELO "); ++ 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"); ++ } ++#else + if (smtpcode() != 250) quit("ZConnected to "," but my name was rejected"); +- ++#endif ++ ++#ifdef TLS ++ i = 0; ++ while((i += str_chr(smtptext.s+i,'\n') + 1) && (i+12 < smtptext.len) && ++ str_diffn(smtptext.s+i+4,"STARTTLS\n",9)); ++ if (i+12 < smtptext.len) ++ { ++ substdio_puts(&smtpto,"STARTTLS\r\n"); ++ substdio_flush(&smtpto); ++ if (smtpcode() == 220) ++ { ++ SSL_library_init(); ++ if(!(ctx=SSL_CTX_new(SSLv23_client_method()))) ++ {char buf[1024]; ++ ++ out("ZTLS not available: error initializing ctx: "); ++ SSL_load_error_strings(); ++ out(ERR_error_string(ERR_get_error(), buf)); ++ out("\n"); ++ SSL_shutdown(ssl); ++ zerodie(); ++ } ++ if((stat("control/clientcert.pem", &st) == 0) && ++ ((SSL_CTX_use_RSAPrivateKey_file(ctx, "control/clientcert.pem", SSL_FILETYPE_PEM) <= 0) || ++ (SSL_CTX_use_certificate_chain_file(ctx, "control/clientcert.pem") <= 0) || ++ (SSL_CTX_check_private_key(ctx) <= 0))) ++ /* if there is a cert and it is bad, I fail ++ if there is no cert, I leave it to the other side to complain */ ++ SSL_CTX_set_client_cert_cb(ctx, client_cert_cb); ++ ++ /*SSL_CTX_set_options(ctx, SSL_OP_NO_TLSv1);*/ ++ SSL_CTX_set_cipher_list(ctx,tlsclientciphers.s); ++ ++ if (needtlsauth){ ++ if (!SSL_CTX_load_verify_locations(ctx, servercert.s, NULL)) ++ {out("ZTLS unable to load "); out(servercert.s); out("\n"); ++ zerodie();} ++ SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, verify_cb); ++ } ++ ++ if(!(ssl=SSL_new(ctx))) ++ {char buf[1024]; ++ ++ out("ZTLS not available: error initializing ssl: "); ++ SSL_load_error_strings(); ++ out(ERR_error_string(ERR_get_error(), buf)); ++ out("\n"); ++ SSL_shutdown(ssl); ++ zerodie(); ++ } ++ SSL_set_fd(ssl,smtpfd); ++ ++ alarm(timeout); ++ r = SSL_connect(ssl); saveerrno = errno; ++ alarm(0); ++ if (flagtimedout) ++ {out("ZTLS not available: connect timed out\n"); ++ zerodie();} ++ errno = saveerrno; ++ if (r<=0) ++ {char buf[1024]; ++ ++ out("ZTLS not available: connect failed: "); ++ SSL_load_error_strings(); ++ out(ERR_error_string(ERR_get_error(), buf)); ++ out("\n"); ++ SSL_shutdown(ssl); ++ zerodie(); ++ } ++ if (needtlsauth) ++ /* should also check alternate names */ ++ {char commonName[256]; ++ ++ if ((r=SSL_get_verify_result(ssl)) != X509_V_OK) ++ {out("ZTLS unable to verify server with "); ++ out(servercert.s); out(": "); ++ out(X509_verify_cert_error_string(r)); out("\n"); ++ zerodie(); ++ } ++ X509_NAME_get_text_by_NID(X509_get_subject_name( ++ SSL_get_peer_certificate(ssl)), ++ NID_commonName, commonName, 256); ++ if (strcasecmp(fqdn,commonName)){ ++ out("ZTLS connection to "); out(fqdn); ++ out(" wanted, certificate for "); out(commonName); ++ out(" received\n"); ++ zerodie();} ++ } ++ ++ substdio_puts(&smtpto,"EHLO "); ++ substdio_put(&smtpto,helohost.s,helohost.len); ++ substdio_puts(&smtpto,"\r\n"); ++ substdio_flush(&smtpto); ++ ++ if (smtpcode() != 250) ++ { ++ quit("ZTLS connected to "," but my name was rejected"); ++ } ++ } ++ } ++ if ((!ssl) && needtlsauth) ++ {out("ZNo TLS achieved while "); out(servercert.s); out(" exists.\n"); ++ quit();} ++#endif ++ + substdio_puts(&smtpto,"MAIL FROM:<"); + substdio_put(&smtpto,sender.s,sender.len); + substdio_puts(&smtpto,">\r\n"); +@@ -324,6 +577,11 @@ + case 1: + if (!constmap_init(&maproutes,routes.s,routes.len,1)) temp_nomem(); break; + } ++#ifdef TLS ++ if (control_rldef(&tlsclientciphers,"control/tlsclientciphers",0,"DEFAULT") != 1) ++ temp_control(); ++ if(!stralloc_0(&tlsclientciphers)) temp_nomem(); ++#endif + } + + void main(argc,argv) +@@ -338,7 +596,10 @@ + int flagallaliases; + int flagalias; + char *relayhost; +- ++ ++#ifdef TLS ++ sig_alarmcatch(sigalrm); ++#endif + sig_pipeignore(); + if (argc < 4) perm_usage(); + if (chdir(auto_qmail) == -1) temp_chdir(); +@@ -417,7 +678,11 @@ + if (timeoutconn(smtpfd,&ip.ix[i].ip,(unsigned int) port,timeoutconnect) == 0) { + tcpto_err(&ip.ix[i].ip,0); + partner = ip.ix[i].ip; ++#ifdef TLS ++ smtp(ip.ix[i].fqdn); /* does not return */ ++#else + smtp(); /* does not return */ ++#endif + } + tcpto_err(&ip.ix[i].ip,errno == error_timeout); + close(smtpfd); +diff -urP qmail-1.03-vanilla/qmail-smtpd.8 qmail-1.03-tls-auth/qmail-smtpd.8 +--- qmail-1.03-vanilla/qmail-smtpd.8 Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/qmail-smtpd.8 Wed Jun 19 15:30:20 2002 +@@ -3,6 +3,11 @@ + qmail-smtpd \- receive mail via SMTP + .SH SYNOPSIS + .B qmail-smtpd ++[ ++.I hostname ++.I checkprogram ++.I subprogram ++] + .SH DESCRIPTION + .B qmail-smtpd + receives mail messages via the Simple Mail Transfer Protocol (SMTP) +@@ -23,7 +28,29 @@ + header fields. + + .B qmail-smtpd +-supports ESMTP, including the 8BITMIME and PIPELINING options. ++supports ESMTP, including the 8BITMIME, PIPELINING, and AUTH options. ++ ++.B qmail-smtpd ++can accept LOGIN, PLAIN, and CRAM-MD5 AUTH types. It invokes ++.IR checkprogram , ++which reads on file descriptor 3 the username, a 0 byte, the password ++or challenge derived from ++.IR hostname , ++another 0 byte, a CRAM-MD5 response (if applicable to the AUTH type), ++and a final 0 byte. ++.I checkprogram ++invokes ++.I subprogram ++upon successful authentication, which should in turn return 0 to ++.BR qmail-smtpd , ++effectively setting the environment variables RELAYCLIENT and TCPREMOTEINFO ++(any supplied value replaced with the authenticated username). ++.B qmail-smtpd ++will reject the authentication attempt if it receives a nonzero return ++value from ++.I checkprogram ++or ++.IR subprogram . + .SH TRANSPARENCY + .B qmail-smtpd + converts the SMTP newline convention into the UNIX newline convention +@@ -177,3 +204,6 @@ + qmail-newmrh(8), + qmail-queue(8), + qmail-remote(8) ++.SH "HISTORY" ++The patch enabling the ESMTP AUTH option is not part of the standard ++qmail-1.03 distribution. +diff -urP qmail-1.03-vanilla/qmail-smtpd.c qmail-1.03-tls-auth/qmail-smtpd.c +--- qmail-1.03-vanilla/qmail-smtpd.c Mon Jun 15 05:53:16 1998 ++++ qmail-1.03-tls-auth/qmail-smtpd.c Wed Jun 19 16:05:56 2002 +@@ -20,18 +20,75 @@ + #include "now.h" + #include "exit.h" + #include "rcpthosts.h" ++#ifndef TLS + #include "timeoutread.h" + #include "timeoutwrite.h" ++#endif + #include "commands.h" ++#include "wait.h" ++#include "fd.h" + ++#ifdef TLS ++#include <openssl/ssl.h> ++SSL *ssl = NULL; ++ ++stralloc clientcert = {0}; ++stralloc tlsserverciphers = {0}; ++#endif ++ ++#define AUTHCRAM + #define MAXHOPS 100 + unsigned int databytes = 0; + int timeout = 1200; + ++#ifdef TLS ++int flagtimedout = 0; ++void sigalrm() ++{ ++ flagtimedout = 1; ++} ++int ssl_timeoutread(timeout,fd,buf,n) int timeout; int fd; char *buf; int n; ++{ ++ int r; int saveerrno; ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ alarm(timeout); ++ if (ssl) { ++ while(((r = SSL_read(ssl,buf,n)) <= 0) ++ && (SSL_get_error(ssl, r) == SSL_ERROR_WANT_READ)); ++ }else r = read(fd,buf,n); ++ saveerrno = errno; ++ alarm(0); ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ errno = saveerrno; ++ return r; ++} ++ ++ ++int ssl_timeoutwrite(timeout,fd,buf,n) int timeout; int fd; char *buf; int n; ++{ ++ int r; int saveerrno; ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ alarm(timeout); ++ if (ssl) { ++ while(((r = SSL_write(ssl,buf,n)) <= 0) ++ && (SSL_get_error(ssl, r) == SSL_ERROR_WANT_WRITE)); ++ }else r = write(fd,buf,n); ++ saveerrno = errno; ++ alarm(0); ++ if (flagtimedout) { errno = error_timeout; return -1; } ++ errno = saveerrno; ++ return r; ++} ++#endif ++ + int safewrite(fd,buf,len) int fd; char *buf; int len; + { + int r; ++#ifdef TLS ++ r = ssl_timeoutwrite(timeout,fd,buf,len); ++#else + r = timeoutwrite(timeout,fd,buf,len); ++#endif + if (r <= 0) _exit(1); + return r; + } +@@ -51,6 +108,9 @@ + + void err_bmf() { out("553 sorry, your envelope sender is in my badmailfrom list (#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"); } ++#ifdef TLS ++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_syntax() { out("555 syntax error (#5.5.4)\r\n"); } + void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); } +@@ -59,6 +119,15 @@ + void err_vrfy() { out("252 send some mail, i'll try my best\r\n"); } + void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); } + ++int err_child() { out("454 oops, problem with child and I can't auth (#4.3.0)\r\n"); return -1; } ++int err_fork() { out("454 oops, child won't start and I can't auth (#4.3.0)\r\n"); return -1; } ++int err_pipe() { out("454 oops, unable to open pipe and I can't auth (#4.3.0)\r\n"); return -1; } ++int err_write() { out("454 oops, unable to write pipe and I can't auth (#4.3.0)\r\n"); return -1; } ++void err_authd() { out("503 you're already authenticated (#5.5.0)\r\n"); } ++void err_authmail() { out("503 no auth during mail transaction (#5.5.0)\r\n"); } ++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; } + + stralloc greeting = {0}; + +@@ -81,6 +150,9 @@ + char *remoteinfo; + char *local; + char *relayclient; ++#ifdef TLS ++char *tlsciphers; ++#endif + + stralloc helohost = {0}; + char *fakehelo; /* pointer into helohost, or 0 */ +@@ -101,6 +173,9 @@ + { + char *x; + unsigned long u; ++#ifdef TLS ++ char *tlsciphers; ++#endif + + if (control_init() == -1) die_control(); + if (control_rldef(&greeting,"control/smtpgreeting",1,(char *) 0) != 1) +@@ -131,6 +206,17 @@ + if (!remotehost) remotehost = "unknown"; + remoteinfo = env_get("TCPREMOTEINFO"); + relayclient = env_get("RELAYCLIENT"); ++#ifdef TLS ++ if (tlsciphers = env_get("TLSCIPHERS")){ ++ if (!stralloc_copys(&tlsserverciphers,tlsciphers)) die_nomem(); ++ } ++ else { ++ if (control_rldef(&tlsserverciphers,"control/tlsserverciphers",0,"DEFAULT") != 1) ++ die_control(); ++ } ++ if (!stralloc_0(&tlsserverciphers)) die_nomem(); ++#endif ++ + dohelo(remotehost); + } + +@@ -229,7 +315,18 @@ + } + void smtp_ehlo(arg) char *arg; + { +- smtp_greet("250-"); out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n"); ++ 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 ++ out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n"); + seenmail = 0; dohelo(arg); + } + void smtp_rset() +@@ -247,6 +344,12 @@ + if (!stralloc_0(&mailfrom)) die_nomem(); + out("250 ok\r\n"); + } ++#ifdef TLS ++static int verify_cb(int ok, X509_STORE_CTX * ctx) ++{ ++ return (1); ++} ++#endif + void smtp_rcpt(arg) char *arg; { + if (!seenmail) { err_wantmail(); return; } + if (!addrparse(arg)) { err_syntax(); return; } +@@ -257,7 +360,54 @@ + if (!stralloc_0(&addr)) die_nomem(); + } + else ++#ifndef TLS + if (!addrallowed()) { err_nogateway(); return; } ++#else ++ if (!addrallowed()) ++ { ++ if (ssl) ++ { STACK_OF(X509_NAME) *sk; ++ X509 *peercert; ++ stralloc tlsclients = {0}; ++ struct constmap maptlsclients; ++ int r; ++ ++ SSL_set_verify(ssl, ++ SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE, ++ verify_cb); ++ if ((sk = SSL_load_client_CA_file("control/clientca.pem")) == NULL) ++ { err_nogateway(); return; } ++ SSL_set_client_CA_list(ssl, sk); ++ if((control_readfile(&tlsclients,"control/tlsclients",0) != 1) || ++ !constmap_init(&maptlsclients,tlsclients.s,tlsclients.len,0)) ++ { err_nogateway(); return; } ++ ++ SSL_renegotiate(ssl); ++ SSL_do_handshake(ssl); ++ ssl->state = SSL_ST_ACCEPT; ++ SSL_do_handshake(ssl); ++ if ((r = SSL_get_verify_result(ssl)) != X509_V_OK) ++ {out("553 no valid cert for gatewaying: "); ++ out(X509_verify_cert_error_string(r)); ++ out(" (#5.7.1)\r\n"); ++ return; ++ } ++ ++ if (peercert = SSL_get_peer_certificate(ssl)) ++ {char emailAddress[256]; ++ ++ X509_NAME_get_text_by_NID(X509_get_subject_name( ++ SSL_get_peer_certificate(ssl)), ++ NID_pkcs9_emailAddress, emailAddress, 256); if (!stralloc_copys(&clientcert, emailAddress)) die_nomem(); ++ if (!constmap(&maptlsclients,clientcert.s,clientcert.len)) ++ { err_nogwcert(); return; } ++ relayclient = ""; ++ } ++ else { err_nogwcert(); return; } ++ } ++ else { err_nogateway(); return; } ++ } ++#endif + if (!stralloc_cats(&rcptto,"T")) die_nomem(); + if (!stralloc_cats(&rcptto,addr.s)) die_nomem(); + if (!stralloc_0(&rcptto)) die_nomem(); +@@ -269,7 +419,11 @@ + { + int r; + flush(); ++#ifdef TLS ++ r = ssl_timeoutread(timeout,fd,buf,len); ++#else + r = timeoutread(timeout,fd,buf,len); ++#endif + if (r == -1) if (errno == error_timeout) die_alarm(); + if (r <= 0) die_read(); + return r; +@@ -369,6 +523,9 @@ + int hops; + unsigned long qp; + char *qqx; ++#ifdef TLS ++ stralloc protocolinfo = {0}; ++#endif + + if (!seenmail) { err_wantmail(); return; } + if (!rcptto.len) { err_wantrcpt(); return; } +@@ -377,8 +534,20 @@ + if (qmail_open(&qqt) == -1) { err_qqt(); return; } + qp = qmail_qp(&qqt); + out("354 go ahead\r\n"); +- ++#ifdef TLS ++ if(ssl){ ++ if (!stralloc_copys(&protocolinfo, SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)))) die_nomem(); ++ if (!stralloc_catb(&protocolinfo, " encrypted SMTP", 15)) die_nomem(); ++ if (clientcert.len){ ++ if (!stralloc_catb(&protocolinfo," cert ", 6)) die_nomem(); ++ if (!stralloc_catb(&protocolinfo,clientcert.s, clientcert.len)) die_nomem(); ++ } ++ if (!stralloc_0(&protocolinfo)) die_nomem(); ++ } else if (!stralloc_copyb(&protocolinfo,"SMTP",5)) die_nomem(); ++ received(&qqt,protocolinfo.s,local,remoteip,remotehost,remoteinfo,case_diffs(remotehost,helohost.s) ? helohost.s : 0); ++#else + received(&qqt,"SMTP",local,remoteip,remotehost,remoteinfo,fakehelo); ++#endif + blast(&hops); + hops = (hops >= MAXHOPS); + if (hops) qmail_fail(&qqt); +@@ -393,23 +562,299 @@ + out(qqx + 1); + out("\r\n"); + } ++#ifdef TLS ++static RSA *tmp_rsa_cb(ssl,export,keylength) SSL *ssl; int export; int keylength; ++{ ++ RSA* rsa; ++ BIO* in; ++ ++ if (!export || keylength == 512) ++ if (in=BIO_new(BIO_s_file_internal())) ++ if (BIO_read_filename(in,"control/rsa512.pem") > 0) ++ if (rsa=PEM_read_bio_RSAPrivateKey(in,NULL,NULL,NULL)) ++ return rsa; ++ return (RSA_generate_key(export?keylength:512,RSA_F4,NULL,NULL)); ++} ++ ++void smtp_tls(arg) char *arg; ++{ ++ SSL_CTX *ctx; ++ ++ if (*arg) ++ {out("501 Syntax error (no parameters allowed) (#5.5.4)\r\n"); ++ return;} ++ ++ SSL_library_init(); ++ if(!(ctx=SSL_CTX_new(SSLv23_server_method()))) ++ {out("454 TLS not available: unable to initialize ctx (#4.3.0)\r\n"); ++ return;} ++ if(!SSL_CTX_use_RSAPrivateKey_file(ctx, "control/servercert.pem", SSL_FILETYPE_PEM)) ++ {out("454 TLS not available: missing RSA private key (#4.3.0)\r\n"); ++ return;} ++ if(!SSL_CTX_use_certificate_chain_file(ctx, "control/servercert.pem")) ++ {out("454 TLS not available: missing certificate (#4.3.0)\r\n"); ++ return;} ++ SSL_CTX_set_tmp_rsa_callback(ctx, tmp_rsa_cb); ++ SSL_CTX_set_cipher_list(ctx,tlsserverciphers.s); ++ SSL_CTX_load_verify_locations(ctx, "control/clientca.pem",NULL); ++ SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, verify_cb); ++ ++ out("220 ready for tls\r\n"); flush(); ++ ++ if(!(ssl=SSL_new(ctx))) die_read(); ++ SSL_set_fd(ssl,0); ++ if(SSL_accept(ssl)<=0) die_read(); ++ substdio_fdbuf(&ssout,SSL_write,ssl,ssoutbuf,sizeof(ssoutbuf)); ++ ++ remotehost = env_get("TCPREMOTEHOST"); ++ if (!remotehost) remotehost = "unknown"; ++ dohelo(remotehost); ++} ++#endif ++ ++ ++char unique[FMT_ULONG + FMT_ULONG + 3]; ++static stralloc authin = {0}; ++static stralloc user = {0}; ++static stralloc pass = {0}; ++static stralloc resp = {0}; ++static stralloc slop = {0}; ++char *hostname; ++char **childargs; ++substdio ssup; ++char upbuf[128]; ++int authd = 0; ++ ++int authgetl(void) { ++ int i; ++ ++ if (!stralloc_copys(&authin, "")) die_nomem(); ++ ++ for (;;) { ++ if (!stralloc_readyplus(&authin,1)) die_nomem(); /* XXX */ ++ i = substdio_get(&ssin,authin.s + authin.len,1); ++ if (i != 1) die_read(); ++ if (authin.s[authin.len] == '\n') break; ++ ++authin.len; ++ } ++ ++ if (authin.len > 0) if (authin.s[authin.len - 1] == '\r') --authin.len; ++ authin.s[authin.len] = 0; ++ ++ if (*authin.s == '*' && *(authin.s + 1) == 0) { return err_authabrt(); } ++ if (authin.len == 0) { return err_input(); } ++ return authin.len; ++} ++ ++int authenticate(void) ++{ ++ int child; ++ int wstat; ++ int pi[2]; ++ ++ if (!stralloc_0(&user)) die_nomem(); ++ if (!stralloc_0(&pass)) die_nomem(); ++ if (!stralloc_0(&resp)) die_nomem(); ++ ++ if (fd_copy(2,1) == -1) return err_pipe(); ++ close(3); ++ if (pipe(pi) == -1) return err_pipe(); ++ if (pi[0] != 3) return err_pipe(); ++ switch(child = fork()) { ++ case -1: ++ return err_fork(); ++ case 0: ++ close(pi[1]); ++ sig_pipedefault(); ++ execvp(*childargs, childargs); ++ _exit(1); ++ } ++ close(pi[0]); ++ ++ substdio_fdbuf(&ssup,write,pi[1],upbuf,sizeof upbuf); ++ if (substdio_put(&ssup,user.s,user.len) == -1) return err_write(); ++ if (substdio_put(&ssup,pass.s,pass.len) == -1) return err_write(); ++ if (substdio_put(&ssup,resp.s,resp.len) == -1) return err_write(); ++ if (substdio_flush(&ssup) == -1) return err_write(); ++ ++ close(pi[1]); ++ byte_zero(pass.s,pass.len); ++ byte_zero(upbuf,sizeof upbuf); ++ if (wait_pid(&wstat,child) == -1) return err_child(); ++ if (wait_crashed(wstat)) return err_child(); ++ if (wait_exitcode(wstat)) { sleep(5); return 1; } /* no */ ++ return 0; /* yes */ ++} ++ ++int auth_login(arg) char *arg; ++{ ++ int r; ++ ++ if (*arg) { ++ if (r = b64decode(arg,str_len(arg),&user) == 1) return err_input(); ++ } ++ else { ++ out("334 VXNlcm5hbWU6\r\n"); flush(); /* Username: */ ++ if (authgetl() < 0) return -1; ++ if (r = b64decode(authin.s,authin.len,&user) == 1) return err_input(); ++ } ++ if (r == -1) die_nomem(); ++ ++ out("334 UGFzc3dvcmQ6\r\n"); flush(); /* Password: */ ++ ++ if (authgetl() < 0) return -1; ++ if (r = b64decode(authin.s,authin.len,&pass) == 1) return err_input(); ++ if (r == -1) die_nomem(); ++ ++ if (!user.len || !pass.len) return err_input(); ++ return authenticate(); ++} ++ ++int auth_plain(arg) char *arg; ++{ ++ int r, id = 0; ++ ++ if (*arg) { ++ if (r = b64decode(arg,str_len(arg),&slop) == 1) return err_input(); ++ } ++ else { ++ out("334 \r\n"); flush(); ++ if (authgetl() < 0) return -1; ++ if (r = b64decode(authin.s,authin.len,&slop) == 1) return err_input(); ++ } ++ if (r == -1 || !stralloc_0(&slop)) die_nomem(); ++ while (slop.s[id]) id++; /* ignore authorize-id */ ++ ++ if (slop.len > id + 1) ++ if (!stralloc_copys(&user,slop.s + id + 1)) die_nomem(); ++ if (slop.len > id + user.len + 2) ++ if (!stralloc_copys(&pass,slop.s + id + user.len + 2)) die_nomem(); ++ ++ if (!user.len || !pass.len) return err_input(); ++ return authenticate(); ++} ++ ++#ifdef AUTHCRAM ++int auth_cram() ++{ ++ int i, r; ++ char *s; ++ ++ s = unique; ++ s += fmt_uint(s,getpid()); ++ *s++ = '.'; ++ s += fmt_ulong(s,(unsigned long) now()); ++ *s++ = '@'; ++ *s++ = 0; ++ ++ if (!stralloc_copys(&pass,"<")) die_nomem(); ++ if (!stralloc_cats(&pass,unique)) die_nomem(); ++ if (!stralloc_cats(&pass,hostname)) die_nomem(); ++ if (!stralloc_cats(&pass,">")) die_nomem(); ++ if (b64encode(&pass,&slop) < 0) die_nomem(); ++ if (!stralloc_0(&slop)) die_nomem(); ++ ++ out("334 "); ++ out(slop.s); ++ out("\r\n"); ++ flush(); ++ ++ if (authgetl() < 0) return -1; ++ if (r = b64decode(authin.s,authin.len,&slop) == 1) return err_input(); ++ if (r == -1 || !stralloc_0(&slop)) die_nomem(); ++ ++ i = str_chr(slop.s,' '); ++ s = slop.s + i; ++ while (*s == ' ') ++s; ++ slop.s[i] = 0; ++ if (!stralloc_copys(&user,slop.s)) die_nomem(); ++ if (!stralloc_copys(&resp,s)) die_nomem(); ++ ++ if (!user.len || !resp.len) return err_input(); ++ return authenticate(); ++} ++#endif ++ ++struct authcmd { ++ char *text; ++ int (*fun)(); ++} authcmds[] = { ++ { "login", auth_login } ++, { "plain", auth_plain } ++#ifdef AUTHCRAM ++, { "cram-md5", auth_cram } ++#endif ++, { 0, err_noauth } ++}; ++ ++void smtp_auth(arg) ++char *arg; ++{ ++ int i; ++ char *cmd = arg; ++ ++ if (!hostname || !*childargs) ++ { ++ out("503 auth not available (#5.3.3)\r\n"); ++ return; ++ } ++ if (authd) { err_authd(); return; } ++ if (seenmail) { err_authmail(); return; } ++ ++ if (!stralloc_copys(&user,"")) die_nomem(); ++ if (!stralloc_copys(&pass,"")) die_nomem(); ++ if (!stralloc_copys(&resp,"")) die_nomem(); ++ ++ i = str_chr(cmd,' '); ++ arg = cmd + i; ++ while (*arg == ' ') ++arg; ++ cmd[i] = 0; ++ ++ for (i = 0;authcmds[i].text;++i) ++ if (case_equals(authcmds[i].text,cmd)) break; ++ ++ switch (authcmds[i].fun(arg)) { ++ case 0: ++ authd = 1; ++ relayclient = ""; ++ remoteinfo = user.s; ++ if (!env_unset("TCPREMOTEINFO")) die_read(); ++ if (!env_put2("TCPREMOTEINFO",remoteinfo)) die_nomem(); ++ out("235 ok, go ahead (#2.0.0)\r\n"); ++ break; ++ case 1: ++ out("535 authorization failed (#5.7.0)\r\n"); ++ } ++} + + struct commands smtpcommands[] = { + { "rcpt", smtp_rcpt, 0 } + , { "mail", smtp_mail, 0 } + , { "data", smtp_data, flush } ++, { "auth", smtp_auth, flush } + , { "quit", smtp_quit, flush } + , { "helo", smtp_helo, flush } + , { "ehlo", smtp_ehlo, flush } + , { "rset", smtp_rset, 0 } + , { "help", smtp_help, flush } ++#ifdef TLS ++, { "starttls", smtp_tls, flush } ++#endif + , { "noop", err_noop, flush } + , { "vrfy", err_vrfy, flush } + , { 0, err_unimpl, flush } + } ; + +-void main() +-{ ++void main(argc,argv) ++int argc; ++char **argv; ++{ ++ hostname = argv[1]; ++ childargs = argv + 2; ++ ++#ifdef TLS ++ sig_alarmcatch(sigalrm); ++#endif + sig_pipeignore(); + if (chdir(auto_qmail) == -1) die_control(); + setup(); diff --git a/mail-mta/qmail/files/1.03-r9/qmail-control b/mail-mta/qmail/files/1.03-r9/qmail-control new file mode 100644 index 000000000000..185304df89a0 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r9/qmail-control @@ -0,0 +1,30 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r9/qmail-control,v 1.1 2004/05/30 10:50:14 robbat2 Exp $ + +opts="start stop restart reload" + +start() { + ebegin "Starting qmail mta ..." + svc -u /var/qmail/supervise/* + eend $? + ebegin "Starting qmail mta logging ..." + svc -u /var/qmail/supervise/*/log + eend $? +} + +stop() { + ebegin "Stopping qmail mta ..." + svc -d /var/qmail/supervise/* + eend $? + ebegin "Stopping qmail mta logging ..." + svc -d /var/qmail/supervise/*/log + eend $? +} + +reload() { + ebegin "Reloading 'locals' and 'virtualdomains' control files." + svc -h /var/qmail/supervise/qmail-send + eend $? +} diff --git a/mail-mta/qmail/files/1.03-r9/qmail-linksync.patch b/mail-mta/qmail/files/1.03-r9/qmail-linksync.patch new file mode 100644 index 000000000000..1b35f12aaa1f --- /dev/null +++ b/mail-mta/qmail/files/1.03-r9/qmail-linksync.patch @@ -0,0 +1,54 @@ +--- ../qmail-1.03.orig/qmail-local.c Mon Jun 15 12:53:16 1998 ++++ qmail-local.c Sun Jul 16 16:19:04 2000 +@@ -1,5 +1,6 @@ + #include <sys/types.h> + #include <sys/stat.h> ++#include <fcntl.h> + #include "readwrite.h" + #include "sig.h" + #include "env.h" +@@ -128,6 +129,9 @@ + if (close(fd) == -1) goto fail; /* NFS dorks */ + + if (link(fntmptph,fnnewtph) == -1) goto fail; ++ if ((fd = open(fnnewtph, O_RDONLY)) < 0 || ++ fsync(fd) < 0 || close(fd) < 0) goto fail; ++ + /* if it was error_exist, almost certainly successful; i hate NFS */ + tryunlinktmp(); _exit(0); + +--- ../qmail-1.03.orig/qmail-queue.c Mon Jun 15 12:53:16 1998 ++++ qmail-queue.c Sun Jul 16 16:19:33 2000 +@@ -1,5 +1,6 @@ + #include <sys/types.h> + #include <sys/stat.h> ++#include <fcntl.h> + #include "readwrite.h" + #include "sig.h" + #include "exit.h" +@@ -155,6 +156,7 @@ + { + unsigned int len; + char ch; ++ int fd; + + sig_blocknone(); + umask(033); +@@ -183,7 +185,7 @@ + todofn = fnnum("todo/",0); + intdfn = fnnum("intd/",0); + +- if (link(pidfn,messfn) == -1) die(64); ++ if (link(pidfn,messfn) == -1) die(64); + if (unlink(pidfn) == -1) die(63); + flagmademess = 1; + +@@ -248,6 +250,8 @@ + if (fsync(intdfd) == -1) die_write(); + + if (link(intdfn,todofn) == -1) die(66); ++ if ((fd = open(todofn, O_RDONLY)) < 0 || ++ fsync(fd) < 0 || close(fd) < 0) die(66); + + triggerpull(); + die(0); diff --git a/mail-mta/qmail/files/1.03-r9/qmail-queue.patch b/mail-mta/qmail/files/1.03-r9/qmail-queue.patch new file mode 100644 index 000000000000..4edd5fad86e5 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r9/qmail-queue.patch @@ -0,0 +1,49 @@ +diff -u qmail-1.03-orig/Makefile qmail-1.03/Makefile +--- qmail-1.03-orig/Makefile Mon Jun 15 04:53:16 1998 ++++ Makefile Tue Jan 19 10:52:24 1999 +@@ -1483,12 +1483,12 @@ + trigger.o fmtqfn.o quote.o now.o readsubdir.o qmail.o date822fmt.o \ + datetime.a case.a ndelay.a getln.a wait.a seek.a fd.a sig.a open.a \ + lock.a stralloc.a alloc.a substdio.a error.a str.a fs.a auto_qmail.o \ +-auto_split.o ++auto_split.o env.a + ./load qmail-send qsutil.o control.o constmap.o newfield.o \ + prioq.o trigger.o fmtqfn.o quote.o now.o readsubdir.o \ + qmail.o date822fmt.o datetime.a case.a ndelay.a getln.a \ + wait.a seek.a fd.a sig.a open.a lock.a stralloc.a alloc.a \ +- substdio.a error.a str.a fs.a auto_qmail.o auto_split.o ++ substdio.a error.a str.a fs.a auto_qmail.o auto_split.o env.a + + qmail-send.0: \ + qmail-send.8 +diff -u qmail-1.03-orig/qmail.c qmail-1.03/qmail.c +--- qmail-1.03-orig/qmail.c Mon Jun 15 04:53:16 1998 ++++ qmail.c Tue Jan 19 09:57:36 1999 +@@ -6,14 +6,25 @@ + #include "fd.h" + #include "qmail.h" + #include "auto_qmail.h" ++#include "env.h" + +-static char *binqqargs[2] = { "bin/qmail-queue", 0 } ; ++static char *binqqargs[2] = { 0, 0 } ; ++ ++static void setup_qqargs() ++{ ++ if(!binqqargs[0]) ++ binqqargs[0] = env_get("QMAILQUEUE"); ++ if(!binqqargs[0]) ++ binqqargs[0] = "bin/qmail-queue"; ++} + + int qmail_open(qq) + struct qmail *qq; + { + int pim[2]; + int pie[2]; ++ ++ setup_qqargs(); + + if (pipe(pim) == -1) return -1; + if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; } + diff --git a/mail-mta/qmail/files/1.03-r9/run-qmailsend b/mail-mta/qmail/files/1.03-r9/run-qmailsend new file mode 100644 index 000000000000..8dbd3adf524f --- /dev/null +++ b/mail-mta/qmail/files/1.03-r9/run-qmailsend @@ -0,0 +1,2 @@ +#!/bin/sh +exec /var/qmail/rc diff --git a/mail-mta/qmail/files/1.03-r9/run-qmailsendlog b/mail-mta/qmail/files/1.03-r9/run-qmailsendlog new file mode 100644 index 000000000000..5ff50d1e7711 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r9/run-qmailsendlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-send diff --git a/mail-mta/qmail/files/1.03-r9/run-qmailsmtpd b/mail-mta/qmail/files/1.03-r9/run-qmailsmtpd new file mode 100644 index 000000000000..9733e11e154a --- /dev/null +++ b/mail-mta/qmail/files/1.03-r9/run-qmailsmtpd @@ -0,0 +1,6 @@ +#!/bin/sh +QMAILDUID=`id -u qmaild` +NOFILESGID=`id -g qmaild` +exec /usr/bin/softlimit -m 8000000 \ + /usr/bin/tcpserver -H -R -v -p -x /etc/tcp.smtp.cdb \ + -u $QMAILDUID -g $NOFILESGID 0 smtp rblsmtpd /var/qmail/bin/qmail-smtpd 2>&1 diff --git a/mail-mta/qmail/files/1.03-r9/run-qmailsmtpdlog b/mail-mta/qmail/files/1.03-r9/run-qmailsmtpdlog new file mode 100644 index 000000000000..2d9546146583 --- /dev/null +++ b/mail-mta/qmail/files/1.03-r9/run-qmailsmtpdlog @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-smtpd diff --git a/mail-mta/qmail/files/99qmail b/mail-mta/qmail/files/99qmail new file mode 100644 index 000000000000..d9d929e4892b --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/conf-common b/mail-mta/qmail/files/conf-common new file mode 100644 index 000000000000..d4e48c2d56fa --- /dev/null +++ b/mail-mta/qmail/files/conf-common @@ -0,0 +1,57 @@ +# Common Configuration file for all qmail daemons +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-common,v 1.1 2004/05/30 10:50:13 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" + +# This tells tcpserver where to file the rules cdb file +[ -d /etc/tcprules.d/ ] && TCPSERVER_RULESCDB=/etc/tcprules.d/tcp.qmail-${SERVICE}.cdb +[ ! -f "${TCPSERVER_RULESCDB}" ] && TCPSERVER_RULESCDB=/etc/tcp.${SERVICE}.cdb + +# 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 Generally it is best to add this in your appropriate (usually SMTP) cdb +# files /etc/tcp.*.cdb OR /etc/tcprules.d/tcp.qmail-*.cdb instead of on a +# global basis, as otherwise outgoing mail will be checked (because qmail-queue +# is used for most parts of qmail) You can also enable this per-server by just +# placing it into the other configuration files by placing the line there +# instead. Please note that the export part is important. +#export 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} n${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/mail-mta/qmail/files/conf-pop3d b/mail-mta/qmail/files/conf-pop3d new file mode 100644 index 000000000000..afc9e27504ae --- /dev/null +++ b/mail-mta/qmail/files/conf-pop3d @@ -0,0 +1,29 @@ +# Configuration file for qmail-pop3d +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-pop3d,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/conf-qmqpd b/mail-mta/qmail/files/conf-qmqpd new file mode 100644 index 000000000000..53ddb9cabeb2 --- /dev/null +++ b/mail-mta/qmail/files/conf-qmqpd @@ -0,0 +1,15 @@ +# Configuration file for qmail-qmqpd +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-qmqpd,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/conf-qmtpd b/mail-mta/qmail/files/conf-qmtpd new file mode 100644 index 000000000000..761cacb14221 --- /dev/null +++ b/mail-mta/qmail/files/conf-qmtpd @@ -0,0 +1,18 @@ +# Configuration file for qmail-qmtpd +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-qmtpd,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/conf-send b/mail-mta/qmail/files/conf-send new file mode 100644 index 000000000000..bbcb0cf95c63 --- /dev/null +++ b/mail-mta/qmail/files/conf-send @@ -0,0 +1,6 @@ +# Configuration file for qmail-send +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-send,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +# directory to log to +# override conf-common on this +LOG_DEST=/var/log/qmail/qmail-send diff --git a/mail-mta/qmail/files/conf-smtpd b/mail-mta/qmail/files/conf-smtpd new file mode 100644 index 000000000000..ca9e943866be --- /dev/null +++ b/mail-mta/qmail/files/conf-smtpd @@ -0,0 +1,37 @@ +# Configuration file for qmail-smtpd +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/conf-smtpd,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/config-sanity-check b/mail-mta/qmail/files/config-sanity-check new file mode 100644 index 000000000000..ab78dc60b381 --- /dev/null +++ b/mail-mta/qmail/files/config-sanity-check @@ -0,0 +1,35 @@ +#!/bin/sh +# Configuration Sanity Checking for qmail +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/config-sanity-check,v 1.1 2004/05/30 10:50:13 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 [ "${SERVICE}" != "send" -a ! -f "${TCPSERVER_RULESCDB}" ]; then + echo "No CDB file found (${TCPSERVER_RULESCDB})" + 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/mail-mta/qmail/files/digest-qmail-1.03-r10 b/mail-mta/qmail/files/digest-qmail-1.03-r10 new file mode 100644 index 000000000000..80ad6ed5cfca --- /dev/null +++ b/mail-mta/qmail/files/digest-qmail-1.03-r10 @@ -0,0 +1,7 @@ +MD5 622f65f982e380dbe86e6574f3abcb7c qmail-1.03.tar.gz 220668 +MD5 6b202f71a99fb41e9e32906017270ba0 qmail-smtpd-auth-0.31.tar.gz 8798 +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 8edda59102180973dd1bb546da7de160 qmail-0.0.0.0.patch 450 diff --git a/mail-mta/qmail/files/digest-qmail-1.03-r11 b/mail-mta/qmail/files/digest-qmail-1.03-r11 new file mode 100644 index 000000000000..b1db88921e23 --- /dev/null +++ b/mail-mta/qmail/files/digest-qmail-1.03-r11 @@ -0,0 +1,12 @@ +MD5 622f65f982e380dbe86e6574f3abcb7c qmail-1.03.tar.gz 220668 +MD5 6b202f71a99fb41e9e32906017270ba0 qmail-smtpd-auth-0.31.tar.gz 8798 +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 8edda59102180973dd1bb546da7de160 qmail-0.0.0.0.patch 450 +MD5 4e1f2d8315e7e2a5482798c9d19fac4d sendmail-flagf.patch 863 +MD5 3dc69265a561c7d82ba3e43e89828722 qmail-tls.patch.tbz2 14076 +MD5 122664c38338e5ec35fcac43f33d6927 qmail-1.03-qmtpc.patch 6197 +MD5 24fc1a33089faf12e00b127cd659f317 qmail-smtpd-relay-reject 1230 +MD5 ed5c0ddb6a5cc0386b1e04ced71d26ad qmail-local-tabs.patch 505 diff --git a/mail-mta/qmail/files/digest-qmail-1.03-r12 b/mail-mta/qmail/files/digest-qmail-1.03-r12 new file mode 100644 index 000000000000..88f3a557ed29 --- /dev/null +++ b/mail-mta/qmail/files/digest-qmail-1.03-r12 @@ -0,0 +1,20 @@ +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 8edda59102180973dd1bb546da7de160 qmail-0.0.0.0.patch 450 +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 413be7bb5b407c2964c3275c4d596947 qmail-maildir++.patch 43512 +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 diff --git a/mail-mta/qmail/files/digest-qmail-1.03-r13 b/mail-mta/qmail/files/digest-qmail-1.03-r13 new file mode 100644 index 000000000000..88f3a557ed29 --- /dev/null +++ b/mail-mta/qmail/files/digest-qmail-1.03-r13 @@ -0,0 +1,20 @@ +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 8edda59102180973dd1bb546da7de160 qmail-0.0.0.0.patch 450 +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 413be7bb5b407c2964c3275c4d596947 qmail-maildir++.patch 43512 +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 diff --git a/mail-mta/qmail/files/digest-qmail-1.03-r14 b/mail-mta/qmail/files/digest-qmail-1.03-r14 new file mode 100644 index 000000000000..4d9be20c7e95 --- /dev/null +++ b/mail-mta/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 413be7bb5b407c2964c3275c4d596947 qmail-maildir++.patch 43512 +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/mail-mta/qmail/files/digest-qmail-1.03-r15 b/mail-mta/qmail/files/digest-qmail-1.03-r15 new file mode 100644 index 000000000000..4d9be20c7e95 --- /dev/null +++ b/mail-mta/qmail/files/digest-qmail-1.03-r15 @@ -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 413be7bb5b407c2964c3275c4d596947 qmail-maildir++.patch 43512 +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/mail-mta/qmail/files/digest-qmail-1.03-r8 b/mail-mta/qmail/files/digest-qmail-1.03-r8 new file mode 100644 index 000000000000..9ade032bccfa --- /dev/null +++ b/mail-mta/qmail/files/digest-qmail-1.03-r8 @@ -0,0 +1,4 @@ +MD5 622f65f982e380dbe86e6574f3abcb7c qmail-1.03.tar.gz 220668 +MD5 39b6f70f65056472ff97ab40c1dba7b4 big-todo.103.patch 5546 +MD5 2ff58c3570870a8ff9a1d9eb9aec05a6 big-concurrency.patch 9331 +MD5 9140ad2b03017145cd7963c84bb24f16 qmail-103.patch 2104 diff --git a/mail-mta/qmail/files/digest-qmail-1.03-r9 b/mail-mta/qmail/files/digest-qmail-1.03-r9 new file mode 100644 index 000000000000..069eaa99c8ac --- /dev/null +++ b/mail-mta/qmail/files/digest-qmail-1.03-r9 @@ -0,0 +1,5 @@ +MD5 622f65f982e380dbe86e6574f3abcb7c qmail-1.03.tar.gz 220668 +MD5 39b6f70f65056472ff97ab40c1dba7b4 big-todo.103.patch 5546 +MD5 2ff58c3570870a8ff9a1d9eb9aec05a6 big-concurrency.patch 9331 +MD5 9140ad2b03017145cd7963c84bb24f16 qmail-103.patch 2104 +MD5 48d2761e9ae44bb4d2812a19634f1a5b qmail-ldap-1.03-20020901.patch.gz 130655 diff --git a/mail-mta/qmail/files/dot_qmail b/mail-mta/qmail/files/dot_qmail new file mode 100644 index 000000000000..81a15fc5c50c --- /dev/null +++ b/mail-mta/qmail/files/dot_qmail @@ -0,0 +1,3 @@ +# Uncomment the next line for .forward support +#|dot-forward .forward +./.maildir/ diff --git a/mail-mta/qmail/files/errno.patch b/mail-mta/qmail/files/errno.patch new file mode 100644 index 000000000000..f9b77b91e065 --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/gencert.sh b/mail-mta/qmail/files/gencert.sh new file mode 100644 index 000000000000..6adc05fdc8b6 --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/mkservercert b/mail-mta/qmail/files/mkservercert new file mode 100644 index 000000000000..f03b0a16b7fe --- /dev/null +++ b/mail-mta/qmail/files/mkservercert @@ -0,0 +1,55 @@ +#! /bin/sh +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/mkservercert,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/qmail-config-system b/mail-mta/qmail/files/qmail-config-system new file mode 100644 index 000000000000..2b10c5ffc577 --- /dev/null +++ b/mail-mta/qmail/files/qmail-config-system @@ -0,0 +1,26 @@ +#!/bin/sh +# Configuration System for Qmail +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/qmail-config-system,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/qmail-genrsacert.sh b/mail-mta/qmail/files/qmail-genrsacert.sh new file mode 100644 index 000000000000..1f0020975747 --- /dev/null +++ b/mail-mta/qmail/files/qmail-genrsacert.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/qmail-genrsacert.sh,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/rc b/mail-mta/qmail/files/rc new file mode 100644 index 000000000000..ab8e003703fb --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/rc,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +exec env - PATH="/var/qmail/bin:$PATH" \ + qmail-start "`grep -v '^#' /var/qmail/control/defaultdelivery`" diff --git a/mail-mta/qmail/files/run-qmailpop3d b/mail-mta/qmail/files/run-qmailpop3d new file mode 100644 index 000000000000..ddf8b82d59ec --- /dev/null +++ b/mail-mta/qmail/files/run-qmailpop3d @@ -0,0 +1,17 @@ +#!/bin/sh +# Gentoo Startup script for qmail's POP3 daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/run-qmailpop3d,v 1.1 2004/05/30 10:50:13 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 ${TCPSERVER_RULESCDB} \ + -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/mail-mta/qmail/files/run-qmailpop3dlog b/mail-mta/qmail/files/run-qmailpop3dlog new file mode 100644 index 000000000000..bae7615cb71a --- /dev/null +++ b/mail-mta/qmail/files/run-qmailpop3dlog @@ -0,0 +1,6 @@ +#!/bin/sh +# Gentoo Startup script for qmail's POP3 daemon (logging) +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/run-qmailpop3dlog,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/run-qmailqmqpd b/mail-mta/qmail/files/run-qmailqmqpd new file mode 100644 index 000000000000..316feee4b00f --- /dev/null +++ b/mail-mta/qmail/files/run-qmailqmqpd @@ -0,0 +1,17 @@ +#!/bin/sh +# Gentoo Startup script for qmail's QMQP daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/run-qmailqmqpd,v 1.1 2004/05/30 10:50:13 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 ${TCPSERVER_RULESCDB} \ + -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/mail-mta/qmail/files/run-qmailqmqpdlog b/mail-mta/qmail/files/run-qmailqmqpdlog new file mode 100644 index 000000000000..f1d1b47cb7a2 --- /dev/null +++ b/mail-mta/qmail/files/run-qmailqmqpdlog @@ -0,0 +1,6 @@ +#!/bin/sh +# Gentoo Startup script for qmail's QMQP daemon (logging) +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/run-qmailqmqpdlog,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/run-qmailqmtpd b/mail-mta/qmail/files/run-qmailqmtpd new file mode 100644 index 000000000000..d7c90c6f98f6 --- /dev/null +++ b/mail-mta/qmail/files/run-qmailqmtpd @@ -0,0 +1,17 @@ +#!/bin/sh +# Gentoo Startup script for qmail's QMTP daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/run-qmailqmtpd,v 1.1 2004/05/30 10:50:13 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 ${TCPSERVER_RULESCDB} \ + -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/mail-mta/qmail/files/run-qmailqmtpdlog b/mail-mta/qmail/files/run-qmailqmtpdlog new file mode 100644 index 000000000000..0e2725c2322e --- /dev/null +++ b/mail-mta/qmail/files/run-qmailqmtpdlog @@ -0,0 +1,6 @@ +#!/bin/sh +# Gentoo Startup script for qmail's QMTP daemon (logging) +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/run-qmailqmtpdlog,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/run-qmailsend b/mail-mta/qmail/files/run-qmailsend new file mode 100644 index 000000000000..33eefeb2b431 --- /dev/null +++ b/mail-mta/qmail/files/run-qmailsend @@ -0,0 +1,4 @@ +#!/bin/sh +# Gentoo qmail rc booter +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/run-qmailsend,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ +exec /var/qmail/rc diff --git a/mail-mta/qmail/files/run-qmailsendlog b/mail-mta/qmail/files/run-qmailsendlog new file mode 100644 index 000000000000..1578e3875c14 --- /dev/null +++ b/mail-mta/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/mail-mta/qmail/files/run-qmailsmtpd b/mail-mta/qmail/files/run-qmailsmtpd new file mode 100644 index 000000000000..7e0cc1f654ab --- /dev/null +++ b/mail-mta/qmail/files/run-qmailsmtpd @@ -0,0 +1,17 @@ +#!/bin/sh +# Gentoo Startup script for qmail's SMTP daemon +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/run-qmailsmtpd,v 1.1 2004/05/30 10:50:13 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 ${TCPSERVER_RULESCDB} \ + -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/mail-mta/qmail/files/run-qmailsmtpdlog b/mail-mta/qmail/files/run-qmailsmtpdlog new file mode 100644 index 000000000000..04332a39b9cb --- /dev/null +++ b/mail-mta/qmail/files/run-qmailsmtpdlog @@ -0,0 +1,6 @@ +#!/bin/sh +# Gentoo Startup script for qmail's SMTP daemon (logging) +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/run-qmailsmtpdlog,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/servercert.cnf b/mail-mta/qmail/files/servercert.cnf new file mode 100644 index 000000000000..32ed98e642ad --- /dev/null +++ b/mail-mta/qmail/files/servercert.cnf @@ -0,0 +1,37 @@ +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/servercert.cnf,v 1.1 2004/05/30 10:50:13 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/mail-mta/qmail/files/tcp.pop3.sample b/mail-mta/qmail/files/tcp.pop3.sample new file mode 100644 index 000000000000..55df788cf074 --- /dev/null +++ b/mail-mta/qmail/files/tcp.pop3.sample @@ -0,0 +1,6 @@ +# to update the database after changing this file, run: +# tcprules /etc/tcprules.d/tcp.qmail-pop3.cdb /etc/tcprules.d/.tcp.qmail-pop3.tmp < /etc/tcprules.d/tcp.qmail-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/mail-mta/qmail/files/tcp.qmqp.sample b/mail-mta/qmail/files/tcp.qmqp.sample new file mode 100644 index 000000000000..da21632c950e --- /dev/null +++ b/mail-mta/qmail/files/tcp.qmqp.sample @@ -0,0 +1,8 @@ +# to update the database after changing this file, run: +# tcprules /etc/tcprules.d/tcp.qmail-qmqp.cdb /etc/tcprules.d/.tcp.qmail-qmqp.tmp < /etc/tcprules.d/tcp.qmail-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/tcprules.d/tcp.qmail-smtp for more info +:deny diff --git a/mail-mta/qmail/files/tcp.qmtp.sample b/mail-mta/qmail/files/tcp.qmtp.sample new file mode 100644 index 000000000000..48f77ca4e442 --- /dev/null +++ b/mail-mta/qmail/files/tcp.qmtp.sample @@ -0,0 +1,15 @@ +# to update the database after changing this file, run: +# tcprules /etc/tcprules.d/tcp.qmail-qmtp.cdb /etc/tcprules.d/.tcp.qmail-qmtp.tmp < /etc/tcprules.d/tcp.qmail-qmtp +# We trust QMTP connections just as SMTP by default +# see /etc/tcprules.d/tcp.qmail-smtp 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 + +# If you are using qmail-scanner, this line here is the correct one to use +# instead (comment out the above ':allow' line FIRST) and applies that script +# to any mail coming in that is not from a host allowed to relay. You can +# change the value of the variable to any other value you desire to use custom +# scripts for example. +#:allow,QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl" diff --git a/mail-mta/qmail/files/tcp.smtp.sample b/mail-mta/qmail/files/tcp.smtp.sample new file mode 100644 index 000000000000..a53d3b651d1a --- /dev/null +++ b/mail-mta/qmail/files/tcp.smtp.sample @@ -0,0 +1,90 @@ +# to update the database after changing this file, run: +# tcprules /etc/tcprules.d/tcp.qmail-smtp.cdb /etc/tcprules.d/.tcp.qmail-smtp.tmp < /etc/tcprules.d/tcp.qmail-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 + +# If you are using qmail-scanner, this line here is the correct one to use +# instead (comment out the above ':allow' line FIRST) and applies that script +# to any mail coming in that is not from a host allowed to relay. You can +# change the value of the variable to any other value you desire to use custom +# scripts for example. +#:allow,QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl" diff --git a/mail-mta/qmail/metadata.xml b/mail-mta/qmail/metadata.xml new file mode 100644 index 000000000000..89dcd746873c --- /dev/null +++ b/mail-mta/qmail/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>net-mail</herd> + <maintainer> + <email>robbat2@gentoo.org</email> + <name>Robin H. Johnson</name> + </maintainer> +</pkgmetadata> diff --git a/mail-mta/qmail/qmail-1.03-r10.ebuild b/mail-mta/qmail/qmail-1.03-r10.ebuild new file mode 100644 index 000000000000..e8cacd753c6f --- /dev/null +++ b/mail-mta/qmail/qmail-1.03-r10.ebuild @@ -0,0 +1,342 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r10.ebuild,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +inherit gcc eutils + +IUSE="ssl" +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="http://cr.yp.to/software/qmail-1.03.tar.gz + http://members.elysium.pl/brush/qmail-smtpd-auth/dist/qmail-smtpd-auth-0.31.tar.gz + http://www.qmail.org/qmailqueue-patch + http://qmail.null.dk/big-todo.103.patch + http://www.jedi.claranet.fr/qmail-link-sync.patch + http://www.qmail.org/big-concurrency.patch + http://www.suspectclass.com/~sgifford/qmail/qmail-0.0.0.0.patch" + +SLOT="0" +LICENSE="as-is" +KEYWORDS="x86 ppc ~sparc alpha" +DEPEND="virtual/glibc + sys-apps/groff + >=sys-apps/ucspi-tcp-0.88 + >=net-mail/checkpassword-0.90 + >=net-mail/cmd5checkpw-0.22 + ssl? ( >=dev-libs/openssl-0.9.6g )" + +RDEPEND="!virtual/mta + virtual/glibc + sys-apps/groff + >=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" + +PROVIDE="virtual/mta + virtual/mda" + +src_unpack() { + unpack qmail-1.03.tar.gz + + # SMTP AUTH + unpack qmail-smtpd-auth-0.31.tar.gz + cd ${WORKDIR}/qmail-smtpd-auth-0.31 + cp README.auth base64.c base64.h ${S} + cd ${S} + epatch ../qmail-smtpd-auth-0.31/auth.patch + # Fixes a problem when utilizing "morercpthosts" + epatch ${FILESDIR}/${PV}-${PR}/smtp-auth-close3.patch + + # TLS support and an EHLO patch + if use ssl + then + ebegin "Applying tls.patch.bz2..." + bzcat ${FILESDIR}/${PV}-${PR}/tls.patch.bz2 | patch -p1 &>/dev/null || die + eend $? + fi + + # patch so an alternate queue processor can be used + # i.e. - qmail-scanner + epatch ${DISTDIR}/qmailqueue-patch + + # a patch for faster queue processing + epatch ${DISTDIR}/big-todo.103.patch + + # Account for Linux filesystems lack of a synchronus link() + cd ${S} + 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-0.0.0.0.patch + + # Let the system decide how to define errno + epatch ${FILESDIR}/${PV}-${PR}/errno.patch + + if [ `use ssl` ]; then + echo "gcc ${CFLAGS} -DTLS" > conf-cc + else + echo "gcc ${CFLAGS}" > conf-cc + fi + + echo "gcc" > conf-ld + echo "500" > conf-spawn + +} + +src_compile() { + cd ${S} + emake it man || die +} + + + +src_install() { + + cd ${S} + + 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 + + dodir /var/qmail/users + 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 + dodoc ${FILESDIR}/${PV}-${PR}/tls-patch.txt + + insopts -o qmailq -g qmail -m 4711 + insinto /var/qmail/bin + doins qmail-queue qmail-queue + + insopts -o root -g qmail -m 700 + insinto /var/qmail/bin + doins qmail-lspawn qmail-start qmail-newu qmail-newmrh + + insopts -o root -g qmail -m 711 + insinto /var/qmail/bin + doins qmail-getpw qmail-local qmail-remote qmail-rspawn \ + qmail-clean qmail-send splogger qmail-pw2u + + insopts -o root -g qmail -m 755 + insinto /var/qmail/bin + 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 + + into /usr + for i in *.1 *.5 *.8 + do + doman $i + done + + einfo "Adding /var/qmail/bin to PATH and ROOTPATH" + dodir /etc/env.d + cp ${FILESDIR}/${PV}-${PR}/99qmail ${D}/etc/env.d + + 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 + if [ ! -d ${ROOT}/var/qmail/alias/.maildir ] ; then + dodir /var/qmail/alias/.maildir + for i in cur new tmp + do + dodir /var/qmail/alias/.maildir/$i + done + fi + + 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 + ${D}/var/qmail/bin/maildirmake ${D}/etc/skel/.maildir + newins ${FILESDIR}/${PV}-${PR}/dot_qmail .qmail + fperms 644 /etc/skel/.qmail + insinto /root + ${D}/var/qmail/bin/maildirmake ${D}/root/.maildir + newins ${FILESDIR}/${PV}-${PR}/dot_qmail .qmail + fperms 644 /root/.qmail + + einfo "Setting up daemontools ..." + insopts -o root -g root -m 755 + diropts -m 755 -o root -g root + dodir /var/qmail/supervise + dodir /var/qmail/supervise/qmail-send + dodir /var/qmail/supervise/qmail-send/log + dodir /var/qmail/supervise/qmail-smtpd + dodir /var/qmail/supervise/qmail-smtpd/log + chmod +t ${D}/var/qmail/supervise/qmail-send + chmod +t ${D}/var/qmail/supervise/qmail-smtpd + diropts -m 755 -o qmaill + dodir /var/log/qmail + keepdir /var/log/qmail + dodir /var/log/qmail/qmail-send + keepdir /var/log/qmail/qmail-send + dodir /var/log/qmail/qmail-smtpd + keepdir /var/log/qmail/qmail-smtpd + + insinto /var/qmail/supervise/qmail-send + newins ${FILESDIR}/${PV}-${PR}/run-qmailsend run + insinto /var/qmail/supervise/qmail-send/log + newins ${FILESDIR}/${PV}-${PR}/run-qmailsendlog run + insinto /var/qmail/supervise/qmail-smtpd + newins ${FILESDIR}/${PV}-${PR}/run-qmailsmtpd run + insinto /var/qmail/supervise/qmail-smtpd/log + newins ${FILESDIR}/${PV}-${PR}/run-qmailsmtpdlog run + + einfo "Installing the qmail control file ..." + exeinto /var/qmail/bin + doexe ${FILESDIR}/${PV}-${PR}/qmail-control + + einfo "Installing the qmail startup file ..." + insinto /var/qmail + doins ${FILESDIR}/${PV}-${PR}/rc + insinto /var/qmail/control + doins ${FILESDIR}/${PV}-${PR}/defaultdelivery + + einfo "Setting up the pop3d service ..." + insopts -o root -g root -m 755 + diropts -m 755 -o root -g root + dodir /service + dodir /var/qmail/supervise/qmail-pop3d + dodir /var/qmail/supervise/qmail-pop3d/log + chmod +t ${D}/var/qmail/supervise/qmail-pop3d + diropts -m 755 -o qmaill + dodir /var/log/qmail/qmail-pop3d + + insinto /var/qmail/supervise/qmail-pop3d + newins ${FILESDIR}/${PV}-${PR}/run-qmailpop3d run + insinto /var/qmail/supervise/qmail-pop3d/log + newins ${FILESDIR}/${PV}-${PR}/run-qmailpop3dlog run +} + +pkg_postinst() { + + einfo "Setting up the message queue hierarchy ..." + + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/todo + install -d -m 700 -o qmailq -g qmail ${ROOT}/var/qmail/queue/pid + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/bounce + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/mess + + for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 + do + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/mess/${i} + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/todo/${i} + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/intd/${i} + done + + for i in info local remote + do + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/${i} + done + + for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 + do + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/info/${i} + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/local/${i} + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/remote/${i} + done + + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/lock + + dd if=/dev/zero of=${ROOT}/var/qmail/queue/lock/tcpto bs=1024 count=1 + chmod 644 ${ROOT}/var/qmail/queue/lock/tcpto + chown qmailr:qmail ${ROOT}/var/qmail/queue/lock/tcpto + + touch ${ROOT}/var/qmail/queue/lock/sendmutex + chmod 600 ${ROOT}/var/qmail/queue/lock/sendmutex + chown qmails:qmail ${ROOT}/var/qmail/queue/lock/sendmutex + + mkfifo ${ROOT}/var/qmail/queue/lock/trigger + chmod 622 ${ROOT}/var/qmail/queue/lock/trigger + chown qmails:qmail ${ROOT}/var/qmail/queue/lock/trigger + + echo -e "\e[32;01m Please do not forget to run, the following syntax :\033[0m" + echo -e "\e[32;01m ebuild /var/db/pkg/${CATEGORY}/${PN}-${PV}-${PR}/${PN}-${PV}-${PR}.ebuild config \033[0m" + echo -e "\e[32;01m This will setup qmail to run out-of-the-box on your system. \033[0m" + echo -e "" + echo -e "\e[32;01m To start qmail at boot you have to enable the /etc/init.d/svscan rc file \033[0m" + echo -e "\e[32;01m and create the following links : \033[0m" + echo -e "\e[32;01m ln -s /var/qmail/supervise/qmail-send /service/qmail-send \033[0m" + echo -e "\e[32;01m ln -s /var/qmail/supervise/qmail-smtpd /service/qmail-smtpd \033[0m" + echo -e "" + echo -e "\e[32;01m To start the pop3 server as well, create the following link : \033[0m" + echo -e "\e[32;01m ln -s /var/qmail/supervise/qmail-pop3d /service/qmail-pop3d \033[0m" +} + +pkg_config() { + +export qhost=`hostname --fqdn` + if [ ${ROOT} = "/" ] ; then + if [ ! -f ${ROOT}/var/qmail/control/me ] ; then + ${ROOT}/var/qmail/bin/config-fast $qhost + fi + fi + + echo "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` + for ip in $LOCALIPS; do + echo "$ip:allow,RELAYCLIENT=\"\"" >> /etc/tcp.smtp + done + echo ":allow" >> /etc/tcp.smtp + + tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp + + if [ `use ssl` ]; then + if [ ! -f /var/qmail/control/servercert.pem ]; then + echo "Creating a self-signed ssl-cert:" + /usr/bin/openssl req -new -x509 -nodes -out /var/qmail/control/servercert.pem -days 366 -keyout /var/qmail/control/servercert.pem + chmod 640 /var/qmail/control/servercert.pem + chown qmaild:qmail /var/qmail/control/servercert.pem + ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.pem + + echo -e "\e[32;01m If You want to have a signed cert, do the following: \033[0m" + echo -e "\e[32;01m openssl req -new -nodes -out req.pem \ \033[0m" + echo -e "\e[32;01m -keyout /var/qmail/control/servercert.pem \033[0m" + echo -e "\e[32;01m chmod 640 /var/qmail/control/servercert.pem \033[0m" + echo -e "\e[32;01m chown qmaild:qmail /var/qmail/control/servercert.pem \033[0m" + echo -e "\e[32;01m ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.pem \033[0m" + echo -e "\e[32;01m Send req.pem to your CA to obtain signed_req.pem, and do: \033[0m" + echo -e "\e[32;01m cat signed_req.pem >> /var/qmail/control/servercert.pem \033[0m" + fi + fi +} diff --git a/mail-mta/qmail/qmail-1.03-r11.ebuild b/mail-mta/qmail/qmail-1.03-r11.ebuild new file mode 100644 index 000000000000..0d93a2c41f15 --- /dev/null +++ b/mail-mta/qmail/qmail-1.03-r11.ebuild @@ -0,0 +1,359 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r11.ebuild,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +inherit gcc eutils + +IUSE="ssl" +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 + http://members.elysium.pl/brush/qmail-smtpd-auth/dist/qmail-smtpd-auth-0.31.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-0.0.0.0.patch + http://david.acz.org/software/sendmail-flagf.patch + mirror://gentoo/qmail-tls.patch.tbz2 + mirror://qmail/qmail-1.03-qmtpc.patch + http://qmail.goof.com/qmail-smtpd-relay-reject + mirror://gentoo/qmail-local-tabs.patch" + +SLOT="0" +LICENSE="as-is" +KEYWORDS="~x86 ~ppc ~sparc ~alpha" +DEPEND="virtual/glibc + sys-apps/groff + ssl? ( >=dev-libs/openssl-0.9.6g )" + +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" + +PROVIDE="virtual/mta + virtual/mda" + +S=${WORKDIR}/${P} + +src_unpack() { + + # This makes life easy + EPATCH_OPTS="-d ${S}" + + # unpack the initial stuff + unpack ${P}.tar.gz qmail-tls.patch.tbz2 qmail-smtpd-auth-0.31.tar.gz + + # SMTP AUTH + cp ${WORKDIR}/qmail-smtpd-auth-0.31/{README.auth,base64.c,base64.h} ${S} + + EPATCH_SINGLE_MSG="Adding SMTP AUTH support" \ + epatch qmail-smtpd-auth-0.31/auth.patch + + # Fixes a problem when utilizing "morercpthosts" + epatch ${FILESDIR}/${PV}-${PR}/smtp-auth-close3.patch + + # TLS support and an EHLO patch + if use ssl + then + #bzcat ${WORKDIR}/tls.patch.bz2 | patch -p1 &>/dev/null || die + ebegin "Adding TLS support" + bzcat ${WORKDIR}/tls.patch.bz2 | patch -p1 -d ${S} &>/dev/null || die + eend $? + fi + + # 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 + + # 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-0.0.0.0.patch + + # Let the system decide how to define errno + epatch ${FILESDIR}/${PV}-${PR}/errno.patch + + # make the qmail 'sendmail' binary behave like sendmail's for -f + epatch ${DISTDIR}/sendmail-flagf.patch + + # Reject some bad relaying attempts + # gentoo bug #18064 + epatch ${DISTDIR}/qmail-smtpd-relay-reject + + cd ${S} + + if [ `use ssl` ]; then + echo "$(gcc-getCC) ${CFLAGS} -DTLS" > conf-cc + else + echo "$(gcc-getCC) ${CFLAGS}" > conf-cc + fi + + echo "$(gcc-getCC) ${LDFLAGS}" > conf-ld + echo "500" > conf-spawn + +} + +src_compile() { + cd ${S} + emake it man || die +} + + + +src_install() { + + cd ${S} + + 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 + dodoc ${WORKDIR}/tls-patch.txt + + insopts -o qmailq -g qmail -m 4711 + insinto /var/qmail/bin + doins qmail-queue qmail-queue + + insopts -o root -g qmail -m 700 + insinto /var/qmail/bin + doins qmail-lspawn qmail-start qmail-newu qmail-newmrh + + insopts -o root -g qmail -m 711 + insinto /var/qmail/bin + doins qmail-getpw qmail-local qmail-remote qmail-rspawn \ + qmail-clean qmail-send splogger qmail-pw2u + + insopts -o root -g qmail -m 755 + insinto /var/qmail/bin + 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 + + into /usr + for i in *.1 *.5 *.8 + do + doman $i + done + + einfo "Adding env.d entry for qmail" + dodir /etc/env.d + insinto /etc/env.d + doins ${FILESDIR}/${PV}-${PR}/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 + ${D}/var/qmail/bin/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 + ${D}/var/qmail/bin/maildirmake ${D}/etc/skel/.maildir + newins ${FILESDIR}/${PV}-${PR}/dot_qmail .qmail + fperms 644 /etc/skel/.qmail + insinto /root + ${D}/var/qmail/bin/maildirmake ${D}/root/.maildir + newins ${FILESDIR}/${PV}-${PR}/dot_qmail .qmail + fperms 644 /root/.qmail + # for good measure + keepdir /etc/skel/.maildir/{cur,new,tmp} /root/.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}/${PV}-${PR}/run-qmail${i} run + insinto /var/qmail/supervise/qmail-${i}/log + newins ${FILESDIR}/${PV}-${PR}/run-qmail${i}log run + done + + einfo "Installing the qmail control file ..." + exeinto /var/qmail/bin + doexe ${FILESDIR}/${PV}-${PR}/qmail-control + + einfo "Installing the qmail startup file ..." + insinto /var/qmail + doins ${FILESDIR}/${PV}-${PR}/rc + + einfo "Insalling some stock configuration files" + insinto /var/qmail/control + doins ${FILESDIR}/${PV}-${PR}/{defaultdelivery,conf-*} +} + +pkg_postinst() { + + einfo "Setting up the message queue hierarchy ..." + + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/todo + install -d -m 700 -o qmailq -g qmail ${ROOT}/var/qmail/queue/pid + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/bounce + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/mess + + for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 + do + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/{mess,todo,intd}/${i} + done + + for i in info local remote + do + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/${i} + done + + for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 + do + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/{info,local,remote}/${i} + done + + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/lock + + [ -e ${ROOT}/var/qmail/queue/lock/tcpto ] || dd if=/dev/zero of=${ROOT}/var/qmail/queue/lock/tcpto bs=1024 count=1 + chmod 644 ${ROOT}/var/qmail/queue/lock/tcpto + chown qmailr:qmail ${ROOT}/var/qmail/queue/lock/tcpto + + + [ -e ${ROOT}/var/qmail/queue/lock/sendmutex ] || touch ${ROOT}/var/qmail/queue/lock/sendmutex + chmod 600 ${ROOT}/var/qmail/queue/lock/sendmutex + chown qmails:qmail ${ROOT}/var/qmail/queue/lock/sendmutex + + [ -e ${ROOT}/var/qmail/queue/lock/trigger ] || mkfifo ${ROOT}/var/qmail/queue/lock/trigger + chmod 622 ${ROOT}/var/qmail/queue/lock/trigger + chown qmails:qmail ${ROOT}/var/qmail/queue/lock/trigger + + # for good measure + env-update + + einfo "Please do not forget to run, the following syntax :" + einfo "ebuild /var/db/pkg/${CATEGORY}/${PN}-${PV}-${PR}/${PN}-${PV}-${PR}.ebuild config" + einfo "This will setup qmail to run out-of-the-box on your system." + echo + einfo "To start qmail at boot you have to enable the /etc/init.d/svscan rc file" + 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, 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 run:" + einfo "source /etc/profile" +} + +pkg_config() { + + export qhost=`hostname --fqdn` + if [ ${ROOT} = "/" ] ; then + if [ ! -f ${ROOT}/var/qmail/control/me ] ; then + ${ROOT}/var/qmail/bin/config-fast $qhost + fi + 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` + for ip in $LOCALIPS; do + echo "$ip:allow,RELAYCLIENT=\"\",RBLSMTPD=\"\"" >> /etc/tcp.smtp + echo "$ip:allow,RELAYCLIENT=\"\"" >> /etc/tcp.qmtp + echo "$ip:allow,RELAYCLIENT=\"\"" >> /etc/tcp.qmqp + done + echo ":allow" >> /etc/tcp.smtp + echo ":allow" >> /etc/tcp.qmtp + echo ":deny" >> /etc/tcp.qmqp + + for i in smtp qmtp qmqp; do + tcprules /etc/tcp.${i}.cdb /etc/tcp.${i}.tmp < /etc/tcp.${i} + done + + if [ `use ssl` ]; then + if [ ! -f /var/qmail/control/servercert.pem ]; then + echo "Creating a self-signed ssl-cert:" + /usr/bin/openssl req -new -x509 -nodes -out /var/qmail/control/servercert.pem -days 366 -keyout /var/qmail/control/servercert.pem + chmod 640 /var/qmail/control/servercert.pem + chown qmaild:qmail /var/qmail/control/servercert.pem + ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.pem + + einfo "If You want to have a signed cert, do the following:" + einfo "openssl req -new -nodes -out req.pem \\" + einfo "-keyout /var/qmail/control/servercert.pem" + einfo "chmod 640 /var/qmail/control/servercert.pem" + einfo "chown qmaild:qmail /var/qmail/control/servercert.pem" + einfo "ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.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 + fi +} diff --git a/mail-mta/qmail/qmail-1.03-r12.ebuild b/mail-mta/qmail/qmail-1.03-r12.ebuild new file mode 100644 index 000000000000..6748aa2762d0 --- /dev/null +++ b/mail-mta/qmail/qmail-1.03-r12.ebuild @@ -0,0 +1,393 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r12.ebuild,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +inherit gcc eutils fixheadtails + +IUSE="ssl" +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-0.0.0.0.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 + " +# 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" +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 + + # Fixes a problem when utilizing "morercpthosts" + epatch ${FILESDIR}/${PV}-${PR}/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-0.0.0.0.patch + + # Let the system decide how to define errno + epatch ${FILESDIR}/${PV}-${PR}/errno.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 + # upstream has changed the patch and this isn't needed anymore + #epatch ${FILESDIR}/${PV}-${PR}/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 + + #TODO TEST + # 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}/${PV}-${PR}/qmail-smtpd-esmtp-size-gentoo.patch + + #TODO TEST + # Reject some bad relaying attempts + # gentoo bug #18064 + epatch ${FILESDIR}/${PV}-${PR}/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 + + # TODO TESTING NEEDED + 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 + + # TODO REDIFF + #EPATCH_SINGLE_MSG="Refuse messages from the null envelope sender if they have more than one envelope recipient" \ + #epatch ${DISTDIR}/nullenvsender-recipcount.patch + # TODO REDIFF + #EPATCH_SINGLE_MSG="qmail-pop3d reports erroneous figures on STAT after a DELE" \ + #epatch ${DISTDIR}/qmail-pop3d-stat.patch + + echo -n "$(gcc-getCC) ${CFLAGS}" >${S}/conf-cc + if use ssl; then + einfo "Enabling SSL/TLS functionality" + echo -n ' -DTLS' >>${S}/conf-cc + fi + echo -n "$(gcc-getCC) ${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}/${PV}-${PR}/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}/${PV}-${PR}/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}/${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} + for i in smtp qmtp qmqp pop3; do + [ -f ${D}/etc/tcp.${i} ] && tcprules ${D}/etc/tcp.${i}.cdb ${D}/etc/.tcp.${i}.tmp < ${D}/etc/tcp.${i} + done + done + + einfo "Installing the qmail startup file ..." + insinto /var/qmail + insopts -o root -g root -m 755 + doins ${FILESDIR}/${PV}-${PR}/rc + + einfo "Installing the qmail control file ..." + exeinto /var/qmail/bin + insopts -o root -g root -m 755 + doexe ${FILESDIR}/${PV}-${PR}/qmail-control + + einfo "Insalling some stock configuration files" + insinto /var/qmail/control + insopts -o root -g root -m 644 + doins ${FILESDIR}/${PV}-${PR}/conf-* + newins ${FILESDIR}/${PV}-${PR}/dot_qmail defaultdelivery + + einfo "Configuration sanity checker" + into /var/qmail + insopts -o root -g root -m 644 + dobin ${FILESDIR}/${PV}-${PR}/config-sanity-check + +} + +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 +} + +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 + + # 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}/${PN}-${PV}-${PR}/${PN}-${PV}-${PR}.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, 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 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 + 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 + echo "${ip}${TCPSTRING}" >> ${ROOT}/etc/tcp.smtp + echo "${ip}${TCPSTRING}" >> ${ROOT}/etc/tcp.qmtp + echo "${ip}${TCPSTRING}" >> ${ROOT}/etc/tcp.qmqp + done + + for i in smtp qmtp qmqp pop3; do + [ -f ${ROOT}/etc/tcp.${i} ] && tcprules ${ROOT}/etc/tcp.${i}.cdb ${ROOT}/etc/.tcp.${i}.tmp < ${ROOT}/etc/tcp.${i} + done + + 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 + chown qmaild:qmail ${ROOT}/var/qmail/control/servercert.pem + ln -s /var/qmail/control/servercert.pem ${ROOT}/var/qmail/control/clientcert.pem + + einfo "If You want to have a signed cert, do the following:" + einfo "openssl req -new -nodes -out req.pem \\" + 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 +} diff --git a/mail-mta/qmail/qmail-1.03-r13.ebuild b/mail-mta/qmail/qmail-1.03-r13.ebuild new file mode 100644 index 000000000000..87c4ecaea6e4 --- /dev/null +++ b/mail-mta/qmail/qmail-1.03-r13.ebuild @@ -0,0 +1,426 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r13.ebuild,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +inherit gcc eutils fixheadtails + +IUSE="ssl" +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-0.0.0.0.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 + " +# 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 ~hppa alpha" +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 + + # Fixes a problem when utilizing "morercpthosts" + epatch ${FILESDIR}/${PV}-${PR}/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-0.0.0.0.patch + + # Let the system decide how to define errno + epatch ${FILESDIR}/${PV}-${PR}/errno.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 + # upstream has changed the patch and this isn't needed anymore + #epatch ${FILESDIR}/${PV}-${PR}/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 + + #TODO TEST + # 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}/${PV}-${PR}/qmail-smtpd-esmtp-size-gentoo.patch + + #TODO TEST + # Reject some bad relaying attempts + # gentoo bug #18064 + epatch ${FILESDIR}/${PV}-${PR}/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 + + # TODO TESTING NEEDED + 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 + + # TODO REDIFF + #EPATCH_SINGLE_MSG="Refuse messages from the null envelope sender if they have more than one envelope recipient" \ + #epatch ${DISTDIR}/nullenvsender-recipcount.patch + # TODO REDIFF + #EPATCH_SINGLE_MSG="qmail-pop3d reports erroneous figures on STAT after a DELE" \ + #epatch ${DISTDIR}/qmail-pop3d-stat.patch + + echo -n "$(gcc-getCC) ${CFLAGS}" >${S}/conf-cc + if use ssl; then + einfo "Enabling SSL/TLS functionality" + echo -n ' -DTLS' >>${S}/conf-cc + fi + echo -n "$(gcc-getCC) ${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}/${PV}-${PR}/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}/${PV}-${PR}/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}/${PV}-${PR}/run-qmail${i} run + insinto /var/qmail/supervise/qmail-${i}/log + newins ${FILESDIR}/${PV}-${PR}/run-qmail${i}log run + insinto /etc + done + + insinto /etc + for i in smtp qmtp qmqp pop3; do + if [ -f ${FILESDIR}/tcp.${i}.sample ]; then + newins ${FILESDIR}/tcp.${i}.sample tcp.${i} + fi + if [ -f ${D}/etc/tcp.${i} ]; then + tcprules ${D}/etc/tcp.${i}.cdb ${D}/etc/.tcp.${i}.tmp \ + < ${D}/etc/tcp.${i} + fi + done + + einfo "Installing the qmail startup file ..." + insinto /var/qmail + insopts -o root -g root -m 755 + doins ${FILESDIR}/${PV}-${PR}/rc + + einfo "Installing the qmail control file ..." + exeinto /var/qmail/bin + insopts -o root -g root -m 755 + doexe ${FILESDIR}/${PV}-${PR}/qmail-control + + einfo "Insalling some stock configuration files" + insinto /var/qmail/control + insopts -o root -g root -m 644 + doins ${FILESDIR}/${PV}-${PR}/conf-* + newins ${FILESDIR}/${PV}-${PR}/dot_qmail defaultdelivery + use ssl && doins ${FILESDIR}/${PV}-${PR}/servercert.cnf + + einfo "Configuration sanity checker" + into /var/qmail + insopts -o root -g root -m 644 + dobin ${FILESDIR}/${PV}-${PR}/config-sanity-check + + if use ssl; then + einfo "SSL Certificate creation script" + dobin ${FILESDIR}/${PV}-${PR}/mkservercert + einfo "RSA key generation cronjob" + insinto /etc/cron.daily + doins ${FILESDIR}/${PV}-${PR}/qmail-genrsacert.sh + chmod +x ${D}/etc/cron.daily/qmail-genrsacert.sh + 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}/${PN}-${PV}-${PR}/${PN}-${PV}-${PR}.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 +} + diff --git a/mail-mta/qmail/qmail-1.03-r14.ebuild b/mail-mta/qmail/qmail-1.03-r14.ebuild new file mode 100644 index 000000000000..cbad907aaa9e --- /dev/null +++ b/mail-mta/qmail/qmail-1.03-r14.ebuild @@ -0,0 +1,467 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r14.ebuild,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +inherit gcc 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" +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 + EPATCH_SINGLE_MSG="Adding QMAILQUEUE info to documentation" \ + epatch ${FILESDIR}/${PVR}/qmail-qmailqueue-docs.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 + # upstream has changed the patch and this isn't needed anymore + #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 + + EPATCH_SINGLE_MSG="Branding qmail with Gentoo identifier 'Gentoo Linux ${PF}'" \ + epatch ${FILESDIR}/${PVR}/qmail-gentoo-branding.patch + sed -e "s/__PF__/${PF}/" -i ${S}/qmail-smtpd.c + + echo -n "$(gcc-getCC) ${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 "$(gcc-getCC) ${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 +} + diff --git a/mail-mta/qmail/qmail-1.03-r15.ebuild b/mail-mta/qmail/qmail-1.03-r15.ebuild new file mode 100644 index 000000000000..f36f37aeb63f --- /dev/null +++ b/mail-mta/qmail/qmail-1.03-r15.ebuild @@ -0,0 +1,501 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r15.ebuild,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +inherit gcc 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/${P}.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 + +LICENSE="as-is" +SLOT="0" +KEYWORDS="~x86 ~ppc ~sparc mips ~alpha arm hppa amd64 ia64" + +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} + +#MY_PVR=${PVR} +MY_PVR=${PV}-r14 + +TCPRULES_DIR=/etc/tcprules.d + +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}/${MY_PVR}/qmail-1.03-qregex-memleak-fix.patch + + # Fixes a problem when utilizing "morercpthosts" + epatch ${FILESDIR}/${MY_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 + EPATCH_SINGLE_MSG="Adding QMAILQUEUE info to documentation" \ + epatch ${FILESDIR}/${MY_PVR}/qmail-qmailqueue-docs.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 + # upstream has changed the patch and this isn't needed anymore + #epatch ${FILESDIR}/${MY_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}/${MY_PVR}/qmail-smtpd-esmtp-size-gentoo.patch + + #TODO TEST + # Reject some bad relaying attempts + # gentoo bug #18064 + epatch ${FILESDIR}/${MY_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}/${MY_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}/${MY_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}/${MY_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}/${MY_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}/${MY_PVR}/qmail-pop3d-stat.tls.patch + + EPATCH_SINGLE_MSG="Branding qmail with Gentoo identifier 'Gentoo Linux ${PF}'" \ + epatch ${FILESDIR}/${MY_PVR}/qmail-gentoo-branding.patch + sed -e "s/__PF__/${PF}/" -i ${S}/qmail-smtpd.c + + EPATCH_SINGLE_MSG="qmail-pop3d fix for top output so Evolution doesn't barf" \ + epatch ${FILESDIR}/${PVR}/qmail-pop3d-top-outputfix.patch + + echo -n "$(gcc-getCC) ${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 "$(gcc-getCC) ${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 + + dodir ${TCPRULES_DIR} + insinto ${TCPRULES_DIR} + for i in smtp qmtp qmqp pop3; do + newins ${FILESDIR}/tcp.${i}.sample tcp.qmail-${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! + f=tcp.qmail-${i} + src=${ROOT}${TCPRULES_DIR}/${f} + cdb=${ROOT}${TCPRULES_DIR}/${f}.cdb + tmp=${ROOT}${TCPRULES_DIR}/.${f}.tmp + cat ${src} 2>/dev/null | tcprules ${cdb} ${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_preinst() { + mkdir -p ${TCPRULES_DIR} + for proto in smtp qmtp qmqp pop3; do + for ext in '' .cdb; do + old="/etc/tcp.${proto}${ext}" + new="${TCPRULES_DIR}/tcp.qmail-${proto}${ext}" + fail=0 + if [ -f "$old" -a ! -f "$new" ]; then + einfo "Moving $old to $new" + cp $old $new || fail=1 + else + fail=1 + fi + if [ "${fail}" = "1" ]; then + eerror "Error moving $old to $new, be sure to check the" + eerror "configuration! You may have already moved the files," + eerror "in which case you can delete $old" + fi + done + done +} + +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}${TCPRULES_DIR}/tcp.qmail-${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 +} + diff --git a/mail-mta/qmail/qmail-1.03-r8.ebuild b/mail-mta/qmail/qmail-1.03-r8.ebuild new file mode 100644 index 000000000000..abe5256b4347 --- /dev/null +++ b/mail-mta/qmail/qmail-1.03-r8.ebuild @@ -0,0 +1,275 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r8.ebuild,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +S=${WORKDIR}/${P} +DESCRIPTION="A modern replacement for sendmail which uses maildirs" +HOMEPAGE="http://www.qmail.org/ + http://www.jedi.claranet.fr/qmail-tuning.html + http://iain.cx/unix/qmail/mysql.php + http://www.nrg4u.com/" + +SRC_URI="http://cr.yp.to/software/qmail-1.03.tar.gz + http://www.qmail.org/big-todo.103.patch + http://www.qmail.org/big-concurrency.patch + http://www.ckdhr.com/ckd/qmail-103.patch" + +DEPEND="virtual/glibc + sys-apps/groff + >=sys-apps/ucspi-tcp-0.88 + >=net-mail/checkpassword-0.90" + +RDEPEND="!virtual/mta + virtual/glibc + sys-apps/groff + >=sys-apps/ucspi-tcp-0.88 + >=sys-apps/daemontools-0.76-r1 + >=net-mail/checkpassword-0.90 + >=net-mail/dot-forward-0.71" + +PROVIDE="virtual/mta" + +SLOT="0" +LICENSE="as-is" +KEYWORDS="x86 ppc sparc alpha" + +src_unpack() { + +cd ${WORKDIR} +unpack qmail-1.03.tar.gz + +cd ${S} + + echo "Applying dns patch..." + patch < ${DISTDIR}/qmail-103.patch + + echo "Applying big-todo patch..." + patch < ${DISTDIR}/big-todo.103.patch + + echo "Applying big-concurrency patch..." + patch < ${DISTDIR}/big-concurrency.patch + + echo "Applying Ext2FS/ReiserFS patch..." + patch < ${FILESDIR}/${PV}-${PR}/qmail-linksync.patch + + echo "Applying QMAILQUEUE patch..." + patch < ${FILESDIR}/${PV}-${PR}/qmail-queue.patch + + echo "gcc ${CFLAGS}" > conf-cc + echo "gcc" > conf-ld + echo "500" > conf-spawn + +} + +src_compile() { + + cd ${S} + + emake it man || die +} + + + +src_install() { + + cd ${S} + + 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 + + dodir /var/qmail/users + 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 + + into /usr + dodoc FAQ UPGRADE SENDMAIL INSTALL* TEST* REMOVE* PIC* SECURITY + dodoc SYSDEPS TARGETS THANKS THOUGHTS TODO VERSION + + insopts -o qmailq -g qmail -m 4711 + insinto /var/qmail/bin + doins qmail-queue qmail-queue + + insopts -o root -g qmail -m 700 + insinto /var/qmail/bin + doins qmail-lspawn qmail-start qmail-newu qmail-newmrh + + insopts -o root -g qmail -m 711 + insinto /var/qmail/bin + doins qmail-getpw qmail-local qmail-remote qmail-rspawn \ + qmail-clean qmail-send splogger qmail-pw2u + + insopts -o root -g qmail -m 755 + insinto /var/qmail/bin + 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 + + into /usr + for i in *.1 *.5 *.8 + do + doman $i + done + + 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 + if [ ! -d ${ROOT}/var/qmail/alias/.maildir ] ; then + dodir /var/qmail/alias/.maildir + for i in cur new tmp + do + dodir /var/qmail/alias/.maildir/$i + done + fi + + for i in mailer-daemon postmaster root + do + touch ${D}/var/qmail/alias/.qmail-${i} + fowners alias:qmail /var/qmail/alias/.qmail-${i} + done + + einfo "Setting up maildirs by default in the account skeleton ..." + diropts -m 755 -o root -g root + insinto /etc/skel + ${D}/var/qmail/bin/maildirmake ${D}/etc/skel/.maildir + newins ${FILESDIR}/${PV}-${PR}/dot_qmail .qmail + fperms 644 /etc/skel/.qmail + insinto /root + ${D}/var/qmail/bin/maildirmake ${D}/root/.maildir + newins ${FILESDIR}/${PV}-${PR}/dot_qmail .qmail + fperms 644 /root/.qmail + + einfo "Setting up daemontools ..." + insopts -o root -g root -m 755 + diropts -m 755 -o root -g root + dodir /var/qmail/supervise + dodir /var/qmail/supervise/qmail-send + dodir /var/qmail/supervise/qmail-send/log + dodir /var/qmail/supervise/qmail-smtpd + dodir /var/qmail/supervise/qmail-smtpd/log + chmod +t ${D}/var/qmail/supervise/qmail-send + chmod +t ${D}/var/qmail/supervise/qmail-smtpd + diropts -m 755 -o qmaill + dodir /var/log/qmail + keepdir /var/log/qmail + dodir /var/log/qmail/qmail-send + keepdir /var/log/qmail/qmail-send + dodir /var/log/qmail/qmail-smtpd + keepdir /var/log/qmail/qmail-smtpd + + insinto /var/qmail/supervise/qmail-send + newins ${FILESDIR}/${PV}-${PR}/run-qmailsend run + insinto /var/qmail/supervise/qmail-send/log + newins ${FILESDIR}/${PV}-${PR}/run-qmailsendlog run + insinto /var/qmail/supervise/qmail-smtpd + newins ${FILESDIR}/${PV}-${PR}/run-qmailsmtpd run + insinto /var/qmail/supervise/qmail-smtpd/log + newins ${FILESDIR}/${PV}-${PR}/run-qmailsmtpdlog run + + einfo "Installing the qmail control file ..." + exeinto /var/qmail/bin + doexe ${FILESDIR}/${PV}-${PR}/qmail-control + + einfo "Installing the qmail startup file ..." + insinto /var/qmail + doins ${FILESDIR}/${PV}-${PR}/rc + insinto /var/qmail/control + doins ${FILESDIR}/${PV}-${PR}/defaultdelivery + +} + +pkg_postinst() { + + einfo "Setting up the message queue hierarchy ..." + + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/todo + install -d -m 700 -o qmailq -g qmail ${ROOT}/var/qmail/queue/pid + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/bounce + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/mess + + for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 + do + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/mess/${i} + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/todo/${i} + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/intd/${i} + done + + for i in info local remote + do + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/${i} + done + + for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 + do + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/info/${i} + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/local/${i} + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/remote/${i} + done + + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/lock + + dd if=/dev/zero of=${ROOT}/var/qmail/queue/lock/tcpto bs=1024 count=1 + chmod 644 ${ROOT}/var/qmail/queue/lock/tcpto + chown qmailr:qmail ${ROOT}/var/qmail/queue/lock/tcpto + + touch ${ROOT}/var/qmail/queue/lock/sendmutex + chmod 600 ${ROOT}/var/qmail/queue/lock/sendmutex + chown qmails:qmail ${ROOT}/var/qmail/queue/lock/sendmutex + + mkfifo ${ROOT}/var/qmail/queue/lock/trigger + chmod 622 ${ROOT}/var/qmail/queue/lock/trigger + chown qmails:qmail ${ROOT}/var/qmail/queue/lock/trigger + + echo -e "\e[32;01m Please do not forget to run, the following syntax :\033[0m" + echo -e "\e[32;01m ebuild /var/db/pkg/${CATEGORY}/${PN}-${PV}-${PR}/${PN}-${PV}-${PR}.ebuild config \033[0m" + echo -e "\e[32;01m This will setup qmail to run out-of-the-box on your system. \033[0m" + echo -e "" + echo -e "\e[32;01m To start qmail at boot you have to enable the /etc/init.d/svscan rc file \033[0m" + echo -e "\e[32;01m and create the following links : \033[0m" + echo -e "\e[32;01m ln -s /var/qmail/supervise/qmail-send /service/qmail-send \033[0m" + echo -e "\e[32;01m ln -s /var/qmail/supervise/qmail-smtpd /service/qmail-smtpd \033[0m" + +} + +pkg_config() { + +export qhost=`hostname` + if [ ${ROOT} = "/" ] ; then + if [ ! -f ${ROOT}/var/qmail/control/me ] ; then + ${ROOT}/var/qmail/bin/config-fast $qhost + fi + fi + + echo "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` + for ip in $LOCALIPS; do + echo "$ip:allow,RELAYCLIENT=\"\"" >> /etc/tcp.smtp + done + echo ":allow" >> /etc/tcp.smtp + + tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp + +} diff --git a/mail-mta/qmail/qmail-1.03-r9.ebuild b/mail-mta/qmail/qmail-1.03-r9.ebuild new file mode 100644 index 000000000000..b1f2bbd03619 --- /dev/null +++ b/mail-mta/qmail/qmail-1.03-r9.ebuild @@ -0,0 +1,313 @@ +# Copyright 1999-2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/qmail-1.03-r9.ebuild,v 1.1 2004/05/30 10:50:13 robbat2 Exp $ + +IUSE="ssl ldap" + +S=${WORKDIR}/${P} + +DESCRIPTION="A modern replacement for sendmail which uses maildirs" +HOMEPAGE="http://www.qmail.org/ + http://www.jedi.claranet.fr/qmail-tuning.html + http://iain.cx/unix/qmail/mysql.php + http://www.nrg4u.com/" +SRC_URI="http://cr.yp.to/software/qmail-1.03.tar.gz + http://www.qmail.org/big-todo.103.patch + http://www.qmail.org/big-concurrency.patch + http://www.ckdhr.com/ckd/qmail-103.patch + ldap? ( http://www.nrg4u.com/qmail/qmail-ldap-1.03-20020901.patch.gz )" + +DEPEND="virtual/glibc + sys-apps/groff + >=sys-apps/ucspi-tcp-0.88 + >=net-mail/checkpassword-0.90 + ldap? ( >=net-nds/openldap-2.0.25-r2 ) + ssl? ( >=dev-libs/openssl-0.9.6e )" + +RDEPEND="!virtual/mta + virtual/glibc + sys-apps/groff + >=sys-apps/ucspi-tcp-0.88 + >=sys-apps/daemontools-0.76-r1 + >=net-mail/checkpassword-0.90 + >=net-mail/dot-forward-0.71" + +PROVIDE="virtual/mta + virtual/mda" + +SLOT="0" +LICENSE="as-is" +KEYWORDS="-x86 -ppc -sparc" + +src_unpack() { + + unpack qmail-1.03.tar.gz + + use ldap && unpack qmail-ldap-1.03-20020901.patch.gz + + cd ${S} + + echo "Applying big-todo patch..." + patch < ${DISTDIR}/big-todo.103.patch || die "big-todo patch failed" + + echo "Applying Ext2FS/ReiserFS patch..." + patch < ${FILESDIR}/${PV}-${PR}/qmail-linksync.patch || die "linksync patch failed" + + echo "Applying QMAILQUEUE patch..." + patch < ${FILESDIR}/${PV}-${PR}/qmail-queue.patch || die "qmail queue patch failed" + + if [ `use ldap` ]; then + echo "Applying ldap patches..." + patch -p1 < ${WORKDIR}/qmail-ldap-1.03-20020901.patch || die "ldap patch failed" + #patch -p1 < ${FILESDIR}/${PV}-${PR}/ldap-config.diff || die "ldap config patch failed" + else + echo "Applying dns patch..." + patch < ${DISTDIR}/qmail-103.patch || die "dns patch failed" + + echo "Applying big-concurrency patch..." + patch < ${DISTDIR}/big-concurrency.patch || die "big-concurrency patch failed" + + use ssl && patch < ${FILESDIR}/${PV}-${PR}/qmail-1.03-starttls-smtp-auth.patch || die "tls+auth patch failed" + fi + + if [ `use ssl` ]; then + echo "gcc ${CFLAGS} -DTLS" > conf-cc + else + echo "gcc ${CFLAGS}" > conf-cc + fi + echo "gcc" > conf-ld + echo "500" > conf-spawn + +} + +src_compile() { + + cd ${S} + + emake it man || die + +} + + + +src_install() { + + cd ${S} + + 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 + + dodir /var/qmail/users + 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 + + into /usr + dodoc FAQ UPGRADE SENDMAIL INSTALL* TEST* REMOVE* PIC* SECURITY + dodoc SYSDEPS TARGETS THANKS THOUGHTS TODO VERSION + + insopts -o qmailq -g qmail -m 4711 + insinto /var/qmail/bin + doins qmail-queue qmail-queue + + insopts -o root -g qmail -m 700 + insinto /var/qmail/bin + doins qmail-lspawn qmail-start qmail-newu qmail-newmrh + + insopts -o root -g qmail -m 711 + insinto /var/qmail/bin + doins qmail-getpw qmail-local qmail-remote qmail-rspawn \ + qmail-clean qmail-send splogger qmail-pw2u + + insopts -o root -g qmail -m 755 + insinto /var/qmail/bin + 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 + + into /usr + for i in *.1 *.5 *.8 + do + doman $i + done + + 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 + if [ ! -d ${ROOT}/var/qmail/alias/.maildir ] ; then + dodir /var/qmail/alias/.maildir + for i in cur new tmp + do + dodir /var/qmail/alias/.maildir/$i + done + fi + + for i in mailer-daemon postmaster root + do + touch ${D}/var/qmail/alias/.qmail-${i} + fowners alias:qmail /var/qmail/alias/.qmail-${i} + done + + einfo "Setting up maildirs by default in the account skeleton ..." + diropts -m 755 -o root -g root + insinto /etc/skel + ${D}/var/qmail/bin/maildirmake ${D}/etc/skel/.maildir + newins ${FILESDIR}/${PV}-${PR}/dot_qmail .qmail + fperms 644 /etc/skel/.qmail + insinto /root + ${D}/var/qmail/bin/maildirmake ${D}/root/.maildir + newins ${FILESDIR}/${PV}-${PR}/dot_qmail .qmail + fperms 644 /root/.qmail + + einfo "Setting up daemontools ..." + insopts -o root -g root -m 755 + diropts -m 755 -o root -g root + dodir /var/qmail/supervise + dodir /var/qmail/supervise/qmail-send + dodir /var/qmail/supervise/qmail-send/log + dodir /var/qmail/supervise/qmail-smtpd + dodir /var/qmail/supervise/qmail-smtpd/log + chmod +t ${D}/var/qmail/supervise/qmail-send + chmod +t ${D}/var/qmail/supervise/qmail-smtpd + diropts -m 755 -o qmaill + dodir /var/log/qmail + keepdir /var/log/qmail + dodir /var/log/qmail/qmail-send + keepdir /var/log/qmail/qmail-send + dodir /var/log/qmail/qmail-smtpd + keepdir /var/log/qmail/qmail-smtpd + + insinto /var/qmail/supervise/qmail-send + newins ${FILESDIR}/${PV}-${PR}/run-qmailsend run + insinto /var/qmail/supervise/qmail-send/log + newins ${FILESDIR}/${PV}-${PR}/run-qmailsendlog run + insinto /var/qmail/supervise/qmail-smtpd + newins ${FILESDIR}/${PV}-${PR}/run-qmailsmtpd run + insinto /var/qmail/supervise/qmail-smtpd/log + newins ${FILESDIR}/${PV}-${PR}/run-qmailsmtpdlog run + + einfo "Installing the qmail control file ..." + exeinto /var/qmail/bin + doexe ${FILESDIR}/${PV}-${PR}/qmail-control + + einfo "Installing the qmail startup file ..." + insinto /var/qmail + doins ${FILESDIR}/${PV}-${PR}/rc + insinto /var/qmail/control + doins ${FILESDIR}/${PV}-${PR}/defaultdelivery + +} + +pkg_postinst() { + + einfo "Setting up the message queue hierarchy ..." + + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/todo + install -d -m 700 -o qmailq -g qmail ${ROOT}/var/qmail/queue/pid + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/bounce + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/mess + + for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 + do + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/mess/${i} + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/todo/${i} + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/intd/${i} + done + + for i in info local remote + do + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/${i} + done + + for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 + do + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/info/${i} + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/local/${i} + install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/remote/${i} + done + + install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/lock + + dd if=/dev/zero of=${ROOT}/var/qmail/queue/lock/tcpto bs=1024 count=1 + chmod 644 ${ROOT}/var/qmail/queue/lock/tcpto + chown qmailr:qmail ${ROOT}/var/qmail/queue/lock/tcpto + + touch ${ROOT}/var/qmail/queue/lock/sendmutex + chmod 600 ${ROOT}/var/qmail/queue/lock/sendmutex + chown qmails:qmail ${ROOT}/var/qmail/queue/lock/sendmutex + + mkfifo ${ROOT}/var/qmail/queue/lock/trigger + chmod 622 ${ROOT}/var/qmail/queue/lock/trigger + chown qmails:qmail ${ROOT}/var/qmail/queue/lock/trigger + + echo -e "\e[32;01m Please do not forget to run, the following syntax :\033[0m" + echo -e "\e[32;01m ebuild /var/db/pkg/${CATEGORY}/${PN}-${PV}-${PR}/${PN}-${PV}-${PR}.ebuild config \033[0m" + echo -e "\e[32;01m This will setup qmail to run out-of-the-box on your system. \033[0m" + echo -e "" + echo -e "\e[32;01m To start qmail at boot you have to enable the /etc/init.d/svscan rc file \033[0m" + echo -e "\e[32;01m and create the following links : \033[0m" + echo -e "\e[32;01m ln -s /var/qmail/supervise/qmail-send /service/qmail-send \033[0m" + echo -e "\e[32;01m ln -s /var/qmail/supervise/qmail-smtpd /service/qmail-smtpd \033[0m" + + + if use ssl; then + echo "Creating a self-signed ssl-cert:" + /usr/bin/openssl req -new -x509 -nodes -out /var/qmail/control/servercert.pem -days 366 -keyout /var/qmail/control/servercert.pem + chmod 640 /var/qmail/control/servercert.pem + chown qmaild:qmail /var/qmail/control/servercert.pem + ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.pem + + echo -e "\e[32;01m If You want to have a signed cert, do the following: \033[0m" + echo -e "\e[32;01m openssl req -new -nodes -out req.pem \ \033[0m" + echo -e "\e[32;01m -keyout /var/qmail/control/servercert.pem \033[0m" + echo -e "\e[32;01m chmod 640 /var/qmail/control/servercert.pem \033[0m" + echo -e "\e[32;01m chown qmaild:qmail /var/qmail/control/servercert.pem \033[0m" + echo -e "\e[32;01m ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.pem \033[0m" + echo -e "\e[32;01m Send req.pem to your CA to obtain signed_req.pem, and do: \033[0m" + echo -e "\e[32;01m cat signed_req.pem >> /var/qmail/control/servercert.pem \033[0m" + fi + +} + +pkg_config() { + +export qhost=`hostname` + if [ ${ROOT} = "/" ] ; then + if [ ! -f ${ROOT}/var/qmail/control/me ] ; then + ${ROOT}/var/qmail/bin/config-fast $qhost + fi + fi + + echo "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` + for ip in $LOCALIPS; do + echo "$ip:allow,RELAYCLIENT=\"\"" >> /etc/tcp.smtp + done + echo ":allow" >> /etc/tcp.smtp + + tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp + +} |