diff options
author | Michael Hanselmann <hansmi@gentoo.org> | 2005-05-19 19:03:17 +0000 |
---|---|---|
committer | Michael Hanselmann <hansmi@gentoo.org> | 2005-05-19 19:03:17 +0000 |
commit | 16ebe2ea6c37742a25172bc923a4e75f5ecb406c (patch) | |
tree | dc6cb5a8fccc51c193f9160f8ea5a7c500ad9294 /mail-mta | |
parent | initial import from #93150 (diff) | |
download | gentoo-2-16ebe2ea6c37742a25172bc923a4e75f5ecb406c.tar.gz gentoo-2-16ebe2ea6c37742a25172bc923a4e75f5ecb406c.tar.bz2 gentoo-2-16ebe2ea6c37742a25172bc923a4e75f5ecb406c.zip |
Cleaned up ... a bit
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'mail-mta')
116 files changed, 64 insertions, 6320 deletions
diff --git a/mail-mta/qmail/ChangeLog b/mail-mta/qmail/ChangeLog index 24d8ff7130ba..a811836fefbf 100644 --- a/mail-mta/qmail/ChangeLog +++ b/mail-mta/qmail/ChangeLog @@ -1,6 +1,69 @@ # ChangeLog for mail-mta/qmail # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/ChangeLog,v 1.38 2005/05/19 03:37:20 anarchy Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/ChangeLog,v 1.39 2005/05/19 19:03:16 hansmi Exp $ + + 19 May 2005; Michael Hanselmann <hansmi@gentoo.org> + -files/1.03-r10/99qmail, -files/1.03-r10/defaultdelivery, + -files/1.03-r10/dot_qmail, -files/1.03-r10/errno.patch, + -files/1.03-r10/qmail-control, -files/1.03-r10/rc, + -files/1.03-r10/run-qmailpop3d, -files/1.03-r10/run-qmailpop3dlog, + -files/1.03-r10/run-qmailsend, -files/1.03-r10/run-qmailsendlog, + -files/1.03-r10/run-qmailsmtpd, -files/1.03-r10/run-qmailsmtpdlog, + -files/1.03-r10/smtp-auth-close3.patch, -files/1.03-r10/tls.patch.bz2, + -files/1.03-r10/tls-patch.txt, -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, + -files/1.03-r12/99qmail, -files/1.03-r12/bad-rcpt-noisy-patch, + -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/config-sanity-check, + -files/1.03-r12/dot_qmail, -files/1.03-r12/errno.patch, + -files/1.03-r12/maildir-quota-fix.patch, -files/1.03-r12/qmail-control, + -files/1.03-r12/qmail-remote-auth-login.patch, + -files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch, + -files/1.03-r12/qmail-smtpd-relay-reject.gentoo.patch, -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, -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, + -files/1.03-r8/defaultdelivery, -files/1.03-r8/dot_qmail, + -files/1.03-r8/qmail-1.03-starttls-smtp-auth.patch, + -files/1.03-r8/qmail-control, -files/1.03-r8/qmail-linksync.patch, + -files/1.03-r8/qmail-queue.patch, -files/1.03-r8/rc, + -files/1.03-r8/run-qmailsend, -files/1.03-r8/run-qmailsendlog, + -files/1.03-r8/run-qmailsmtpd, -files/1.03-r8/run-qmailsmtpdlog, + -files/1.03-r9/defaultdelivery, -files/1.03-r9/dot_qmail, + -files/1.03-r9/qmail-1.03-starttls-smtp-auth.patch, + -files/1.03-r9/qmail-control, -files/1.03-r9/qmail-linksync.patch, + -files/1.03-r9/qmail-queue.patch, -files/1.03-r9/run-qmailsend, + -files/1.03-r9/run-qmailsendlog, -files/1.03-r9/run-qmailsmtpd, + -files/1.03-r9/run-qmailsmtpdlog, -qmail-1.03-r14.ebuild: + Cleaned up 19 May 2005; Jory A. Pratt<anarchy@gentoo.org> -qmail-1.03-r8.ebuild, -qmail-1.03-r9.ebuild, -qmail-1.03-r10.ebuild, -qmail-1.03-r11.ebuild, diff --git a/mail-mta/qmail/files/1.03-r10/99qmail b/mail-mta/qmail/files/1.03-r10/99qmail deleted file mode 100644 index d17f5d7dbee9..000000000000 --- a/mail-mta/qmail/files/1.03-r10/99qmail +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index d0ef7de8b590..000000000000 --- a/mail-mta/qmail/files/1.03-r10/defaultdelivery +++ /dev/null @@ -1,2 +0,0 @@ -|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 deleted file mode 100644 index 7c9e5d08f067..000000000000 --- a/mail-mta/qmail/files/1.03-r10/dot_qmail +++ /dev/null @@ -1 +0,0 @@ -./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r10/errno.patch b/mail-mta/qmail/files/1.03-r10/errno.patch deleted file mode 100644 index f9b77b91e065..000000000000 --- a/mail-mta/qmail/files/1.03-r10/errno.patch +++ /dev/null @@ -1,38 +0,0 @@ -% 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 deleted file mode 100644 index 810b21e1f191..000000000000 --- a/mail-mta/qmail/files/1.03-r10/qmail-control +++ /dev/null @@ -1,30 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# 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.2 2004/07/14 22:34:06 agriffis 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 deleted file mode 100644 index a7bbdc986766..000000000000 --- a/mail-mta/qmail/files/1.03-r10/rc +++ /dev/null @@ -1,4 +0,0 @@ -#!/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 deleted file mode 100644 index acf14ac43ae2..000000000000 --- a/mail-mta/qmail/files/1.03-r10/run-qmailpop3d +++ /dev/null @@ -1,6 +0,0 @@ -#!/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 deleted file mode 100644 index b1fcb8f4af22..000000000000 --- a/mail-mta/qmail/files/1.03-r10/run-qmailpop3dlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 8dbd3adf524f..000000000000 --- a/mail-mta/qmail/files/1.03-r10/run-qmailsend +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 5ff50d1e7711..000000000000 --- a/mail-mta/qmail/files/1.03-r10/run-qmailsendlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 9733e11e154a..000000000000 --- a/mail-mta/qmail/files/1.03-r10/run-qmailsmtpd +++ /dev/null @@ -1,6 +0,0 @@ -#!/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 deleted file mode 100644 index 2d9546146583..000000000000 --- a/mail-mta/qmail/files/1.03-r10/run-qmailsmtpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 82fda701fd12..000000000000 --- a/mail-mta/qmail/files/1.03-r10/smtp-auth-close3.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- 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 deleted file mode 100644 index 11b29a778f89..000000000000 --- a/mail-mta/qmail/files/1.03-r10/tls-patch.txt +++ /dev/null @@ -1,105 +0,0 @@ -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 differdeleted file mode 100644 index ee9d912da088..000000000000 --- a/mail-mta/qmail/files/1.03-r10/tls.patch.bz2 +++ /dev/null diff --git a/mail-mta/qmail/files/1.03-r11/99qmail b/mail-mta/qmail/files/1.03-r11/99qmail deleted file mode 100644 index d9d929e4892b..000000000000 --- a/mail-mta/qmail/files/1.03-r11/99qmail +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 7d7415f4b495..000000000000 --- a/mail-mta/qmail/files/1.03-r11/conf-common +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# Configuration file for all qmail daemons -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r11/conf-common,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index be338643cb8c..000000000000 --- a/mail-mta/qmail/files/1.03-r11/conf-qmqpd +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# Configuration file for qmail-qmqpd -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r11/conf-qmqpd,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 8f76403aca1f..000000000000 --- a/mail-mta/qmail/files/1.03-r11/conf-qmtpd +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# Configuration file for qmail-qmtpd -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r11/conf-qmtpd,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 2f398c4222e5..000000000000 --- a/mail-mta/qmail/files/1.03-r11/conf-smtpd +++ /dev/null @@ -1,16 +0,0 @@ -#!/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 deleted file mode 100644 index d0ef7de8b590..000000000000 --- a/mail-mta/qmail/files/1.03-r11/defaultdelivery +++ /dev/null @@ -1,2 +0,0 @@ -|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 deleted file mode 100644 index 7c9e5d08f067..000000000000 --- a/mail-mta/qmail/files/1.03-r11/dot_qmail +++ /dev/null @@ -1 +0,0 @@ -./.maildir/ diff --git a/mail-mta/qmail/files/1.03-r11/errno.patch b/mail-mta/qmail/files/1.03-r11/errno.patch deleted file mode 100644 index f9b77b91e065..000000000000 --- a/mail-mta/qmail/files/1.03-r11/errno.patch +++ /dev/null @@ -1,38 +0,0 @@ -% 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 deleted file mode 100644 index ae9ebc76b13d..000000000000 --- a/mail-mta/qmail/files/1.03-r11/qmail-control +++ /dev/null @@ -1,30 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# 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.2 2004/07/14 22:34:06 agriffis 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 deleted file mode 100644 index a7bbdc986766..000000000000 --- a/mail-mta/qmail/files/1.03-r11/rc +++ /dev/null @@ -1,4 +0,0 @@ -#!/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 deleted file mode 100644 index 174d47ad310f..000000000000 --- a/mail-mta/qmail/files/1.03-r11/run-qmailpop3d +++ /dev/null @@ -1,6 +0,0 @@ -#!/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 deleted file mode 100644 index b1fcb8f4af22..000000000000 --- a/mail-mta/qmail/files/1.03-r11/run-qmailpop3dlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index e936de18973a..000000000000 --- a/mail-mta/qmail/files/1.03-r11/run-qmailqmqpd +++ /dev/null @@ -1,17 +0,0 @@ -#!/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 deleted file mode 100644 index d759fbcbcfe1..000000000000 --- a/mail-mta/qmail/files/1.03-r11/run-qmailqmqpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index d22c977593f0..000000000000 --- a/mail-mta/qmail/files/1.03-r11/run-qmailqmtpd +++ /dev/null @@ -1,17 +0,0 @@ -#!/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 deleted file mode 100644 index 413a217d7de6..000000000000 --- a/mail-mta/qmail/files/1.03-r11/run-qmailqmtpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 8dbd3adf524f..000000000000 --- a/mail-mta/qmail/files/1.03-r11/run-qmailsend +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 5ff50d1e7711..000000000000 --- a/mail-mta/qmail/files/1.03-r11/run-qmailsendlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 8ee797b566fb..000000000000 --- a/mail-mta/qmail/files/1.03-r11/run-qmailsmtpd +++ /dev/null @@ -1,17 +0,0 @@ -#!/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 deleted file mode 100644 index 2d9546146583..000000000000 --- a/mail-mta/qmail/files/1.03-r11/run-qmailsmtpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 82fda701fd12..000000000000 --- a/mail-mta/qmail/files/1.03-r11/smtp-auth-close3.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- 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 deleted file mode 100644 index d9d929e4892b..000000000000 --- a/mail-mta/qmail/files/1.03-r12/99qmail +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 576d6c410dcb..000000000000 --- a/mail-mta/qmail/files/1.03-r12/bad-rcpt-noisy-patch +++ /dev/null @@ -1,328 +0,0 @@ -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 deleted file mode 100644 index 601dfd5fb262..000000000000 --- a/mail-mta/qmail/files/1.03-r12/badrcptto-morebadrcptto-accdias-gentoo +++ /dev/null @@ -1,564 +0,0 @@ -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 deleted file mode 100644 index 023de481ac8e..000000000000 --- a/mail-mta/qmail/files/1.03-r12/conf-common +++ /dev/null @@ -1,29 +0,0 @@ -# Common Configuration file for all qmail daemons -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/conf-common,v 1.3 2005/02/14 12:26:31 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 16000000" - -# 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 deleted file mode 100644 index 7672c3fd59ac..000000000000 --- a/mail-mta/qmail/files/1.03-r12/conf-pop3d +++ /dev/null @@ -1,25 +0,0 @@ -# Configuration file for qmail-pop3d -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/conf-pop3d,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 35ee04a04446..000000000000 --- a/mail-mta/qmail/files/1.03-r12/conf-qmqpd +++ /dev/null @@ -1,15 +0,0 @@ -# Configuration file for qmail-qmqpd -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/conf-qmqpd,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index bc944970e7fe..000000000000 --- a/mail-mta/qmail/files/1.03-r12/conf-qmtpd +++ /dev/null @@ -1,18 +0,0 @@ -# Configuration file for qmail-qmtpd -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/conf-qmtpd,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index c5db42d91c20..000000000000 --- a/mail-mta/qmail/files/1.03-r12/conf-smtpd +++ /dev/null @@ -1,37 +0,0 @@ -# Configuration file for qmail-smtpd -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/conf-smtpd,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 5fe43e1bc7a7..000000000000 --- a/mail-mta/qmail/files/1.03-r12/config-sanity-check +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Configuration Sanity Checking for qmail -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r12/config-sanity-check,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 81a15fc5c50c..000000000000 --- a/mail-mta/qmail/files/1.03-r12/dot_qmail +++ /dev/null @@ -1,3 +0,0 @@ -# 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 deleted file mode 100644 index f9b77b91e065..000000000000 --- a/mail-mta/qmail/files/1.03-r12/errno.patch +++ /dev/null @@ -1,38 +0,0 @@ -% 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 deleted file mode 100644 index 3d38a477f5a1..000000000000 --- a/mail-mta/qmail/files/1.03-r12/maildir-quota-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 4faf73d212d5..000000000000 --- a/mail-mta/qmail/files/1.03-r12/qmail-control +++ /dev/null @@ -1,30 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# 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.2 2004/07/14 22:34:06 agriffis 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 deleted file mode 100644 index f819973e5987..000000000000 --- a/mail-mta/qmail/files/1.03-r12/qmail-remote-auth-login.patch +++ /dev/null @@ -1,218 +0,0 @@ -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 deleted file mode 100644 index 3409116d57ab..000000000000 --- a/mail-mta/qmail/files/1.03-r12/qmail-smtpd-esmtp-size-gentoo.patch +++ /dev/null @@ -1,81 +0,0 @@ -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 deleted file mode 100644 index e6aab720418c..000000000000 --- a/mail-mta/qmail/files/1.03-r12/qmail-smtpd-relay-reject.gentoo.patch +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100644 index 74b00778dc60..000000000000 --- a/mail-mta/qmail/files/1.03-r12/rc +++ /dev/null @@ -1,4 +0,0 @@ -#!/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 deleted file mode 100644 index 007fba8f337e..000000000000 --- a/mail-mta/qmail/files/1.03-r12/run-qmailpop3d +++ /dev/null @@ -1,26 +0,0 @@ -#!/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.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index b1fcb8f4af22..000000000000 --- a/mail-mta/qmail/files/1.03-r12/run-qmailpop3dlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 2752a94f5e64..000000000000 --- a/mail-mta/qmail/files/1.03-r12/run-qmailqmqpd +++ /dev/null @@ -1,27 +0,0 @@ -#!/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.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index d759fbcbcfe1..000000000000 --- a/mail-mta/qmail/files/1.03-r12/run-qmailqmqpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index ab52b9ee8fc9..000000000000 --- a/mail-mta/qmail/files/1.03-r12/run-qmailqmtpd +++ /dev/null @@ -1,27 +0,0 @@ -#!/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.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 413a217d7de6..000000000000 --- a/mail-mta/qmail/files/1.03-r12/run-qmailqmtpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 8dbd3adf524f..000000000000 --- a/mail-mta/qmail/files/1.03-r12/run-qmailsend +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 5ff50d1e7711..000000000000 --- a/mail-mta/qmail/files/1.03-r12/run-qmailsendlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index f104e377915d..000000000000 --- a/mail-mta/qmail/files/1.03-r12/run-qmailsmtpd +++ /dev/null @@ -1,27 +0,0 @@ -#!/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.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 2d9546146583..000000000000 --- a/mail-mta/qmail/files/1.03-r12/run-qmailsmtpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index e259bbf27977..000000000000 --- a/mail-mta/qmail/files/1.03-r12/smtp-auth-close3.patch +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100644 index d9d929e4892b..000000000000 --- a/mail-mta/qmail/files/1.03-r13/99qmail +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index cead661de1f2..000000000000 --- a/mail-mta/qmail/files/1.03-r13/conf-common +++ /dev/null @@ -1,29 +0,0 @@ -# Common Configuration file for all qmail daemons -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/conf-common,v 1.3 2005/02/14 12:26:31 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 16000000" - -# 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 deleted file mode 100644 index 8a219da90c53..000000000000 --- a/mail-mta/qmail/files/1.03-r13/conf-pop3d +++ /dev/null @@ -1,25 +0,0 @@ -# Configuration file for qmail-pop3d -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/conf-pop3d,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index de3e7a460520..000000000000 --- a/mail-mta/qmail/files/1.03-r13/conf-qmqpd +++ /dev/null @@ -1,15 +0,0 @@ -# Configuration file for qmail-qmqpd -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/conf-qmqpd,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index dcc79f01cc88..000000000000 --- a/mail-mta/qmail/files/1.03-r13/conf-qmtpd +++ /dev/null @@ -1,18 +0,0 @@ -# Configuration file for qmail-qmtpd -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/conf-qmtpd,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 6260ebd5b254..000000000000 --- a/mail-mta/qmail/files/1.03-r13/conf-smtpd +++ /dev/null @@ -1,37 +0,0 @@ -# Configuration file for qmail-smtpd -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/conf-smtpd,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 8796846d5cf0..000000000000 --- a/mail-mta/qmail/files/1.03-r13/config-sanity-check +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Configuration Sanity Checking for qmail -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/config-sanity-check,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 81a15fc5c50c..000000000000 --- a/mail-mta/qmail/files/1.03-r13/dot_qmail +++ /dev/null @@ -1,3 +0,0 @@ -# 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 deleted file mode 100644 index f9b77b91e065..000000000000 --- a/mail-mta/qmail/files/1.03-r13/errno.patch +++ /dev/null @@ -1,38 +0,0 @@ -% 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 deleted file mode 100644 index 3d38a477f5a1..000000000000 --- a/mail-mta/qmail/files/1.03-r13/maildir-quota-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 1b543f7c7a8c..000000000000 --- a/mail-mta/qmail/files/1.03-r13/mkservercert +++ /dev/null @@ -1,55 +0,0 @@ -#! /bin/sh -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/mkservercert,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 21595ba0751e..000000000000 --- a/mail-mta/qmail/files/1.03-r13/qmail-control +++ /dev/null @@ -1,30 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# 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.2 2004/07/14 22:34:06 agriffis 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 deleted file mode 100644 index aedfd9407670..000000000000 --- a/mail-mta/qmail/files/1.03-r13/qmail-genrsacert.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/qmail-genrsacert.sh,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 3409116d57ab..000000000000 --- a/mail-mta/qmail/files/1.03-r13/qmail-smtpd-esmtp-size-gentoo.patch +++ /dev/null @@ -1,81 +0,0 @@ -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 deleted file mode 100644 index e6aab720418c..000000000000 --- a/mail-mta/qmail/files/1.03-r13/qmail-smtpd-relay-reject.gentoo.patch +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100644 index 74b00778dc60..000000000000 --- a/mail-mta/qmail/files/1.03-r13/rc +++ /dev/null @@ -1,4 +0,0 @@ -#!/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 deleted file mode 100644 index 2ab2654483cb..000000000000 --- a/mail-mta/qmail/files/1.03-r13/run-qmailpop3d +++ /dev/null @@ -1,27 +0,0 @@ -#!/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.2 2004/07/05 00:14:00 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} \ - ${QMAIL_TCPSERVER_PRE} \ - /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 deleted file mode 100644 index b1fcb8f4af22..000000000000 --- a/mail-mta/qmail/files/1.03-r13/run-qmailpop3dlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index b7447f1af0ab..000000000000 --- a/mail-mta/qmail/files/1.03-r13/run-qmailqmqpd +++ /dev/null @@ -1,27 +0,0 @@ -#!/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.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index d759fbcbcfe1..000000000000 --- a/mail-mta/qmail/files/1.03-r13/run-qmailqmqpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index b8123f7a0a06..000000000000 --- a/mail-mta/qmail/files/1.03-r13/run-qmailqmtpd +++ /dev/null @@ -1,27 +0,0 @@ -#!/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.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 413a217d7de6..000000000000 --- a/mail-mta/qmail/files/1.03-r13/run-qmailqmtpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 8dbd3adf524f..000000000000 --- a/mail-mta/qmail/files/1.03-r13/run-qmailsend +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 5ff50d1e7711..000000000000 --- a/mail-mta/qmail/files/1.03-r13/run-qmailsendlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index c546c1068cd7..000000000000 --- a/mail-mta/qmail/files/1.03-r13/run-qmailsmtpd +++ /dev/null @@ -1,27 +0,0 @@ -#!/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.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index 2d9546146583..000000000000 --- a/mail-mta/qmail/files/1.03-r13/run-qmailsmtpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index f03c4bcd106b..000000000000 --- a/mail-mta/qmail/files/1.03-r13/servercert.cnf +++ /dev/null @@ -1,37 +0,0 @@ -# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail/files/1.03-r13/servercert.cnf,v 1.2 2004/07/18 03:29:51 dragonheart 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 deleted file mode 100644 index e259bbf27977..000000000000 --- a/mail-mta/qmail/files/1.03-r13/smtp-auth-close3.patch +++ /dev/null @@ -1,24 +0,0 @@ -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-r8/defaultdelivery b/mail-mta/qmail/files/1.03-r8/defaultdelivery deleted file mode 100644 index d0ef7de8b590..000000000000 --- a/mail-mta/qmail/files/1.03-r8/defaultdelivery +++ /dev/null @@ -1,2 +0,0 @@ -|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 deleted file mode 100644 index 7c9e5d08f067..000000000000 --- a/mail-mta/qmail/files/1.03-r8/dot_qmail +++ /dev/null @@ -1 +0,0 @@ -./.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 deleted file mode 100644 index 1a427fb55b62..000000000000 --- a/mail-mta/qmail/files/1.03-r8/qmail-1.03-starttls-smtp-auth.patch +++ /dev/null @@ -1,1408 +0,0 @@ - -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 deleted file mode 100644 index be8f7e1b728e..000000000000 --- a/mail-mta/qmail/files/1.03-r8/qmail-control +++ /dev/null @@ -1,30 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# 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.2 2004/07/14 22:34:06 agriffis 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 deleted file mode 100644 index 1b35f12aaa1f..000000000000 --- a/mail-mta/qmail/files/1.03-r8/qmail-linksync.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../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 deleted file mode 100644 index 4edd5fad86e5..000000000000 --- a/mail-mta/qmail/files/1.03-r8/qmail-queue.patch +++ /dev/null @@ -1,49 +0,0 @@ -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 deleted file mode 100644 index a7bbdc986766..000000000000 --- a/mail-mta/qmail/files/1.03-r8/rc +++ /dev/null @@ -1,4 +0,0 @@ -#!/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 deleted file mode 100644 index 8dbd3adf524f..000000000000 --- a/mail-mta/qmail/files/1.03-r8/run-qmailsend +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 5ff50d1e7711..000000000000 --- a/mail-mta/qmail/files/1.03-r8/run-qmailsendlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 9733e11e154a..000000000000 --- a/mail-mta/qmail/files/1.03-r8/run-qmailsmtpd +++ /dev/null @@ -1,6 +0,0 @@ -#!/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 deleted file mode 100644 index 2d9546146583..000000000000 --- a/mail-mta/qmail/files/1.03-r8/run-qmailsmtpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index d0ef7de8b590..000000000000 --- a/mail-mta/qmail/files/1.03-r9/defaultdelivery +++ /dev/null @@ -1,2 +0,0 @@ -|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 deleted file mode 100644 index 7c9e5d08f067..000000000000 --- a/mail-mta/qmail/files/1.03-r9/dot_qmail +++ /dev/null @@ -1 +0,0 @@ -./.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 deleted file mode 100644 index 1a427fb55b62..000000000000 --- a/mail-mta/qmail/files/1.03-r9/qmail-1.03-starttls-smtp-auth.patch +++ /dev/null @@ -1,1408 +0,0 @@ - -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 deleted file mode 100644 index d9f3c7e033d6..000000000000 --- a/mail-mta/qmail/files/1.03-r9/qmail-control +++ /dev/null @@ -1,30 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# 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.2 2004/07/14 22:34:06 agriffis 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 deleted file mode 100644 index 1b35f12aaa1f..000000000000 --- a/mail-mta/qmail/files/1.03-r9/qmail-linksync.patch +++ /dev/null @@ -1,54 +0,0 @@ ---- ../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 deleted file mode 100644 index 4edd5fad86e5..000000000000 --- a/mail-mta/qmail/files/1.03-r9/qmail-queue.patch +++ /dev/null @@ -1,49 +0,0 @@ -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 deleted file mode 100644 index 8dbd3adf524f..000000000000 --- a/mail-mta/qmail/files/1.03-r9/run-qmailsend +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 5ff50d1e7711..000000000000 --- a/mail-mta/qmail/files/1.03-r9/run-qmailsendlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/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 deleted file mode 100644 index 9733e11e154a..000000000000 --- a/mail-mta/qmail/files/1.03-r9/run-qmailsmtpd +++ /dev/null @@ -1,6 +0,0 @@ -#!/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 deleted file mode 100644 index 2d9546146583..000000000000 --- a/mail-mta/qmail/files/1.03-r9/run-qmailsmtpdlog +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-smtpd diff --git a/mail-mta/qmail/files/digest-qmail-1.03-r14 b/mail-mta/qmail/files/digest-qmail-1.03-r14 deleted file mode 100644 index 4d9be20c7e95..000000000000 --- a/mail-mta/qmail/files/digest-qmail-1.03-r14 +++ /dev/null @@ -1,23 +0,0 @@ -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/qmail-1.03-r14.ebuild b/mail-mta/qmail/qmail-1.03-r14.ebuild deleted file mode 100644 index 2c26977da5d0..000000000000 --- a/mail-mta/qmail/qmail-1.03-r14.ebuild +++ /dev/null @@ -1,466 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# 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.12 2005/03/03 18:43:27 ciaranm Exp $ - -inherit toolchain-funcs eutils fixheadtails - -IUSE="ssl noauthcram notlsbeforeauth selinux" -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 - mirror://qmail/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/old_software/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/libc - sys-apps/groff - ssl? ( >=dev-libs/openssl-0.9.6g ) - >=net-mail/queue-fix-1.4-r1" - -RDEPEND="!virtual/mta - virtual/libc - app-shells/bash - >=sys-apps/ucspi-tcp-0.88 - >=sys-process/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 - selinux? ( sec-policy/selinux-qmail )" - -PROVIDE="virtual/mta - virtual/mda" - -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 "$(tc-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 "$(tc-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 "every mail was 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 -} |