summaryrefslogtreecommitdiff
path: root/mail/qmail
diff options
context:
space:
mode:
authorschmonz <schmonz@pkgsrc.org>2004-04-10 05:30:06 +0000
committerschmonz <schmonz@pkgsrc.org>2004-04-10 05:30:06 +0000
commitfa7fdb69b2297f2ea46af51e7dc9ff5a134ba52c (patch)
treea8ef553fd6a3c69535ee6c696866180a84bf812c /mail/qmail
parent00eb9f5e8fcea0df00ff1ca1e955f892fc0bbe37 (diff)
downloadpkgsrc-fa7fdb69b2297f2ea46af51e7dc9ff5a134ba52c.tar.gz
Russ Nelson, Charles Cazabon, Dave Sill, Peter Samuel, and Henning
Brauer have prepared a distribution of qmail, called "netqmail": "We have done this because in our opinion, too many new users are confused by the out-of-date INSTALL file, and too much time is spent arguing on the mailing list over bugs. We have tried to stick to the barest minimum number of changes. We have fixed only those things which are out-and-out wrong, or which have been approved by djb (specifically QMAILQUEUE)." This package already includes the QMAILQUEUE patch. Add netqmail 1.05's other patches, with the exception that patches to documentation files which are not installed have been lovingly omitted. This package also already includes a patch to handle oversized DNS packets. It's still here, too. pkgsrc changes: * Add qmail-smtpd rc.d script (and ensuing dependency on net/ucspi-tcp). * Update qmail rc.d script: respect $qmail_flags, treating it as the default delivery instruction. * Remove non-working MASTER_SITES. From the netqmail changelog: 20040121 code: qmail-smtpd is protected from exceedingly long (eg 2GB) header lines 20040121 code: qmail_lspawn, qmail-newmrh, qmail-newu, and qmail-rspawn are protected from misbehaving on hosts where the size of an integer is not the same as the size of a character pointer (eg 64 bit hosts with 32 bit ints) 20031027 doc: qmail.7 identifies installation as netqmail and points to http://qmail.org/ 20031027 doc: qmail-queue.8 adds explanation of $QMAILQUEUE 20031027 doc: qmail-log.5 adds reference to errors from $QMAILQUEUE script 20031027 code: qmail-smtpd identifies itself as netqmail 20031027 code: if $QMAILQUEUE is set, it's invoked instead of qmail-queue 20031024 code: changed errno from int to #include. 20031024 code: fixed .qmail parsing bug. 20031024 code: recognize 0.0.0.0 as a local address. 20031024 code: sendmail's -f flag now overrides environment variables. And for all this, bump PKGREVISION. Pre-flight checks by snj@.
Diffstat (limited to 'mail/qmail')
-rw-r--r--mail/qmail/Makefile16
-rw-r--r--mail/qmail/PLIST3
-rw-r--r--mail/qmail/distinfo22
-rw-r--r--mail/qmail/files/qmail.sh13
-rw-r--r--mail/qmail/files/qmailsmtpd.sh29
-rw-r--r--mail/qmail/patches/patch-aa28
-rw-r--r--mail/qmail/patches/patch-ab18
-rw-r--r--mail/qmail/patches/patch-ac24
-rw-r--r--mail/qmail/patches/patch-ad11
-rw-r--r--mail/qmail/patches/patch-ae9
-rw-r--r--mail/qmail/patches/patch-af15
-rw-r--r--mail/qmail/patches/patch-ag13
-rw-r--r--mail/qmail/patches/patch-ah16
-rw-r--r--mail/qmail/patches/patch-ai13
-rw-r--r--mail/qmail/patches/patch-aj16
-rw-r--r--mail/qmail/patches/patch-ak103
-rw-r--r--mail/qmail/patches/patch-al27
-rw-r--r--mail/qmail/patches/patch-am17
-rw-r--r--mail/qmail/patches/patch-an63
-rw-r--r--mail/qmail/patches/patch-ao22
-rw-r--r--mail/qmail/patches/patch-ap51
-rw-r--r--mail/qmail/patches/patch-aq12
22 files changed, 500 insertions, 41 deletions
diff --git a/mail/qmail/Makefile b/mail/qmail/Makefile
index 2522530aae1..733e298f7a4 100644
--- a/mail/qmail/Makefile
+++ b/mail/qmail/Makefile
@@ -1,21 +1,20 @@
-# $NetBSD: Makefile,v 1.20 2004/03/29 05:10:04 snj Exp $
+# $NetBSD: Makefile,v 1.21 2004/04/10 05:30:06 schmonz Exp $
#
DISTNAME= qmail-1.03
-PKGREVISION= 4
+PKGREVISION= 5
CATEGORIES= mail
MASTER_SITES= http://cr.yp.to/software/ \
ftp://ftp.ntnu.no/pub/unix/mail/qmail/ \
ftp://ftp.jp.qmail.org/qmail/ \
- ftp://ftp.rifkin.technion.ac.il/pub/qmail/ \
- ftp://ftp.net.ohio-state.edu/pub/networking/mail/qmail/ \
- ftp://ftp.id.wustl.edu/pub/qmail/
+ ftp://ftp.net.ohio-state.edu/pub/networking/mail/qmail/
MAINTAINER= zuntum@NetBSD.org
HOMEPAGE= http://www.qmail.org/
-COMMENT= SECURE, reliable, efficient, simple, and FAST MTA for UNIX systems
+COMMENT= Secure, reliable, efficient, simple, and fast MTA for UNIX systems
DEPENDS+= qmail-users>=1.0:../../mail/qmail-users
+DEPENDS+= ucspi-tcp-[0-9]*:../../net/ucspi-tcp
ALL_TARGET= it man
INSTALL_TARGET= setup check
@@ -30,8 +29,11 @@ USE_PKGINSTALL= yes
DEINSTALL_EXTRA_TMPL+= ${.CURDIR}/DEINSTALL
OWN_DIRS+= ${QMAILDIR}
+EVAL_PREFIX+= LOCALBASE_UCSPI_TCP=ucspi-tcp
+
FILES_SUBST+= QMAILDIR=${QMAILDIR}
-RCD_SCRIPTS= qmail
+FILES_SUBST+= LOCALBASE_UCSPI_TCP=${LOCALBASE_UCSPI_TCP}
+RCD_SCRIPTS= qmail qmailsmtpd
RCD_SCRIPTS_EXAMPLEDIR= ${QMAILDIR}/etc/rc.d
.include "../../mk/bsd.prefs.mk"
diff --git a/mail/qmail/PLIST b/mail/qmail/PLIST
index ec2b774a345..7ab04c03100 100644
--- a/mail/qmail/PLIST
+++ b/mail/qmail/PLIST
@@ -1,6 +1,7 @@
-@comment $NetBSD: PLIST,v 1.4 2002/07/28 01:56:14 schmonz Exp $
+@comment $NetBSD: PLIST,v 1.5 2004/04/10 05:30:06 schmonz Exp $
${QMAILDIR}/etc/mailer.conf.qmail
${QMAILDIR}/etc/rc.d/qmail
+${QMAILDIR}/etc/rc.d/qmailsmtpd
${QMAILDIR}/bin/bouncesaying
${QMAILDIR}/bin/condredirect
${QMAILDIR}/bin/datemail
diff --git a/mail/qmail/distinfo b/mail/qmail/distinfo
index 5f4cd3ba4e0..8e1c27a16c1 100644
--- a/mail/qmail/distinfo
+++ b/mail/qmail/distinfo
@@ -1,7 +1,21 @@
-$NetBSD: distinfo,v 1.3 2002/05/03 10:39:01 zuntum Exp $
+$NetBSD: distinfo,v 1.4 2004/04/10 05:30:06 schmonz Exp $
SHA1 (qmail-1.03.tar.gz) = 18fb960481291a0503e93a94df3f6094edb7f27a
Size (qmail-1.03.tar.gz) = 220668 bytes
-SHA1 (patch-aa) = 9a54276636d5000fb8ae217344158301b91bde1d
-SHA1 (patch-ab) = a37492ce29e86cab7aaf0dc3446ab5db95edcd86
-SHA1 (patch-ac) = 2f1ef6b0490d9792fc8d7d50af5f620b09f58ecf
+SHA1 (patch-aa) = d876fb59c6e1e93d0332696c1ebf06e04a8fafb2
+SHA1 (patch-ab) = 47f788fd28feca2442bbb9094d99633a1578e447
+SHA1 (patch-ac) = e05c2c1c4066a2fd1b6c3763c6fe73d541994014
+SHA1 (patch-ad) = eacd740cf85abbb385b241cf4f33f7b80a03ce4b
+SHA1 (patch-ae) = 56311eb87ee8325ba347c6cdbfd8b5484c7142e0
+SHA1 (patch-af) = 582ce985dde5df7eb507e2abe90c62b6d73485e2
+SHA1 (patch-ag) = bfd2ae4613add0ab9b4c2672466600abf9de38ae
+SHA1 (patch-ah) = 48d9c4f5a47372dd13c380edf50ceeb209d61ea3
+SHA1 (patch-ai) = 67ac4722837e5dd6136d4fbe900ef80eda74ea95
+SHA1 (patch-aj) = a1691a04a90f3969ac8853e7d04833603195880e
+SHA1 (patch-ak) = d1e88006f04874df6c1896b08bbdfb4e5d67f654
+SHA1 (patch-al) = 20a8bb4d44477522135762219c4aaeebddfd6085
+SHA1 (patch-am) = fd1d09686dcdbb58b7a45c114aa56d0b1360035b
+SHA1 (patch-an) = de2bb294c742ee4b512634f37553bdb79ea7ffb1
+SHA1 (patch-ao) = 63176ba524913c6e693de7460d25016a10a438f8
+SHA1 (patch-ap) = de2d4d409c5e588e1cf9c6ca2cd966eeef022a55
+SHA1 (patch-aq) = 2e5f0a4870b13ff60f79edf5dc58eff783fd5bea
diff --git a/mail/qmail/files/qmail.sh b/mail/qmail/files/qmail.sh
index 6ef9458980e..7354ea576d5 100644
--- a/mail/qmail/files/qmail.sh
+++ b/mail/qmail/files/qmail.sh
@@ -1,24 +1,29 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: qmail.sh,v 1.2 2002/09/20 02:01:57 grant Exp $
+# $NetBSD: qmail.sh,v 1.3 2004/04/10 05:30:06 schmonz Exp $
#
-# PROVIDE: mail
+# PROVIDE: mail qmail
# REQUIRE: LOGIN
. /etc/rc.subr
name="qmail"
rcvar=${name}
-required_files="@QMAILDIR@/rc @QMAILDIR@/control/me"
+required_files="@QMAILDIR@/control/me"
command="@QMAILDIR@/bin/qmail-send"
start_precmd="qmail_precmd"
extra_commands="reload"
+if [ -z "$qmail_flags" ]; then
+ qmail_flags="./Mailbox"
+fi
+
qmail_precmd()
{
- command="@QMAILDIR@/rc"
+ command="@SETENV@ - PATH=@QMAILDIR@/bin:$PATH qmail-start '$qmail_flags' splogger qmail"
command_args="&"
+ rc_flags=""
}
load_rc_config $name
diff --git a/mail/qmail/files/qmailsmtpd.sh b/mail/qmail/files/qmailsmtpd.sh
new file mode 100644
index 00000000000..44453ec653c
--- /dev/null
+++ b/mail/qmail/files/qmailsmtpd.sh
@@ -0,0 +1,29 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: qmailsmtpd.sh,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+#
+
+# PROVIDE: mail
+# REQUIRE: qmail
+
+. /etc/rc.subr
+
+name="qmailsmtpd"
+rcvar=${name}
+command="@LOCALBASE_UCSPI_TCP@/bin/tcpserver"
+procname=${name}
+start_precmd="qmailsmtpd_precmd"
+
+if [ -z "$qmailsmtpd_flags" ]; then
+ qmailsmtpd_flags="-v -H -R -l 0"
+fi
+
+qmailsmtpd_precmd()
+{
+ command="@SETENV@ - @LOCALBASE_UCSPI_TCP@/bin/argv0 @LOCALBASE_UCSPI_TCP@/bin/tcpserver $name $qmailsmtpd_flags -u `@ID@ -u qmaild` -g `@ID@ -g qmaild` 0 smtp @QMAILDIR@/bin/qmail-smtpd 2>&1 | @QMAILDIR@/bin/splogger smtpd 3"
+ command_args="&"
+ rc_flags=""
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/mail/qmail/patches/patch-aa b/mail/qmail/patches/patch-aa
index 4e139808673..8415513de1f 100644
--- a/mail/qmail/patches/patch-aa
+++ b/mail/qmail/patches/patch-aa
@@ -1,10 +1,17 @@
-$NetBSD: patch-aa,v 1.1 2002/05/03 10:39:01 zuntum Exp $
+$NetBSD: patch-aa,v 1.2 2004/04/10 05:30:06 schmonz Exp $
-First part of QMAILQUEUE patch, as found on http://www.qmail.org/
-
---- Makefile.orig Mon Jun 15 04:53:16 1998
-+++ Makefile Tue Jan 19 10:52:24 1999
-@@ -1483,12 +1483,12 @@
+--- Makefile.orig 1998-06-15 06:53:16.000000000 -0400
++++ Makefile
+@@ -263,7 +263,7 @@ makelib cdbmake_pack.o cdbmake_hash.o cd
+ cdbmake_add.o
+
+ cdbmake_add.o: \
+-compile cdbmake_add.c cdbmake.h uint32.h
++compile cdbmake_add.c cdbmake.h alloc.h uint32.h
+ ./compile cdbmake_add.c
+
+ cdbmake_hash.o: \
+@@ -1483,12 +1483,12 @@ load qmail-send.o qsutil.o control.o con
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 \
@@ -19,3 +26,12 @@ First part of QMAILQUEUE patch, as found on http://www.qmail.org/
qmail-send.0: \
qmail-send.8
+@@ -1892,7 +1892,7 @@ trylsock.c compile load
+
+ spawn.o: \
+ compile chkspawn spawn.c sig.h wait.h substdio.h byte.h str.h \
+-stralloc.h gen_alloc.h select.h exit.h coe.h open.h error.h \
++stralloc.h gen_alloc.h select.h exit.h alloc.h coe.h open.h error.h \
+ auto_qmail.h auto_uids.h auto_spawn.h
+ ./chkspawn
+ ./compile spawn.c
diff --git a/mail/qmail/patches/patch-ab b/mail/qmail/patches/patch-ab
index d65ff218465..6a46485025e 100644
--- a/mail/qmail/patches/patch-ab
+++ b/mail/qmail/patches/patch-ab
@@ -1,10 +1,8 @@
-$NetBSD: patch-ab,v 1.1 2002/05/03 10:39:01 zuntum Exp $
+$NetBSD: patch-ab,v 1.2 2004/04/10 05:30:06 schmonz Exp $
-Second part of QMAILQUEUE patch, as found on http://www.qmail.org/
-
---- qmail.c.orig Mon Jun 15 04:53:16 1998
-+++ qmail.c Tue Jan 19 09:57:36 1999
-@@ -6,14 +6,25 @@
+--- qmail.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ qmail.c
+@@ -6,8 +6,17 @@
#include "fd.h"
#include "qmail.h"
#include "auto_qmail.h"
@@ -23,12 +21,12 @@ Second part of QMAILQUEUE patch, as found on http://www.qmail.org/
int qmail_open(qq)
struct qmail *qq;
- {
+@@ -15,6 +24,8 @@ struct qmail *qq;
int pim[2];
int pie[2];
-+
-+ setup_qqargs();
++ setup_qqargs();
++
if (pipe(pim) == -1) return -1;
if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; }
-
+
diff --git a/mail/qmail/patches/patch-ac b/mail/qmail/patches/patch-ac
index 0e76751ed93..b548ebe3ddd 100644
--- a/mail/qmail/patches/patch-ac
+++ b/mail/qmail/patches/patch-ac
@@ -1,11 +1,17 @@
-$NetBSD: patch-ac,v 1.1 2002/05/03 10:39:01 zuntum Exp $
+$NetBSD: patch-ac,v 1.2 2004/04/10 05:30:06 schmonz Exp $
-Patch necessary to cope with non-RFC >512 dns entries,
-as found on http://www.ckdhr.com/ckd/qmail-103.patch
-
---- dns.c.orig Mon Aug 17 16:06:58 1998
-+++ dns.c Wed Aug 26 16:28:56 1998
-@@ -21,10 +21,12 @@
+--- dns.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ dns.c
+@@ -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"
+@@ -21,10 +19,12 @@ extern int h_errno;
static unsigned short getshort(c) unsigned char *c;
{ unsigned short u; u = c[0]; return (u << 8) + c[1]; }
@@ -19,7 +25,7 @@ as found on http://www.ckdhr.com/ckd/qmail-103.patch
static int numanswers;
static char name[MAXDNAME];
-@@ -45,18 +47,33 @@
+@@ -45,18 +45,33 @@ int type;
errno = 0;
if (!stralloc_copy(&glue,domain)) return DNS_MEM;
if (!stralloc_0(&glue)) return DNS_MEM;
@@ -57,7 +63,7 @@ as found on http://www.ckdhr.com/ckd/qmail-103.patch
while (n-- > 0)
{
i = dn_expand(response.buf,responseend,responsepos,name,MAXDNAME);
-@@ -66,7 +83,7 @@
+@@ -66,7 +81,7 @@ int type;
if (i < QFIXEDSZ) return DNS_SOFT;
responsepos += QFIXEDSZ;
}
diff --git a/mail/qmail/patches/patch-ad b/mail/qmail/patches/patch-ad
new file mode 100644
index 00000000000..802665bda1c
--- /dev/null
+++ b/mail/qmail/patches/patch-ad
@@ -0,0 +1,11 @@
+$NetBSD: patch-ad,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- cdb_seek.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ cdb_seek.c
+@@ -1,6 +1,5 @@
+ #include <sys/types.h>
+ #include <errno.h>
+-extern int errno;
+ #include "cdb.h"
+
+ #ifndef SEEK_SET
diff --git a/mail/qmail/patches/patch-ae b/mail/qmail/patches/patch-ae
new file mode 100644
index 00000000000..aedb6dc669d
--- /dev/null
+++ b/mail/qmail/patches/patch-ae
@@ -0,0 +1,9 @@
+$NetBSD: patch-ae,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- cdbmake_add.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ cdbmake_add.c
+@@ -1,3 +1,4 @@
++#include "alloc.h"
+ #include "cdbmake.h"
+
+ void cdbmake_init(cdbm)
diff --git a/mail/qmail/patches/patch-af b/mail/qmail/patches/patch-af
new file mode 100644
index 00000000000..d459b90d2c5
--- /dev/null
+++ b/mail/qmail/patches/patch-af
@@ -0,0 +1,15 @@
+$NetBSD: patch-af,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- error.3.orig 1998-06-15 06:53:16.000000000 -0400
++++ error.3
+@@ -3,8 +3,8 @@
+ error \- syscall error codes
+ .SH SYNTAX
+ .B #include <error.h>
+-
+-extern int \fBerrno\fP;
++.br
++.B #include <errno.h>
+
+ extern int \fBerror_intr\fP;
+ .br
diff --git a/mail/qmail/patches/patch-ag b/mail/qmail/patches/patch-ag
new file mode 100644
index 00000000000..b6137736520
--- /dev/null
+++ b/mail/qmail/patches/patch-ag
@@ -0,0 +1,13 @@
+$NetBSD: patch-ag,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- error.h.orig 1998-06-15 06:53:16.000000000 -0400
++++ error.h
+@@ -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 --git a/mail/qmail/patches/patch-ah b/mail/qmail/patches/patch-ah
new file mode 100644
index 00000000000..f9f5a8d6ba3
--- /dev/null
+++ b/mail/qmail/patches/patch-ah
@@ -0,0 +1,16 @@
+$NetBSD: patch-ah,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- ipme.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ ipme.c
+@@ -46,6 +46,11 @@ int ipme_init()
+ ipme.len = 0;
+ ix.pref = 0;
+
++ /* 0.0.0.0 is a special address which always refers to
++ * "this host, this network", according to RFC 1122, Sec. 3.2.1.3a.
++ */
++ byte_copy(&ix.ip,4,"\0\0\0\0");
++ if (!ipalloc_append(&ipme,&ix)) { return 0; }
+ if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1;
+
+ len = 256;
diff --git a/mail/qmail/patches/patch-ai b/mail/qmail/patches/patch-ai
new file mode 100644
index 00000000000..85846ad1071
--- /dev/null
+++ b/mail/qmail/patches/patch-ai
@@ -0,0 +1,13 @@
+$NetBSD: patch-ai,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- qmail-local.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ qmail-local.c
+@@ -645,7 +645,7 @@ char **argv;
+ {
+ cmds.s[j] = 0;
+ k = j;
+- while ((k > i) && (cmds.s[k - 1] == ' ') || (cmds.s[k - 1] == '\t'))
++ while ((k > i) && ((cmds.s[k - 1] == ' ') || (cmds.s[k - 1] == '\t')))
+ cmds.s[--k] = 0;
+ switch(cmds.s[i])
+ {
diff --git a/mail/qmail/patches/patch-aj b/mail/qmail/patches/patch-aj
new file mode 100644
index 00000000000..e709c9b9e63
--- /dev/null
+++ b/mail/qmail/patches/patch-aj
@@ -0,0 +1,16 @@
+$NetBSD: patch-aj,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- qmail-log.5.orig 1998-06-15 06:53:16.000000000 -0400
++++ qmail-log.5
+@@ -232,6 +232,11 @@ It will try again later.
+ is unable to queue a bounce message,
+ usually because the machine is almost out of memory.
+ It will try again later.
++This can also be caused by incorrect settings of
++.B $QMAILQUEUE
++or errors in a program or script which
++.B $QMAILQUEUE
++points to.
+ .TP
+ .B unable to stat ...
+ .B qmail-send
diff --git a/mail/qmail/patches/patch-ak b/mail/qmail/patches/patch-ak
new file mode 100644
index 00000000000..adae72f70ce
--- /dev/null
+++ b/mail/qmail/patches/patch-ak
@@ -0,0 +1,103 @@
+$NetBSD: patch-ak,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- qmail-pop3d.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ qmail-pop3d.c
+@@ -66,14 +66,14 @@ void die_nomaildir() { err("this user ha
+ void die_scan() { err("unable to scan $HOME/Maildir"); die(); }
+
+ void err_syntax() { err("syntax error"); }
+-void err_unimpl() { err("unimplemented"); }
++void err_unimpl(arg) char *arg; { err("unimplemented"); }
+ void err_deleted() { err("already deleted"); }
+ void err_nozero() { err("messages are counted from 1"); }
+ void err_toobig() { err("not that many messages"); }
+ void err_nosuch() { err("unable to open that message"); }
+ void err_nounlink() { err("unable to unlink all deleted messages"); }
+
+-void okay() { puts("+OK \r\n"); flush(); }
++void okay(arg) char *arg; { puts("+OK \r\n"); flush(); }
+
+ void printfn(fn) char *fn;
+ {
+@@ -146,7 +146,7 @@ void getlist()
+ }
+ }
+
+-void pop3_stat()
++void pop3_stat(arg) char *arg;
+ {
+ int i;
+ unsigned long total;
+@@ -161,15 +161,15 @@ void pop3_stat()
+ flush();
+ }
+
+-void pop3_rset()
++void pop3_rset(arg) char *arg;
+ {
+ int i;
+ for (i = 0;i < numm;++i) m[i].flagdeleted = 0;
+ last = 0;
+- okay();
++ okay(0);
+ }
+
+-void pop3_last()
++void pop3_last(arg) char *arg;
+ {
+ puts("+OK ");
+ put(strnum,fmt_uint(strnum,last));
+@@ -177,7 +177,7 @@ void pop3_last()
+ flush();
+ }
+
+-void pop3_quit()
++void pop3_quit(arg) char *arg;
+ {
+ int i;
+ for (i = 0;i < numm;++i)
+@@ -192,7 +192,7 @@ void pop3_quit()
+ if (!stralloc_0(&line)) die_nomem();
+ rename(m[i].fn,line.s); /* if it fails, bummer */
+ }
+- okay();
++ okay(0);
+ die();
+ }
+
+@@ -214,7 +214,7 @@ void pop3_dele(arg) char *arg;
+ if (i == -1) return;
+ m[i].flagdeleted = 1;
+ if (i + 1 > last) last = i + 1;
+- okay();
++ okay(0);
+ }
+
+ void list(i,flaguidl)
+@@ -238,7 +238,7 @@ void dolisting(arg,flaguidl) char *arg;
+ list(i,flaguidl);
+ }
+ else {
+- okay();
++ okay(0);
+ for (i = 0;i < numm;++i)
+ if (!m[i].flagdeleted)
+ list(i,flaguidl);
+@@ -267,7 +267,7 @@ void pop3_top(arg) char *arg;
+
+ fd = open_read(m[i].fn);
+ if (fd == -1) { err_nosuch(); return; }
+- okay();
++ okay(0);
+ substdio_fdbuf(&ssmsg,read,fd,ssmsgbuf,sizeof(ssmsgbuf));
+ blast(&ssmsg,limit);
+ close(fd);
+@@ -299,7 +299,7 @@ char **argv;
+
+ getlist();
+
+- okay();
++ okay(0);
+ commands(&ssin,pop3commands);
+ die();
+ }
diff --git a/mail/qmail/patches/patch-al b/mail/qmail/patches/patch-al
new file mode 100644
index 00000000000..8f3e467ca9a
--- /dev/null
+++ b/mail/qmail/patches/patch-al
@@ -0,0 +1,27 @@
+$NetBSD: patch-al,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- qmail-popup.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ qmail-popup.c
+@@ -64,10 +64,10 @@ void die_badauth() { err("authorization
+
+ void err_syntax() { err("syntax error"); }
+ void err_wantuser() { err("USER first"); }
+-void err_authoriz() { err("authorization first"); }
++void err_authoriz(arg) char *arg; { err("authorization first"); }
+
+-void okay() { puts("+OK \r\n"); flush(); }
+-void pop3_quit() { okay(); die(); }
++void okay(arg) char *arg; { puts("+OK \r\n"); flush(); }
++void pop3_quit(arg) char *arg; { okay(0); die(); }
+
+
+ char unique[FMT_ULONG + FMT_ULONG + 3];
+@@ -136,7 +136,7 @@ void pop3_greet()
+ void pop3_user(arg) char *arg;
+ {
+ if (!*arg) { err_syntax(); return; }
+- okay();
++ okay(0);
+ seenuser = 1;
+ if (!stralloc_copys(&username,arg)) die_nomem();
+ if (!stralloc_0(&username)) die_nomem();
diff --git a/mail/qmail/patches/patch-am b/mail/qmail/patches/patch-am
new file mode 100644
index 00000000000..7526aafef39
--- /dev/null
+++ b/mail/qmail/patches/patch-am
@@ -0,0 +1,17 @@
+$NetBSD: patch-am,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- qmail-queue.8.orig 1998-06-15 06:53:16.000000000 -0400
++++ qmail-queue.8
+@@ -40,6 +40,12 @@ and does not enforce any restrictions on
+ However, the recipients probably expect to see a proper header,
+ as described in
+ .BR qmail-header(5) .
++
++Programs included with qmail which invoke
++.B qmail-queue
++will invoke the contents of
++.B $QMAILQUEUE
++instead, if that environment variable is set.
+ .SH "FILESYSTEM RESTRICTIONS"
+ .B qmail-queue
+ imposes two constraints on the queue structure:
diff --git a/mail/qmail/patches/patch-an b/mail/qmail/patches/patch-an
new file mode 100644
index 00000000000..7f0797b1b6e
--- /dev/null
+++ b/mail/qmail/patches/patch-an
@@ -0,0 +1,63 @@
+$NetBSD: patch-an,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- qmail-smtpd.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ qmail-smtpd.c
+@@ -51,12 +51,12 @@ void straynewline() { out("451 See http:
+
+ 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"); }
+-void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); }
++void err_unimpl(arg) char *arg; { 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"); }
+ void err_wantrcpt() { out("503 RCPT first (#5.5.1)\r\n"); }
+-void err_noop() { out("250 ok\r\n"); }
+-void err_vrfy() { out("252 send some mail, i'll try my best\r\n"); }
++void err_noop(arg) char *arg; { out("250 ok\r\n"); }
++void err_vrfy(arg) char *arg; { out("252 send some mail, i'll try my best\r\n"); }
+ void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); }
+
+
+@@ -67,11 +67,11 @@ void smtp_greet(code) char *code;
+ substdio_puts(&ssout,code);
+ substdio_put(&ssout,greeting.s,greeting.len);
+ }
+-void smtp_help()
++void smtp_help(arg) char *arg;
+ {
+- out("214 qmail home page: http://pobox.com/~djb/qmail.html\r\n");
++ out("214 netqmail home page: http://qmail.org/netqmail\r\n");
+ }
+-void smtp_quit()
++void smtp_quit(arg) char *arg;
+ {
+ smtp_greet("221 "); out("\r\n"); flush(); _exit(0);
+ }
+@@ -232,7 +232,7 @@ void smtp_ehlo(arg) char *arg;
+ smtp_greet("250-"); out("\r\n250-PIPELINING\r\n250 8BITMIME\r\n");
+ seenmail = 0; dohelo(arg);
+ }
+-void smtp_rset()
++void smtp_rset(arg) char *arg;
+ {
+ seenmail = 0;
+ out("250 flushed\r\n");
+@@ -316,8 +316,8 @@ int *hops;
+ if (flagmaybex) if (pos == 7) ++*hops;
+ if (pos < 2) if (ch != "\r\n"[pos]) flagmaybey = 0;
+ if (flagmaybey) if (pos == 1) flaginheader = 0;
++ ++pos;
+ }
+- ++pos;
+ if (ch == '\n') { pos = 0; flagmaybex = flagmaybey = flagmaybez = 1; }
+ }
+ switch(state) {
+@@ -365,7 +365,7 @@ void acceptmessage(qp) unsigned long qp;
+ out("\r\n");
+ }
+
+-void smtp_data() {
++void smtp_data(arg) char *arg; {
+ int hops;
+ unsigned long qp;
+ char *qqx;
diff --git a/mail/qmail/patches/patch-ao b/mail/qmail/patches/patch-ao
new file mode 100644
index 00000000000..3c506904b50
--- /dev/null
+++ b/mail/qmail/patches/patch-ao
@@ -0,0 +1,22 @@
+$NetBSD: patch-ao,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- qmail.7.orig 1998-06-15 06:53:16.000000000 -0400
++++ qmail.7
+@@ -55,12 +55,14 @@ Miscellaneous documentation includes
+ and
+ .BR qmail-pop3d (8).
+
+-This documentation describes version
+-1.03
++This documentation describes netqmail version
++1.05
+ of
+ .BR qmail .
+ See
+ .B http://pobox.com/~djb/qmail.html
+ for other
+ .BR qmail -related
+-software.
++software, and
++.B http://qmail.org/
++for other qmail community contributions.
diff --git a/mail/qmail/patches/patch-ap b/mail/qmail/patches/patch-ap
new file mode 100644
index 00000000000..d81694906d3
--- /dev/null
+++ b/mail/qmail/patches/patch-ap
@@ -0,0 +1,51 @@
+$NetBSD: patch-ap,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- sendmail.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ sendmail.c
+@@ -45,6 +45,38 @@ void mailq()
+ _exit(111);
+ }
+
++void do_sender(s)
++const char *s;
++{
++ char *x;
++ int n;
++ int a;
++ int i;
++
++ env_unset("QMAILNAME");
++ env_unset("MAILNAME");
++ env_unset("NAME");
++ env_unset("QMAILHOST");
++ env_unset("MAILHOST");
++
++ n = str_len(s);
++ a = str_rchr(s, '@');
++ if (a == n)
++ {
++ env_put2("QMAILUSER", s);
++ return;
++ }
++ env_put2("QMAILHOST", s + a + 1);
++
++ x = (char *) alloc((a + 1) * sizeof(char));
++ if (!x) nomem();
++ for (i = 0; i < a; i++)
++ x[i] = s[i];
++ x[i] = 0;
++ env_put2("QMAILUSER", x);
++ alloc_free(x);
++}
++
+ int flagh;
+ char *sender;
+
+@@ -118,6 +150,7 @@ char **argv;
+ if (sender) {
+ *arg++ = "-f";
+ *arg++ = sender;
++ do_sender(sender);
+ }
+ *arg++ = "--";
+ for (i = 0;i < argc;++i) *arg++ = argv[i];
diff --git a/mail/qmail/patches/patch-aq b/mail/qmail/patches/patch-aq
new file mode 100644
index 00000000000..cf2c09685b5
--- /dev/null
+++ b/mail/qmail/patches/patch-aq
@@ -0,0 +1,12 @@
+$NetBSD: patch-aq,v 1.1 2004/04/10 05:30:06 schmonz Exp $
+
+--- spawn.c.orig 1998-06-15 06:53:16.000000000 -0400
++++ spawn.c
+@@ -5,6 +5,7 @@
+ #include "substdio.h"
+ #include "byte.h"
+ #include "str.h"
++#include "alloc.h"
+ #include "stralloc.h"
+ #include "select.h"
+ #include "exit.h"