Skip to content
Permalink
Browse files

Second release of netqmail (1.05).

20040121 version: netqmail 1.05
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)
  • Loading branch information...
schmonz committed Jul 15, 2017
1 parent 4546c82 commit 21eab7f917571d554978a29f35de6f73fa5eb7e3
Showing with 55 additions and 29 deletions.
  1. +7 −0 CHANGES
  2. +2 −2 Makefile
  3. +16 −0 README
  4. +1 −1 UPGRADE
  5. +1 −1 VERSION
  6. +1 −0 cdbmake_add.c
  7. +1 −0 error.3
  8. +12 −12 qmail-pop3d.c
  9. +4 −4 qmail-popup.c
  10. +8 −8 qmail-smtpd.c
  11. +1 −1 qmail.7
  12. +1 −0 spawn.c
@@ -1,3 +1,10 @@
20040121 version: netqmail 1.05
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 version: netqmail 1.04.
20031027 doc: INSTALL points to http://lifewithqmail.org/lwq.html
20031027 doc: qmail.7 identifies installation as netqmail and points to
@@ -263,7 +263,7 @@ makelib cdbmake_pack.o cdbmake_hash.o cdbmake_add.o
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: \
@@ -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
16 README
@@ -12,6 +12,22 @@ the official qmail-1.03.tar.gz and patches approved by the community.
D. J. Bernstein did not participate in, nor has he been asked to
approve of this distribution.

netqmail 1.05
20040121
James Craig Burley claims copyright on the qmail-isoc patch. For
more details, see the COPYRIGHTS file shipped with the netqmail-1.05
distribution.

James' patch has been combined with the original netqmail-1.04 patch
and the result incorporated into a unified netqmail-1.05 patch.
Apart from James' copyrights, no other copyright is claimed by the
distributors of netqmail for changes from qmail 1.03 to netqmail 1.05.

NOTE: netqmail 1.05 is a community-assembled distribution of qmail from
the official qmail-1.03.tar.gz and patches approved by the community.
D. J. Bernstein did not participate in, nor has he been asked to
approve of this distribution.

qmail is a secure, reliable, efficient, simple message transfer agent.
It is meant as a replacement for the entire sendmail-binmail system on
typical Internet-connected UNIX hosts. See BLURB, BLURB2, BLURB3, and
@@ -3,7 +3,7 @@ information generally), the qmail system comes with NO WARRANTY. It's
much more secure and reliable than sendmail, but that's not saying much.


Here's how to upgrade to netqmail 1.04. This procedure will overwrite the
Here's how to upgrade to netqmail 1.05. This procedure will overwrite the
old qmail binaries. Furthermore, it may begin delivering messages from
the queue before you have had a chance to test it.

@@ -1 +1 @@
netqmail 1.04
netqmail 1.05
@@ -1,3 +1,4 @@
#include "alloc.h"
#include "cdbmake.h"

void cdbmake_init(cdbm)
@@ -3,6 +3,7 @@
error \- syscall error codes
.SH SYNTAX
.B #include <error.h>
.br
.B #include <errno.h>

extern int \fBerror_intr\fP;
@@ -66,14 +66,14 @@ void die_nomaildir() { err("this user has no $HOME/Maildir"); die(); }
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,23 +161,23 @@ 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));
puts("\r\n");
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; int flaguidl;
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();
}
@@ -64,10 +64,10 @@ void die_badauth() { err("authorization failed"); }

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();
@@ -51,12 +51,12 @@ void straynewline() { out("451 See http://pobox.com/~djb/docs/smtplf.html.\r\n")

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 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;
@@ -56,7 +56,7 @@ and
.BR qmail-pop3d (8).

This documentation describes netqmail version
1.04
1.05
of
.BR qmail .
See
@@ -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"

0 comments on commit 21eab7f

Please sign in to comment.
You can’t perform that action at this time.