summaryrefslogtreecommitdiff
path: root/mail/qmail/patches
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/patches
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/patches')
-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
17 files changed, 433 insertions, 25 deletions
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"