summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mail-mta')
-rw-r--r--mail-mta/qmail-mysql/ChangeLog45
-rw-r--r--mail-mta/qmail-mysql/Manifest48
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/99qmail4
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/conf-common29
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/conf-pop3d25
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/conf-qmqpd15
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/conf-qmtpd18
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/conf-smtpd37
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/config-sanity-check23
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/dot_qmail3
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/errno.patch38
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/maildir-quota-fix.patch13
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/mkservercert55
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/qmail-control30
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/qmail-genrsacert.sh33
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/qmail-smtpd-esmtp-size-gentoo.patch81
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/qmail-smtpd-relay-reject.gentoo.patch41
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/rc4
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/run-qmailpop3d26
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/run-qmailpop3dlog2
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmqpd27
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmqpdlog2
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmtpd27
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmtpdlog2
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/run-qmailsend2
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/run-qmailsendlog2
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/run-qmailsmtpd27
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/run-qmailsmtpdlog2
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/servercert.cnf37
-rw-r--r--mail-mta/qmail-mysql/files/1.03-r13/smtp-auth-close3.patch24
-rw-r--r--mail-mta/qmail-mysql/files/1.03/99qmail2
-rw-r--r--mail-mta/qmail-mysql/files/1.03/defaultdelivery2
-rw-r--r--mail-mta/qmail-mysql/files/1.03/dot_qmail1
-rw-r--r--mail-mta/qmail-mysql/files/1.03/errno.patch38
-rw-r--r--mail-mta/qmail-mysql/files/1.03/qmail-control30
-rw-r--r--mail-mta/qmail-mysql/files/1.03/rc4
-rw-r--r--mail-mta/qmail-mysql/files/1.03/run-qmailsend2
-rw-r--r--mail-mta/qmail-mysql/files/1.03/run-qmailsendlog2
-rw-r--r--mail-mta/qmail-mysql/files/1.03/run-qmailsmtpd6
-rw-r--r--mail-mta/qmail-mysql/files/1.03/run-qmailsmtpdlog2
-rw-r--r--mail-mta/qmail-mysql/files/digest-qmail-mysql-1.036
-rw-r--r--mail-mta/qmail-mysql/files/digest-qmail-mysql-1.03-r1321
-rw-r--r--mail-mta/qmail-mysql/files/tcp.pop3.sample7
-rw-r--r--mail-mta/qmail-mysql/files/tcp.qmqp.sample8
-rw-r--r--mail-mta/qmail-mysql/files/tcp.qmtp.sample8
-rw-r--r--mail-mta/qmail-mysql/files/tcp.smtp.sample83
-rw-r--r--mail-mta/qmail-mysql/metadata.xml5
-rw-r--r--mail-mta/qmail-mysql/qmail-mysql-1.03-r13.ebuild421
-rw-r--r--mail-mta/qmail-mysql/qmail-mysql-1.03.ebuild276
49 files changed, 1646 insertions, 0 deletions
diff --git a/mail-mta/qmail-mysql/ChangeLog b/mail-mta/qmail-mysql/ChangeLog
new file mode 100644
index 000000000000..430f66978235
--- /dev/null
+++ b/mail-mta/qmail-mysql/ChangeLog
@@ -0,0 +1,45 @@
+# ChangeLog for net-mail/qmail-mysql
+# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/ChangeLog,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+
+ 18 Jan 2004; Robin H. Johnson <robbat2@gentoo.org>
+ qmail-mysql-1.03-r13.ebuild, qmail-mysql-1.03.ebuild:
+ fixup for correct library list to solve bug #36562, where mysql is linked
+ against ssl, but we aren't building ssl support into qmail-mysql.
+
+ 25 Dec 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-mysql-1.03.ebuild:
+ change to keepdir as per bug #35308
+
+ 05 Dec 2003; Robin H. Johnson <robbat2@gentoo.org> qmail-mysql-1.03.ebuild:
+ fix chown . to : as per bug #35127
+
+*qmail-mysql-1.03-r13 (29 Nov 2003)
+
+ 29 Nov 2003; Robin H. Johnson <robbat2@gentoo.org>
+ qmail-mysql-1.03-r13.ebuild, files/tcp.pop3.sample, files/tcp.qmqp.sample,
+ files/tcp.qmtp.sample, files/tcp.smtp.sample, 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:
+ new revision, major changes. now integerates -r13 of main qmail package. bug
+ #20899 fixed. package hardmasked for more testing
+
+*qmail-mysql-1.03 (05 Feb 2003)
+
+ 29 Mar 2003; Martin Holzer <mholzer@gentoo.org> qmail-mysql-1.03.ebuild:
+ changed homepage. closes #18379.
+
+ 05 Feb 2003; Nick Hadaway <raker@gentoo.org> qmail-mysql-1.03.ebuild,
+ files/digest-qmail-mysql-1.03, files/1.03/* :
+ New qmail ebuild with the latest mysql patch and other patches.
diff --git a/mail-mta/qmail-mysql/Manifest b/mail-mta/qmail-mysql/Manifest
new file mode 100644
index 000000000000..3bd16a13e39d
--- /dev/null
+++ b/mail-mta/qmail-mysql/Manifest
@@ -0,0 +1,48 @@
+MD5 baa17f07c524e4d1d281622e366c1864 ChangeLog 2318
+MD5 ad5f709caba10633051e86b380239219 qmail-mysql-1.03.ebuild 8437
+MD5 5721b86fd871bdfab77231abc6e02f68 metadata.xml 161
+MD5 775eec6fc547196f638e9baa39878dd4 qmail-mysql-1.03-r13.ebuild 14068
+MD5 7dbe164188aa14fd05fa2c26d1095a9a files/digest-qmail-mysql-1.03 385
+MD5 02b7d10943e7640a9e4bc684a0c2ed1a files/digest-qmail-mysql-1.03-r13 1446
+MD5 55b519379b1330f57110fa6d60982cff files/tcp.pop3.sample 285
+MD5 e0686e52df7f0c840a7ac2bfe1fd291a files/tcp.qmqp.sample 337
+MD5 76d218a258e2ec859ab80c377351afce files/tcp.qmtp.sample 370
+MD5 946a715ffdd5e6d2d29c6fdfb29376dd files/tcp.smtp.sample 3726
+MD5 c378c5845848ee31d70f0d05cbcf86be files/1.03/dot_qmail 12
+MD5 5cb0c8c4c9feeee55362d77a99076c2f files/1.03/99qmail 44
+MD5 b24f4dbd450d2d4eddc75ba19cebb915 files/1.03/defaultdelivery 34
+MD5 c47d861aeef098d12d022d44c27386b5 files/1.03/errno.patch 850
+MD5 4b6834904a00eff57c10a9a68f9e3723 files/1.03/qmail-control 812
+MD5 f42a779e5c708c2d7bf38de66dfb93f5 files/1.03/rc 108
+MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03/run-qmailsend 29
+MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03/run-qmailsendlog 96
+MD5 aa0823cdce32c502c856664c8b0ce775 files/1.03/run-qmailsmtpd 231
+MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03/run-qmailsmtpdlog 97
+MD5 047436e2b3e309b09ea946db7fd66055 files/1.03-r13/conf-common 1101
+MD5 180a513f34e3f00abc609672a190072c files/1.03-r13/99qmail 137
+MD5 33dda088187a18e6953857bb473c6685 files/1.03-r13/conf-pop3d 1078
+MD5 a699750c413a20089d5090e7365eb632 files/1.03-r13/conf-qmqpd 477
+MD5 7ab839e1b1878708d470366ab136b113 files/1.03-r13/conf-qmtpd 569
+MD5 6b1f828ce78f419a8831d96d0dcb3a82 files/1.03-r13/conf-smtpd 1716
+MD5 0b3b3174044f23197f47e60df95b140c files/1.03-r13/config-sanity-check 821
+MD5 c369664bce0646b3d323d08f9ba5b8ce files/1.03-r13/dot_qmail 82
+MD5 c47d861aeef098d12d022d44c27386b5 files/1.03-r13/errno.patch 850
+MD5 6287c0a071fdd68a9038b6daed42b7e3 files/1.03-r13/maildir-quota-fix.patch 547
+MD5 0e00415ba1172ceae242ced4c747273d files/1.03-r13/mkservercert 1441
+MD5 43463548dee0c51fac4f6faff8efc462 files/1.03-r13/qmail-control 865
+MD5 46ff9cfd4e790458b4ffce380f011fe2 files/1.03-r13/qmail-genrsacert.sh 1177
+MD5 2a725c31201c59077cd389486407624f files/1.03-r13/qmail-smtpd-esmtp-size-gentoo.patch 2131
+MD5 d3997795df512803e6a27b5486d2b81e files/1.03-r13/qmail-smtpd-relay-reject.gentoo.patch 1433
+MD5 6c0f741d2f9a7cc5e6b346d435ab0e64 files/1.03-r13/rc 117
+MD5 eecd0de7832d76016bc6175f9225e98b files/1.03-r13/run-qmailpop3d 1183
+MD5 0e97c0b031776f40cacdfbf3114af574 files/1.03-r13/run-qmailpop3dlog 97
+MD5 87fad8ee7e6af929149bd47c8d02c473 files/1.03-r13/run-qmailqmqpd 1172
+MD5 249138d56492deb0f856849bc002e46a files/1.03-r13/run-qmailqmqpdlog 97
+MD5 1a97ad85b4adeef1237a9171111a014b files/1.03-r13/run-qmailqmtpd 1172
+MD5 795f633858c0919b6e201cf2b845779e files/1.03-r13/run-qmailqmtpdlog 97
+MD5 23a2babf3049fe012de21c17e550b3e5 files/1.03-r13/run-qmailsend 29
+MD5 834dad5113515d0f00981fdc1d07fa84 files/1.03-r13/run-qmailsendlog 96
+MD5 1dc42fe77fdaf153ef1a378b22af64b8 files/1.03-r13/run-qmailsmtpd 1172
+MD5 f43900d79a0aacb5e0d71b0bb6c06fea files/1.03-r13/run-qmailsmtpdlog 97
+MD5 751bbfb90eab7b327b58b02842c31bb2 files/1.03-r13/servercert.cnf 1110
+MD5 bed3133c1737dd9bc3c67e07f8bc65d8 files/1.03-r13/smtp-auth-close3.patch 728
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/99qmail b/mail-mta/qmail-mysql/files/1.03-r13/99qmail
new file mode 100644
index 000000000000..d9d929e4892b
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/99qmail
@@ -0,0 +1,4 @@
+PATH="/var/qmail/bin"
+ROOTPATH="/var/qmail/bin"
+CONFIG_PROTECT="/var/qmail/control /var/qmail/alias"
+QMAIL_CONTROLDIR=/var/qmail/control
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/conf-common b/mail-mta/qmail-mysql/files/1.03-r13/conf-common
new file mode 100644
index 000000000000..fb7e6cd74e19
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/conf-common
@@ -0,0 +1,29 @@
+# Common Configuration file for all qmail daemons
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/conf-common,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+
+# Qmail User IDS to run daemons as
+QMAILDUID=`id -u qmaild`
+NOFILESGID=`id -g qmaild`
+
+# Qmail Control Dir (this is actually set in /etc/env.d/99qmail)
+#QMAIL_CONTROLDIR=/var/qmail/control
+
+# Host and port to listen on
+# We listen on the IPv4 local ip by default
+TCPSERVER_HOST=0.0.0.0
+TCPSERVER_PORT=${SERVICE}
+
+# you do not need to specify -x, -c, -u or -g in this variable as those are
+# added later
+TCPSERVER_OPTS="-p -v"
+
+# we limit data and stack segments to 8mbytes, you may need to raise this if
+# you are using a filter in QMAILQUEUE
+SOFTLIMIT_OPTS="-m 8000000"
+
+# We don't have anything to set QMAILQUEUE to at the moment, so we leave it alone
+#QMAILQUEUE=""
+
+# tcpserver maximum concurrency, defaults to 40 in tcpserver
+# this controls the maximum number of incoming connections that it will accept
+[ -e ${QMAIL_CONTROLDIR}/concurrencyincoming ] && MAXCONN=$(<${QMAIL_CONTROLDIR}/concurrencyincoming) || MAXCONN=40
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/conf-pop3d b/mail-mta/qmail-mysql/files/1.03-r13/conf-pop3d
new file mode 100644
index 000000000000..8039bbb66259
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/conf-pop3d
@@ -0,0 +1,25 @@
+# Configuration file for qmail-pop3d
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/conf-pop3d,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+
+# Stuff to run before tcpserver
+#QMAIL_TCPSERVER_PRE=""
+# Stuff to run before the authenticator
+#QMAIL_POP3_PREAUTH=""
+# Stuff to run after the user has authenticated successfully
+#QMAIL_POP3_POSTAUTH=""
+
+# this should contain the FQDN of your server
+# by default it pulls the value from qmail
+# which should be correct
+QMAIL_POP3_POP3HOST="$(<${QMAIL_CONTROLDIR}/me)"
+
+# If you want POP3 before SMTP, and you are using this POP3 daemon
+# uncomment the next two lines
+#QMAIL_TCPSERVER_PRE="${QMAIL_TCPSERVER_PRE} envdir /etc/relay-ctrl relay-ctrl-chdir"
+#QMAIL_POP3_POSTAUTH="${QMAIL_POP3_POSTAUTH} /usr/bin/relay-ctrl-allow"
+
+# This controls what password authentication tool POP3 uses
+# It must support DJB's checkpassword interface (http://cr.yp.to/checkpwd.html)
+QMAIL_POP3_CHECKPASSWORD="/bin/checkpassword"
+# cmd5checkpw only validates passwords from /etc/poppasswd
+#QMAIL_POP3_CHECKPASSWORD="/bin/cmd5checkpw"
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/conf-qmqpd b/mail-mta/qmail-mysql/files/1.03-r13/conf-qmqpd
new file mode 100644
index 000000000000..85c5115acb8d
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/conf-qmqpd
@@ -0,0 +1,15 @@
+# Configuration file for qmail-qmqpd
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/conf-qmqpd,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+
+# Stuff to run before tcpserver
+#QMAIL_TCPSERVER_PRE=""
+# Stuff to run qmail-qmqpd
+#QMAIL_QMQP_PRE=""
+# Stuff to after qmail-qmqpd
+#QMAIL_QMQP_POST=""
+
+# this turns off the IDENT grab attempt on connecting
+TCPSERVER_OPTS="${TCPSERVER_OPTS} -R"
+
+# I don't trust /etc/services to have obscure ports
+TCPSERVER_PORT=628
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/conf-qmtpd b/mail-mta/qmail-mysql/files/1.03-r13/conf-qmtpd
new file mode 100644
index 000000000000..578d16f65bf6
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/conf-qmtpd
@@ -0,0 +1,18 @@
+# Configuration file for qmail-qmtpd
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/conf-qmtpd,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+
+# For more information on making your servers talk QMTP
+# see http://cr.yp.to/im/mxps.html
+
+# Stuff to run before tcpserver
+#QMAIL_TCPSERVER_PRE=""
+# Stuff to run qmail-qmtpd
+#QMAIL_QMTP_PRE=""
+# Stuff to after qmail-qmtpd
+#QMAIL_QMTP_POST=""
+
+# this turns off the IDENT grab attempt on connecting
+TCPSERVER_OPTS="${TCPSERVER_OPTS} -R"
+
+# I don't trust /etc/services to have obscure ports
+TCPSERVER_PORT=209
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/conf-smtpd b/mail-mta/qmail-mysql/files/1.03-r13/conf-smtpd
new file mode 100644
index 000000000000..25d84251c11d
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/conf-smtpd
@@ -0,0 +1,37 @@
+# Configuration file for qmail-smtpd
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/conf-smtpd,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+
+# Stuff to run before tcpserver
+#QMAIL_TCPSERVER_PRE=""
+# Stuff to run qmail-smtpd
+#QMAIL_SMTP_PRE=""
+# Stuff to after qmail-smtpd
+#QMAIL_SMTP_POST=""
+
+# this turns off the IDENT grab attempt on connecting
+TCPSERVER_OPTS="${TCPSERVER_OPTS} -R"
+
+# You might want to use rblsmtpd with this, but you need to fill in a RBL server here first
+# see http://cr.yp.to/ucspi-tcp/rblsmtpd.html for more details
+#QMAIL_SMTP_PRE="${QMAIL_SMTP_PRE} rblsmtpd -r RBL-SERVER"
+
+# If you are interested in providing POP or IMAP before SMTP type relaying,
+# emerge relay-ctrl, then uncomment the next 2 lines
+#QMAIL_TCPSERVER_PRE="${QMAIL_TCPSERVER_PRE} envdir /etc/relay-ctrl relay-ctrl-chdir"
+#QMAIL_SMTP_POST="${QMAIL_SMTP_POST} relay-ctrl-check"
+# In /etc/courier-imap/authdaemonrc add the next line to the end:
+#authmodulelist="${authmodulelist} relay-ctrl-allow"
+# Then in /etc/courier-imap/{imapd,imapd-ssl,pop3d,pop3d-ssl}
+# Add this at the end
+#PRERUN="${PRERUN} envdir /etc/relay-ctrl relay-ctrl-chdir"
+
+# This next block is for SMTP-AUTH
+# This provides the LOGIN, PLAIN and CRAM-MD5 types
+# the 'cmd5checkpw' used in $QMAIL_SMTP_AUTHCHECKPASSWORD supports CRAM-MD5
+# and reads it's data from /etc/poppasswd
+# see the manpage for cmd5checkpw for details on the passwords
+# uncomment the next four lines to enable SMTP-AUTH
+#QMAIL_SMTP_AUTHHOST=$(<${QMAIL_CONTROLDIR}/me)
+#[ -z "${QMAIL_SMTP_POST}" ] && QMAIL_SMTP_POST=/bin/true
+#QMAIL_SMTP_CHECKPASSWORD="/bin/cmd5checkpw"
+#QMAIL_SMTP_POST="${QMAIL_SMTP_AUTHHOST} ${QMAIL_SMTP_CHECKPASSWORD} ${QMAIL_SMTP_POST}"
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/config-sanity-check b/mail-mta/qmail-mysql/files/1.03-r13/config-sanity-check
new file mode 100644
index 000000000000..a5e746c13a8e
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/config-sanity-check
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Configuration Sanity Checking for qmail
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/config-sanity-check,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+# This is intended solely to stop qmail eating up all your hard disk space with logs
+
+CONFIG_SANITY_GOOD=1
+
+# check simple stuff first
+if [ -z "${QMAILDUID}" -o -z "${NOFILESGID}" -o -z "${SERVICE}" ]; then
+ echo "SERVICE(${SERVICE}), QMAILDUID(${QMAILDUID}) or NOFILESGID(${NOFILESGID}) is unset in $0"
+ CONFIG_SANITY_GOOD=0
+fi
+
+# now make sure we are are on a port that is resolable to a port number
+if [ -z "`getent services ${TCPSERVER_PORT}`" ]; then
+ CONFIG_SANITY_GOOD=0
+fi
+
+if [ ! "${CONFIG_SANITY_GOOD}" -eq "1" ]; then
+ echo "Some error detected, sleeping for 30 seconds for safety"
+ sleep 30s
+ exit 1
+fi
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/dot_qmail b/mail-mta/qmail-mysql/files/1.03-r13/dot_qmail
new file mode 100644
index 000000000000..81a15fc5c50c
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/dot_qmail
@@ -0,0 +1,3 @@
+# Uncomment the next line for .forward support
+#|dot-forward .forward
+./.maildir/
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/errno.patch b/mail-mta/qmail-mysql/files/1.03-r13/errno.patch
new file mode 100644
index 000000000000..f9b77b91e065
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/errno.patch
@@ -0,0 +1,38 @@
+% diff -u3 error.h.orig error.h
+--- error.h.orig 1998-06-15 06:53:16.000000000 -0400
++++ error.h 2002-12-24 20:28:40.000000000 -0500
+@@ -1,7 +1,7 @@
+ #ifndef ERROR_H
+ #define ERROR_H
+
+-extern int errno;
++#include <errno.h>
+
+ extern int error_intr;
+ extern int error_nomem;
+
+
+% diff -u3 dns.c.orig dns.c
+--- dns.c.orig 2002-08-09 19:20:48.000000000 -0400
++++ dns.c 2002-12-24 20:42:46.000000000 -0500
+@@ -7,8 +7,6 @@
+ #include <errno.h>
+ extern int res_query();
+ extern int res_search();
+-extern int errno;
+-extern int h_errno;
+ #include "ip.h"
+ #include "ipalloc.h"
+ #include "fmt.h"
+
+
+% diff -u3 cdb_seek.c.orig cdb_seek.c
+--- cdb_seek.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ cdb_seek.c 2002-12-24 20:42:52.000000000 -0500
+@@ -1,6 +1,5 @@
+ #include <sys/types.h>
+ #include <errno.h>
+-extern int errno;
+ #include "cdb.h"
+
+ #ifndef SEEK_SET
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/maildir-quota-fix.patch b/mail-mta/qmail-mysql/files/1.03-r13/maildir-quota-fix.patch
new file mode 100644
index 000000000000..d101e79cf30c
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/maildir-quota-fix.patch
@@ -0,0 +1,13 @@
+diff -ur qmail-1.03.orig/overmaildirquota.c qmail-1.03/overmaildirquota.c
+--- qmail-1.03.orig/overmaildirquota.c 2003-08-28 18:44:46.000000000 -0700
++++ qmail-1.03/overmaildirquota.c 2003-08-28 18:48:06.000000000 -0700
+@@ -12,8 +12,7 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+
+-static const char rcsid[]="$Id: overquota.c,v 1.0 2002/06/09 16:21:05 mr
+-sam Exp $";
++static const char rcsid[]="$Id: maildir-quota-fix.patch,v 1.1 2004/05/30 10:52:14 robbat2 Exp $";
+
+
+ int user_over_maildirquota( const char *dir, const char *q)
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/mkservercert b/mail-mta/qmail-mysql/files/1.03-r13/mkservercert
new file mode 100644
index 000000000000..1a5d06220fe1
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/mkservercert
@@ -0,0 +1,55 @@
+#! /bin/sh
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/mkservercert,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+# Self-signed certificate generator for Qmail under Gentoo
+# Robin H. Johnson <robbat2@gentoo.org> - October 17, 2003
+# Based on mkimapdcert from courier-imap.
+
+test -x /usr/bin/openssl || exit 0
+source /sbin/functions.sh
+
+filedir="/var/qmail/control"
+pemfile="${filedir}/servercert.pem"
+randfile="${filedir}/servercert.rand"
+conffile="${filedir}/servercert.cnf"
+
+# file details for pemfile
+mode="0640"
+uid="qmaild"
+gid="qmail"
+
+# expire on certifcate
+days="365"
+
+if test -f $pemfile
+then
+ eerror "$pemfile already exists."
+ exit 1
+fi
+
+ewarn "Please customize ${conffile} before continuing!"
+einfo "Press ENTER to continue, or CTRL-C to stop now."
+read
+
+# setup the temp file
+cp /dev/null $pemfile
+chmod 600 $pemfile
+chown root $pemfile
+
+cleanup() {
+ rm -f $pemfile
+ rm -f $randfile
+ exit 1
+}
+
+dd if=/dev/urandom of=${randfile} bs=64 count=1 2>/dev/null
+chmod 600 ${randfile}
+einfo "Creating self-signed certificate"
+/usr/bin/openssl req -new -x509 -days ${days} -nodes \
+ -config ${conffile} -out $pemfile -keyout $pemfile -rand ${randfile} || cleanup
+einfo "Certificate details"
+/usr/bin/openssl x509 -subject -dates -fingerprint -noout -in $pemfile || cleanup
+chown ${uid}:${gid} ${pemfile}
+chmod ${mode} ${pemfile}
+#qmail needs an extra item
+ln -s ${pemfile} ${filedir}/clientcert.pem
+rm -f $randfile
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/qmail-control b/mail-mta/qmail-mysql/files/1.03-r13/qmail-control
new file mode 100644
index 000000000000..c9970718851f
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/qmail-control
@@ -0,0 +1,30 @@
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/qmail-control,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+
+opts="start stop restart reload"
+
+start() {
+ ebegin "Starting qmail mta ..."
+ svc -u /service/qmail-{smtpd,send,qmqp,qmtp}
+ eend $?
+ ebegin "Starting qmail mta logging ..."
+ svc -u /service/qmail-{smtpd,send,qmqp,qmtp}/log
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping qmail mta ..."
+ svc -d /service/qmail-{smtpd,send,qmqp,qmtp}
+ eend $?
+ ebegin "Stopping qmail mta logging ..."
+ svc -d /service/qmail-{smtpd,send,qmqp,qmtp}/log
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading 'locals' and 'virtualdomains' control files."
+ svc -h /service/qmail-send
+ eend $?
+}
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/qmail-genrsacert.sh b/mail-mta/qmail-mysql/files/1.03-r13/qmail-genrsacert.sh
new file mode 100644
index 000000000000..1389a2ec2d6b
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/qmail-genrsacert.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/qmail-genrsacert.sh,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+# Robin H. Johnson <robbat2@gentoo.org> - October 17, 2003
+# This file generates the static temporary RSA keys needed for qmail to encrypt messages
+# It should be run from a crontab, once a day is ok on low load machines, but
+# if you do lots of mail, once per hour is more reasonable
+# if you do NOT create the rsa512.pem, qmail will generate it on the fly for
+# each connection, which can be VERY slow.
+
+if [ -z "${ROOT}" -o "${ROOT}" = "/" ]; then
+confdir=/var/qmail/control
+else
+confdir=${ROOT}/var/qmail/control
+fi
+pemfile="${confdir}/rsa512.pem"
+tmpfile="${confdir}/rsa512.pem.tmp"
+
+# this is the number of bits in the key
+# it should be a power of 2 ideally
+# and it must be more than 64!
+bits="512"
+
+# the key should be 0600
+# which is readable by qmaild only!
+umaskvalue="0077"
+uid="qmaild"
+gid="qmail"
+
+umask ${umaskvalue} ;
+# we need to make sure that all of the operations succeed
+/usr/bin/openssl genrsa -out ${tmpfile} ${bits} 2>/dev/null && \
+/bin/chown ${uid}:${gid} ${tmpfile} && \
+/bin/mv -f ${tmpfile} ${pemfile}
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/qmail-smtpd-esmtp-size-gentoo.patch b/mail-mta/qmail-mysql/files/1.03-r13/qmail-smtpd-esmtp-size-gentoo.patch
new file mode 100644
index 000000000000..3409116d57ab
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/qmail-smtpd-esmtp-size-gentoo.patch
@@ -0,0 +1,81 @@
+diff -ur qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
+--- qmail-1.03.orig/qmail-smtpd.c 2003-09-01 21:47:32.000000000 -0700
++++ qmail-1.03/qmail-smtpd.c 2003-09-01 21:48:36.000000000 -0700
+@@ -117,6 +117,7 @@
+ void err_nogwcert() { out("553 no valid cert for gatewaying (#5.7.1)\r\n"); }
+ #endif
+ void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); }
++void err_size() { out("552 sorry, that message size exceeds my databytes limit (#5.3.4)\r\n"); }
+ void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); }
+ void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); }
+ void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); }
+@@ -296,6 +297,40 @@
+ return 1;
+ }
+
++int sizelimit(arg)
++char *arg;
++{
++ int i;
++ long r;
++ unsigned long sizebytes = 0;
++
++ i = str_chr(arg,'<');
++ if (arg[i])
++ arg += i + 1;
++ else {
++ arg += str_chr(arg,':');
++ if (*arg == ':') ++arg;
++ while (*arg == ' ') ++arg;
++ }
++
++ arg += str_chr(arg,' ');
++ if (*arg == ' ') while (*arg == ' ') ++arg;
++ else return 1;
++
++ i = str_chr(arg,'=');
++ arg[i] = 0;
++ if (case_equals(arg,"SIZE")) {
++ arg += i;
++ while (*++arg && *arg > 47 && *arg < 58) {
++ sizebytes *= 10;
++ sizebytes += *arg - 48;
++ }
++ r = databytes - sizebytes;
++ if (r < 0) return 0;
++ }
++ return 1;
++}
++
+ int bmcheck(which) int which;
+ {
+ int i = 0;
+@@ -351,6 +386,12 @@
+ smtp_greet("250 "); out("\r\n");
+ seenmail = 0; dohelo(arg);
+ }
++char size_buf[FMT_ULONG];
++void smtp_size()
++{
++ size_buf[fmt_ulong(size_buf,(unsigned long) databytes)] = 0;
++ out("\r\n250-SIZE "); out(size_buf);
++}
+ void smtp_ehlo(arg) char *arg;
+ {
+ smtp_greet("250-");
+@@ -364,6 +405,7 @@
+ #ifdef TLS
+ if (!ssl) out("\r\n250-STARTTLS");
+ #endif
++ smtp_size();
+ out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n");
+ seenmail = 0; dohelo(arg);
+ }
+@@ -375,6 +417,7 @@
+ void smtp_mail(arg) char *arg;
+ {
+ if (!addrparse(arg)) { err_syntax(); return; }
++ if (databytes && !sizelimit(arg)) { err_size(); return; }
+ if (bmfok) flagbarfbmf = bmcheck(BMCHECK_BMF);
+ seenmail = 1;
+ if (!stralloc_copys(&rcptto,"")) die_nomem();
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/qmail-smtpd-relay-reject.gentoo.patch b/mail-mta/qmail-mysql/files/1.03-r13/qmail-smtpd-relay-reject.gentoo.patch
new file mode 100644
index 000000000000..e6aab720418c
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/qmail-smtpd-relay-reject.gentoo.patch
@@ -0,0 +1,41 @@
+diff -ur -x '*.*orig' qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
+--- qmail-1.03.orig/qmail-smtpd.c 2003-09-01 21:51:08.000000000 -0700
++++ qmail-1.03/qmail-smtpd.c 2003-09-01 21:52:12.000000000 -0700
+@@ -119,6 +119,7 @@
+ void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); }
+ void err_size() { out("552 sorry, that message size exceeds my databytes limit (#5.3.4)\r\n"); }
+ void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); }
++void err_relay() { out("553 we don't relay (#5.7.1)\r\n"); }
+ void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); }
+ void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); }
+ void err_noop() { out("250 ok\r\n"); }
+@@ -374,6 +375,21 @@
+ return r;
+ }
+
++int addrrelay()
++{
++ int j;
++ j = addr.len;
++ while(--j >= 0)
++ if (addr.s[j] == '@') break;
++ if (j < 0) j = addr.len;
++ while(--j >= 0) {
++ if (addr.s[j] == '@') return 1;
++ if (addr.s[j] == '%') return 1;
++ if (addr.s[j] == '!') return 1;
++ }
++ return 0;
++}
++
+
+ int seenmail = 0;
+ int flagbarfbmf; /* defined if seenmail */
+@@ -434,6 +450,7 @@
+ void smtp_rcpt(arg) char *arg; {
+ if (!seenmail) { err_wantmail(); return; }
+ if (!addrparse(arg)) { err_syntax(); return; }
++ if (addrrelay()) { err_relay(); return; }
+ if ((!flagbarfbmf) && (bmtok)) { flagbarfbmt = bmcheck(BMCHECK_BMT); }
+ if (flagbarfbmf) {
+ strerr_warn4("qmail-smtpd: badmailfrom: ",mailfrom.s," at ",remoteip,0);
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/rc b/mail-mta/qmail-mysql/files/1.03-r13/rc
new file mode 100644
index 000000000000..74b00778dc60
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/rc
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+exec env - PATH="/var/qmail/bin:$PATH" \
+ qmail-start "`grep -v '^#' /var/qmail/control/defaultdelivery`"
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/run-qmailpop3d b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailpop3d
new file mode 100644
index 000000000000..6105ac22be13
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailpop3d
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's POP3 daemon
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/run-qmailpop3d,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+#
+# If you need to edit this file, please look at editing conf-pop3d and
+# conf-common first. If you still need to change this file, you should
+# probably file a bug on the bugzilla saying what you wanted to change so that
+# modification can be make possible via the configuration files
+
+# This is to make life easier
+SERVICE=pop3
+
+# this is to inherit QMAIL_CONTROLDIR
+. /etc/profile
+
+[ -s ${QMAIL_CONTROLDIR}/conf-common ] && source ${QMAIL_CONTROLDIR}/conf-common
+[ -s ${QMAIL_CONTROLDIR}/conf-${SERVICE}d ] && source ${QMAIL_CONTROLDIR}/conf-${SERVICE}d
+[ -s /var/qmail/bin/config-sanity-check ] && source /var/qmail/bin/config-sanity-check
+
+exec /usr/bin/softlimit ${SOFTLIMIT_OPTS} \
+ /usr/bin/tcpserver ${TCPSERVER_OPTS} -x /etc/tcp.${SERVICE}.cdb -c ${MAXCONN} \
+ ${TCPSERVER_HOST} ${TCPSERVER_PORT} \
+ ${QMAIL_POP3_PREAUTH} /var/qmail/bin/qmail-popup ${QMAIL_POP3_POP3HOST} \
+ ${QMAIL_POP3_CHECKPASSWORD} ${QMAIL_POP3_POSTAUTH} \
+ /var/qmail/bin/qmail-pop3d .maildir 2>&1
+
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/run-qmailpop3dlog b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailpop3dlog
new file mode 100644
index 000000000000..b1fcb8f4af22
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailpop3dlog
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-pop3d
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmqpd b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmqpd
new file mode 100644
index 000000000000..531ac55b3e2e
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmqpd
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's QMQP daemon
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmqpd,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+#
+# If you need to edit this file, please look at editing conf-qmqpd and
+# conf-common first. If you still need to change this file, you should
+# probably file a bug on the bugzilla saying what you wanted to change so that
+# modification can be make possible via the configuration files
+
+# This is to make life easier
+SERVICE=qmqp
+
+# this is to inherit QMAIL_CONTROLDIR
+. /etc/profile
+
+[ -s ${QMAIL_CONTROLDIR}/conf-common ] && source ${QMAIL_CONTROLDIR}/conf-common
+[ -s ${QMAIL_CONTROLDIR}/conf-${SERVICE}d ] && source ${QMAIL_CONTROLDIR}/conf-${SERVICE}d
+[ -s /var/qmail/bin/config-sanity-check ] && source /var/qmail/bin/config-sanity-check
+
+# Now run it all
+exec /usr/bin/softlimit ${SOFTLIMIT_OPTS} \
+ ${QMAIL_TCPSERVER_PRE} \
+ /usr/bin/tcpserver ${TCPSERVER_OPTS} -x /etc/tcp.${SERVICE}.cdb \
+ -c ${MAXCONN} -u ${QMAILDUID} -g ${NOFILESGID} \
+ ${TCPSERVER_HOST} ${TCPSERVER_PORT} \
+ ${QMAIL_QMQP_PRE} /var/qmail/bin/qmail-${SERVICE}d ${QMAIL_QMQP_POST} \
+ 2>&1
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmqpdlog b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmqpdlog
new file mode 100644
index 000000000000..d759fbcbcfe1
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmqpdlog
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-qmqpd
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmtpd b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmtpd
new file mode 100644
index 000000000000..166f113585a6
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmtpd
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's QMTP daemon
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmtpd,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+#
+# If you need to edit this file, please look at editing conf-qmtpd and
+# conf-common first. If you still need to change this file, you should
+# probably file a bug on the bugzilla saying what you wanted to change so that
+# modification can be make possible via the configuration files
+
+# This is to make life easier
+SERVICE=qmtp
+
+# this is to inherit QMAIL_CONTROLDIR
+. /etc/profile
+
+[ -s ${QMAIL_CONTROLDIR}/conf-common ] && source ${QMAIL_CONTROLDIR}/conf-common
+[ -s ${QMAIL_CONTROLDIR}/conf-${SERVICE}d ] && source ${QMAIL_CONTROLDIR}/conf-${SERVICE}d
+[ -s /var/qmail/bin/config-sanity-check ] && source /var/qmail/bin/config-sanity-check
+
+# Now run it all
+exec /usr/bin/softlimit ${SOFTLIMIT_OPTS} \
+ ${QMAIL_TCPSERVER_PRE} \
+ /usr/bin/tcpserver ${TCPSERVER_OPTS} -x /etc/tcp.${SERVICE}.cdb \
+ -c ${MAXCONN} -u ${QMAILDUID} -g ${NOFILESGID} \
+ ${TCPSERVER_HOST} ${TCPSERVER_PORT} \
+ ${QMAIL_QMTP_PRE} /var/qmail/bin/qmail-${SERVICE}d ${QMAIL_QMTP_POST} \
+ 2>&1
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmtpdlog b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmtpdlog
new file mode 100644
index 000000000000..413a217d7de6
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailqmtpdlog
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-qmtpd
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsend b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsend
new file mode 100644
index 000000000000..8dbd3adf524f
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsend
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /var/qmail/rc
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsendlog b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsendlog
new file mode 100644
index 000000000000..5ff50d1e7711
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsendlog
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-send
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsmtpd b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsmtpd
new file mode 100644
index 000000000000..a3f8a1176f90
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsmtpd
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Gentoo Startup script for qmail's SMTP daemon
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsmtpd,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+#
+# If you need to edit this file, please look at editing conf-smtpd and
+# conf-common first. If you still need to change this file, you should
+# probably file a bug on the bugzilla saying what you wanted to change so that
+# modification can be make possible via the configuration files
+
+# This is to make life easier
+SERVICE=smtp
+
+# this is to inherit QMAIL_CONTROLDIR
+. /etc/profile
+
+[ -s ${QMAIL_CONTROLDIR}/conf-common ] && source ${QMAIL_CONTROLDIR}/conf-common
+[ -s ${QMAIL_CONTROLDIR}/conf-${SERVICE}d ] && source ${QMAIL_CONTROLDIR}/conf-${SERVICE}d
+[ -s /var/qmail/bin/config-sanity-check ] && source /var/qmail/bin/config-sanity-check
+
+# Now run it all
+exec /usr/bin/softlimit ${SOFTLIMIT_OPTS} \
+ ${QMAIL_TCPSERVER_PRE} \
+ /usr/bin/tcpserver ${TCPSERVER_OPTS} -x /etc/tcp.${SERVICE}.cdb \
+ -c ${MAXCONN} -u ${QMAILDUID} -g ${NOFILESGID} \
+ ${TCPSERVER_HOST} ${TCPSERVER_PORT} \
+ ${QMAIL_SMTP_PRE} /var/qmail/bin/qmail-${SERVICE}d ${QMAIL_SMTP_POST} \
+ 2>&1
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsmtpdlog b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsmtpdlog
new file mode 100644
index 000000000000..2d9546146583
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/run-qmailsmtpdlog
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-smtpd
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/servercert.cnf b/mail-mta/qmail-mysql/files/1.03-r13/servercert.cnf
new file mode 100644
index 000000000000..3e12895adaf2
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/servercert.cnf
@@ -0,0 +1,37 @@
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03-r13/servercert.cnf,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+# Robin H. Johnson <robbat2@gentoo.org> - October 17, 2003
+# This is the openssl config file to generate keys for qmail
+# It is read by mkservercert
+
+[ req ]
+# you can increase this value, but be aware that it will make things much slower
+# this should be a power of 2!
+default_bits = 1024
+# leave the rest of these alone!
+encrypt_key = yes
+distinguished_name = req_dn
+x509_extensions = cert_type
+prompt = no
+
+[ req_dn ]
+# 2-Letter ISO country code
+C=US
+# FULL name of state/province/district
+# NO abbreviations!
+ST=Alabama
+# FULL name of city
+# NO abbreviations!
+L=Mobile
+# Full Name of your organization
+# NO abbreviations!
+O=Foobar Systems
+# Leave this alone unless specifically need to change it!
+OU=Automatically-generated Qmail SMTP SSL key
+# This should be a FQDN that resolves to the IP of your server
+CN=localhost
+# This should be the email address for the administrator of the server
+emailAddress=postmaster@localhost
+
+# Leave this alone!
+[ cert_type ]
+nsCertType = server
diff --git a/mail-mta/qmail-mysql/files/1.03-r13/smtp-auth-close3.patch b/mail-mta/qmail-mysql/files/1.03-r13/smtp-auth-close3.patch
new file mode 100644
index 000000000000..e259bbf27977
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03-r13/smtp-auth-close3.patch
@@ -0,0 +1,24 @@
+diff -ur qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
+--- qmail-1.03.orig/qmail-smtpd.c 2003-08-11 20:37:16.000000000 -0700
++++ qmail-1.03/qmail-smtpd.c 2003-08-11 20:39:52.000000000 -0700
+@@ -519,14 +519,18 @@
+ if (!stralloc_0(&resp)) die_nomem();
+
+ if (fd_copy(2,1) == -1) return err_pipe();
+- close(3);
++ //close(3);
+ if (pipe(pi) == -1) return err_pipe();
+- if (pi[0] != 3) return err_pipe();
++ //if (pi[0] != 3) return err_pipe();
+ switch(child = fork()) {
+ case -1:
+ return err_fork();
+ case 0:
+ close(pi[1]);
++ if (pi[0] != 3) {
++ close(3);
++ if (0 > dup2(pi[0],3)) _exit(1);
++ }
+ sig_pipedefault();
+ execvp(*childargs, childargs);
+ _exit(1);
diff --git a/mail-mta/qmail-mysql/files/1.03/99qmail b/mail-mta/qmail-mysql/files/1.03/99qmail
new file mode 100644
index 000000000000..d17f5d7dbee9
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03/99qmail
@@ -0,0 +1,2 @@
+PATH=/var/qmail/bin
+ROOTPATH=/var/qmail/bin
diff --git a/mail-mta/qmail-mysql/files/1.03/defaultdelivery b/mail-mta/qmail-mysql/files/1.03/defaultdelivery
new file mode 100644
index 000000000000..d0ef7de8b590
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03/defaultdelivery
@@ -0,0 +1,2 @@
+|dot-forward .forward
+./.maildir/
diff --git a/mail-mta/qmail-mysql/files/1.03/dot_qmail b/mail-mta/qmail-mysql/files/1.03/dot_qmail
new file mode 100644
index 000000000000..7c9e5d08f067
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03/dot_qmail
@@ -0,0 +1 @@
+./.maildir/
diff --git a/mail-mta/qmail-mysql/files/1.03/errno.patch b/mail-mta/qmail-mysql/files/1.03/errno.patch
new file mode 100644
index 000000000000..f9b77b91e065
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03/errno.patch
@@ -0,0 +1,38 @@
+% diff -u3 error.h.orig error.h
+--- error.h.orig 1998-06-15 06:53:16.000000000 -0400
++++ error.h 2002-12-24 20:28:40.000000000 -0500
+@@ -1,7 +1,7 @@
+ #ifndef ERROR_H
+ #define ERROR_H
+
+-extern int errno;
++#include <errno.h>
+
+ extern int error_intr;
+ extern int error_nomem;
+
+
+% diff -u3 dns.c.orig dns.c
+--- dns.c.orig 2002-08-09 19:20:48.000000000 -0400
++++ dns.c 2002-12-24 20:42:46.000000000 -0500
+@@ -7,8 +7,6 @@
+ #include <errno.h>
+ extern int res_query();
+ extern int res_search();
+-extern int errno;
+-extern int h_errno;
+ #include "ip.h"
+ #include "ipalloc.h"
+ #include "fmt.h"
+
+
+% diff -u3 cdb_seek.c.orig cdb_seek.c
+--- cdb_seek.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ cdb_seek.c 2002-12-24 20:42:52.000000000 -0500
+@@ -1,6 +1,5 @@
+ #include <sys/types.h>
+ #include <errno.h>
+-extern int errno;
+ #include "cdb.h"
+
+ #ifndef SEEK_SET
diff --git a/mail-mta/qmail-mysql/files/1.03/qmail-control b/mail-mta/qmail-mysql/files/1.03/qmail-control
new file mode 100644
index 000000000000..8db4128577c5
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03/qmail-control
@@ -0,0 +1,30 @@
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/files/1.03/qmail-control,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+
+opts="start stop restart reload"
+
+start() {
+ ebegin "Starting qmail mta ..."
+ svc -u /var/qmail/supervise/*
+ eend $?
+ ebegin "Starting qmail mta logging ..."
+ svc -u /var/qmail/supervise/*/log
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping qmail mta ..."
+ svc -d /var/qmail/supervise/*
+ eend $?
+ ebegin "Stopping qmail mta logging ..."
+ svc -d /var/qmail/supervise/*/log
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading 'locals' and 'virtualdomains' control files."
+ svc -h /var/qmail/supervise/qmail-send
+ eend $?
+}
diff --git a/mail-mta/qmail-mysql/files/1.03/rc b/mail-mta/qmail-mysql/files/1.03/rc
new file mode 100644
index 000000000000..a7bbdc986766
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03/rc
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+exec env - PATH="/var/qmail/bin:$PATH" \
+ qmail-start "`cat /var/qmail/control/defaultdelivery`"
diff --git a/mail-mta/qmail-mysql/files/1.03/run-qmailsend b/mail-mta/qmail-mysql/files/1.03/run-qmailsend
new file mode 100644
index 000000000000..8dbd3adf524f
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03/run-qmailsend
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /var/qmail/rc
diff --git a/mail-mta/qmail-mysql/files/1.03/run-qmailsendlog b/mail-mta/qmail-mysql/files/1.03/run-qmailsendlog
new file mode 100644
index 000000000000..5ff50d1e7711
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03/run-qmailsendlog
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-send
diff --git a/mail-mta/qmail-mysql/files/1.03/run-qmailsmtpd b/mail-mta/qmail-mysql/files/1.03/run-qmailsmtpd
new file mode 100644
index 000000000000..9733e11e154a
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03/run-qmailsmtpd
@@ -0,0 +1,6 @@
+#!/bin/sh
+QMAILDUID=`id -u qmaild`
+NOFILESGID=`id -g qmaild`
+exec /usr/bin/softlimit -m 8000000 \
+ /usr/bin/tcpserver -H -R -v -p -x /etc/tcp.smtp.cdb \
+ -u $QMAILDUID -g $NOFILESGID 0 smtp rblsmtpd /var/qmail/bin/qmail-smtpd 2>&1
diff --git a/mail-mta/qmail-mysql/files/1.03/run-qmailsmtpdlog b/mail-mta/qmail-mysql/files/1.03/run-qmailsmtpdlog
new file mode 100644
index 000000000000..2d9546146583
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/1.03/run-qmailsmtpdlog
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s2500000 /var/log/qmail/qmail-smtpd
diff --git a/mail-mta/qmail-mysql/files/digest-qmail-mysql-1.03 b/mail-mta/qmail-mysql/files/digest-qmail-mysql-1.03
new file mode 100644
index 000000000000..85a397d672e1
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/digest-qmail-mysql-1.03
@@ -0,0 +1,6 @@
+MD5 622f65f982e380dbe86e6574f3abcb7c qmail-1.03.tar.gz 220668
+MD5 1d5b0aafb651ce2ad02aac6af80758c0 qmail-link-sync.patch 1403
+MD5 99070bb55cac5ad61f8fb203422e651e ext_todo-20030105.patch 33763
+MD5 2ff58c3570870a8ff9a1d9eb9aec05a6 big-concurrency.patch 9331
+MD5 8edda59102180973dd1bb546da7de160 qmail-0.0.0.0.patch 450
+MD5 0860a5b5cd5b6f99bf005e845b2e0764 qmail-mysql-1.1.8.patch 57702
diff --git a/mail-mta/qmail-mysql/files/digest-qmail-mysql-1.03-r13 b/mail-mta/qmail-mysql/files/digest-qmail-mysql-1.03-r13
new file mode 100644
index 000000000000..4afd7652e5a8
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/digest-qmail-mysql-1.03-r13
@@ -0,0 +1,21 @@
+MD5 622f65f982e380dbe86e6574f3abcb7c qmail-1.03.tar.gz 220668
+MD5 5a8d7a5863b0c56236af945dedd45754 qmailqueue-patch 2510
+MD5 39b6f70f65056472ff97ab40c1dba7b4 big-todo.103.patch 5546
+MD5 1d5b0aafb651ce2ad02aac6af80758c0 qmail-link-sync.patch 1403
+MD5 2ff58c3570870a8ff9a1d9eb9aec05a6 big-concurrency.patch 9331
+MD5 8edda59102180973dd1bb546da7de160 qmail-0.0.0.0.patch 450
+MD5 4e1f2d8315e7e2a5482798c9d19fac4d sendmail-flagf.patch 863
+MD5 122664c38338e5ec35fcac43f33d6927 qmail-1.03-qmtpc.patch 6197
+MD5 24fc1a33089faf12e00b127cd659f317 qmail-smtpd-relay-reject 1230
+MD5 ed5c0ddb6a5cc0386b1e04ced71d26ad qmail-local-tabs.patch 505
+MD5 7553829a93411cdaffce31a29323697f qmail-maildir++.patch 43510
+MD5 d566e8bd99b33efee0194e855b8d6995 qmail-date-localtime.patch.txt 2603
+MD5 1c4518f780d231bde9745cdd0fa313b2 qmail-limit-bounce-size.patch.txt 1753
+MD5 9140ad2b03017145cd7963c84bb24f16 qmail-103.patch 2104
+MD5 83bf5c4a4aade3c6c15faa9665ccfb71 qregex-starttls-2way-auth.patch 63825
+MD5 1d8b89607d35bfa409f8cfe6d23bc554 qmail-remote-auth-patch-doc.txt 1287
+MD5 fc00be3edc2827f1c93112d7d5147122 qmail-gentoo-1.03-r12-badrcptto-morebadrcptto-accdias.diff.bz2 4524
+MD5 58d912de1ede57062fa8a3e2e0e75abf qmail-popupnofd2close.patch 401
+MD5 d7151dcbeb02eea1c24c1dedffe20e0b qmail-1.03-reread-concurrency.2.patch 1129
+MD5 ad597c93426c0938fdb36d853fbcf40d 08-capa.diff 1323
+MD5 c422674e16bb2209617f5bb5a69197d5 qmail-mysql-1.1.9.patch.gentoo-1.03-r13.bz2 14046
diff --git a/mail-mta/qmail-mysql/files/tcp.pop3.sample b/mail-mta/qmail-mysql/files/tcp.pop3.sample
new file mode 100644
index 000000000000..12405307c5f3
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/tcp.pop3.sample
@@ -0,0 +1,7 @@
+# to update the database after changing this file, run:
+# tcprules /etc/tcp.pop3.cdb /etc/.tcp.pop3.tmp < /etc/tcp.pop3
+# Allow any client to connect to us via POP3
+# If people are abusing POP3 such as denial-of-service on POP3,
+# you can add their ips here to block them out
+:allow
+
diff --git a/mail-mta/qmail-mysql/files/tcp.qmqp.sample b/mail-mta/qmail-mysql/files/tcp.qmqp.sample
new file mode 100644
index 000000000000..e8536f1f3163
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/tcp.qmqp.sample
@@ -0,0 +1,8 @@
+# to update the database after changing this file, run:
+# tcprules /etc/tcp.qmqp.cdb /etc/.tcp.qmqp.tmp < /etc/tcp.qmqp
+# QMQP is a bulk protocol
+# and we don't want spam to ever come by it
+# and it is intended to go between a few servers only
+# so we don't trust any default people with it
+# see /etc/tcp.smtp.rules for more info
+:deny
diff --git a/mail-mta/qmail-mysql/files/tcp.qmtp.sample b/mail-mta/qmail-mysql/files/tcp.qmtp.sample
new file mode 100644
index 000000000000..825c3f11f1c0
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/tcp.qmtp.sample
@@ -0,0 +1,8 @@
+# to update the database after changing this file, run:
+# tcprules /etc/tcp.qmtp.cdb /etc/.tcp.qmtp.tmp < /etc/tcp.qmtp
+# We trust QMTP connections just as SMTP by default
+# see /etc/tcp.smtp.rules for more info
+# allow relaying from localhost
+127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD=""
+# everybody else is not allowed to relay, and is subject to RBLSMTPD checks
+:allow
diff --git a/mail-mta/qmail-mysql/files/tcp.smtp.sample b/mail-mta/qmail-mysql/files/tcp.smtp.sample
new file mode 100644
index 000000000000..5f339073c49e
--- /dev/null
+++ b/mail-mta/qmail-mysql/files/tcp.smtp.sample
@@ -0,0 +1,83 @@
+# to update the database after changing this file, run:
+# tcprules /etc/tcp.smtp.cdb /etc/.tcp.smtp.tmp < /etc/tcp.smtp
+#------------------------------------------------------
+# DESCRIPTION OF THE RULES TO REMIND ME OF HOW THIS FILE WORKS
+#
+# If you set 'allow', this means that our mail server will allow
+# the specified IP range to make a TCP connection to our server
+#
+# If you set 'deny', this means that our mail server will not allow
+# the specified IP range to make a TCP connection to our server
+#
+# If you set RELAYCLIENT="", this means that the listed IP range is
+# allowed to relay mail through our server
+#
+# If you dont set RELAYCLIENT="", this means that the listed IP range
+# will not be able to relay mail through our server
+#
+# If you set RBLSMTPD="", this means that the listed IP ranges will
+# not be checked against any of the RBL databases
+#
+# If you set RBLSMTPD="some text here", this means that an RBL lookup
+# wont be performed, but the mail will be rejected with the specified
+# text as a 4xx temp error message
+#
+# If you set RBLSMTPD="-some text here", this means that an RBL lookup
+# wont be performed, but the mail will be rejected with the specified
+# text as a 5xx perm error message
+#
+# If you do not set RBLSMTPD="" or ="some text", then an RBL lookup
+# will be performed. If the lookup is successful, then RBLSMTPD will
+# return your custom error message (as specified in the -r parameter
+# in smtpd supervise script)
+#
+#-----------------------------------------------------
+# HERE ARE THE RULES! :
+#-----------------------------------------------------
+# BYPASS OPEN RELAY CHECKING FOR THESE IPS :
+#
+# These IPs are ones that we have setup so that they arent RBL checked.
+# We have done this because these particular servers are RBL listed,
+# and for whatever reason they can't/won't fix their open relay problem,
+# and we still want to be able to receive mail from them.
+#
+# reminder text goes here for this entry so we know the story...
+#111.111.111.111:allow,RBLSMTPD=""
+# reminder text goes here for this entry so we know the story...
+#222.222.222.222:allow,RBLSMTPD=""
+#
+#-----------------------------------------------------------------
+# DONT ALLOW THESE IPS TO SEND MAIL TO US :
+#
+# mailXX.offermail.net connecting regularly and sending invalid
+# format messages causing exit with status 256 (bare linefeed normally)
+# entry added 15/12/2001
+# after looking at the mail coming from these servers it was found to be spam
+#216.242.75.100-116:allow,RBLSMTPD="-Connections from this IP have been banned."
+#
+# heaps of spam from replyto of *@freeamateurhotties.com dec2001
+#64.228.127.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
+#154.20.94.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
+#209.151.132.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
+#216.18.85.:allow,RBLSMTPD="-Connections refused due to spam from freeamateurhotties.com"
+#
+#-----------------------------------------------------------------
+# ALLOW THESE IPS TO RELAY MAIL THROUGH OUR SERVER
+#
+# Local class-c's from our LAN are allowed to relay,
+# and we wont bother doing any RBL checking.
+#123.123.123.:allow,RELAYCLIENT="",RBLSMTPD=""
+#123.111.111.:allow,RELAYCLIENT="",RBLSMTPD=""
+#
+# Connections from localhost are allowed to relay
+# (because the WebMail server runs on localhost),
+# and obviously there is no point trying to perform an RBL check.
+127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD=""
+#
+#-----------------------------------------------------------------
+# ALLOW EVERYONE ELSE TO SEND US MAIL
+#
+# Everyone else can make connections to our server,
+# but not allowed to relay
+# RBL lookups are performed
+:allow
diff --git a/mail-mta/qmail-mysql/metadata.xml b/mail-mta/qmail-mysql/metadata.xml
new file mode 100644
index 000000000000..51f94e3fbe0e
--- /dev/null
+++ b/mail-mta/qmail-mysql/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-mail</herd>
+</pkgmetadata>
diff --git a/mail-mta/qmail-mysql/qmail-mysql-1.03-r13.ebuild b/mail-mta/qmail-mysql/qmail-mysql-1.03-r13.ebuild
new file mode 100644
index 000000000000..8103441b4daf
--- /dev/null
+++ b/mail-mta/qmail-mysql/qmail-mysql-1.03-r13.ebuild
@@ -0,0 +1,421 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/qmail-mysql-1.03-r13.ebuild,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+
+inherit eutils fixheadtails
+
+IUSE="ssl"
+DESCRIPTION="A modern replacement for sendmail which uses maildirs and includes SSL/TLS, AUTH SMTP, and queue optimization"
+HOMEPAGE="http://www.qmail.org/
+ http://members.elysium.pl/brush/qmail-smtpd-auth/
+ http://www.jedi.claranet.fr/qmail-tuning.html"
+SRC_URI="mirror://qmail/qmail-1.03.tar.gz
+ mirror://qmail/qmailqueue-patch
+ http://qmail.null.dk/big-todo.103.patch
+ http://www.jedi.claranet.fr/qmail-link-sync.patch
+ mirror://qmail/big-concurrency.patch
+ http://www.suspectclass.com/~sgifford/qmail/qmail-0.0.0.0.patch
+ http://david.acz.org/software/sendmail-flagf.patch
+ mirror://qmail/qmail-1.03-qmtpc.patch
+ http://qmail.goof.com/qmail-smtpd-relay-reject
+ mirror://gentoo/qmail-local-tabs.patch
+ http://www.shupp.org/patches/qmail-maildir++.patch
+ ftp://ftp.pipeline.com.au/pipeint/sources/linux/WebMail/qmail-date-localtime.patch.txt
+ ftp://ftp.pipeline.com.au/pipeint/sources/linux/WebMail/qmail-limit-bounce-size.patch.txt
+ http://www.ckdhr.com/ckd/qmail-103.patch
+ http://www.arda.homeunix.net/store/qmail/qregex-starttls-2way-auth.patch
+ http://www.soffian.org/downloads/qmail/qmail-remote-auth-patch-doc.txt
+ mirror://gentoo/qmail-gentoo-1.03-r12-badrcptto-morebadrcptto-accdias.diff.bz2
+ http://www.dataloss.nl/software/patches/qmail-popupnofd2close.patch
+ http://js.hu/package/qmail/qmail-1.03-reread-concurrency.2.patch
+ http://www.mcmilk.de/qmail/dl/djb-qmail/patches/08-capa.diff
+ mirror://gentoo/qmail-mysql-1.1.9.patch.gentoo-${PVR}.bz2
+ "
+# 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 ~hppa ~mips"
+DEPEND="virtual/glibc
+ sys-apps/groff
+ ssl? ( >=dev-libs/openssl-0.9.6g )
+ >=net-mail/queue-fix-1.4-r1"
+
+RDEPEND="!virtual/mta
+ virtual/glibc
+ >=sys-apps/ucspi-tcp-0.88
+ >=sys-apps/daemontools-0.76-r1
+ >=net-mail/checkpassword-0.90
+ >=net-mail/cmd5checkpw-0.22
+ >=net-mail/dot-forward-0.71
+ >=net-mail/queue-fix-1.4-r1"
+
+PROVIDE="virtual/mta
+ virtual/mda"
+
+S=${WORKDIR}/${P/-mysql/}
+
+src_unpack() {
+
+
+ # unpack the initial stuff
+ unpack ${P/-mysql/}.tar.gz
+
+ # This makes life easy
+ EPATCH_OPTS="-d ${S}"
+
+ # this patch merges a few others already
+ EPATCH_SINGLE_MSG="Adding SMTP AUTH (2 way), Qregex and STARTTLS support" \
+ epatch ${DISTDIR}/qregex-starttls-2way-auth.patch
+
+ # Fixes a problem when utilizing "morercpthosts"
+ epatch ${FILESDIR}/${PV}-${PR}/smtp-auth-close3.patch
+
+ # patch so an alternate queue processor can be used
+ # i.e. - qmail-scanner
+ EPATCH_SINGLE_MSG="Adding QMAILQUEUE support" \
+ epatch ${DISTDIR}/qmailqueue-patch
+
+ # a patch for faster queue processing
+ EPATCH_SINGLE_MSG="Patching for large queues" \
+ epatch ${DISTDIR}/big-todo.103.patch
+
+ # Support for remote hosts that have QMTP
+ EPATCH_SINGLE_MSG="Adding support for remote QMTP hosts" \
+ epatch ${DISTDIR}/qmail-1.03-qmtpc.patch
+
+ # Large TCP DNS replies confuse it sometimes
+ EPATCH_SINGLE_MSG="Adding support for oversize DNS" \
+ epatch ${DISTDIR}/qmail-103.patch
+
+ # Fix for tabs in .qmail bug noted at
+ # http://www.ornl.gov/its/archives/mailing-lists/qmail/2000/10/msg00696.html
+ # gentoo bug #24293
+ epatch ${DISTDIR}/qmail-local-tabs.patch
+
+ # Account for Linux filesystems lack of a synchronus link()
+ epatch ${DISTDIR}/qmail-link-sync.patch
+
+ # Increase limits for large mail systems
+ epatch ${DISTDIR}/big-concurrency.patch
+
+ # Treat 0.0.0.0 as a local address
+ epatch ${DISTDIR}/qmail-0.0.0.0.patch
+
+ # Let the system decide how to define errno
+ epatch ${FILESDIR}/${PV}-${PR}/errno.patch
+
+ # make the qmail 'sendmail' binary behave like sendmail's for -f
+ epatch ${DISTDIR}/sendmail-flagf.patch
+
+ # Apply patch to make qmail-local and qmail-pop3d compatible with the
+ # maildir++ quota system that is used by vpopmail and courier-imap
+ epatch ${DISTDIR}/qmail-maildir++.patch
+ # fix a typo in the patch
+ epatch ${FILESDIR}/${PV}-${PR}/maildir-quota-fix.patch
+
+ # Apply patch for local timestamps.
+ # This will make the emails headers be written in localtime rather than GMT
+ # If you really want, uncomment it yourself, as mail really should be in GMT
+ epatch ${DISTDIR}/qmail-date-localtime.patch.txt
+
+ # Apply patch to trim large bouncing messages down greatly reduces traffic
+ # when multiple bounces occur (As in with spam)
+ epatch ${DISTDIR}/qmail-limit-bounce-size.patch.txt
+
+ #TODO TEST
+ # Apply patch to add ESMTP SIZE support to qmail-smtpd
+ # This helps your server to be able to reject excessively large messages
+ # "up front", rather than waiting the whole message to arrive and then
+ # bouncing it because it exceeded your databytes setting
+ epatch ${FILESDIR}/${PV}-${PR}/qmail-smtpd-esmtp-size-gentoo.patch
+
+ #TODO TEST
+ # Reject some bad relaying attempts
+ # gentoo bug #18064
+ epatch ${FILESDIR}/${PV}-${PR}/qmail-smtpd-relay-reject.gentoo.patch
+
+ #TODO TEST HEAVILY AS THIS PATCH WAS CUSTOM FIXED
+ # provide badrcptto support
+ # as per bug #17283
+ # patch re-diffed from original at http://sys.pro.br/files/badrcptto-morebadrcptto-accdias.diff.bz2
+ epatch ${DISTDIR}/qmail-gentoo-1.03-r12-badrcptto-morebadrcptto-accdias.diff.bz2
+
+ # TODO TESTING NEEDED
+ EPATCH_SINGLE_MSG="Enable stderr logging from checkpassword programs" \
+ epatch ${DISTDIR}/qmail-popupnofd2close.patch
+ EPATCH_SINGLE_MSG="Allow qmail to re-read concurrency limits on HUP" \
+ epatch ${DISTDIR}/qmail-1.03-reread-concurrency.2.patch
+ EPATCH_SINGLE_MSG="Add support for CAPA in POP3d" \
+ epatch ${DISTDIR}/08-capa.diff
+ EPATCH_SINGLE_MSG="Patching in MySQL support" \
+ epatch ${DISTDIR}/qmail-mysql-1.1.9.patch.gentoo-${PVR}.bz2
+
+ # TODO REDIFF
+ #EPATCH_SINGLE_MSG="Refuse messages from the null envelope sender if they have more than one envelope recipient" \
+ #epatch ${DISTDIR}/nullenvsender-recipcount.patch
+ # TODO REDIFF
+ #EPATCH_SINGLE_MSG="qmail-pop3d reports erroneous figures on STAT after a DELE" \
+ #epatch ${DISTDIR}/qmail-pop3d-stat.patch
+
+ echo -n "${CC} ${CFLAGS}" >${S}/conf-cc
+ if use ssl; then
+ einfo "Enabling SSL/TLS functionality"
+ echo -n ' -DTLS' >>${S}/conf-cc
+ fi
+ echo -n "${CC} ${LDFLAGS}" > ${S}/conf-ld
+ echo -n "500" > ${S}/conf-spawn
+
+ # fix coreutils messup
+ ht_fix_file ${S}/Makefile
+
+}
+
+src_compile() {
+ emake MYSQL_LIBS="`mysql_config --libs`" it man || die
+}
+
+src_install() {
+
+ einfo "Setting up directory hierarchy ..."
+
+ diropts -m 755 -o root -g qmail
+ dodir /var/qmail
+
+ for i in bin boot control
+ do
+ dodir /var/qmail/${i}
+ done
+
+ keepdir /var/qmail/users
+
+ diropts -m 755 -o alias -g qmail
+ dodir /var/qmail/alias
+
+ einfo "Installing the qmail software ..."
+
+ insopts -o root -g qmail -m 755
+ insinto /var/qmail/boot
+ doins home home+df proc proc+df binm1 binm1+df binm2 \
+ binm2+df binm3 binm3+df
+
+ dodoc FAQ UPGRADE SENDMAIL INSTALL* TEST* REMOVE* PIC* SECURITY
+ dodoc SYSDEPS TARGETS THANKS THOUGHTS TODO VERSION README* \
+ ${DISTDIR}/qmail-remote-auth-patch-doc.txt
+
+ insinto /var/qmail/bin
+ insopts -o qmailq -g qmail -m 4711
+ doins qmail-queue
+
+ insopts -o root -g qmail -m 700
+ doins qmail-lspawn qmail-start qmail-newu qmail-newmrh
+
+ insopts -o root -g qmail -m 711
+ doins qmail-getpw qmail-local qmail-remote qmail-rspawn \
+ qmail-clean qmail-send splogger qmail-pw2u
+
+ insopts -o root -g qmail -m 755
+ doins qmail-inject predate datemail mailsubj qmail-showctl \
+ qmail-qread qmail-qstat qmail-tcpto qmail-tcpok qmail-pop3d \
+ qmail-popup qmail-qmqpc qmail-qmqpd qmail-qmtpd qmail-smtpd \
+ sendmail tcp-env qreceipt qsmhook qbiff forward preline \
+ condredirect bouncesaying except maildirmake maildir2mbox \
+ maildirwatch qail elq pinq config-fast qmail-newbrt
+
+ into /usr
+ einfo "Installing manpages"
+ doman *.[1-8]
+
+ # use the correct maildirmake
+ # the courier-imap one has some extensions that are nicer
+ [ -e /usr/bin/maildirmake ] && \
+ MAILDIRMAKE="/usr/bin/maildirmake" || \
+ MAILDIRMAKE="${D}/var/qmail/bin/maildirmake"
+
+ einfo "Adding env.d entry for qmail"
+ dodir /etc/env.d
+ insinto /etc/env.d
+ doins ${FILESDIR}/${PV}-${PR}/99qmail
+
+ einfo "Creating sendmail replacement ..."
+ diropts -m 755
+ dodir /usr/sbin /usr/lib
+ dosym /var/qmail/bin/sendmail /usr/sbin/sendmail
+ dosym /var/qmail/bin/sendmail /usr/lib/sendmail
+
+ einfo "Setting up the default aliases ..."
+ diropts -m 700 -o alias -g qmail
+ ${MAILDIRMAKE} ${D}/var/qmail/alias/.maildir
+ # for good measure
+ keepdir /var/qmail/alias/.maildir/{cur,new,tmp}
+
+ for i in mailer-daemon postmaster root
+ do
+ if [ ! -f ${ROOT}/var/qmail/alias/.qmail-${i} ]; then
+ touch ${D}/var/qmail/alias/.qmail-${i}
+ fowners alias:qmail /var/qmail/alias/.qmail-${i}
+ fi
+ done
+
+ einfo "Setting up maildirs by default in the account skeleton ..."
+ diropts -m 755 -o root -g root
+ insinto /etc/skel
+ newins ${FILESDIR}/${PV}-${PR}/dot_qmail .qmail.sample
+ fperms 644 /etc/skel/.qmail.sample
+ ${MAILDIRMAKE} ${D}/etc/skel/.maildir
+ # for good measure
+ keepdir /etc/skel/.maildir/{cur,new,tmp}
+
+ einfo "Setting up all services (send, smtp, qmtp, qmqp, pop3) ..."
+ insopts -o root -g root -m 755
+ diropts -m 755 -o root -g root
+ dodir /var/qmail/supervise
+
+ for i in send smtpd qmtpd qmqpd pop3d; do
+ insopts -o root -g root -m 755
+ diropts -m 755 -o root -g root
+ dodir /var/qmail/supervise/qmail-${i}{,/log}
+ diropts -m 755 -o qmaill
+ keepdir /var/log/qmail/qmail-${i}
+ fperms +t /var/qmail/supervise/qmail-${i}{,/log}
+ insinto /var/qmail/supervise/qmail-${i}
+ newins ${FILESDIR}/${PV}-${PR}/run-qmail${i} run
+ insinto /var/qmail/supervise/qmail-${i}/log
+ newins ${FILESDIR}/${PV}-${PR}/run-qmail${i}log run
+ 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}/${PV}-${PR}/rc
+
+ einfo "Installing the qmail control file ..."
+ exeinto /var/qmail/bin
+ insopts -o root -g root -m 755
+ doexe ${FILESDIR}/${PV}-${PR}/qmail-control
+
+ einfo "Insalling some stock configuration files"
+ insinto /var/qmail/control
+ insopts -o root -g root -m 644
+ doins ${FILESDIR}/${PV}-${PR}/conf-*
+ newins ${FILESDIR}/${PV}-${PR}/dot_qmail defaultdelivery
+ use ssl && doins ${FILESDIR}/${PV}-${PR}/servercert.cnf
+
+ einfo "Configuration sanity checker"
+ into /var/qmail
+ insopts -o root -g root -m 644
+ dobin ${FILESDIR}/${PV}-${PR}/config-sanity-check
+
+ if use ssl; then
+ einfo "SSL Certificate creation script"
+ dobin ${FILESDIR}/${PV}-${PR}/mkservercert
+ einfo "RSA key generation cronjob"
+ insinto /etc/cron.daily
+ doins ${FILESDIR}/${PV}-${PR}/qmail-genrsacert.sh
+ chmod +x ${D}/etc/cron.daily/qmail-genrsacert.sh
+ fi
+}
+
+rootmailfixup() {
+ # so you can check mail as root easily
+ local TMPCMD="ln -sf /var/qmail/alias/.maildir/ ${ROOT}/root/.maildir"
+ if [ -d "${ROOT}/root/.maildir" ] && [ ! -L "${ROOT}/root/.maildir" ] ; then
+ einfo "Previously the qmail ebuilds created /root/.maildir/ but not"
+ einfo "mail was every delivered there. If the directory does not"
+ einfo "contain any mail, please delete it and run:"
+ einfo "${TMPCMD}"
+ else
+ ${TMPCMD}
+ fi
+ chown -R alias:qmail ${ROOT}/var/qmail/alias/.maildir 2>/dev/null
+}
+
+buildtcprules() {
+ for i in smtp qmtp qmqp pop3; do
+ # please note that we don't check if it exists
+ # as we want it to make the cdb files anyway!
+ cat ${ROOT}etc/tcp.${i} 2>/dev/null | tcprules ${ROOT}etc/tcp.${i}.cdb ${ROOT}etc/.tcp.${i}.tmp
+ done
+}
+
+pkg_postinst() {
+
+ einfo "Setting up the message queue hierarchy ..."
+ # queue-fix makes life easy!
+ /var/qmail/bin/queue-fix ${ROOT}/var/qmail/queue >/dev/null
+
+ rootmailfixup
+ buildtcprules
+
+ # for good measure
+ env-update
+
+ einfo "To setup qmail to run out-of-the-box on your system, run:"
+ einfo "ebuild /var/db/pkg/${CATEGORY}/${PN}-${PV}-${PR}/${PN}-${PV}-${PR}.ebuild config"
+ echo
+ einfo "To start qmail at boot you have to add svscan to your startup"
+ einfo "and create the following links:"
+ einfo "ln -s /var/qmail/supervise/qmail-send /service/qmail-send"
+ einfo "ln -s /var/qmail/supervise/qmail-smtpd /service/qmail-smtpd"
+ echo
+ einfo "To start the pop3 server as well, create the following link:"
+ einfo "ln -s /var/qmail/supervise/qmail-pop3d /service/qmail-pop3d"
+ echo
+ einfo "Additionally, the QMTP and QMQP protocols are supported, "
+ einfo "and can be started as:"
+ einfo "ln -s /var/qmail/supervise/qmail-qmtpd /service/qmail-qmtpd"
+ einfo "ln -s /var/qmail/supervise/qmail-qmqpd /service/qmail-qmqpd"
+ echo
+ einfo "Additionally, if you wish to run qmail right now, you should "
+ einfo "run this before anything else:"
+ einfo "source /etc/profile"
+}
+
+pkg_config() {
+
+ # avoid some weird locale problems
+ export LC_ALL="C"
+
+ if [ ${ROOT} = "/" ] ; then
+ if [ ! -f ${ROOT}var/qmail/control/me ] ; then
+ export qhost=`hostname --fqdn`
+ ${ROOT}var/qmail/bin/config-fast $qhost
+ fi
+ else
+ ewarn "Skipping some configuration as it MUST be run on the final host"
+ fi
+
+ einfo "Accepting relaying by default from all ips configured on this machine."
+ LOCALIPS=`/sbin/ifconfig | grep inet | cut -d' ' -f 12 -s | cut -b 6-20`
+ TCPSTRING=":allow,RELAYCLIENT=\"\",RBLSMTPD=\"\""
+ for ip in $LOCALIPS; do
+ myline="${ip}${TCPSTRING}"
+ for proto in smtp qmtp qmqp; do
+ f="${ROOT}etc/tcp.${proto}"
+ egrep -q "${myline}" ${f} || echo "${myline}" >>${f}
+ done
+ done
+
+ buildtcprules
+
+ if use ssl; then
+ ${ROOT}etc/cron.daily/qmail-genrsacert.sh
+ einfo "Creating a self-signed ssl-certificate:"
+ /var/qmail/bin/mkservercert
+ einfo "If you want to have a properly signed certificate "
+ einfo "instead, do the following:"
+ einfo "openssl req -new -nodes -out req.pem \\"
+ einfo "-config /var/qmail/control/servercert.cnf \\"
+ einfo "-keyout /var/qmail/control/servercert.pem"
+ einfo "Send req.pem to your CA to obtain signed_req.pem, and do:"
+ einfo "cat signed_req.pem >> /var/qmail/control/servercert.pem"
+ fi
+}
+
diff --git a/mail-mta/qmail-mysql/qmail-mysql-1.03.ebuild b/mail-mta/qmail-mysql/qmail-mysql-1.03.ebuild
new file mode 100644
index 000000000000..417534f90869
--- /dev/null
+++ b/mail-mta/qmail-mysql/qmail-mysql-1.03.ebuild
@@ -0,0 +1,276 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-mysql/qmail-mysql-1.03.ebuild,v 1.1 2004/05/30 10:52:14 robbat2 Exp $
+
+inherit eutils
+
+DESCRIPTION="A modern replacement for sendmail which uses maildirs and includes mysql, and queue optimization"
+HOMEPAGE="http://www.qmail.org/
+ http://iain.cx/qmail/mysql/
+ http://www.jedi.claranet.fr/qmail-tuning.html"
+SRC_URI="http://cr.yp.to/software/qmail-1.03.tar.gz
+ http://www.jedi.claranet.fr/qmail-link-sync.patch
+ http://www.qmail.org/big-concurrency.patch
+ http://www.suspectclass.com/~sgifford/qmail/qmail-0.0.0.0.patch
+ http://iain.cx/unix/qmail/download/qmail-mysql-1.1.8.patch"
+
+SLOT="0"
+LICENSE="as-is"
+KEYWORDS="x86 ~ppc ~sparc"
+
+PROVIDE="virtual/mta
+ virtual/mda"
+
+DEPEND="virtual/glibc
+ sys-apps/groff
+ >=sys-apps/ucspi-tcp-0.88
+ >=net-mail/checkpassword-0.90"
+RDEPEND="!virtual/mta
+ virtual/glibc
+ sys-apps/groff
+ >=sys-apps/ucspi-tcp-0.88
+ >=sys-apps/daemontools-0.76-r1
+ >=net-mail/checkpassword-0.90
+ >=net-mail/dot-forward-0.71"
+
+S=${WORKDIR}/${P/-mysql/}
+
+src_unpack() {
+
+ unpack qmail-1.03.tar.gz
+ cd ${S}
+
+ # Account for Linux filesystems lack of a synchronus link()
+ cd ${S}
+ epatch ${DISTDIR}/qmail-link-sync.patch || die
+
+ # Increase limits for large mail systems
+ epatch ${DISTDIR}/big-concurrency.patch || die
+
+ # Treat 0.0.0.0 as a local address
+ epatch ${DISTDIR}/qmail-0.0.0.0.patch || die
+
+ # Let the system decide how to define errno
+ epatch ${FILESDIR}/${PV}/errno.patch || die
+
+ # MySQL support
+ cd ${WORKDIR}
+ sed \
+ -e "s:/opt/mysql/lib/mysql:/usr/lib/mysql:" \
+ -e "s:/opt/mysql/include:/usr/include/mysql:" \
+ < ${DISTDIR}/qmail-mysql-1.1.8.patch > mysql.patch
+ cd ${S}
+ epatch ${WORKDIR}/mysql.patch || die
+
+ echo "gcc ${CFLAGS}" > conf-cc
+ echo "gcc" > conf-ld
+ echo "500" > conf-spawn
+}
+
+src_compile() {
+ cd ${S}
+ emake MYSQL_LIBS="`mysql_config --libs`" it man || die
+}
+
+
+
+src_install() {
+
+ cd ${S}
+
+ einfo "Setting up directory hierarchy ..."
+
+ diropts -m 755 -o root -g qmail
+ dodir /var/qmail
+
+ for i in bin boot control
+ do
+ dodir /var/qmail/${i}
+ done
+
+ keepdir /var/qmail/users
+
+ diropts -m 755 -o alias -g qmail
+ dodir /var/qmail/alias
+
+ einfo "Installing the qmail software ..."
+
+ insopts -o root -g qmail -m 755
+ insinto /var/qmail/boot
+ doins home home+df proc proc+df binm1 binm1+df binm2 binm2+df binm3 binm3+df
+
+ into /usr
+ dodoc FAQ UPGRADE SENDMAIL INSTALL* TEST* REMOVE* PIC* SECURITY
+ dodoc SYSDEPS TARGETS THANKS THOUGHTS TODO VERSION
+ dodoc ${FILESDIR}/${PV}/tls-patch.txt
+
+ insopts -o qmailq -g qmail -m 4711
+ insinto /var/qmail/bin
+ doins qmail-queue qmail-queue
+
+ insopts -o root -g qmail -m 700
+ insinto /var/qmail/bin
+ doins qmail-lspawn qmail-start qmail-newu qmail-newmrh
+
+ insopts -o root -g qmail -m 711
+ insinto /var/qmail/bin
+ doins qmail-getpw qmail-local qmail-remote qmail-rspawn \
+ qmail-clean qmail-send splogger qmail-pw2u
+
+ insopts -o root -g qmail -m 755
+ insinto /var/qmail/bin
+ doins qmail-inject predate datemail mailsubj qmail-showctl \
+ qmail-qread qmail-qstat qmail-tcpto qmail-tcpok qmail-pop3d \
+ qmail-popup qmail-qmqpc qmail-qmqpd qmail-qmtpd qmail-smtpd \
+ sendmail tcp-env qreceipt qsmhook qbiff forward preline \
+ condredirect bouncesaying except maildirmake maildir2mbox \
+ maildirwatch qail elq pinq config-fast qmail-todo
+
+ into /usr
+ for i in *.1 *.5 *.8
+ do
+ doman $i
+ done
+
+ einfo "Adding /var/qmail/bin to PATH and ROOTPATH"
+ dodir /etc/env.d
+ cp ${FILESDIR}/${PV}/99qmail ${D}/etc/env.d
+
+ einfo "Creating sendmail replacement ..."
+ diropts -m 755
+ dodir /usr/sbin /usr/lib
+ dosym /var/qmail/bin/sendmail /usr/sbin/sendmail
+ dosym /var/qmail/bin/sendmail /usr/lib/sendmail
+
+ einfo "Setting up the default aliases ..."
+ diropts -m 700 -o alias -g qmail
+ if [ ! -d ${ROOT}/var/qmail/alias/.maildir ] ; then
+ dodir /var/qmail/alias/.maildir
+ for i in cur new tmp
+ do
+ dodir /var/qmail/alias/.maildir/$i
+ done
+ fi
+
+ for i in mailer-daemon postmaster root
+ do
+ touch ${D}/var/qmail/alias/.qmail-${i}
+ fowners alias:qmail /var/qmail/alias/.qmail-${i}
+ done
+
+ einfo "Setting up maildirs by default in the account skeleton ..."
+ diropts -m 755 -o root -g root
+ insinto /etc/skel
+ ${D}/var/qmail/bin/maildirmake ${D}/etc/skel/.maildir
+ newins ${FILESDIR}/${PV}/dot_qmail .qmail
+ fperms 644 /etc/skel/.qmail
+ insinto /root
+ ${D}/var/qmail/bin/maildirmake ${D}/root/.maildir
+ newins ${FILESDIR}/${PV}/dot_qmail .qmail
+ fperms 644 /root/.qmail
+
+ einfo "Setting up daemontools ..."
+ insopts -o root -g root -m 755
+ diropts -m 755 -o root -g root
+ dodir /var/qmail/supervise
+ dodir /var/qmail/supervise/qmail-send
+ dodir /var/qmail/supervise/qmail-send/log
+ dodir /var/qmail/supervise/qmail-smtpd
+ dodir /var/qmail/supervise/qmail-smtpd/log
+ chmod +t ${D}/var/qmail/supervise/qmail-send
+ chmod +t ${D}/var/qmail/supervise/qmail-smtpd
+ diropts -m 755 -o qmaill
+ keepdir /var/log/qmail /var/log/qmail/qmail-send /var/log/qmail/qmail-smtpd
+
+ insinto /var/qmail/supervise/qmail-send
+ newins ${FILESDIR}/${PV}/run-qmailsend run
+ insinto /var/qmail/supervise/qmail-send/log
+ newins ${FILESDIR}/${PV}/run-qmailsendlog run
+ insinto /var/qmail/supervise/qmail-smtpd
+ newins ${FILESDIR}/${PV}/run-qmailsmtpd run
+ insinto /var/qmail/supervise/qmail-smtpd/log
+ newins ${FILESDIR}/${PV}/run-qmailsmtpdlog run
+
+ einfo "Installing the qmail control file ..."
+ exeinto /var/qmail/bin
+ doexe ${FILESDIR}/${PV}/qmail-control
+
+ einfo "Installing the qmail startup file ..."
+ insinto /var/qmail
+ doins ${FILESDIR}/${PV}/rc
+ insinto /var/qmail/control
+ doins ${FILESDIR}/${PV}/defaultdelivery
+
+}
+
+pkg_postinst() {
+
+ einfo "Setting up the message queue hierarchy ..."
+
+ install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue
+ install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/todo
+ install -d -m 700 -o qmailq -g qmail ${ROOT}/var/qmail/queue/pid
+ install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/bounce
+ install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/mess
+
+ for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
+ do
+ install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/mess/${i}
+ install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/todo/${i}
+ install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/intd/${i}
+ done
+
+ for i in info local remote
+ do
+ install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/${i}
+ done
+
+ for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
+ do
+ install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/info/${i}
+ install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/local/${i}
+ install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/remote/${i}
+ done
+
+ install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/lock
+
+ dd if=/dev/zero of=${ROOT}/var/qmail/queue/lock/tcpto bs=1024 count=1
+ chmod 644 ${ROOT}/var/qmail/queue/lock/tcpto
+ chown qmailr:qmail ${ROOT}/var/qmail/queue/lock/tcpto
+
+ touch ${ROOT}/var/qmail/queue/lock/sendmutex
+ chmod 600 ${ROOT}/var/qmail/queue/lock/sendmutex
+ chown qmails:qmail ${ROOT}/var/qmail/queue/lock/sendmutex
+
+ mkfifo ${ROOT}/var/qmail/queue/lock/trigger
+ chmod 622 ${ROOT}/var/qmail/queue/lock/trigger
+ chown qmails:qmail ${ROOT}/var/qmail/queue/lock/trigger
+
+ echo -e "\e[32;01m Please do not forget to run, the following syntax :\033[0m"
+ echo -e "\e[32;01m ebuild /var/db/pkg/${CATEGORY}/${PN}-${PV}-${PR}/${PN}-${PV}-${PR}.ebuild config \033[0m"
+ echo -e "\e[32;01m This will setup qmail to run out-of-the-box on your system. \033[0m"
+ echo -e ""
+ echo -e "\e[32;01m To start qmail at boot you have to enable the /etc/init.d/svscan rc file \033[0m"
+ echo -e "\e[32;01m and create the following links : \033[0m"
+ echo -e "\e[32;01m ln -s /var/qmail/supervise/qmail-send /service/qmail-send \033[0m"
+ echo -e "\e[32;01m ln -s /var/qmail/supervise/qmail-smtpd /service/qmail-smtpd \033[0m"
+}
+
+pkg_config() {
+
+export qhost=`hostname`
+ if [ ${ROOT} = "/" ] ; then
+ if [ ! -f ${ROOT}/var/qmail/control/me ] ; then
+ ${ROOT}/var/qmail/bin/config-fast $qhost
+ fi
+ fi
+
+ echo "Accepting relaying by default from all ips configured on this machine."
+ LOCALIPS=`/sbin/ifconfig | grep inet | cut -d " " -f 12 -s | cut -b 6-20`
+ for ip in $LOCALIPS; do
+ echo "$ip:allow,RELAYCLIENT=\"\"" >> /etc/tcp.smtp
+ done
+ echo ":allow" >> /etc/tcp.smtp
+
+ tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
+}