From: Wietse Venema The queue manager (the qmgr(8) server process in the
figure) is the heart of Postfix mail delivery. It contacts the
-smtp(8), lmtp(8), local(8), virtual(8), pipe(8), or error(8) delivery
-agents, and sends a delivery request for one or more recipient
-addresses. The error(8) delivery agent is special: it always declares
-mail as undeliverable. It is not shown in the figure above.
The queue manager maintains a small active queue with the messages that it has opened for delivery. The active queue acts as diff --git a/postfix/html/discard.8.html b/postfix/html/discard.8.html new file mode 100644 index 000000000..930d7b56c --- /dev/null +++ b/postfix/html/discard.8.html @@ -0,0 +1,128 @@ + +
+ ++DISCARD(8) DISCARD(8) + +NAME + discard - Postfix discard mail delivery agent + +SYNOPSIS + discard [generic Postfix daemon options] + +DESCRIPTION + The Postfix discard delivery agent processes delivery + requests from the queue manager. Each request specifies a + queue file, a sender address, a domain or host name that + is treated as the reason for discarding the mail, and + recipient information. This program expects to be run + from the master(8) process manager. + + The discard delivery agent pretends to deliver all recipi- + ents in the delivery request, logs the "next-hop" domain + or host information as the reason for discarding the mail, + updates the queue file and marks recipients as finished or + informs the queue manager that delivery should be tried + again at a later time. + + Delivery status reports are sent to the bounce(8), + defer(8) or trace(8) daemon as appropriate. + +SECURITY + The discard mailer is not security-sensitive. It does not + talk to the network, and can be run chrooted at fixed low + privilege. + +STANDARDS + None. + +DIAGNOSTICS + Problems and transactions are logged to syslogd(8). + + Depending on the setting of the notify_classes parameter, + the postmaster is notified of bounces and of other trou- + ble. + +CONFIGURATION PARAMETERS + Changes to main.cf are picked up automatically as dis- + card(8) processes run for only a limited amount of time. + Use the command "postfix reload" to speed up a change. + + The text below provides only a parameter summary. See + postconf(5) for more details including examples. + + config_directory (see 'postconf -d' output) + The default location of the Postfix main.cf and + master.cf configuration files. + + daemon_timeout (18000s) + How much time a Postfix daemon process may take to + handle a request before it is terminated by a + built-in watchdog timer. + + double_bounce_sender (double-bounce) + The sender address of postmaster notifications that + are generated by the mail system. + + ipc_timeout (3600s) + The time limit for sending or receiving information + over an internal communication channel. + + max_idle (100s) + The maximum amount of time that an idle Postfix + daemon process waits for the next service request + before exiting. + + max_use (100) + The maximal number of connection requests before a + Postfix daemon process terminates. + + process_id (read-only) + The process ID of a Postfix command or daemon pro- + cess. + + process_name (read-only) + The process name of a Postfix command or daemon + process. + + queue_directory (see 'postconf -d' output) + The location of the Postfix top-level queue direc- + tory. + + syslog_facility (mail) + The syslog facility of Postfix logging. + + syslog_name (postfix) + The mail system name that is prepended to the pro- + cess name in syslog records, so that "smtpd" + becomes, for example, "postfix/smtpd". + +SEE ALSO + qmgr(8), queue manager + bounce(8), delivery status reports + error(8), Postfix error delivery agent + postconf(5), configuration parameters + master(8), process manager + syslogd(8), system logging + +LICENSE + The Secure Mailer license must be distributed with this + software. + +HISTORY + This service was introduced with Postfix version 2.2. + +AUTHOR(S) + Victor Duchovni + Morgan Stanley + + Based on code by: + Wietse Venema + IBM T.J. Watson Research + P.O. Box 704 + Yorktown Heights, NY 10598, USA + + DISCARD(8) +diff --git a/postfix/html/error.8.html b/postfix/html/error.8.html index 1a17bac0d..e66fa3b39 100644 --- a/postfix/html/error.8.html +++ b/postfix/html/error.8.html @@ -116,6 +116,7 @@ ERROR(8) ERROR(8) SEE ALSO qmgr(8), queue manager bounce(8), delivery status reports + discard(8), Postfix discard delivery agent postconf(5), configuration parameters master(8), process manager syslogd(8), system logging diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index ee5633105..d9d1c55d9 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -717,6 +717,97 @@ This feature is available in Postfix 2.1 and later. + + +
+List of users who are authorized to flush the queue. +
+ ++By default all users are allowed to flush the queue. Otherwise if the +invoking user is neither the super-user nor the $mail_owner user, access +is denied unless the real uid of the process trying to flush the queue +is listed in the system password file and the corresponding login name +is on the access list.
+ ++Specify a list of user names, "/file/name" or "type:table" patterns, +separated by commas and/or whitespace. The list is matched left to +right, and the search stops on the first match. Specify "!name" to +exclude a name from the list. A "/file/name" pattern is replaced +by its contents; a "type:table" lookup table is matched when a name +matches a lookup key (the lookup result is ignored). Continue long +lines by starting the next line with whitespace.
+ ++This feature is available in Postfix 2.2 and later. +
+ + ++List of users who are authorized to view the queue. +
+ ++By default all users are allowed to view the queue. Otherwise if the +invoking user is neither the super-user nor the $mail_owner user, access +is denied unless the real uid of the process trying to view the queue +is listed in the system password file and the corresponding login name +is on the access list.
+ ++Specify a list of user names, "/file/name" or "type:table" patterns, +separated by commas and/or whitespace. The list is matched left to +right, and the search stops on the first match. Specify "!name" to +exclude a name from the list. A "/file/name" pattern is replaced +by its contents; a "type:table" lookup table is matched when a name +matches a lookup key (the lookup result is ignored). Continue long +lines by starting the next line with whitespace.
+ ++This feature is available in Postfix 2.2 and later. +
+ + ++List of users who are authorized to use the sendmail(1) command +(and the privileged postdrop(1) helper command) to submit mail. +
+ ++By default all users are allowed to submit mail. Otherwise, access is denied +unless the real uid of the process trying to submit mail is listed in +the system password file and the corresponding login name is on the +access list. To deny mail submission access to all users specify an +empty list.
+ ++Specify a list of user names, "/file/name" or "type:table" patterns, +separated by commas and/or whitespace. The list is matched left to right, +and the search stops on the first match. Specify "!name" to exclude a +name from the list. A "/file/name" pattern is replaced by its contents; +a "type:table" lookup table is matched when a name matches a lookup key +(the lookup result is ignored). Continue long lines by starting the +next line with whitespace.
+ ++This feature is available in Postfix 2.2 and later. +
+ +The queue manager (the qmgr(8) server process in the figure) is the heart of Postfix mail delivery. It contacts the -smtp(8), lmtp(8), local(8), virtual(8), pipe(8), or error(8) delivery -agents, and sends a delivery request for one or more recipient -addresses. The error(8) delivery agent is special: it always declares -mail as undeliverable. It is not shown in the figure above.
+smtp(8), lmtp(8), local(8), virtual(8), pipe(8), discard(8) or +error(8) delivery agents, and sends a delivery request for one +or more recipient addresses. The discard(8) and error(8) delivery +agents are special: they discard or bounce all mail, they are not +shown in the figure above.The queue manager maintains a small active queue with the messages that it has opened for delivery. The active queue acts as diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 49994026b..d06ffffbb 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -5510,6 +5510,85 @@ The default time unit is s (seconds). This feature is available in Postfix 2.1 and later.
+%PARAM authorized_flush_users static:anyone + ++List of users who are authorized to flush the queue. +
+ ++By default all users are allowed to flush the queue. Otherwise if the +invoking user is neither the super-user nor the $mail_owner user, access +is denied unless the real uid of the process trying to flush the queue +is listed in the system password file and the corresponding login name +is on the access list.
+ ++Specify a list of user names, "/file/name" or "type:table" patterns, +separated by commas and/or whitespace. The list is matched left to +right, and the search stops on the first match. Specify "!name" to +exclude a name from the list. A "/file/name" pattern is replaced +by its contents; a "type:table" lookup table is matched when a name +matches a lookup key (the lookup result is ignored). Continue long +lines by starting the next line with whitespace.
+ ++This feature is available in Postfix 2.2 and later. +
+ +%PARAM authorized_mailq_users static:anyone + ++List of users who are authorized to view the queue. +
+ ++By default all users are allowed to view the queue. Otherwise if the +invoking user is neither the super-user nor the $mail_owner user, access +is denied unless the real uid of the process trying to view the queue +is listed in the system password file and the corresponding login name +is on the access list.
+ ++Specify a list of user names, "/file/name" or "type:table" patterns, +separated by commas and/or whitespace. The list is matched left to +right, and the search stops on the first match. Specify "!name" to +exclude a name from the list. A "/file/name" pattern is replaced +by its contents; a "type:table" lookup table is matched when a name +matches a lookup key (the lookup result is ignored). Continue long +lines by starting the next line with whitespace.
+ ++This feature is available in Postfix 2.2 and later. +
+ +%PARAM authorized_sendmail_users static:anyone + ++List of users who are authorized to use the sendmail(1) command +(and the privileged postdrop(1) helper command) to submit mail. +
+ ++By default all users are allowed to submit mail. Otherwise, access is denied +unless the real uid of the process trying to submit mail is listed in +the system password file and the corresponding login name is on the +access list. To deny mail submission access to all users specify an +empty list.
+ ++Specify a list of user names, "/file/name" or "type:table" patterns, +separated by commas and/or whitespace. The list is matched left to right, +and the search stops on the first match. Specify "!name" to exclude a +name from the list. A "/file/name" pattern is replaced by its contents; +a "type:table" lookup table is matched when a name matches a lookup key +(the lookup result is ignored). Continue long lines by starting the +next line with whitespace.
+ ++This feature is available in Postfix 2.2 and later. +
+ %PARAM backwards_bounce_logfile_compatibility yes
diff --git a/postfix/proto/postconf.spec b/postfix/proto/postconf.spec
index d2e50c019..930a2656b 100644
--- a/postfix/proto/postconf.spec
+++ b/postfix/proto/postconf.spec
@@ -35,6 +35,9 @@
%CLASS security
%PARAM allow_min_user
%PARAM alternate_config_directories
+%PARAM authorized_flush_users
+%PARAM authorized_mailq_users
+%PARAM authorized_sendmail_users
%PARAM default_privs
%PARAM import_environment
%PARAM proxy_read_maps
diff --git a/postfix/src/discard/Makefile.in b/postfix/src/discard/Makefile.in
new file mode 100644
index 000000000..f8a09a779
--- /dev/null
+++ b/postfix/src/discard/Makefile.in
@@ -0,0 +1,67 @@
+SHELL = /bin/sh
+SRCS = discard.c
+OBJS = discard.o
+HDRS =
+TESTSRC =
+DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE)
+CFLAGS = $(DEBUG) $(OPT) $(DEFS)
+TESTPROG=
+PROG = discard
+INC_DIR = ../../include
+LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
+
+.c.o:; $(CC) $(CFLAGS) -c $*.c
+
+$(PROG): $(OBJS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
+
+Makefile: Makefile.in
+ (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../../makedefs && cat $?) >$@
+
+test: $(TESTPROG)
+
+tests: test
+
+update: ../../libexec/$(PROG)
+
+../../libexec/$(PROG): $(PROG)
+ cp $(PROG) ../../libexec
+
+printfck: $(OBJS) $(PROG)
+ rm -rf printfck
+ mkdir printfck
+ sed '1,/^# do not edit/!d' Makefile >printfck/Makefile
+ set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done
+ cd printfck; make "INC_DIR=../../../include" `cd ..; ls *.o`
+
+lint:
+ lint $(DEFS) $(SRCS) $(LINTFIX)
+
+clean:
+ rm -f *.o *core $(PROG) $(TESTPROG) junk
+ rm -rf printfck
+
+tidy: clean
+
+depend: $(MAKES)
+ (sed '1,/^# do not edit/!d' Makefile.in; \
+ set -e; for i in [a-z][a-z0-9]*.c; do \
+ $(CC) -E $(DEFS) $(INCL) $$i | sed -n -e '/^# *1 *"\([^"]*\)".*/{' \
+ -e 's//'`echo $$i|sed 's/c$$/o/'`': \1/' -e 'p' -e '}'; \
+ done) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in
+ @$(EXPORT) make -f Makefile.in Makefile 1>&2
+
+# do not edit below this line - it is generated by 'make depend'
+discard.o: discard.c
+discard.o: ../../include/sys_defs.h
+discard.o: ../../include/msg.h
+discard.o: ../../include/vstream.h
+discard.o: ../../include/vbuf.h
+discard.o: ../../include/deliver_request.h
+discard.o: ../../include/vstring.h
+discard.o: ../../include/recipient_list.h
+discard.o: ../../include/mail_queue.h
+discard.o: ../../include/bounce.h
+discard.o: ../../include/deliver_completed.h
+discard.o: ../../include/flush_clnt.h
+discard.o: ../../include/mail_server.h
diff --git a/postfix/src/discard/discard.c b/postfix/src/discard/discard.c
new file mode 100644
index 000000000..f6ad47d5d
--- /dev/null
+++ b/postfix/src/discard/discard.c
@@ -0,0 +1,224 @@
+/*++
+/* NAME
+/* discard 8
+/* SUMMARY
+/* Postfix discard mail delivery agent
+/* SYNOPSIS
+/* \fBdiscard\fR [generic Postfix daemon options]
+/* DESCRIPTION
+/* The Postfix discard delivery agent processes delivery requests from
+/* the queue manager. Each request specifies a queue file, a sender
+/* address, a domain or host name that is treated as the reason for
+/* discarding the mail, and recipient information.
+/* This program expects to be run from the \fBmaster\fR(8) process
+/* manager.
+/*
+/* The discard delivery agent pretends to deliver all recipients
+/* in the delivery request, logs the "next-hop" domain or host
+/* information as the reason for discarding the mail, updates the
+/* queue file and marks recipients as finished or informs the
+/* queue manager that delivery should be tried again at a later time.
+/*
+/* Delivery status reports are sent to the \fBbounce\fR(8),
+/* \fBdefer\fR(8) or \fBtrace\fR(8) daemon as appropriate.
+/* SECURITY
+/* .ad
+/* .fi
+/* The discard mailer is not security-sensitive. It does not talk
+/* to the network, and can be run chrooted at fixed low privilege.
+/* STANDARDS
+/* None.
+/* DIAGNOSTICS
+/* Problems and transactions are logged to \fBsyslogd\fR(8).
+/*
+/* Depending on the setting of the \fBnotify_classes\fR parameter,
+/* the postmaster is notified of bounces and of other trouble.
+/* CONFIGURATION PARAMETERS
+/* .ad
+/* .fi
+/* Changes to \fBmain.cf\fR are picked up automatically as discard(8)
+/* processes run for only a limited amount of time. Use the command
+/* "\fBpostfix reload\fR" to speed up a change.
+/*
+/* The text below provides only a parameter summary. See
+/* postconf(5) for more details including examples.
+/* .IP "\fBconfig_directory (see 'postconf -d' output)\fR"
+/* The default location of the Postfix main.cf and master.cf
+/* configuration files.
+/* .IP "\fBdaemon_timeout (18000s)\fR"
+/* How much time a Postfix daemon process may take to handle a
+/* request before it is terminated by a built-in watchdog timer.
+/* .IP "\fBdouble_bounce_sender (double-bounce)\fR"
+/* The sender address of postmaster notifications that are generated
+/* by the mail system.
+/* .IP "\fBipc_timeout (3600s)\fR"
+/* The time limit for sending or receiving information over an internal
+/* communication channel.
+/* .IP "\fBmax_idle (100s)\fR"
+/* The maximum amount of time that an idle Postfix daemon process
+/* waits for the next service request before exiting.
+/* .IP "\fBmax_use (100)\fR"
+/* The maximal number of connection requests before a Postfix daemon
+/* process terminates.
+/* .IP "\fBprocess_id (read-only)\fR"
+/* The process ID of a Postfix command or daemon process.
+/* .IP "\fBprocess_name (read-only)\fR"
+/* The process name of a Postfix command or daemon process.
+/* .IP "\fBqueue_directory (see 'postconf -d' output)\fR"
+/* The location of the Postfix top-level queue directory.
+/* .IP "\fBsyslog_facility (mail)\fR"
+/* The syslog facility of Postfix logging.
+/* .IP "\fBsyslog_name (postfix)\fR"
+/* The mail system name that is prepended to the process name in syslog
+/* records, so that "smtpd" becomes, for example, "postfix/smtpd".
+/* SEE ALSO
+/* qmgr(8), queue manager
+/* bounce(8), delivery status reports
+/* error(8), Postfix error delivery agent
+/* postconf(5), configuration parameters
+/* master(8), process manager
+/* syslogd(8), system logging
+/* LICENSE
+/* .ad
+/* .fi
+/* The Secure Mailer license must be distributed with this software.
+/* HISTORY
+/* This service was introduced with Postfix version 2.2.
+/* AUTHOR(S)
+/* Victor Duchovni
+/* Morgan Stanley
+/*
+/* Based on code by:
+/* Wietse Venema
+/* IBM T.J. Watson Research
+/* P.O. Box 704
+/* Yorktown Heights, NY 10598, USA
+/*--*/
+
+/* System library. */
+
+#include