netqmail 1.04
This commit is contained in:
parent
f5df10d173
commit
2bb7433cc9
20 changed files with 103 additions and 101 deletions
14
CHANGES
14
CHANGES
|
|
@ -1,3 +1,17 @@
|
||||||
|
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
|
||||||
|
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 doc: FAQ also points to http://cr.yp.to/qmail/faq.html and
|
||||||
|
http://qmail.org/
|
||||||
|
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.
|
||||||
19980615 version: qmail 1.03.
|
19980615 version: qmail 1.03.
|
||||||
19980614 doc: eliminated BIN.setup in favor of a web page.
|
19980614 doc: eliminated BIN.setup in favor of a web page.
|
||||||
19980614 code: added other auto* to qmail-showctl output.
|
19980614 code: added other auto* to qmail-showctl output.
|
||||||
|
|
|
||||||
3
FAQ
3
FAQ
|
|
@ -1,3 +1,6 @@
|
||||||
|
See http://cr.yp.to/qmail/faq.html for newer FAQs not included in this
|
||||||
|
document, and http://qmail.org/ for qmail community contributions.
|
||||||
|
|
||||||
1. Controlling the appearance of outgoing messages
|
1. Controlling the appearance of outgoing messages
|
||||||
1.1. How do I set up host masquerading?
|
1.1. How do I set up host masquerading?
|
||||||
1.2. How do I set up user masquerading?
|
1.2. How do I set up user masquerading?
|
||||||
|
|
|
||||||
1
FILES
1
FILES
|
|
@ -10,6 +10,7 @@ INSTALL.ctl
|
||||||
INSTALL.ids
|
INSTALL.ids
|
||||||
INSTALL.maildir
|
INSTALL.maildir
|
||||||
INSTALL.mbox
|
INSTALL.mbox
|
||||||
|
INSTALL-1.03
|
||||||
INSTALL.vsm
|
INSTALL.vsm
|
||||||
REMOVE.sendmail
|
REMOVE.sendmail
|
||||||
REMOVE.binmail
|
REMOVE.binmail
|
||||||
|
|
|
||||||
85
INSTALL
85
INSTALL
|
|
@ -1,84 +1 @@
|
||||||
SAVE COPIES OF YOUR OUTGOING MAIL! Like any other piece of software (and
|
See http://lifewithqmail.org/lwq.html
|
||||||
information generally), the qmail system comes with NO WARRANTY. It's
|
|
||||||
much more secure and reliable than sendmail, but that's not saying much.
|
|
||||||
|
|
||||||
|
|
||||||
Things you have to decide before starting:
|
|
||||||
|
|
||||||
* The qmail home directory, normally /var/qmail. To change this
|
|
||||||
directory, edit conf-qmail now.
|
|
||||||
|
|
||||||
* The names of the qmail users and the qmail groups. To change these
|
|
||||||
names, edit conf-users and conf-groups now.
|
|
||||||
|
|
||||||
|
|
||||||
To create /var/qmail and configure qmail (won't interfere with sendmail):
|
|
||||||
|
|
||||||
1. Create the qmail home directory:
|
|
||||||
# mkdir /var/qmail
|
|
||||||
|
|
||||||
2. Read INSTALL.ids. You must set up the qmail group and the qmail
|
|
||||||
users before compiling the programs.
|
|
||||||
|
|
||||||
3. Compile the programs and create the qmail directory tree:
|
|
||||||
# make setup check
|
|
||||||
|
|
||||||
4. Read INSTALL.ctl and FAQ. Minimal survival command:
|
|
||||||
# ./config
|
|
||||||
|
|
||||||
5. Read INSTALL.alias. Minimal survival command:
|
|
||||||
# (cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root)
|
|
||||||
# chmod 644 ~alias/.qmail*
|
|
||||||
|
|
||||||
6. Read INSTALL.mbox and INSTALL.vsm.
|
|
||||||
|
|
||||||
7. Read INSTALL.maildir.
|
|
||||||
|
|
||||||
8. Copy /var/qmail/boot/home (or proc) to /var/qmail/rc.
|
|
||||||
|
|
||||||
|
|
||||||
To test qmail deliveries (won't interfere with sendmail):
|
|
||||||
|
|
||||||
9. Enable deliveries of messages injected into qmail:
|
|
||||||
# csh -cf '/var/qmail/rc &'
|
|
||||||
|
|
||||||
10. Read TEST.deliver.
|
|
||||||
|
|
||||||
|
|
||||||
To upgrade from sendmail to qmail:
|
|
||||||
|
|
||||||
11. Read SENDMAIL. This is what your users will want to know about the
|
|
||||||
switch from sendmail to qmail.
|
|
||||||
|
|
||||||
12. Read REMOVE.sendmail. You must remove sendmail before installing
|
|
||||||
qmail.
|
|
||||||
|
|
||||||
13. Read REMOVE.binmail.
|
|
||||||
|
|
||||||
14. Add
|
|
||||||
csh -cf '/var/qmail/rc &'
|
|
||||||
to your boot scripts, so that the qmail daemons are restarted
|
|
||||||
whenever your system reboots. Make sure you include the &.
|
|
||||||
|
|
||||||
15. Make qmail's ``sendmail'' wrapper available to MUAs:
|
|
||||||
# ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
|
|
||||||
# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
|
|
||||||
/usr/sbin might not exist on your system.
|
|
||||||
|
|
||||||
16. Set up qmail-smtpd in /etc/inetd.conf (all on one line):
|
|
||||||
smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env
|
|
||||||
tcp-env /var/qmail/bin/qmail-smtpd
|
|
||||||
|
|
||||||
17. Reboot. (Or kill -HUP your inetd and make sure the qmail daemons
|
|
||||||
are running.)
|
|
||||||
|
|
||||||
18. Read TEST.receive.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
That's it! To report success:
|
|
||||||
% ( echo 'First M. Last'; cat `cat SYSDEPS` ) | mail djb-qst@cr.yp.to
|
|
||||||
Replace First M. Last with your name.
|
|
||||||
|
|
||||||
If you have questions about qmail, join the qmail mailing list; see
|
|
||||||
http://pobox.com/~djb/qmail.html.
|
|
||||||
|
|
|
||||||
4
Makefile
4
Makefile
|
|
@ -1483,12 +1483,12 @@ load qmail-send.o qsutil.o control.o constmap.o newfield.o prioq.o \
|
||||||
trigger.o fmtqfn.o quote.o now.o readsubdir.o qmail.o date822fmt.o \
|
trigger.o fmtqfn.o quote.o now.o readsubdir.o qmail.o date822fmt.o \
|
||||||
datetime.a case.a ndelay.a getln.a wait.a seek.a fd.a sig.a open.a \
|
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 \
|
lock.a stralloc.a alloc.a substdio.a error.a str.a fs.a auto_qmail.o \
|
||||||
auto_split.o
|
auto_split.o env.a
|
||||||
./load qmail-send qsutil.o control.o constmap.o newfield.o \
|
./load qmail-send qsutil.o control.o constmap.o newfield.o \
|
||||||
prioq.o trigger.o fmtqfn.o quote.o now.o readsubdir.o \
|
prioq.o trigger.o fmtqfn.o quote.o now.o readsubdir.o \
|
||||||
qmail.o date822fmt.o datetime.a case.a ndelay.a getln.a \
|
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 \
|
wait.a seek.a fd.a sig.a open.a lock.a stralloc.a alloc.a \
|
||||||
substdio.a error.a str.a fs.a auto_qmail.o auto_split.o
|
substdio.a error.a str.a fs.a auto_qmail.o auto_split.o env.a
|
||||||
|
|
||||||
qmail-send.0: \
|
qmail-send.0: \
|
||||||
qmail-send.8
|
qmail-send.8
|
||||||
|
|
|
||||||
9
README
9
README
|
|
@ -3,6 +3,15 @@ qmail 1.03
|
||||||
Copyright 1998
|
Copyright 1998
|
||||||
D. J. Bernstein, qmail@pobox.com
|
D. J. Bernstein, qmail@pobox.com
|
||||||
|
|
||||||
|
netqmail 1.04
|
||||||
|
20031024
|
||||||
|
No copyright claimed for changes from qmail 1.03 to netqmail 1.04
|
||||||
|
Russell Nelson, nelson@qmail.org
|
||||||
|
NOTE: netqmail 1.04 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.
|
qmail is a secure, reliable, efficient, simple message transfer agent.
|
||||||
It is meant as a replacement for the entire sendmail-binmail system on
|
It is meant as a replacement for the entire sendmail-binmail system on
|
||||||
typical Internet-connected UNIX hosts. See BLURB, BLURB2, BLURB3, and
|
typical Internet-connected UNIX hosts. See BLURB, BLURB2, BLURB3, and
|
||||||
|
|
|
||||||
4
UPGRADE
4
UPGRADE
|
|
@ -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.
|
much more secure and reliable than sendmail, but that's not saying much.
|
||||||
|
|
||||||
|
|
||||||
Here's how to upgrade to qmail 1.03. This procedure will overwrite the
|
Here's how to upgrade to netqmail 1.04. This procedure will overwrite the
|
||||||
old qmail binaries. Furthermore, it may begin delivering messages from
|
old qmail binaries. Furthermore, it may begin delivering messages from
|
||||||
the queue before you have had a chance to test it.
|
the queue before you have had a chance to test it.
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@ mechanism has been expanded to support virtual users.
|
||||||
|
|
||||||
|
|
||||||
Before starting, compare conf* to your old conf*, and make any necessary
|
Before starting, compare conf* to your old conf*, and make any necessary
|
||||||
changes. You can copy conf* from 1.02.
|
changes. You can copy conf* from 1.02 or 1.03.
|
||||||
|
|
||||||
|
|
||||||
How to install:
|
How to install:
|
||||||
|
|
|
||||||
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
qmail 1.03
|
netqmail 1.04
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
extern int errno;
|
|
||||||
#include "cdb.h"
|
#include "cdb.h"
|
||||||
|
|
||||||
#ifndef SEEK_SET
|
#ifndef SEEK_SET
|
||||||
|
|
|
||||||
2
dns.c
2
dns.c
|
|
@ -7,8 +7,6 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
extern int res_query();
|
extern int res_query();
|
||||||
extern int res_search();
|
extern int res_search();
|
||||||
extern int errno;
|
|
||||||
extern int h_errno;
|
|
||||||
#include "ip.h"
|
#include "ip.h"
|
||||||
#include "ipalloc.h"
|
#include "ipalloc.h"
|
||||||
#include "fmt.h"
|
#include "fmt.h"
|
||||||
|
|
|
||||||
3
error.3
3
error.3
|
|
@ -3,8 +3,7 @@
|
||||||
error \- syscall error codes
|
error \- syscall error codes
|
||||||
.SH SYNTAX
|
.SH SYNTAX
|
||||||
.B #include <error.h>
|
.B #include <error.h>
|
||||||
|
.B #include <errno.h>
|
||||||
extern int \fBerrno\fP;
|
|
||||||
|
|
||||||
extern int \fBerror_intr\fP;
|
extern int \fBerror_intr\fP;
|
||||||
.br
|
.br
|
||||||
|
|
|
||||||
2
error.h
2
error.h
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef ERROR_H
|
#ifndef ERROR_H
|
||||||
#define ERROR_H
|
#define ERROR_H
|
||||||
|
|
||||||
extern int errno;
|
#include <errno.h>
|
||||||
|
|
||||||
extern int error_intr;
|
extern int error_intr;
|
||||||
extern int error_nomem;
|
extern int error_nomem;
|
||||||
|
|
|
||||||
5
ipme.c
5
ipme.c
|
|
@ -46,6 +46,11 @@ int ipme_init()
|
||||||
ipme.len = 0;
|
ipme.len = 0;
|
||||||
ix.pref = 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;
|
if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1;
|
||||||
|
|
||||||
len = 256;
|
len = 256;
|
||||||
|
|
|
||||||
|
|
@ -645,7 +645,7 @@ char **argv;
|
||||||
{
|
{
|
||||||
cmds.s[j] = 0;
|
cmds.s[j] = 0;
|
||||||
k = j;
|
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;
|
cmds.s[--k] = 0;
|
||||||
switch(cmds.s[i])
|
switch(cmds.s[i])
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -232,6 +232,11 @@ It will try again later.
|
||||||
is unable to queue a bounce message,
|
is unable to queue a bounce message,
|
||||||
usually because the machine is almost out of memory.
|
usually because the machine is almost out of memory.
|
||||||
It will try again later.
|
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
|
.TP
|
||||||
.B unable to stat ...
|
.B unable to stat ...
|
||||||
.B qmail-send
|
.B qmail-send
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,12 @@ and does not enforce any restrictions on its contents.
|
||||||
However, the recipients probably expect to see a proper header,
|
However, the recipients probably expect to see a proper header,
|
||||||
as described in
|
as described in
|
||||||
.BR qmail-header(5) .
|
.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"
|
.SH "FILESYSTEM RESTRICTIONS"
|
||||||
.B qmail-queue
|
.B qmail-queue
|
||||||
imposes two constraints on the queue structure:
|
imposes two constraints on the queue structure:
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ void smtp_greet(code) char *code;
|
||||||
}
|
}
|
||||||
void smtp_help()
|
void smtp_help()
|
||||||
{
|
{
|
||||||
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()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
8
qmail.7
8
qmail.7
|
|
@ -55,12 +55,14 @@ Miscellaneous documentation includes
|
||||||
and
|
and
|
||||||
.BR qmail-pop3d (8).
|
.BR qmail-pop3d (8).
|
||||||
|
|
||||||
This documentation describes version
|
This documentation describes netqmail version
|
||||||
1.03
|
1.04
|
||||||
of
|
of
|
||||||
.BR qmail .
|
.BR qmail .
|
||||||
See
|
See
|
||||||
.B http://pobox.com/~djb/qmail.html
|
.B http://pobox.com/~djb/qmail.html
|
||||||
for other
|
for other
|
||||||
.BR qmail -related
|
.BR qmail -related
|
||||||
software.
|
software, and
|
||||||
|
.B http://qmail.org/
|
||||||
|
for other qmail community contributions.
|
||||||
|
|
|
||||||
13
qmail.c
13
qmail.c
|
|
@ -6,8 +6,17 @@
|
||||||
#include "fd.h"
|
#include "fd.h"
|
||||||
#include "qmail.h"
|
#include "qmail.h"
|
||||||
#include "auto_qmail.h"
|
#include "auto_qmail.h"
|
||||||
|
#include "env.h"
|
||||||
|
|
||||||
static char *binqqargs[2] = { "bin/qmail-queue", 0 } ;
|
static char *binqqargs[2] = { 0, 0 } ;
|
||||||
|
|
||||||
|
static void setup_qqargs()
|
||||||
|
{
|
||||||
|
if(!binqqargs[0])
|
||||||
|
binqqargs[0] = env_get("QMAILQUEUE");
|
||||||
|
if(!binqqargs[0])
|
||||||
|
binqqargs[0] = "bin/qmail-queue";
|
||||||
|
}
|
||||||
|
|
||||||
int qmail_open(qq)
|
int qmail_open(qq)
|
||||||
struct qmail *qq;
|
struct qmail *qq;
|
||||||
|
|
@ -15,6 +24,8 @@ struct qmail *qq;
|
||||||
int pim[2];
|
int pim[2];
|
||||||
int pie[2];
|
int pie[2];
|
||||||
|
|
||||||
|
setup_qqargs();
|
||||||
|
|
||||||
if (pipe(pim) == -1) return -1;
|
if (pipe(pim) == -1) return -1;
|
||||||
if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; }
|
if (pipe(pie) == -1) { close(pim[0]); close(pim[1]); return -1; }
|
||||||
|
|
||||||
|
|
|
||||||
33
sendmail.c
33
sendmail.c
|
|
@ -45,6 +45,38 @@ void mailq()
|
||||||
_exit(111);
|
_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;
|
int flagh;
|
||||||
char *sender;
|
char *sender;
|
||||||
|
|
||||||
|
|
@ -118,6 +150,7 @@ char **argv;
|
||||||
if (sender) {
|
if (sender) {
|
||||||
*arg++ = "-f";
|
*arg++ = "-f";
|
||||||
*arg++ = sender;
|
*arg++ = sender;
|
||||||
|
do_sender(sender);
|
||||||
}
|
}
|
||||||
*arg++ = "--";
|
*arg++ = "--";
|
||||||
for (i = 0;i < argc;++i) *arg++ = argv[i];
|
for (i = 0;i < argc;++i) *arg++ = argv[i];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue