From: Wietse Venema Date: Thu, 9 Mar 2000 00:00:00 +0000 (+0000) Subject: snapshot-20000309 X-Git-Tag: v20010228~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a68548b1754358b532c7fbcecd745dcd49f99351;p=thirdparty%2Fpostfix.git snapshot-20000309 --- diff --git a/postfix/.indent.pro b/postfix/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/.indent.pro +++ b/postfix/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/HISTORY b/postfix/HISTORY index 1f0614f7a..58fd9eb63 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -3607,10 +3607,10 @@ Apologies for any names omitted. 20000126 Emergency feature: qmgr_site_hog_factor (default: 90 percent) - limits the amount of resources that Postfix will devote to - a single site. With less than 100, Postfix will defer the + limits the amount of resources that Postfix devotes to a + single destination. With less than 100, Postfix defers the excess mail so that one site with a large backlog does not - block other deliveries. + block other deliveries. Files: qmgr/qmgr.c, qmgr/qmgr_message.c. 20000128 @@ -3669,3 +3669,77 @@ Apologies for any names omitted. to the access, canonical, virtual, transport and relocated man pages, and write new man pages that are specific to regular expressions: pcre_table.5 and regexp_table.5. + +20000214 + + Bugfix: postconf reported some parameters more than once + because the parameter extracting script didn't recognize + lines that differ in whitespace only. File: postconf/extract.awk. + Reported by Kenn Martin. + +20000221 + + Logging: the SMTP client now logs log host+port when it is + unable to connect to a non-MX host, just like it logs + host+port when unable to connect to an MX host. + +20000226 + + Bugfix: the SMTP server's "User unknown" test didn't notice + LDAP etc. dictionary access errors. The code now reports + a 450 status (try again instead of bounce) if the reply is + not definitive. File: smtp/smtpd_check.c. + + Robustness: the smtp-source program could stall when making + hundreds of parallel connections to a Postfix system with + only one SMTP server process. The fix is to use non-blocking + connect() calls, very carefully. File: smtpstone/smtp-source.c. + +20000303 + + Feature: with smtp_always_send_ehlo the SMTP client will + send EHLO regardless of the content of the SMTP server's + greeting. File: smtp/smtp_proto.c. + +20000304 + + Feature: DICT_FLAG_SYNC_UPDATE flag for synchronous dictionary + updates, if supported by the underlying mechanism. Files: + util/dict.h, util/dict_open.c, util/dict_db.c. + +20000307 + + Cleanup: the manual pages in Postfix configuration files + no longer contain troff formatting codes. The text is now + generated from prototype files in a new "proto" subdirectory. + Requested by Matthias Andree @ dt.e-technik.uni-dortmund.de. + +20000308 + + Bugfix: the unused db and dbm "delete" routines would + clobber the per-dictionary flags when called before reading + or writing the table. Files: util/dict_dbm.c, util/dict_db.c. + Lutz Jaenicke @ aet.TU-Cottbus.DE. + + Bugfix: the SMTP server would produce a cryptic message + when a queue file write error happened before it had written + any recipients. Keith Stevenson. File: smtpd/smtpd.c. + + Robustness: the db and dbm "delete" routines didn't adjust + to dictionaries with/without one trailing null in lookup + keys and values. Did a complete rewrite of the routines. + Files: util/dict_db.c, util/dict_dbm.c. + + Feature: specify "-d key" to postalias or postmap in order + to remove one key. This still needs to be generalized to + multi-key removal (read stdin?). Files: postmap/postmap.c, + postalias/postalias.c. + + Test: added test targets for the dictionary delete operations. + Files: util/Makefile.in, util/dict_test.{c,in,ref}. + + Feature: added data offset and recipient count fields to + the first queue file record output from the cleanup daemon. + The recipient counts provides an initial estimate for a + more advanced queue manager scheduling algorithm. Files: + cleanup/cleanup_envelope.c, cleanup/cleanup_extracted.c. diff --git a/postfix/INSTALL b/postfix/INSTALL index db176903b..1277b79dc 100644 --- a/postfix/INSTALL +++ b/postfix/INSTALL @@ -399,17 +399,26 @@ forward mail to a real person. 11 - To chroot or not to chroot ============================== -Most Postfix daemons can run in a chroot jail, that is, in a chroot -environment at fixed low privilege. This provides a significant -barrier against intrusion. The barrier is not impenetrable, but -every little bit helps. - -The file /etc/postfix/master.cf by default runs no Postfix daemons -in a chroot jail. However, with the exception of the `local' and -`pipe' daemons, every Postfix daemon can run chrooted. - -The examples/chroot-setup directory has a collection of scripts -for setting up chroot environments for Postfix systems. +Postfix can run most daemon processes in a chroot jail, that is, +the processes run at a fixed low privilege and with access only to +the Postfix queue directories (/var/spool/postfix). This provides +a significant barrier against intrusion. The barrier is not +impenetrable, but every little bit helps. + +With the exception of the Postfix local delivery and `pipe' daemons, +every Postfix daemon can run chrooted. + +By default, no Postfix daemon runs chrooted. In order to enable +chroot operation, edit the file /etc/postfix/master.cf. It is +highy recommended to chroot the daemons that talk to the network: +the smtp and smtpd processes. + +Note that a chrooted daemon resolves all filenames relative to the +Postfix queue directory (/var/spool/postfix). For successful use +of a chroot jail, most UNIX systems require you to bring in some +files or device nodes. The examples/chroot-setup directory has a +collection of scripts that help you set up chroot environments for +Postfix systems. 12 - Security: writable versus protected maildrop directory =========================================================== diff --git a/postfix/Makefile.in b/postfix/Makefile.in index fd29c9d46..ec3d76ba3 100644 --- a/postfix/Makefile.in +++ b/postfix/Makefile.in @@ -4,7 +4,7 @@ OPTS = "CC=$(CC)" DIRS = util global dns master postfix smtpstone sendmail error \ pickup cleanup smtpd local trivial-rewrite qmgr smtp bounce pipe \ showq postalias postcat postconf postdrop postkick postlock postlog \ - postmap postsuper # spawn man html + postmap postsuper # spawn proto man html default: update diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 6a45b4ddb..c83265f39 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -1,14 +1,28 @@ -Incompatible changes with snapshot-20000204 +Incompatible changes with snapshot-20000309 =========================================== This release is mainly to have a reference point after reorganizing -the cleanup daemon. +the cleanup daemon, and before adding some major contributions from +other people. -Major changes with snapshot-20000204 +Major changes with snapshot-20000309 ==================================== Questionable feature: with "smtp_skip_5xx_greeting = yes", Postfix -emulates behavior found in some other MTAs. +emulates behavior found in some other MTAs. + +Questionable feature: with "smtp_always_send_ehlo = yes", the SMTP +client sends EHLO regardless of the content of the SMTP server's +greeting. + +Specify "-d key" to postalias or postmap in order to remove one +key. This still needs to be generalized to multi-key removal (e.g., +read keys from stdin). + +The manual pages in Postfix configuration files no longer contain +troff formatting codes. The text is now generated from prototype +files in a new "proto" subdirectory. + Incompatible changes with postfix-19991231: =========================================== diff --git a/postfix/bounce/.indent.pro b/postfix/bounce/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/bounce/.indent.pro +++ b/postfix/bounce/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/cleanup/.indent.pro b/postfix/cleanup/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/cleanup/.indent.pro +++ b/postfix/cleanup/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/cleanup/cleanup.h b/postfix/cleanup/cleanup.h index f984eb5cc..7c5eaed71 100644 --- a/postfix/cleanup/cleanup.h +++ b/postfix/cleanup/cleanup.h @@ -54,9 +54,11 @@ typedef struct CLEANUP_STATE { BH_TABLE *dups; /* recipient dup filter */ long warn_time; /* cleanup_envelope.c */ void (*action) (struct CLEANUP_STATE *, int, char *, int); - long mesg_offset; /* start of message segment */ - long data_offset; /* start of message content */ + off_t mesg_offset; /* start of message segment */ + off_t data_offset; /* start of message content */ + off_t xtra_offset; /* start of extra segment */ int end_seen; /* REC_TYPE_END seen */ + int rcpt_count; /* recipient count */ } CLEANUP_STATE; /* diff --git a/postfix/cleanup/cleanup_envelope.c b/postfix/cleanup/cleanup_envelope.c index 86e1fc410..3541cb5d9 100644 --- a/postfix/cleanup/cleanup_envelope.c +++ b/postfix/cleanup/cleanup_envelope.c @@ -16,7 +16,7 @@ /* This module processes envelope records and writes the result /* to the queue file. It validates the message structure, rewrites /* sender/recipient addresses to canonical form, and expands recipients -/* according to entries in the virtual table. This routine absorbs but +/* according to entries in the virtual table. This routine absorbs but /* does not emit the envelope to content boundary record. /* /* Arguments: @@ -76,12 +76,15 @@ void cleanup_envelope(CLEANUP_STATE *state, int type, char *str, int len) { /* - * The message content size record goes first, so it can easily be + * The message size and count record goes first, so it can easily be * updated in place. This information takes precedence over any size - * estimate provided by the client. Size goes first so that it it easy to - * produce queue file reports. + * estimate provided by the client. It's all in one record for forward + * compatibility so we can switch back to an older Postfix version. */ - cleanup_out_format(state, REC_TYPE_SIZE, REC_TYPE_SIZE_FORMAT, 0L); + cleanup_out_format(state, REC_TYPE_SIZE, REC_TYPE_SIZE_FORMAT, + (REC_TYPE_SIZE_CAST1) 0, + (REC_TYPE_SIZE_CAST2) 0, + (REC_TYPE_SIZE_CAST3) 0); /* * Pass control to the actual envelope processing routine. diff --git a/postfix/cleanup/cleanup_extracted.c b/postfix/cleanup/cleanup_extracted.c index b95a37299..1f5c54072 100644 --- a/postfix/cleanup/cleanup_extracted.c +++ b/postfix/cleanup/cleanup_extracted.c @@ -41,6 +41,8 @@ /* System library. */ #include +#include +#include /* Utility library. */ @@ -99,6 +101,7 @@ void cleanup_extracted(CLEANUP_STATE *state, int type, char *buf, int len) static void cleanup_extracted_process(CLEANUP_STATE *state, int type, char *buf, int unused_len) { + char *myname = "cleanup_extracted_process"; VSTRING *clean_addr; ARGV *rcpt; char **cpp; @@ -172,4 +175,41 @@ static void cleanup_extracted_process(CLEANUP_STATE *state, int type, char *buf, */ cleanup_out_string(state, REC_TYPE_END, ""); state->end_seen = 1; + + /* + * vstream_fseek() would flush the buffer anyway, but the code just reads + * better if we flush first, because it makes seek error handling more + * straightforward. + */ + if (vstream_fflush(state->dst)) { + msg_warn("%s: write queue file: %m", state->queue_id); + if (errno == EFBIG) + state->errs |= CLEANUP_STAT_SIZE; + else + state->errs |= CLEANUP_STAT_WRITE; + return; + } + + /* + * Update the preliminary message size and count fields with the actual + * values. For forward compatibility, we put the info into one record + * (so that it is possible to switch back to an older Postfix version). + */ + if (vstream_fseek(state->dst, 0L, SEEK_SET) < 0) + msg_fatal("%s: vstream_fseek %s: %m", myname, cleanup_path); + cleanup_out_format(state, REC_TYPE_SIZE, REC_TYPE_SIZE_FORMAT, + (REC_TYPE_SIZE_CAST1) (state->xtra_offset - state->data_offset), + (REC_TYPE_SIZE_CAST2) state->data_offset, + (REC_TYPE_SIZE_CAST3) state->rcpt_count); + + /* + * Update the preliminary start-of-content marker with the actual value. + * For forward compatibility, we keep this information until the end of + * the year 2002 (so that it is possible to switch back to an older + * Postfix version). + */ + if (vstream_fseek(state->dst, state->mesg_offset, SEEK_SET) < 0) + msg_fatal("%s: vstream_fseek %s: %m", myname, cleanup_path); + cleanup_out_format(state, REC_TYPE_MESG, REC_TYPE_MESG_FORMAT, + (REC_TYPE_MESG_CAST) state->xtra_offset); } diff --git a/postfix/cleanup/cleanup_message.c b/postfix/cleanup/cleanup_message.c index c4fb5a91e..c9a48f11c 100644 --- a/postfix/cleanup/cleanup_message.c +++ b/postfix/cleanup/cleanup_message.c @@ -44,7 +44,6 @@ /* System library. */ #include -#include #include #include #include @@ -477,7 +476,6 @@ static void cleanup_message_header(CLEANUP_STATE *state, int type, char *buf, in static void cleanup_message_body(CLEANUP_STATE *state, int type, char *buf, int len) { char *myname = "cleanup_message_body"; - long xtra_offset; /* * Copy body record to the output. @@ -487,30 +485,12 @@ static void cleanup_message_body(CLEANUP_STATE *state, int type, char *buf, int } /* - * If we have reached the end of the message content segment, update the - * start-of-content marker, now that we know how large the message - * content segment is, and update the content size indicator at the - * beginning of the message envelope segment. vstream_fseek() implicitly - * flushes the stream, which may fail for various reasons. + * If we have reached the end of the message content segment, record the + * current file position so we can compute the message size lateron. */ else if (type == REC_TYPE_XTRA) { - if ((xtra_offset = vstream_ftell(state->dst)) < 0) + if ((state->xtra_offset = vstream_ftell(state->dst)) < 0) msg_fatal("%s: vstream_ftell %s: %m", myname, cleanup_path); - if (vstream_fseek(state->dst, state->mesg_offset, SEEK_SET) < 0) { - msg_warn("%s: write queue file: %m", state->queue_id); - if (errno == EFBIG) - state->errs |= CLEANUP_STAT_SIZE; - else - state->errs |= CLEANUP_STAT_WRITE; - return; - } - cleanup_out_format(state, REC_TYPE_MESG, REC_TYPE_MESG_FORMAT, xtra_offset); - if (vstream_fseek(state->dst, 0L, SEEK_SET) < 0) - msg_fatal("%s: vstream_fseek %s: %m", myname, cleanup_path); - cleanup_out_format(state, REC_TYPE_SIZE, REC_TYPE_SIZE_FORMAT, - xtra_offset - state->data_offset); - if (vstream_fseek(state->dst, xtra_offset, SEEK_SET) < 0) - msg_fatal("%s: vstream_fseek %s: %m", myname, cleanup_path); state->action = cleanup_extracted; } diff --git a/postfix/cleanup/cleanup_out_recipient.c b/postfix/cleanup/cleanup_out_recipient.c index ff4450ed1..bb283aa3c 100644 --- a/postfix/cleanup/cleanup_out_recipient.c +++ b/postfix/cleanup/cleanup_out_recipient.c @@ -63,13 +63,13 @@ void cleanup_out_recipient(CLEANUP_STATE *state, char *recip) if (cleanup_virtual_maps == 0) { if (been_here_fixed(state->dups, recip) == 0) - cleanup_out_string(state, REC_TYPE_RCPT, recip); + cleanup_out_string(state, REC_TYPE_RCPT, recip), state->rcpt_count++; } else { argv = cleanup_map1n_internal(state, recip, cleanup_virtual_maps, cleanup_ext_prop_mask & EXT_PROP_VIRTUAL); for (cpp = argv->argv; *cpp; cpp++) if (been_here_fixed(state->dups, *cpp) == 0) - cleanup_out_string(state, REC_TYPE_RCPT, *cpp); + cleanup_out_string(state, REC_TYPE_RCPT, *cpp), state->rcpt_count++; argv_free(argv); } } diff --git a/postfix/cleanup/cleanup_state.c b/postfix/cleanup/cleanup_state.c index 43e402347..c7e5b74b6 100644 --- a/postfix/cleanup/cleanup_state.c +++ b/postfix/cleanup/cleanup_state.c @@ -81,7 +81,9 @@ CLEANUP_STATE *cleanup_state_alloc(void) state->action = cleanup_envelope; state->mesg_offset = -1; state->data_offset = -1; + state->xtra_offset = -1; state->end_seen = 0; + state->rcpt_count = 0; return (state); } diff --git a/postfix/conf/access b/postfix/conf/access index e994a9473..a596d799c 100644 --- a/postfix/conf/access +++ b/postfix/conf/access @@ -1,103 +1,132 @@ -#++ +# +# ACCESS(5) ACCESS(5) +# # NAME -# access 5 -# SUMMARY -# format of Postfix access table +# access - format of Postfix access table +# # SYNOPSIS -# \fBpostmap /etc/postfix/access\fR +# postmap /etc/postfix/access +# # DESCRIPTION -# The optional \fBaccess\fR table directs the Postfix SMTP server -# to selectively reject or accept mail from or to specific hosts, -# domains, networks, host addresses or mail addresses. -# -# Normally, the table serves as input to the \fBpostmap\fR(1) command. -# The result, an indexed file in \fBdbm\fR or \fBdb\fR format, -# is used for fast searching by the mail system. After an update -# it may take a minute or so before the change becomes visible. -# Issue a \fBpostfix reload\fR command to eliminate the delay. -# -# When the table is provided via other means such as NIS, LDAP -# or SQL, the same lookups are done as for ordinary indexed files. -# -# Alternatively, the table can be provided as a regular-expression -# map where patterns are given as regular expressions. In that case, -# the lookups are done in a slightly different way as described below. +# The optional access table directs the Postfix SMTP server +# to selectively reject or accept mail from or to specific +# hosts, domains, networks, host addresses or mail +# addresses. +# +# Normally, the table serves as input to the postmap(1) com- +# mand. The result, an indexed file in dbm or db format, is +# used for fast searching by the mail system. After an +# update it may take a minute or so before the change +# becomes visible. Issue a postfix reload command to elimi- +# nate the delay. +# +# When the table is provided via other means such as NIS, +# LDAP or SQL, the same lookups are done as for ordinary +# indexed files. +# +# Alternatively, the table can be provided as a regular- +# expression map where patterns are given as regular expres- +# sions. In that case, the lookups are done in a slightly +# different way as described below. +# # TABLE FORMAT -# .ad -# .fi -# The format of the access table is as follows: -# .IP "blanks and comments" -# Blank lines are ignored, as are lines beginning with `#'. -# .IP "\fIpattern action\fR" -# When \fIpattern\fR matches a mail address, domain or host address, -# perform the corresponding \fIaction\fR. +# The format of the access table is as follows: +# +# blanks and comments +# Blank lines are ignored, as are lines beginning +# with `#'. +# +# pattern action +# When pattern matches a mail address, domain or host +# address, perform the corresponding action. +# # PATTERNS -# .ad -# .fi -# With lookups from indexed files such as DB or DBM, or from networked -# tables such as NIS, LDAP or SQL, patterns are tried in the order as -# listed below: -# .IP \fIuser\fR@\fIdomain\fR -# Matches the specified mail address. -# .IP \fIdomain.name\fR -# Matches the \fIdomain.name\fR itself and any subdomain thereof, -# either in hostnames or in mail addresses. Top-level domains will -# never be matched. -# .IP \fIuser\fR@ -# Matches all mail addresses with the specified user part. -# .IP \fInet.work.addr.ess\fR -# .IP \fInet.work.addr\fR -# .IP \fInet.work\fR -# .IP \fInet\fR -# Matches any host address in the specified network. A network -# address is a sequence of one or more octets separated by ".". +# With lookups from indexed files such as DB or DBM, or from +# networked tables such as NIS, LDAP or SQL, patterns are +# tried in the order as listed below: +# +# user@domain +# Matches the specified mail address. +# +# domain.name +# Matches the domain.name itself and any subdomain +# thereof, either in hostnames or in mail addresses. +# Top-level domains will never be matched. +# +# user@ Matches all mail addresses with the specified user +# part. +# +# 1 +# +# ACCESS(5) ACCESS(5) +# +# net.work.addr.ess +# +# net.work.addr +# +# net.work +# +# net Matches any host address in the specified network. +# A network address is a sequence of one or more +# octets separated by ".". +# # ACTIONS -# .ad -# .fi -# .IP "[\fB45\fR]\fIXX text\fR" -# Reject the address etc. that matches the pattern, and respond with -# the numerical code and text. -# .IP \fBREJECT\fR -# Reject the address etc. that matches the pattern. A generic -# error response message is generated. -# .IP \fBOK\fR -# .IP "\fIAny other text\fR" -# Accept the address etc. that matches the pattern. +# [45]XX text +# Reject the address etc. that matches the pattern, +# and respond with the numerical code and text. +# +# REJECT Reject the address etc. that matches the pattern. A +# generic error response message is generated. +# +# OK +# +# Any other text +# Accept the address etc. that matches the pattern. +# # REGULAR EXPRESSION TABLES -# .ad -# .fi -# This section describes how the table lookups change when the table -# is given in the form of regular expressions. For a description of -# regular expression lookup table syntax, see \fBregexp_table\fR(5) -# or \fBpcre_table\fR(5). -# -# Each pattern is a regular expression that is applied to the entire -# string being looked up. Depending on the application, that string -# is an entire client hostname, an entire client IP address, or an -# entire mail address. Thus, no parent domain or parent network search -# is done, and \fIuser@domain\fR mail addresses are not broken up into -# their \fIuser@\fR and \fIdomain\fR constituent parts. -# -# Patterns are applied in the order as specified in the table, until a -# pattern is found that matches the search string. -# -# Actions are the same as with normal indexed file lookups, with -# the additional feature that parenthesized substrings from the -# pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on. +# This section describes how the table lookups change when +# the table is given in the form of regular expressions. For +# a description of regular expression lookup table syntax, +# see regexp_table(5) or pcre_table(5). +# +# Each pattern is a regular expression that is applied to +# the entire string being looked up. Depending on the appli- +# cation, that string is an entire client hostname, an +# entire client IP address, or an entire mail address. Thus, +# no parent domain or parent network search is done, and +# user@domain mail addresses are not broken up into their +# user@ and domain constituent parts. +# +# Patterns are applied in the order as specified in the +# table, until a pattern is found that matches the search +# string. +# +# Actions are the same as with normal indexed file lookups, +# with the additional feature that parenthesized substrings +# from the pattern can be interpolated as $1, $2 and so on. +# # BUGS -# The table format does not understand quoting conventions. +# The table format does not understand quoting conventions. +# # SEE ALSO -# postmap(1) create mapping table -# smtpd(8) smtp server -# pcre_table(5) format of PCRE tables -# regexp_table(5) format of POSIX regular expression tables +# postmap(1) create mapping table +# smtpd(8) smtp server +# pcre_table(5) format of PCRE tables +# regexp_table(5) format of POSIX regular expression tables +# +# 2 +# +# ACCESS(5) ACCESS(5) +# # LICENSE -# .ad -# .fi -# The Secure Mailer license must be distributed with this software. +# The Secure Mailer license must be distributed with this +# software. +# # AUTHOR(S) -# Wietse Venema -# IBM T.J. Watson Research -# P.O. Box 704 -# Yorktown Heights, NY 10598, USA -#-- +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +# +# 3 +# diff --git a/postfix/conf/aliases b/postfix/conf/aliases index 9e2edc344..d5a59cbae 100644 --- a/postfix/conf/aliases +++ b/postfix/conf/aliases @@ -32,121 +32,151 @@ decode: root # Person who should get root's mail #root: you -#++ +# +# ALIASES(5) ALIASES(5) +# # NAME -# aliases 5 -# SUMMARY -# format of the Postfix alias database +# aliases - format of the Postfix alias database +# # SYNOPSIS -# .fi -# \fBpostalias\fR [\fB-c\fR \fIconfig_dir\fR] [\fB-v\fR] -# [\fIfile_type\fR:]\fIinput_file\fR +# postalias [-c config_dir] [-v] [file_type:]input_file +# # DESCRIPTION -# The \fBaliases\fR file provides a system-wide mechanism to -# redirect mail for local recipients. -# -# The file serves as input to the \fBpostalias\fR(1) command. The -# result, an indexed file in \fBdbm\fR or \fBdb\fR format, is -# used for fast lookup by the mail system. After an update -# it may take a minute or so before the change becomes visible. -# Issue a \fBpostfix reload\fR command to eliminate the delay. -# -# The input and output file formats are expected to be compatible -# with Sendmail version 8, and are expected to be suitable for the -# use as NIS maps. -# -# Users can control delivery of their own mail by setting -# up \fB.forward\fR files in their home directory. -# Lines in per-user \fB.forward\fR files have the same syntax -# as the right-hand side of \fBaliases\fR entries. -# -# The format of the alias database input file is as follows: -# .IP \(bu -# An alias definition has the form -# .sp -# .ti +5 -# \fIname\fR: \fIvalue1\fR, \fIvalue2\fR, \fI...\fR -# .IP \(bu -# Lines that begin with whitespace continue the previous line. -# .IP \(bu -# Blank lines are ignored, as are lines beginning with `#'. -# .PP -# The \fIname\fR is a local address (no domain part). -# Use double quotes when the name contains any special characters -# such as whitespace, `#', `:', or `@'. The \fIname\fR is folded to -# lowercase, in order to make database lookups case insensitive. -# .PP -# In addition, when an alias exists for \fBowner-\fIname\fR, delivery -# diagnostics are directed to that address, instead of to the originator. -# This is typically used to direct delivery errors to the owner of -# a mailing list, who is in a better position to deal with mailing -# list delivery problems than the originator of the undelivered mail. -# .PP -# The \fIvalue\fR contains one or more of the following: -# .IP \fIaddress\fR -# Mail is forwarded to \fIaddress\fR, which is compatible -# with the RFC 822 standard. -# .IP \fI/file/name\fR -# Mail is appended to \fI/file/name\fR. See \fBlocal\fR(8) -# for details of delivery to file. -# Delivery is not limited to regular files. For example, to dispose -# of unwanted mail, deflect it to \fB/dev/null\fR. -# .IP "|\fIcommand\fR" -# Mail is piped into \fIcommand\fR. Commands that contain special -# characters, such as whitespace, should be enclosed between double -# quotes. See \fBlocal\fR(8) for details of delivery to command. -# .sp -# When the command fails, a limited amount of command output is -# mailed back to the sender. The file \fB/usr/include/sysexits.h\fR -# defines the expected exit status codes. For example, use -# \fB|"exit 67"\fR to simulate a "user unknown" error, and -# \fB|"exit 0"\fR to implement an expensive black hole. -# .IP \fB:include:\fI/file/name\fR -# Mail is sent to the destinations listed in the named file. -# Lines in \fB:include:\fR files have the same syntax -# as the right-hand side of alias entries. -# .sp -# A destination can be any destination that is described in this -# manual page. However, delivery to "|\fIcommand\fR" and -# \fI/file/name\fR is disallowed by default. To enable, edit the -# \fBallow_mail_to_commands\fR and \fBallow_mail_to_files\fR -# configuration parameters. +# The aliases file provides a system-wide mechanism to redi- +# rect mail for local recipients. +# +# The file serves as input to the postalias(1) command. The +# result, an indexed file in dbm or db format, is used for +# fast lookup by the mail system. After an update it may +# take a minute or so before the change becomes visible. +# Issue a postfix reload command to eliminate the delay. +# +# The input and output file formats are expected to be com- +# patible with Sendmail version 8, and are expected to be +# suitable for the use as NIS maps. +# +# Users can control delivery of their own mail by setting up +# .forward files in their home directory. Lines in per-user +# .forward files have the same syntax as the right-hand side +# of aliases entries. +# +# The format of the alias database input file is as follows: +# +# o An alias definition has the form +# +# name: value1, value2, ... +# +# o Lines that begin with whitespace continue the pre- +# vious line. +# +# o Blank lines are ignored, as are lines beginning +# with `#'. +# +# The name is a local address (no domain part). Use double +# quotes when the name contains any special characters such +# as whitespace, `#', `:', or `@'. The name is folded to +# lowercase, in order to make database lookups case insensi- +# tive. +# +# In addition, when an alias exists for owner-name, delivery +# diagnostics are directed to that address, instead of to +# the originator. This is typically used to direct delivery +# errors to the owner of a mailing list, who is in a better +# position to deal with mailing list delivery problems than +# the originator of the undelivered mail. +# +# The value contains one or more of the following: +# +# address +# Mail is forwarded to address, which is compatible +# +# 1 +# +# ALIASES(5) ALIASES(5) +# +# with the RFC 822 standard. +# +# /file/name +# Mail is appended to /file/name. See local(8) for +# details of delivery to file. Delivery is not lim- +# ited to regular files. For example, to dispose of +# unwanted mail, deflect it to /dev/null. +# +# |command +# Mail is piped into command. Commands that contain +# special characters, such as whitespace, should be +# enclosed between double quotes. See local(8) for +# details of delivery to command. +# +# When the command fails, a limited amount of command +# output is mailed back to the sender. The file +# /usr/include/sysexits.h defines the expected exit +# status codes. For example, use |"exit 67" to simu- +# late a "user unknown" error, and |"exit 0" to +# implement an expensive black hole. +# +# :include:/file/name +# Mail is sent to the destinations listed in the +# named file. Lines in :include: files have the same +# syntax as the right-hand side of alias entries. +# +# A destination can be any destination that is +# described in this manual page. However, delivery to +# "|command" and /file/name is disallowed by default. +# To enable, edit the allow_mail_to_commands and +# allow_mail_to_files configuration parameters. +# # ADDRESS EXTENSION -# .ad -# .fi -# When alias database search fails, and the recipient localpart -# contains the optional recipient delimiter (e.g., \fIuser+foo\fR), -# the search is repeated for the unextended address (e.g., \fIuser\fR). +# When alias database search fails, and the recipient local- +# part contains the optional recipient delimiter (e.g., +# user+foo), the search is repeated for the unextended +# address (e.g., user). +# # CONFIGURATION PARAMETERS -# .ad -# .fi -# The following \fBmain.cf\fR parameters are especially relevant to -# this topic. See the Postfix \fBmain.cf\fR file for syntax details -# and for default values. Use the \fBpostfix reload\fR command after -# a configuration change. -# .IP \fBalias_maps\fR -# List of alias databases. -# .IP \fBallow_mail_to_commands\fR -# Restrict the usage of mail delivery to external command. -# .IP \fBallow_mail_to_files\fR -# Restrict the usage of mail delivery to external file. -# .IP \fBowner_request_special\fR -# Give special treatment to \fBowner-\fIxxx\fR and \fIxxx\fB-request\fR -# addresses. -# .IP \fBrecipient_delimiter\fR -# Delimiter that separates recipients from address extensions. +# The following main.cf parameters are especially relevant +# to this topic. See the Postfix main.cf file for syntax +# details and for default values. Use the postfix reload +# command after a configuration change. +# +# alias_maps +# List of alias databases. +# +# allow_mail_to_commands +# Restrict the usage of mail delivery to external +# command. +# +# allow_mail_to_files +# Restrict the usage of mail delivery to external +# file. +# +# 2 +# +# ALIASES(5) ALIASES(5) +# +# owner_request_special +# Give special treatment to owner-xxx and xxx-request +# addresses. +# +# recipient_delimiter +# Delimiter that separates recipients from address +# extensions. +# # STANDARDS -# RFC 822 (ARPA Internet Text Messages) +# RFC 822 (ARPA Internet Text Messages) +# # SEE ALSO -# local(8) local delivery agent -# postalias(1) alias database management +# local(8) local delivery agent +# postalias(1) alias database management +# # LICENSE -# .ad -# .fi -# The Secure Mailer license must be distributed with this software. +# The Secure Mailer license must be distributed with this +# software. +# # AUTHOR(S) -# Wietse Venema -# IBM T.J. Watson Research -# P.O. Box 704 -# Yorktown Heights, NY 10598, USA -#-- +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +# +# 3 +# diff --git a/postfix/conf/canonical b/postfix/conf/canonical index 448ae5040..cd451828d 100644 --- a/postfix/conf/canonical +++ b/postfix/conf/canonical @@ -1,151 +1,191 @@ -#++ +# +# CANONICAL(5) CANONICAL(5) +# # NAME -# canonical 5 -# SUMMARY -# format of Postfix canonical table +# canonical - format of Postfix canonical table +# # SYNOPSIS -# \fBpostmap /etc/postfix/canonical\fR +# postmap /etc/postfix/canonical +# # DESCRIPTION -# The optional \fBcanonical\fR file specifies an address mapping for -# local and non-local addresses. The mapping is used by the -# \fBcleanup\fR(8) daemon. The address mapping is recursive. -# -# Normally, the file serves as input to the \fBpostmap\fR(1) command. -# The result, an indexed file in \fBdbm\fR or \fBdb\fR format, -# is used for fast searching by the mail system. After an update -# it may take a minute or so before the change becomes visible. -# Issue a \fBpostfix reload\fR command to eliminate the delay. -# -# When the table is provided via other means such as NIS, LDAP -# or SQL, the same lookups are done as for ordinary indexed files. -# -# Alternatively, the table can be provided as a regular-expression -# map where patterns are given as regular expressions. In that case, -# the lookups are done in a slightly different way as described below. -# -# The \fBcanonical\fR mapping affects both message header addresses -# (i.e. addresses that appear inside messages) and message envelope -# addresses (for example, the addresses that are used in SMTP protocol -# commands). Think Sendmail rule set \fBS3\fR, if you like. -# -# Typically, one would use the \fBcanonical\fR table to replace login -# names by \fIFirstname.Lastname\fR, or to clean up addresses produced -# by legacy mail systems. -# -# The \fBcanonical\fR mapping is not to be confused with \fIvirtual -# domain\fR support. Use the \fBvirtual\fR(5) map for that purpose. -# -# The \fBcanonical\fR mapping is not to be confused with local aliasing. -# Use the \fBaliases\fR(5) map for that purpose. +# The optional canonical file specifies an address mapping +# for local and non-local addresses. The mapping is used by +# the cleanup(8) daemon. The address mapping is recursive. +# +# Normally, the file serves as input to the postmap(1) com- +# mand. The result, an indexed file in dbm or db format, is +# used for fast searching by the mail system. After an +# update it may take a minute or so before the change +# becomes visible. Issue a postfix reload command to elimi- +# nate the delay. +# +# When the table is provided via other means such as NIS, +# LDAP or SQL, the same lookups are done as for ordinary +# indexed files. +# +# Alternatively, the table can be provided as a regular- +# expression map where patterns are given as regular expres- +# sions. In that case, the lookups are done in a slightly +# different way as described below. +# +# The canonical mapping affects both message header +# addresses (i.e. addresses that appear inside messages) and +# message envelope addresses (for example, the addresses +# that are used in SMTP protocol commands). Think Sendmail +# rule set S3, if you like. +# +# Typically, one would use the canonical table to replace +# login names by Firstname.Lastname, or to clean up +# addresses produced by legacy mail systems. +# +# The canonical mapping is not to be confused with virtual +# domain support. Use the virtual(5) map for that purpose. +# +# The canonical mapping is not to be confused with local +# aliasing. Use the aliases(5) map for that purpose. +# # TABLE FORMAT -# .ad -# .fi -# The format of the \fBcanonical\fR table is as follows: -# .IP "blanks and comments" -# Blank lines are ignored, as are lines beginning with `#'. -# .IP "\fIpattern result\fR" -# When \fIpattern\fR matches a mail address, replace it by the -# corresponding \fIresult\fR. -# .PP -# With lookups from indexed files such as DB or DBM, or from networked -# tables such as NIS, LDAP or SQL, patterns are tried in the order as -# listed below: -# .IP "\fIuser\fR@\fIdomain address\fR" -# \fIuser\fR@\fIdomain\fR is replaced by \fIaddress\fR. This form -# has the highest precedence. -# .sp -# This form useful to clean up addresses produced by legacy mail systems. -# It can also be used to produce \fIFirstname.Lastname\fR style -# addresses, but see below for a simpler solution. -# .IP "\fIuser address\fR" -# \fIuser\fR@\fIsite\fR is replaced by \fIaddress\fR when \fIsite\fR is -# equal to $\fBmyorigin\fR, when \fIsite\fR is listed in -# $\fBmydestination\fR, or when it is listed in $\fBinet_interfaces\fR. -# .sp -# This form is useful for replacing login names by -# \fIFirstname.Lastname\fR. -# .IP "@\fIdomain address\fR" -# Every address in \fIdomain\fR is replaced by \fIaddress\fR. -# This form has the lowest precedence. -# .PP -# In all the above forms, when \fIaddress\fR has the form -# @\fIotherdomain\fR, the result is the same user in \fIotherdomain\fR. +# The format of the canonical table is as follows: +# +# blanks and comments +# Blank lines are ignored, as are lines beginning +# with `#'. +# +# pattern result +# When pattern matches a mail address, replace it by +# the corresponding result. +# +# 1 +# +# CANONICAL(5) CANONICAL(5) +# +# With lookups from indexed files such as DB or DBM, or from +# networked tables such as NIS, LDAP or SQL, patterns are +# tried in the order as listed below: +# +# user@domain address +# user@domain is replaced by address. This form has +# the highest precedence. +# +# This form useful to clean up addresses produced by +# legacy mail systems. It can also be used to pro- +# duce Firstname.Lastname style addresses, but see +# below for a simpler solution. +# +# user address +# user@site is replaced by address when site is equal +# to $myorigin, when site is listed in $mydestina- +# tion, or when it is listed in $inet_interfaces. +# +# This form is useful for replacing login names by +# Firstname.Lastname. +# +# @domain address +# Every address in domain is replaced by address. +# This form has the lowest precedence. +# +# In all the above forms, when address has the form @other- +# domain, the result is the same user in otherdomain. +# # ADDRESS EXTENSION -# .fi -# .ad -# When table lookup fails, and the address localpart contains the -# optional recipient delimiter (e.g., \fIuser+foo\fR@\fIdomain\fR), the -# search is repeated for the unextended address (e.g. -# \fIuser\fR@\fIdomain\fR), and the unmatched extension is propagated -# to the result of table lookup. The matching order is: -# \fIuser+foo\fR@\fIdomain\fR, \fIuser\fR@\fIdomain\fR, -# \fIuser+foo\fR, \fIuser\fR, and @\fIdomain\fR. +# When table lookup fails, and the address localpart con- +# tains the optional recipient delimiter (e.g., +# user+foo@domain), the search is repeated for the unex- +# tended address (e.g. user@domain), and the unmatched +# extension is propagated to the result of table lookup. The +# matching order is: user+foo@domain, user@domain, user+foo, +# user, and @domain. +# # REGULAR EXPRESSION TABLES -# .ad -# .fi -# This section describes how the table lookups change when the table -# is given in the form of regular expressions. For a description of -# regular expression lookup table syntax, see \fBregexp_table\fR(5) -# or \fBpcre_table\fR(5). -# -# Each pattern is a regular expression that is applied to the entire -# address being looked up. Thus, \fIuser@domain\fR mail addresses are not -# broken up into their \fIuser\fR and \fI@domain\fR constituent parts, -# nor is \fIuser+foo\fR broken up into \fIuser\fR and \fIfoo\fR. -# -# Patterns are applied in the order as specified in the table, until a -# pattern is found that matches the search string. -# -# Results are the same as with normal indexed file lookups, with -# the additional feature that parenthesized substrings from the -# pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on. +# This section describes how the table lookups change when +# the table is given in the form of regular expressions. For +# a description of regular expression lookup table syntax, +# see regexp_table(5) or pcre_table(5). +# +# Each pattern is a regular expression that is applied to +# the entire address being looked up. Thus, user@domain mail +# addresses are not broken up into their user and @domain +# constituent parts, nor is user+foo broken up into user and +# foo. +# +# Patterns are applied in the order as specified in the +# table, until a pattern is found that matches the search +# string. +# +# Results are the same as with normal indexed file lookups, +# +# 2 +# +# CANONICAL(5) CANONICAL(5) +# +# with the additional feature that parenthesized substrings +# from the pattern can be interpolated as $1, $2 and so on. +# # BUGS -# The table format does not understand quoting conventions. +# The table format does not understand quoting conventions. +# # CONFIGURATION PARAMETERS -# .ad -# .fi -# The following \fBmain.cf\fR parameters are especially relevant to -# this topic. See the Postfix \fBmain.cf\fR file for syntax details -# and for default values. Use the \fBpostfix reload\fR command after -# a configuration change. -# .IP \fBcanonical_maps\fR -# List of canonical mapping tables. -# .IP \fBrecipient_canonical_maps\fR -# Address mapping lookup table for envelope and header recipient -# addresses. -# .IP \fBsender_canonical_maps\fR -# Address mapping lookup table for envelope and header sender -# addresses. -# .PP -# Other parameters of interest: -# .IP \fBinet_interfaces\fR -# The network interface addresses that this system receives mail on. -# .IP \fBmasquerade_domains\fR -# List of domains that hide their subdomain structure. -# .IP \fBmasquerade_exceptions\fR -# List of user names that are not subject to address masquerading. -# .IP \fBmydestination\fR -# List of domains that this mail system considers local. -# .IP \fBmyorigin\fR -# The domain that is appended to locally-posted mail. -# .IP \fBowner_request_special\fR -# Give special treatment to \fBowner-\fIxxx\fR and \fIxxx\fB-request\fR -# addresses. +# The following main.cf parameters are especially relevant +# to this topic. See the Postfix main.cf file for syntax +# details and for default values. Use the postfix reload +# command after a configuration change. +# +# canonical_maps +# List of canonical mapping tables. +# +# recipient_canonical_maps +# Address mapping lookup table for envelope and +# header recipient addresses. +# +# sender_canonical_maps +# Address mapping lookup table for envelope and +# header sender addresses. +# +# Other parameters of interest: +# +# inet_interfaces +# The network interface addresses that this system +# receives mail on. +# +# masquerade_domains +# List of domains that hide their subdomain struc- +# ture. +# +# masquerade_exceptions +# List of user names that are not subject to address +# masquerading. +# +# mydestination +# List of domains that this mail system considers +# local. +# +# myorigin +# The domain that is appended to locally-posted mail. +# +# owner_request_special +# Give special treatment to owner-xxx and xxx-request +# addresses. +# # SEE ALSO -# cleanup(8) canonicalize and enqueue mail -# postmap(1) create mapping table -# virtual(5) virtual domain mapping -# pcre_table(5) format of PCRE tables -# regexp_table(5) format of POSIX regular expression tables +# cleanup(8) canonicalize and enqueue mail +# postmap(1) create mapping table +# virtual(5) virtual domain mapping +# pcre_table(5) format of PCRE tables +# regexp_table(5) format of POSIX regular expression tables +# +# 3 +# +# CANONICAL(5) CANONICAL(5) +# # LICENSE -# .ad -# .fi -# The Secure Mailer license must be distributed with this software. +# The Secure Mailer license must be distributed with this +# software. +# # AUTHOR(S) -# Wietse Venema -# IBM T.J. Watson Research -# P.O. Box 704 -# Yorktown Heights, NY 10598, USA -#-- - -# By default, this file is not used. See sample-canonical.cf +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +# +# 4 +# diff --git a/postfix/conf/pcre_table b/postfix/conf/pcre_table index 525d7fb0e..0193058cd 100644 --- a/postfix/conf/pcre_table +++ b/postfix/conf/pcre_table @@ -1,79 +1,97 @@ -#++ +# +# PCRE_TABLE(5) PCRE_TABLE(5) +# # NAME -# pcre_table 5 -# SUMMARY -# format of Postfix PCRE tables +# pcre_table - format of Postfix PCRE tables +# # SYNOPSIS -# pcre:/etc/postfix/filename +# pcre:/etc/postfix/filename +# # DESCRIPTION -# The Postfix mail system uses optional tables for address -# rewriting or mail routing. These tables usually are in -# \fBdbm\fR or \fBdb\fR format. Alternatively, lookup tables -# can be specified in Perl Compatible Regular Expression form. -# -# To find out what types of lookup tables your Postfix system -# supports use the \fBpostconf -m\fR command. -# -# The general form of a PCRE table is: -# .IP "blanks and comments" -# Blank lines are ignored, as are lines beginning with `#'. -# .IP "\fIpattern result\fR" -# When \fIpattern\fR matches a search string, use the corresponding -# \fIresult\fR. A line that starts with white space continues the -# preceding line. -# .PP -# Each pattern is a perl-like regular expression. The expression -# delimiter can be any character, except whitespace or characters -# that have special meaning (traditionally the forward slash is used). -# The regular expression can contain whitespace. -# -# By default, matching is case-insensitive, although following -# the second slash with an `i' flag will reverse this. Other flags -# are supported, but the only other useful one is `U', which makes -# matching ungreedy (see PCRE documentation and source for more -# info). -# -# Each pattern is applied to the entire string being looked up. -# Depending on the application, that string is an entire client -# hostname, an entire client IP address, or an entire mail address. -# Thus, no parent domain or parent network search is done, and -# \fIuser@domain\fR mail addresses are not broken up into their -# \fIuser\fR and \fIdomain\fR constituent parts, nor is \fIuser+foo\fR -# broken up into \fIuser\fR and \fIfoo\fR. -# -# Patterns are applied in the order as specified in the table, until a -# pattern is found that matches the search string. -# -# Substitution of sub-strings from the matched expression is -# possible using the conventional perl syntax ($1, $2, etc.). The -# macros in the replacement string may need to be written as ${n} -# or $(n) if they aren't followed by whitespace. +# The Postfix mail system uses optional tables for address +# rewriting or mail routing. These tables are usually in dbm +# or db format. Alternatively, lookup tables can be speci- +# fied in Perl Compatible Regular Expression form. +# +# To find out what types of lookup tables your Postfix sys- +# tem supports use the postconf -m command. +# +# The general form of a PCRE table is: +# +# blanks and comments +# Blank lines are ignored, as are lines beginning +# with `#'. +# +# pattern result +# When pattern matches a search string, use the cor- +# responding result. A line that starts with white +# space continues the preceding line. +# +# Each pattern is a perl-like regular expression. The +# expression delimiter can be any character, except whites- +# pace or characters that have special meaning (tradition- +# ally the forward slash is used). The regular expression +# can contain whitespace. +# +# By default, matching is case-insensitive, although follow- +# ing the second slash with an `i' flag will reverse this. +# Other flags are supported, but the only other useful one +# is `U', which makes matching ungreedy (see PCRE documenta- +# tion and source for more info). +# +# Each pattern is applied to the entire string being looked +# up. Depending on the application, that string is an +# entire client hostname, an entire client IP address, or an +# entire mail address. Thus, no parent domain or parent +# network search is done, and user@domain mail addresses are +# not broken up into their user and domain constituent +# parts, nor is user+foo broken up into user and foo. +# +# Patterns are applied in the order as specified in the +# table, until a pattern is found that matches the search +# string. +# +# Substitution of sub-strings from the matched expression is +# possible using the conventional perl syntax ($1, $2, +# etc.). The macros in the replacement string may need to be +# written as ${n} or $(n) if they aren't followed by +# +# 1 +# +# PCRE_TABLE(5) PCRE_TABLE(5) +# +# whitespace. +# # EXAMPLES -# # Protect your outgoing majordomo exploders -# /^(?!owner-)(.*)-outgoing@(my\.domain)$/ 550 Use ${1}@${2} instead -# -# # Bounce friend@whatever, except when whatever is our domain (you would -# # be better just bouncing all friend@ mail - this is just an example). -# /^friend@(?!my\.domain).*$/ 550 Stick this in your pipe $0 -# -# # A multi-line entry. The text is sent as one line. -# # -# /^noddy@connect\.com\.au$/ -# \ 550 This user is a funny one. You really don't want to send mail to -# \ them as it only makes their head spin. +# # Protect your outgoing majordomo exploders +# /^(?!owner-)(.*)-outgoing@(my.domain)$/ 550 Use ${1}@${2} instead +# +# # Bounce friend@whatever, except when whatever is our domain (you would +# # be better just bouncing all friend@ mail - this is just an example). +# /^friend@(?!my.domain).*$/ 550 Stick this in your pipe $0 +# +# # A multi-line entry. The text is sent as one line. +# # +# /^noddy@connect.com.au$/ +# 550 This user is a funny one. You really don't want to send mail to +# them as it only makes their head spin. +# # SEE ALSO -# regexp_table(5) format of POSIX regular expression tables +# regexp_table(5) format of POSIX regular expression tables +# # AUTHOR(S) -# The PCRE table lookup code was originally written by: -# Andrew McNamara -# andrewm@connect.com.au -# connect.com.au Pty. Ltd. -# Level 3, 213 Miller St -# North Sydney, NSW, Australia -# -# Adopted and adapted by: -# Wietse Venema -# IBM T.J. Watson Research -# P.O. Box 704 -# Yorktown Heights, NY 10598, USA -#-- +# The PCRE table lookup code was originally written by: +# Andrew McNamara +# andrewm@connect.com.au +# connect.com.au Pty. Ltd. +# Level 3, 213 Miller St +# North Sydney, NSW, Australia +# +# Adopted and adapted by: +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +# +# 2 +# diff --git a/postfix/conf/regexp_table b/postfix/conf/regexp_table index d91251325..c269a38c5 100644 --- a/postfix/conf/regexp_table +++ b/postfix/conf/regexp_table @@ -1,83 +1,101 @@ -#++ +# +# REGEXP_TABLE(5) REGEXP_TABLE(5) +# # NAME -# regexp_table 5 -# SUMMARY -# format of Postfix regular expression tables +# regexp_table - format of Postfix regular expression tables +# # SYNOPSIS -# regexp:/etc/postfix/filename +# regexp:/etc/postfix/filename +# # DESCRIPTION -# The Postfix mail system uses optional tables for address -# rewriting or mail routing. These tables usually are in -# \fBdbm\fR or \fBdb\fR format. Alternatively, lookup tables -# can be specified in POSIX regular expression form. -# -# To find out what types of lookup tables your Postfix system -# supports use the \fBpostconf -m\fR command. -# -# The general form of a Postfix regular expression table is: -# .IP "blanks and comments" -# Blank lines are ignored, as are lines beginning with `#'. -# .IP "\fIpattern result\fR" -# When \fIpattern\fR matches a search string, use the corresponding -# \fIresult\fR. A line that starts with white space continues the -# preceding line. -# .IP "\fIpattern1!pattern2 result\fR" -# Matches \fIpattern1\fR but not \fIpattern2\fR. -# .PP -# Each pattern is a regular expression enclosed by a pair of delimiters. -# The regular expression syntax is described in \fIre_format\fR(7). -# The expression delimiter can be any character, except whitespace -# or characters that have special meaning (traditionally the forward -# slash is used). The regular expression can contain whitespace. -# -# By default, matching is case-insensitive, although following -# the second slash with an `i' flag will reverse this. Other flags -# are `x' (disable extended expression syntax), and `m' (enable -# multi-line mode). -# -# Each pattern is applied to the entire string being looked up. -# Depending on the application, that string is an entire client -# hostname, an entire client IP address, or an entire mail address. -# Thus, no parent domain or parent network search is done, and -# \fIuser@domain\fR mail addresses are not broken up into their -# \fIuser\fR and \fIdomain\fR constituent parts, nor is \fIuser+foo\fR -# broken up into \fIuser\fR and \fIfoo\fR. -# -# Patterns are applied in the order as specified in the table, until a -# pattern is found that matches the search string. -# -# Substitution of sub-strings from the matched expression is -# possible using $1, $2, etc.. The macros in the replacement string -# may need to be written as ${n} or $(n) if they aren't followed -# by whitespace. +# The Postfix mail system uses optional tables for address +# rewriting or mail routing. These tables are usually in dbm +# or db format. Alternatively, lookup tables can be speci- +# fied in POSIX regular expression form. +# +# To find out what types of lookup tables your Postfix sys- +# tem supports use the postconf -m command. +# +# The general form of a Postfix regular expression table is: +# +# blanks and comments +# Blank lines are ignored, as are lines beginning +# with `#'. +# +# pattern result +# When pattern matches a search string, use the cor- +# responding result. A line that starts with white +# space continues the preceding line. +# +# pattern1!pattern2 result +# Matches pattern1 but not pattern2. +# +# Each pattern is a regular expression enclosed by a pair of +# delimiters. The regular expression syntax is described in +# re_format(7). The expression delimiter can be any charac- +# ter, except whitespace or characters that have special +# meaning (traditionally the forward slash is used). The +# regular expression can contain whitespace. +# +# By default, matching is case-insensitive, although follow- +# ing the second slash with an `i' flag will reverse this. +# Other flags are `x' (disable extended expression syntax), +# and `m' (enable multi-line mode). +# +# Each pattern is applied to the entire string being looked +# up. Depending on the application, that string is an +# entire client hostname, an entire client IP address, or an +# entire mail address. Thus, no parent domain or parent +# network search is done, and user@domain mail addresses are +# not broken up into their user and domain constituent +# parts, nor is user+foo broken up into user and foo. +# +# Patterns are applied in the order as specified in the +# table, until a pattern is found that matches the search +# string. +# +# Substitution of sub-strings from the matched expression is +# +# 1 +# +# REGEXP_TABLE(5) REGEXP_TABLE(5) +# +# possible using $1, $2, etc.. The macros in the replacement +# string may need to be written as ${n} or $(n) if they +# aren't followed by whitespace. +# # EXAMPLES -# # Disallow sender-specified routing. This is a must if you relay mail -# # for other domains. -# /[%!@].*[%!@]/ 550 Sender-specified routing rejected -# -# # Postmaster is OK, that way they can talk to us about how to fix -# # their problem. -# /^postmaster@.*$/ OK -# -# # Protect your outgoing majordomo exploders -# /^(.*)-outgoing@(.*)$/!/^owner-.*/ 550 Use ${1}@${2} instead +# # Disallow sender-specified routing. This is a must if you relay mail +# # for other domains. +# /[%!@].*[%!@]/ 550 Sender-specified routing rejected +# +# # Postmaster is OK, that way they can talk to us about how to fix +# # their problem. +# /^postmaster@.*$/ OK +# +# # Protect your outgoing majordomo exploders +# /^(.*)-outgoing@(.*)$/!/^owner-.*/ 550 Use ${1}@${2} instead +# # SEE ALSO -# pcre_table(5) format of PCRE tables +# pcre_table(5) format of PCRE tables +# # AUTHOR(S) -# The regexp table lookup code was originally written by: -# LaMont Jones -# lamont@hp.com -# -# That code was based on the PCRE dictionary contributed by: -# Andrew McNamara -# andrewm@connect.com.au -# connect.com.au Pty. Ltd. -# Level 3, 213 Miller St -# North Sydney, NSW, Australia -# -# Adopted and adapted by: -# Wietse Venema -# IBM T.J. Watson Research -# P.O. Box 704 -# Yorktown Heights, NY 10598, USA -#-- +# The regexp table lookup code was originally written by: +# LaMont Jones +# lamont@hp.com +# +# That code was based on the PCRE dictionary contributed by: +# Andrew McNamara +# andrewm@connect.com.au +# connect.com.au Pty. Ltd. +# Level 3, 213 Miller St +# North Sydney, NSW, Australia +# +# Adopted and adapted by: +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +# +# 2 +# diff --git a/postfix/conf/relocated b/postfix/conf/relocated index aa736cccc..e9be1a0ef 100644 --- a/postfix/conf/relocated +++ b/postfix/conf/relocated @@ -1,112 +1,136 @@ -#++ +# +# RELOCATED(5) RELOCATED(5) +# # NAME -# relocated 5 -# SUMMARY -# format of Postfix relocated table +# relocated - format of Postfix relocated table +# # SYNOPSIS -# \fBpostmap /etc/postfix/relocated\fR +# postmap /etc/postfix/relocated +# # DESCRIPTION -# The optional \fBrelocated\fR file provides the information that is -# used in "user has moved to \fInew_location\fR" bounce messages. -# -# Normally, the file serves as input to the \fBpostmap\fR(1) command. -# The result, an indexed file in \fBdbm\fR or \fBdb\fR format, -# is used for fast searching by the mail system. After an update -# issue a \fBpostfix reload\fR command to make the change visible. -# -# When the table is provided via other means such as NIS, LDAP -# or SQL, the same lookups are done as for ordinary indexed files. -# -# Alternatively, the table can be provided as a regular-expression -# map where patterns are given as regular expressions. In that case, -# the lookups are done in a slightly different way as described below. -# -# Table lookups are case insensitive. +# The optional relocated file provides the information that +# is used in "user has moved to new_location" bounce mes- +# sages. +# +# Normally, the file serves as input to the postmap(1) com- +# mand. The result, an indexed file in dbm or db format, is +# used for fast searching by the mail system. After an +# update issue a postfix reload command to make the change +# visible. +# +# When the table is provided via other means such as NIS, +# LDAP or SQL, the same lookups are done as for ordinary +# indexed files. +# +# Alternatively, the table can be provided as a regular- +# expression map where patterns are given as regular expres- +# sions. In that case, the lookups are done in a slightly +# different way as described below. +# +# Table lookups are case insensitive. +# # TABLE FORMAT -# .ad -# .fi -# The format of the table is as follows: -# .IP \(bu -# Blank lines are ignored, as are lines beginning with `#'. -# .IP \(bu -# An entry has one of the following form: -# .ti +5 -# \fIkey new_location\fR -# .br -# Where \fInew_location\fR specifies contact information such as -# an email address, or perhaps a street address or telephone number. -# .PP -# With lookups from indexed files such as DB or DBM, or from networked -# tables such as NIS, LDAP or SQL, the \fIkey\fR field is one of the -# following: -# .IP \fIuser\fR@\fIdomain\fR -# Matches \fIuser\fR@\fIdomain\fR. This form has precedence over all -# other forms. -# .IP \fIuser\fR -# Matches \fIuser\fR@\fIsite\fR when \fIsite\fR is $\fBmyorigin\fR, -# when \fIsite\fR is listed in $\fBmydestination\fR, or when \fIsite\fR -# is listed in $\fBinet_interfaces\fR. -# .IP @\fIdomain\fR -# Matches every address in \fIdomain\fR. This form has the lowest -# precedence. +# The format of the table is as follows: +# +# o Blank lines are ignored, as are lines beginning +# with `#'. +# +# o An entry has one of the following form: +# key new_location +# Where new_location specifies contact information +# such as an email address, or perhaps a street +# address or telephone number. +# +# With lookups from indexed files such as DB or DBM, or from +# networked tables such as NIS, LDAP or SQL, the key field +# is one of the following: +# +# user@domain +# Matches user@domain. This form has precedence over +# all other forms. +# +# user Matches user@site when site is $myorigin, when site +# is listed in $mydestination, or when site is listed +# in $inet_interfaces. +# +# @domain +# Matches every address in domain. This form has the +# +# 1 +# +# RELOCATED(5) RELOCATED(5) +# +# lowest precedence. +# # ADDRESS EXTENSION -# .fi -# .ad -# When the search fails, and the address localpart contains the -# optional recipient delimiter (e.g., \fIuser+foo\fR@\fIdomain\fR), -# the search is repeated for the unextended address (e.g. -# \fIuser\fR@\fIdomain\fR). +# When the search fails, and the address localpart contains +# the optional recipient delimiter (e.g., user+foo@domain), +# the search is repeated for the unextended address (e.g. +# user@domain). +# # REGULAR EXPRESSION TABLES -# .ad -# .fi -# This section describes how the table lookups change when the table -# is given in the form of regular expressions. For a description of -# regular expression lookup table syntax, see \fBregexp_table\fR(5) -# or \fBpcre_table\fR(5). -# -# Each pattern is a regular expression that is applied to the entire -# address being looked up. Thus, \fIuser@domain\fR mail addresses are not -# broken up into their \fIuser\fR and \fI@domain\fR constituent parts, -# nor is \fIuser+foo\fR broken up into \fIuser\fR and \fIfoo\fR. -# -# Patterns are applied in the order as specified in the table, until a -# pattern is found that matches the search string. -# -# Results are the same as with normal indexed file lookups, with -# the additional feature that parenthesized substrings from the -# pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on. +# This section describes how the table lookups change when +# the table is given in the form of regular expressions. For +# a description of regular expression lookup table syntax, +# see regexp_table(5) or pcre_table(5). +# +# Each pattern is a regular expression that is applied to +# the entire address being looked up. Thus, user@domain mail +# addresses are not broken up into their user and @domain +# constituent parts, nor is user+foo broken up into user and +# foo. +# +# Patterns are applied in the order as specified in the +# table, until a pattern is found that matches the search +# string. +# +# Results are the same as with normal indexed file lookups, +# with the additional feature that parenthesized substrings +# from the pattern can be interpolated as $1, $2 and so on. +# # BUGS -# The table format does not understand quoting conventions. +# The table format does not understand quoting conventions. +# # CONFIGURATION PARAMETERS -# .ad -# .fi -# The following \fBmain.cf\fR parameters are especially relevant to -# this topic. See the Postfix \fBmain.cf\fR file for syntax details -# and for default values. Use the \fBpostfix reload\fR command after -# a configuration change. -# .IP \fBrelocated_maps\fR -# List of lookup tables for relocated users or sites. -# .PP -# Other parameters of interest: -# .IP \fBinet_interfaces\fR -# The network interface addresses that this system receives mail on. -# .IP \fBmydestination\fR -# List of domains that this mail system considers local. -# .IP \fBmyorigin\fR -# The domain that is appended to locally-posted mail. +# The following main.cf parameters are especially relevant +# to this topic. See the Postfix main.cf file for syntax +# details and for default values. Use the postfix reload +# command after a configuration change. +# +# relocated_maps +# List of lookup tables for relocated users or sites. +# +# Other parameters of interest: +# +# inet_interfaces +# The network interface addresses that this system +# receives mail on. +# +# mydestination +# List of domains that this mail system considers +# local. +# +# myorigin +# The domain that is appended to locally-posted mail. +# +# 2 +# +# RELOCATED(5) RELOCATED(5) +# # SEE ALSO -# postmap(1) create lookup table -# pcre_table(5) format of PCRE tables -# regexp_table(5) format of POSIX regular expression tables +# postmap(1) create lookup table +# pcre_table(5) format of PCRE tables +# regexp_table(5) format of POSIX regular expression tables +# # LICENSE -# .ad -# .fi -# The Secure Mailer license must be distributed with this software. +# The Secure Mailer license must be distributed with this +# software. +# # AUTHOR(S) -# Wietse Venema -# IBM T.J. Watson Research -# P.O. Box 704 -# Yorktown Heights, NY 10598, USA -#-- - -# By default, this file is not used. See sample-relocated.cf +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +# +# 3 +# diff --git a/postfix/conf/transport b/postfix/conf/transport index 8b80bb00c..caafa50f5 100644 --- a/postfix/conf/transport +++ b/postfix/conf/transport @@ -1,158 +1,175 @@ -#++ +# +# TRANSPORT(5) TRANSPORT(5) +# # NAME -# transport 5 -# SUMMARY -# format of Postfix transport table +# transport - format of Postfix transport table +# # SYNOPSIS -# \fBpostmap /etc/postfix/transport\fR +# postmap /etc/postfix/transport +# # DESCRIPTION -# The optional \fBtransport\fR file specifies a mapping from domain -# hierarchies to message delivery transports and/or relay hosts. The -# mapping is used by the \fBtrivial-rewrite\fR(8) daemon. -# -# Normally, the file serves as input to the \fBpostmap\fR(1) command. -# The result, an indexed file in \fBdbm\fR or \fBdb\fR format, is used -# for fast searching by the mail system. After updating this table, -# issue the \fBpostfix reload\fR command to make the change visible. -# -# When the table is provided via other means such as NIS, LDAP -# or SQL, the same lookups are done as for ordinary indexed files. -# -# Alternatively, the table can be provided as a regular-expression -# map where patterns are given as regular expressions. In that case, -# the lookups are done in a slightly different way as described below. +# The optional transport file specifies a mapping from +# domain hierarchies to message delivery transports and/or +# relay hosts. The mapping is used by the trivial-rewrite(8) +# daemon. +# +# Normally, the file serves as input to the postmap(1) com- +# mand. The result, an indexed file in dbm or db format, is +# used for fast searching by the mail system. After updating +# this table, issue the postfix reload command to make the +# change visible. +# +# When the table is provided via other means such as NIS, +# LDAP or SQL, the same lookups are done as for ordinary +# indexed files. +# +# Alternatively, the table can be provided as a regular- +# expression map where patterns are given as regular expres- +# sions. In that case, the lookups are done in a slightly +# different way as described below. +# # TABLE FORMAT -# .ad -# .fi -# The format of the transport table is as follows: -# .IP "blanks and comments" -# Blank lines are ignored, as are lines beginning with `#'. -# .IP "\fIpattern result\fR" -# When \fIpattern\fR matches the domain, use the corresponding -# \fIresult\fR. -# .PP -# With lookups from indexed files such as DB or DBM, or from networked -# tables such as NIS, LDAP or SQL, patterns are tried in the order as -# listed below: -# .IP "\fIdomain transport\fR:\fInexthop\fR" -# Mail for \fIdomain\fR is delivered through \fItransport\fR to -# \fInexthop\fR. -# .IP "\fI.domain transport\fR:\fInexthop\fR" -# Mail for any subdomain of \fIdomain\fR is delivered through -# \fItransport\fR to \fInexthop\fR. -# .PP -# Note: transport map entries take precedence over domains -# specified in the \fBmydestination\fR parameter. If you use -# the optional transport map, it may be safer to specify explicit -# entries for all domains specified in \fBmydestination\fR, -# for example: -# -# .ti +5 -# \fBhostname.my.domain local:\fR -# .ti +5 -# \fBlocalhost.my.domain local:\fR -# -# The interpretation of the \fInexthop\fR field is transport -# dependent. In the case of SMTP, specify \fIhost\fR:\fIservice\fR for a -# non-default server port, and use [\fIhost\fR] or [\fIhost\fR:\fIport\fR] -# in order to disable MX (mail exchanger) DNS lookups. The [] form -# can also be used with IP addresses instead of hostnames. +# The format of the transport table is as follows: +# +# blanks and comments +# Blank lines are ignored, as are lines beginning +# with `#'. +# +# pattern result +# When pattern matches the domain, use the corre- +# sponding result. +# +# With lookups from indexed files such as DB or DBM, or from +# networked tables such as NIS, LDAP or SQL, patterns are +# tried in the order as listed below: +# +# domain transport:nexthop +# Mail for domain is delivered through transport to +# nexthop. +# +# .domain transport:nexthop +# Mail for any subdomain of domain is delivered +# through transport to nexthop. +# +# Note: transport map entries take precedence over domains +# specified in the mydestination parameter. If you use the +# optional transport map, it may be safer to specify +# explicit entries for all domains specified in +# +# 1 +# +# TRANSPORT(5) TRANSPORT(5) +# +# mydestination, for example: +# +# hostname.my.domain local: +# localhost.my.domain local: +# +# The interpretation of the nexthop field is transport +# dependent. In the case of SMTP, specify host:service for a +# non-default server port, and use [host] or [host:port] in +# order to disable MX (mail exchanger) DNS lookups. The [] +# form can also be used with IP addresses instead of host- +# names. +# # EXAMPLES -# .ad -# In order to send mail for \fBfoo.org\fR and its subdomains -# via the \fBuucp\fR transport to the UUCP host named \fBfoo\fR: -# -# .ti +5 -# \fBfoo.org uucp:foo\fR -# .ti +5 -# \fB\&.foo.org uucp:foo\fR -# -# When no \fInexthop\fR host name is specified, the destination domain -# name is used instead. For example, the following directs mail for -# \fIuser\fR@\fBfoo.org\fR via the \fBslow\fR transport to a mail -# exchanger for \fBfoo.org\fR. The \fBslow\fR transport could be -# something that runs at most one delivery process at a time: -# -# .ti +5 -# \fBfoo.org slow:\fR -# -# When no \fItransport\fR is specified, the default transport is -# used, as specified via the \fBdefault_transport\fR configuration -# parameter. The following sends all mail for \fBfoo.org\fR and its -# subdomains to host \fBgateway.foo.org\fR: -# -# .ti +5 -# \fBfoo.org :[gateway.foo.org]\fR -# .ti +5 -# \fB\&.foo.org :[gateway.foo.org]\fR -# -# In the above example, the [] are used to suppress MX lookups. -# The result would likely point to your local machine. -# -# In the case of delivery via SMTP, one may specify -# \fIhostname\fR:\fIservice\fR instead of just a host: -# -# .ti +5 -# \fBfoo.org smtp:bar.org:2025\fR -# -# This directs mail for \fIuser\fR@\fBfoo.org\fR to host \fBbar.org\fR -# port \fB2025\fR. Instead of a numerical port a symbolic name may be -# used. Specify [] around the destination in order to disable MX lookups. -# -# The error mailer can be used to bounce mail: -# -# .ti +5 -# \fB\&.foo.org error:mail for *.foo.org is not deliverable\fR -# -# This causes all mail for \fIuser\fR@\fIanything\fBfoo.org\fR -# to be bounced. +# In order to send mail for foo.org and its subdomains +# via the uucp transport to the UUCP host named foo: +# +# foo.org uucp:foo +# .foo.org uucp:foo +# +# When no nexthop host name is specified, the destination domain +# name is used instead. For example, the following directs mail for +# user@foo.org via the slow transport to a mail +# exchanger for foo.org. The slow transport could be +# something that runs at most one delivery process at a time: +# +# foo.org slow: +# +# When no transport is specified, the default transport is +# used, as specified via the default_transport configuration +# parameter. The following sends all mail for foo.org and its +# subdomains to host gateway.foo.org: +# +# foo.org :[gateway.foo.org] +# .foo.org :[gateway.foo.org] +# +# In the above example, the [] are used to suppress MX lookups. +# The result would likely point to your local machine. +# +# In the case of delivery via SMTP, one may specify +# hostname:service instead of just a host: +# +# foo.org smtp:bar.org:2025 +# +# This directs mail for user@foo.org to host bar.org +# port 2025. Instead of a numerical port a symbolic name may be +# used. Specify [] around the destination in order to disable MX lookups. +# +# The error mailer can be used to bounce mail: +# +# .foo.org error:mail for *.foo.org is not deliverable +# +# This causes all mail for user@anythingfoo.org +# to be bounced. +# +# 2 +# +# TRANSPORT(5) TRANSPORT(5) +# # REGULAR EXPRESSION TABLES -# .ad -# .fi -# This section describes how the table lookups change when the table -# is given in the form of regular expressions. For a description of -# regular expression lookup table syntax, see \fBregexp_table\fR(5) -# or \fBpcre_table\fR(5). -# -# Each pattern is a regular expression that is applied to the entire -# domain being looked up. Thus, \fIsome.domain.hierarchy\fR is not -# broken up into parent domains. -# -# Patterns are applied in the order as specified in the table, until a -# pattern is found that matches the search string. -# -# Results are the same as with normal indexed file lookups, with -# the additional feature that parenthesized substrings from the -# pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on. +# This section describes how the table lookups change when +# the table is given in the form of regular expressions. For +# a description of regular expression lookup table syntax, +# see regexp_table(5) or pcre_table(5). +# +# Each pattern is a regular expression that is applied to +# the entire domain being looked up. Thus, some.domain.hier- +# archy is not broken up into parent domains. +# +# Patterns are applied in the order as specified in the +# table, until a pattern is found that matches the search +# string. +# +# Results are the same as with normal indexed file lookups, +# with the additional feature that parenthesized substrings +# from the pattern can be interpolated as $1, $2 and so on. +# # CONFIGURATION PARAMETERS -# .ad -# .fi -# The following \fBmain.cf\fR parameters are especially relevant to -# this topic. See the Postfix \fBmain.cf\fR file for syntax details -# and for default values. Use the \fBpostfix reload\fR command after -# a configuration change. -# .IP \fBtransport_maps\fR -# List of transport lookup tables. -# .PP -# Other parameters of interest: -# .IP \fBdefault_transport\fR -# The transport to use when no transport is explicitly specified. -# .IP \fBrelayhost\fR -# The default host to send to when no transport table entry matches. +# The following main.cf parameters are especially relevant +# to this topic. See the Postfix main.cf file for syntax +# details and for default values. Use the postfix reload +# command after a configuration change. +# +# transport_maps +# List of transport lookup tables. +# +# Other parameters of interest: +# +# default_transport +# The transport to use when no transport is explic- +# itly specified. +# +# relayhost +# The default host to send to when no transport table +# entry matches. +# # SEE ALSO -# postmap(1) create mapping table -# trivial-rewrite(8) rewrite and resolve addresses -# pcre_table(5) format of PCRE tables -# regexp_table(5) format of POSIX regular expression tables +# postmap(1) create mapping table +# trivial-rewrite(8) rewrite and resolve addresses +# pcre_table(5) format of PCRE tables +# regexp_table(5) format of POSIX regular expression tables +# # LICENSE -# .ad -# .fi -# The Secure Mailer license must be distributed with this software. +# The Secure Mailer license must be distributed with this +# software. +# # AUTHOR(S) -# Wietse Venema -# IBM T.J. Watson Research -# P.O. Box 704 -# Yorktown Heights, NY 10598, USA -#-- - -# By default, this file is not used. See sample-transport.cf +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +# +# 3 +# diff --git a/postfix/conf/virtual b/postfix/conf/virtual index bc29dca1a..57b64b3cb 100644 --- a/postfix/conf/virtual +++ b/postfix/conf/virtual @@ -1,142 +1,170 @@ -#++ +# +# VIRTUAL(5) VIRTUAL(5) +# # NAME -# virtual 5 -# SUMMARY -# format of Postfix virtual table +# virtual - format of Postfix virtual table +# # SYNOPSIS -# \fBpostmap /etc/postfix/virtual\fR +# postmap /etc/postfix/virtual +# # DESCRIPTION -# The optional \fBvirtual\fR table specifies redirections for local -# and non-local recipients or domains. The redirections are used by -# the \fBcleanup\fR(8) daemon. The redirections are recursive. -# -# The \fBvirtual\fR redirection is applied only to the recipient -# envelope address, and does not affect message headers. -# Think Sendmail rule set \fBS0\fR, if you like. Use \fBcanonical\fR(5) -# mapping to rewrite header and envelope addresses in general. -# -# Normally, the file serves as input to the \fBpostmap\fR(1) command. -# The result, an indexed file in \fBdbm\fR or \fBdb\fR format, -# is used for fast searching by the mail system. After an update -# it may take a minute or so before the change becomes visible. -# Issue a \fBpostfix reload\fR command to eliminate the delay. -# -# When the table is provided via other means such as NIS, LDAP -# or SQL, the same lookups are done as for ordinary indexed files. -# -# Alternatively, the table can be provided as a regular-expression -# map where patterns are given as regular expressions. In that case, -# the lookups are done in a slightly different way as described below. +# The optional virtual table specifies redirections for +# local and non-local recipients or domains. The redirec- +# tions are used by the cleanup(8) daemon. The redirections +# are recursive. +# +# The virtual redirection is applied only to the recipient +# envelope address, and does not affect message headers. +# Think Sendmail rule set S0, if you like. Use canonical(5) +# mapping to rewrite header and envelope addresses in gen- +# eral. +# +# Normally, the file serves as input to the postmap(1) com- +# mand. The result, an indexed file in dbm or db format, is +# used for fast searching by the mail system. After an +# update it may take a minute or so before the change +# becomes visible. Issue a postfix reload command to elimi- +# nate the delay. +# +# When the table is provided via other means such as NIS, +# LDAP or SQL, the same lookups are done as for ordinary +# indexed files. +# +# Alternatively, the table can be provided as a regular- +# expression map where patterns are given as regular expres- +# sions. In that case, the lookups are done in a slightly +# different way as described below. +# # TABLE FORMAT -# .ad -# .fi -# Typical support for a virtual domain looks like the following: -# -# .in +4 -# .nf -# \fIvirtual.domain anything\fR (right-hand content does not matter) -# \fIuser1@virtual.domain address1\fR -# \fIuser2@virtual.domain address2, address3\fR -# .fi -# .in -4 -# -# With this, the SMTP server accepts mail for \fIvirtual.domain\fR and -# rejects mail for \fIunknown\fR@\fIvirtual.domain\fR as undeliverable. -# -# The format of the virtual table is as follows, mappings being -# tried in the order as listed in this manual page: -# .IP "blanks and comments" -# Blank lines are ignored, as are lines beginning with `#'. -# .IP "\fIpattern result\fR" -# When \fIpattern\fR matches a mail address, replace it by the -# corresponding \fIresult\fR. -# .PP -# With lookups from indexed files such as DB or DBM, or from networked -# tables such as NIS, LDAP or SQL, patterns are tried in the order as -# listed below: -# .IP "\fIuser\fR@\fIdomain address, address, ...\fR" -# Mail for \fIuser\fR@\fIdomain\fR is redirected to \fIaddress\fR. -# This form has the highest precedence. -# .IP "\fIuser address, address, ...\fR" -# Mail for \fIuser\fR@\fIsite\fR is redirected to \fIaddress\fR when -# \fIsite\fR is equal to $\fBmyorigin\fR, when \fIsite\fR is listed in -# $\fRmydestination\fR, or when it is listed in $\fIinet_interfaces\fR. -# .sp -# This functionality overlaps with functionality of the local -# \fIalias\fR(5) database. The difference is that \fBvirtual\fR -# mapping can be applied to non-local addresses. -# .IP "@\fIdomain address, address, ...\fR" -# Mail for any user in \fIdomain\fR is redirected to \fIaddress\fR. -# This form has the lowest precedence. -# .PP -# In all the above forms, when \fIaddress\fR has the form -# @\fIotherdomain\fR, the result is the same user in \fIotherdomain\fR. -# This works for the first address in the expansion only. +# Typical support for a virtual domain looks like the fol- +# lowing: +# +# virtual.domain anything (right-hand content does not matter) +# user1@virtual.domain address1 +# user2@virtual.domain address2, address3 +# +# With this, the SMTP server accepts mail for virtual.domain +# and rejects mail for unknown@virtual.domain as undeliver- +# able. +# +# The format of the virtual table is as follows, mappings +# being tried in the order as listed in this manual page: +# +# blanks and comments +# Blank lines are ignored, as are lines beginning +# with `#'. +# +# 1 +# +# VIRTUAL(5) VIRTUAL(5) +# +# pattern result +# When pattern matches a mail address, replace it by +# the corresponding result. +# +# With lookups from indexed files such as DB or DBM, or from +# networked tables such as NIS, LDAP or SQL, patterns are +# tried in the order as listed below: +# +# user@domain address, address, ... +# Mail for user@domain is redirected to address. +# This form has the highest precedence. +# +# user address, address, ... +# Mail for user@site is redirected to address when +# site is equal to $myorigin, when site is listed in +# $mydestination, or when it is listed in +# $inet_interfaces. +# +# This functionality overlaps with functionality of +# the local alias(5) database. The difference is that +# virtual mapping can be applied to non-local +# addresses. +# +# @domain address, address, ... +# Mail for any user in domain is redirected to +# address. This form has the lowest precedence. +# +# In all the above forms, when address has the form @other- +# domain, the result is the same user in otherdomain. This +# works for the first address in the expansion only. +# # ADDRESS EXTENSION -# .fi -# .ad -# When the search fails, and the address localpart contains the -# optional recipient delimiter (e.g., \fIuser+foo\fR@\fIdomain\fR), -# the search is repeated for the unextended address (e.g. -# \fIuser\fR@\fIdomain\fR), and the unmatched address extension is -# propagated to the result of expansion. The matching order is: -# \fIuser+foo\fR@\fIdomain\fR, \fIuser\fR@\fIdomain\fR, -# \fIuser+foo\fR, \fIuser\fR, and @\fIdomain\fR. +# When the search fails, and the address localpart contains +# the optional recipient delimiter (e.g., user+foo@domain), +# the search is repeated for the unextended address (e.g. +# user@domain), and the unmatched address extension is prop- +# agated to the result of expansion. The matching order is: +# user+foo@domain, user@domain, user+foo, user, and @domain. +# # REGULAR EXPRESSION TABLES -# .ad -# .fi -# This section describes how the table lookups change when the table -# is given in the form of regular expressions. For a description of -# regular expression lookup table syntax, see \fBregexp_table\fR(5) -# or \fBpcre_table\fR(5). -# -# Each pattern is a regular expression that is applied to the entire -# address being looked up. Thus, \fIuser@domain\fR mail addresses are not -# broken up into their \fIuser\fR and \fI@domain\fR constituent parts, -# nor is \fIuser+foo\fR broken up into \fIuser\fR and \fIfoo\fR. -# -# Patterns are applied in the order as specified in the table, until a -# pattern is found that matches the search string. -# -# Results are the same as with normal indexed file lookups, with -# the additional feature that parenthesized substrings from the -# pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on. +# This section describes how the table lookups change when +# the table is given in the form of regular expressions. For +# a description of regular expression lookup table syntax, +# see regexp_table(5) or pcre_table(5). +# +# Each pattern is a regular expression that is applied to +# the entire address being looked up. Thus, user@domain mail +# addresses are not broken up into their user and @domain +# constituent parts, nor is user+foo broken up into user and +# foo. +# +# Patterns are applied in the order as specified in the +# table, until a pattern is found that matches the search +# string. +# +# 2 +# +# VIRTUAL(5) VIRTUAL(5) +# +# Results are the same as with normal indexed file lookups, +# with the additional feature that parenthesized substrings +# from the pattern can be interpolated as $1, $2 and so on. +# # BUGS -# The table format does not understand quoting conventions. +# The table format does not understand quoting conventions. +# # CONFIGURATION PARAMETERS -# .ad -# .fi -# The following \fBmain.cf\fR parameters are especially relevant to -# this topic. See the Postfix \fBmain.cf\fR file for syntax details -# and for default values. Use the \fBpostfix reload\fR command after -# a configuration change. -# .IP \fBvirtual_maps\fR -# List of virtual mapping tables. -# .PP -# Other parameters of interest: -# .IP \fBinet_interfaces\fR -# The network interface addresses that this system receives mail on. -# .IP \fBmydestination\fR -# List of domains that this mail system considers local. -# .IP \fBmyorigin\fR -# The domain that is appended to locally-posted mail. -# .IP \fBowner_request_special\fR -# Give special treatment to \fBowner-\fIxxx\fR and \fIxxx\fB-request\fR -# addresses. +# The following main.cf parameters are especially relevant +# to this topic. See the Postfix main.cf file for syntax +# details and for default values. Use the postfix reload +# command after a configuration change. +# +# virtual_maps +# List of virtual mapping tables. +# +# Other parameters of interest: +# +# inet_interfaces +# The network interface addresses that this system +# receives mail on. +# +# mydestination +# List of domains that this mail system considers +# local. +# +# myorigin +# The domain that is appended to locally-posted mail. +# +# owner_request_special +# Give special treatment to owner-xxx and xxx-request +# addresses. +# # SEE ALSO -# cleanup(8) canonicalize and enqueue mail -# postmap(1) create mapping table -# pcre_table(5) format of PCRE tables -# regexp_table(5) format of POSIX regular expression tables +# cleanup(8) canonicalize and enqueue mail +# postmap(1) create mapping table +# pcre_table(5) format of PCRE tables +# regexp_table(5) format of POSIX regular expression tables +# # LICENSE -# .ad -# .fi -# The Secure Mailer license must be distributed with this software. +# The Secure Mailer license must be distributed with this +# software. +# # AUTHOR(S) -# Wietse Venema -# IBM T.J. Watson Research -# P.O. Box 704 -# Yorktown Heights, NY 10598, USA -#-- - -# By default, this file is not used. See sample-virtual.cf +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +# +# 3 +# diff --git a/postfix/dns/.indent.pro b/postfix/dns/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/dns/.indent.pro +++ b/postfix/dns/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/error/.indent.pro b/postfix/error/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/error/.indent.pro +++ b/postfix/error/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/fsstone/.indent.pro b/postfix/fsstone/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/fsstone/.indent.pro +++ b/postfix/fsstone/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/global/.indent.pro b/postfix/global/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/global/.indent.pro +++ b/postfix/global/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/global/mail_connect.c b/postfix/global/mail_connect.c index 388d67d2b..cd486f9bc 100644 --- a/postfix/global/mail_connect.c +++ b/postfix/global/mail_connect.c @@ -30,11 +30,11 @@ /* /* Arguments: /* .IP class -/* Name of a class of local transport channel endpoints, -/* either \fIpublic\fR (accessible by any local user) or -/* \fIprivate\fR (administrative access only). +/* Name of a class of local transport channel endpoints, +/* either \fIpublic\fR (accessible by any local user) or +/* \fIprivate\fR (administrative access only). /* .IP service -/* The name of a local transport endpoint within the named class. +/* The name of a local transport endpoint within the named class. /* .IP block_mode /* NON_BLOCKING for a non-blocking connection, or BLOCKING. /* SEE ALSO diff --git a/postfix/global/mail_params.h b/postfix/global/mail_params.h index 807ae0f37..e81bb0a62 100644 --- a/postfix/global/mail_params.h +++ b/postfix/global/mail_params.h @@ -598,6 +598,10 @@ extern bool var_ign_mx_lookup_err; #define DEF_SKIP_QUIT_RESP 1 extern bool var_skip_quit_resp; +#define VAR_SMTP_ALWAYS_EHLO "smtp_always_send_ehlo" +#define DEF_SMTP_ALWAYS_EHLO 0 +extern bool var_smtp_always_ehlo; + /* * SMTP server. The soft error limit determines how many errors an SMTP * client may make before we start to slow down; the hard error limit diff --git a/postfix/global/mail_scan.c b/postfix/global/mail_scan.c index 74a580f23..0538c40bf 100644 --- a/postfix/global/mail_scan.c +++ b/postfix/global/mail_scan.c @@ -44,12 +44,12 @@ /* Anything else in a format string is a fatal error. /* .RE /* .IP letter -/* Format letter that is bound to the \fIscan_fn\fR input +/* Format letter that is bound to the \fIscan_fn\fR input /* conversion function. /* .IP name -/* Descriptive string for verbose logging. +/* Descriptive string for verbose logging. /* .IP scan_fn -/* An input conversion function. It takes as arguments: +/* An input conversion function. It takes as arguments: /* .RS /* .IP string /* The null-terminated string to be converted. diff --git a/postfix/global/mail_version.h b/postfix/global/mail_version.h index ee9afa2a3..7b9ffd13b 100644 --- a/postfix/global/mail_version.h +++ b/postfix/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Snapshot-20000204" +#define DEF_MAIL_VERSION "Snapshot-20000309" extern char *var_mail_version; /* LICENSE diff --git a/postfix/global/rec_type.h b/postfix/global/rec_type.h index 15ad19ee1..e0e32122e 100644 --- a/postfix/global/rec_type.h +++ b/postfix/global/rec_type.h @@ -58,10 +58,13 @@ /* * The record at the beginning of the envelope segment specifies the message - * content size. This is the format of the position field. It is a - * fixed-width field so it can be updated in place. + * content size, data offset, and recipient count. These are fixed-width + * fields so they can be updated in place. */ -#define REC_TYPE_SIZE_FORMAT "%15ld" /* content size format */ +#define REC_TYPE_SIZE_FORMAT "%15ld %15ld %15ld" /* size/count format */ +#define REC_TYPE_SIZE_CAST1 long +#define REC_TYPE_SIZE_CAST2 long +#define REC_TYPE_SIZE_CAST3 long /* * The record at the beginning of the message content records specifies the @@ -69,14 +72,15 @@ * field. It is a fixed-width field so it can be updated in place. */ #define REC_TYPE_MESG_FORMAT "%15ld" /* message length format */ +#define REC_TYPE_MESG_CAST long /* - * The warn record specifies when the next warning that the message - * was deferred should be sent. It is updated in place by qmgr, so - * changing this value when there are deferred mesages in the queue - * is dangerous! + * The warn record specifies when the next warning that the message was + * deferred should be sent. It is updated in place by qmgr, so changing + * this value when there are deferred mesages in the queue is dangerous! */ #define REC_TYPE_WARN_FORMAT "%15ld" /* warning time format */ +#define REC_TYPE_WARN_CAST long /* * Programmatic interface. diff --git a/postfix/html/Makefile.in b/postfix/html/Makefile.in index 5354ad333..963766110 100644 --- a/postfix/html/Makefile.in +++ b/postfix/html/Makefile.in @@ -1,3 +1,5 @@ +SHELL = /bin/sh + # For now, just hard-coded rules for daemons, commands, config files. DAEMONS = bounce.8.html cleanup.8.html defer.8.html error.8.html local.8.html \ @@ -104,26 +106,26 @@ newaliases.1.html: sendmail.1.html rm -f $@ ln -s $? $@ -access.5.html: ../conf/access +access.5.html: ../proto/access srctoman - $? | nroff -man | man2html | postlink >$@ -aliases.5.html: ../conf/aliases +aliases.5.html: ../proto/aliases srctoman - $? | nroff -man | man2html | postlink >$@ -canonical.5.html: ../conf/canonical +canonical.5.html: ../proto/canonical srctoman - $? | nroff -man | man2html | postlink >$@ -pcre_table.5.html: ../conf/pcre_table +pcre_table.5.html: ../proto/pcre_table srctoman - $? | nroff -man | man2html | postlink >$@ -regexp_table.5.html: ../conf/regexp_table +regexp_table.5.html: ../proto/regexp_table srctoman - $? | nroff -man | man2html | postlink >$@ -relocated.5.html: ../conf/relocated +relocated.5.html: ../proto/relocated srctoman - $? | nroff -man | man2html | postlink >$@ -transport.5.html: ../conf/transport +transport.5.html: ../proto/transport srctoman - $? | nroff -man | man2html | postlink >$@ -virtual.5.html: ../conf/virtual +virtual.5.html: ../proto/virtual srctoman - $? | nroff -man | man2html | postlink >$@ diff --git a/postfix/html/faq.html b/postfix/html/faq.html index 5e574906a..8e582d89c 100644 --- a/postfix/html/faq.html +++ b/postfix/html/faq.html @@ -1033,8 +1033,8 @@ LDAP or SQL. hash:/etc/postfix/restricted_senders ...other stuff... - restriction_classes = local_only - local_only = check_recipient_access hash:/etc/postfix/local_domains, reject + smtpd_restriction_classes = local_only + local_only = check_sender_access hash:/etc/postfix/local_domains, reject /etc/postfix/restricted_senders: foo@domain local_only @@ -1053,7 +1053,7 @@ types Postfix supports, use the command postconf -m.

-The restriction_classes verbiage exists so that Postfix can +The smtpd_restriction_classes verbiage exists so that Postfix can open /etc/postfix/local_domains.db before entering a chroot jail, so it is only an artefact of implementation. diff --git a/postfix/html/master.8.html b/postfix/html/master.8.html index 723dad55c..9edfc94ae 100644 --- a/postfix/html/master.8.html +++ b/postfix/html/master.8.html @@ -34,16 +34,17 @@ MASTER(8) MASTER(8) -c config_dir Read the main.cf and master.cf configuration files - in the named directory. + in the named directory instead of the default con- + figuration directory. - -D After initialization, run a debugger on the master - process. The debugging command is specified with + -D After initialization, run a debugger on the master + process. The debugging command is specified with the debugger_command in the main.cf global configu- ration file. - -t Test mode. Return a zero exit status when the mas- - ter.pid lock file does not exist or when that file - is not locked. This is evidence that the master + -t Test mode. Return a zero exit status when the mas- + ter.pid lock file does not exist or when that file + is not locked. This is evidence that the master daemon is not running. -v Enable verbose logging for debugging purposes. This @@ -52,13 +53,12 @@ MASTER(8) MASTER(8) Signals: - SIGHUP Upon receipt of a HUP signal (e.g., after postfix + SIGHUP Upon receipt of a HUP signal (e.g., after postfix reload), the master process re-reads its configura- - tion files. If a service has been removed from the - master.cf file, its running processes are termi- - nated immediately. Otherwise, running processes - are allowed to terminate as soon as is convenient, - so that changes in configuration settings affect + tion files. If a service has been removed from the + master.cf file, its running processes are termi- + nated immediately. Otherwise, running processes + are allowed to terminate as soon as is convenient, @@ -71,14 +71,15 @@ MASTER(8) MASTER(8) MASTER(8) MASTER(8) + so that changes in configuration settings affect only new service requests. SIGTERM - Upon receipt of a TERM signal (e.g., after postfix - abort), the master process passes the signal on to + Upon receipt of a TERM signal (e.g., after postfix + abort), the master process passes the signal on to its child processes and terminates. This is useful - for an emergency shutdown. Normally one would ter- - minate only the master (postfix stop) and allow + for an emergency shutdown. Normally one would ter- + minate only the master (postfix stop) and allow running processes to finish what they are doing. DIAGNOSTICS @@ -88,21 +89,21 @@ MASTER(8) MASTER(8) ENVIRONMENT MAIL_DEBUG After initialization, start a debugger as specified - with the debugger_command configuration parameter + with the debugger_command configuration parameter in the main.cf configuration file. MAIL_CONFIG Directory with Postfix configuration files. CONFIGURATION PARAMETERS - The following main.cf parameters are especially relevant - to this program. See the Postfix main.cf file for syntax - details and for default values. Use the postfix reload + The following main.cf parameters are especially relevant + to this program. See the Postfix main.cf file for syntax + details and for default values. Use the postfix reload command after a configuration change. Miscellaneous mail_owner - The owner of the mail queue and of most Postfix + The owner of the mail queue and of most Postfix processes. command_directory @@ -112,22 +113,21 @@ MASTER(8) MASTER(8) Directory with Postfix daemon programs. queue_directory - Top-level directory of the Postfix queue. This is + Top-level directory of the Postfix queue. This is also the root directory of Postfix daemons that run chrooted. Resource controls default_process_limit - Default limit for the number of simultaneous child + Default limit for the number of simultaneous child processes that provide a given service. max_idle - Limit the time in seconds that a child process + Limit the time in seconds that a child process waits between service requests. - 2 @@ -138,11 +138,11 @@ MASTER(8) MASTER(8) max_use - Limit the number of service requests handled by a + Limit the number of service requests handled by a child process. service_throttle_time - Time to avoid forking a server that appears to be + Time to avoid forking a server that appears to be broken. FILES @@ -156,7 +156,7 @@ MASTER(8) MASTER(8) syslogd(8) system logging LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) diff --git a/postfix/html/postalias.1.html b/postfix/html/postalias.1.html index 4d95379f7..c66bc04ae 100644 --- a/postfix/html/postalias.1.html +++ b/postfix/html/postalias.1.html @@ -9,7 +9,7 @@ POSTALIAS(1) POSTALIAS(1) postalias - Postfix alias database maintenance SYNOPSIS - postalias [-Ninvw] [-c config_dir] [-q key] + postalias [-Ninvw] [-c config_dir] [-d key] [-q key] [file_type:]file_name ... DESCRIPTION @@ -33,32 +33,32 @@ POSTALIAS(1) POSTALIAS(1) -c config_dir Read the main.cf configuration file in the named + directory instead of the default configuration directory. - -i Incremental mode. Read entries from standard input + -d key Search the specified maps for key and remove one + entry per map. The exit status is non-zero if the + requested information was not found. + + -i Incremental mode. Read entries from standard input and do not truncate an existing database. By - default, postalias creates a new database from the + default, postalias creates a new database from the entries in file_name. - -n Don't include the terminating null character that - terminates lookup keys and values. By default, - Postfix does whatever is the default for the host + -n Don't include the terminating null character that + terminates lookup keys and values. By default, + Postfix does whatever is the default for the host operating system. - -q key Search the specified maps for key and print the - first value found on the standard output stream. + -q key Search the specified maps for key and print the + first value found on the standard output stream. The exit status is non-zero if the requested infor- mation was not found. -v Enable verbose logging for debugging purposes. Mul- - tiple -v options make the software increasingly + tiple -v options make the software increasingly verbose. - -w Do not warn about duplicate entries; silently - ignore them. - - Arguments: - @@ -71,36 +71,45 @@ POSTALIAS(1) POSTALIAS(1) POSTALIAS(1) POSTALIAS(1) + -w When updating a table, do not warn about duplicate + entries; silently ignore them. + + Arguments: + file_type The type of database to be produced. - btree The output is a btree file, named - file_name.db. This is available only on + btree The output is a btree file, named + file_name.db. This is available only on systems with support for db databases. - dbm The output consists of two files, named - file_name.pag and file_name.dir. This is - available only on systems with support for + dbm The output consists of two files, named + file_name.pag and file_name.dir. This is + available only on systems with support for dbm databases. - hash The output is a hashed file, named - file_name.db. This is available only on + hash The output is a hashed file, named + file_name.db. This is available only on systems with support for db databases. - When no file_type is specified, the software uses - the database type specified via the database_type - configuration parameter. The default value for + When no file_type is specified, the software uses + the database type specified via the database_type + configuration parameter. The default value for this parameter depends on the host environment. file_name - The name of the alias database source file when + The name of the alias database source file when rebuilding a database. DIAGNOSTICS - Problems are logged to the standard error stream. No out- + Problems are logged to the standard error stream. No out- put means no problems were detected. Duplicate entries are skipped and are flagged with a warning. +BUGS + The "delete key" support is limited to one delete opera- + tion per command invocation. + ENVIRONMENT MAIL_CONFIG Directory with Postfix configuration files. @@ -117,15 +126,6 @@ POSTALIAS(1) POSTALIAS(1) Default alias database type. On many UNIX systems, the default type is either dbm or hash. -STANDARDS - RFC 822 (ARPA Internet Text Messages) - -SEE ALSO - aliases(5) format of alias database input file. - sendmail(1) mail posting and compatibility interface. - - - 2 @@ -137,6 +137,13 @@ POSTALIAS(1) POSTALIAS(1) POSTALIAS(1) POSTALIAS(1) +STANDARDS + RFC 822 (ARPA Internet Text Messages) + +SEE ALSO + aliases(5) format of alias database input file. + sendmail(1) mail posting and compatibility interface. + LICENSE The Secure Mailer license must be distributed with this software. @@ -179,13 +186,6 @@ POSTALIAS(1) POSTALIAS(1) - - - - - - - diff --git a/postfix/html/postconf.1.html b/postfix/html/postconf.1.html index 1455eec38..294544500 100644 --- a/postfix/html/postconf.1.html +++ b/postfix/html/postconf.1.html @@ -23,18 +23,19 @@ POSTCONF(1) POSTCONF(1) -c config_dir The main.cf configuration file is in the named + directory instead of the default configuration directory. - -d Print default parameter settings instead of actual + -d Print default parameter settings instead of actual settings. - -e Edit the main.cf configuration file. The file is + -e Edit the main.cf configuration file. The file is copied to a temporary file then renamed into place. - Parameters and values are specified on the command - line. Use quotes in order to protect shell + Parameters and values are specified on the command + line. Use quotes in order to protect shell metacharacters and whitespace. - -h Show parameter values only, not the ``name = '' + -h Show parameter values only, not the ``name = '' label that normally precedes the value. -m List the names of all supported lookup table types. @@ -42,14 +43,14 @@ POSTCONF(1) POSTCONF(1) -n Print non-default parameter settings only. -v Enable verbose logging for debugging purposes. Mul- - tiple -v options make the software increasingly + tiple -v options make the software increasingly verbose. DIAGNOSTICS Problems are reported to the standard error stream. LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) @@ -61,7 +62,6 @@ POSTCONF(1) POSTCONF(1) - 1 diff --git a/postfix/html/postfix.1.html b/postfix/html/postfix.1.html index 6b4a3578a..8db5ad602 100644 --- a/postfix/html/postfix.1.html +++ b/postfix/html/postfix.1.html @@ -50,15 +50,15 @@ POSTFIX(1) POSTFIX(1) The following options are implemented: -c config_dir - The absolute path to a directory with Postfix con- - figuration files. Use this to distinguish between - multiple Postfix instances on the same host. + Read the main.cf and master.cf configuration files + in the named directory instead of the default con- + figuration directory. Use this to distinguish + between multiple Postfix instances on the same + host. -D (with postfix start only) Run each Postfix daemon under control of a debugger as specified via the debugger_command configuration - parameter. - @@ -71,6 +71,8 @@ POSTFIX(1) POSTFIX(1) POSTFIX(1) POSTFIX(1) + parameter. + -v Enable verbose logging for debugging purposes. Mul- tiple -v options make the software increasingly verbose. @@ -126,8 +128,6 @@ POSTFIX(1) POSTFIX(1) - - 2 diff --git a/postfix/html/postkick.1.html b/postfix/html/postkick.1.html index 639eea0a0..0a5a5a3a9 100644 --- a/postfix/html/postkick.1.html +++ b/postfix/html/postkick.1.html @@ -20,25 +20,26 @@ POSTKICK(1) POSTKICK(1) Options: -c config_dir - Read configuration information from main.cf in the - named configuration directory. + Read the main.cf configuration file in the named + directory instead of the default configuration + directory. -v Enable verbose logging for debugging purposes. Mul- - tiple -v options make the software increasingly + tiple -v options make the software increasingly verbose. Arguments: - class Name of a class of local transport channel end- - points, either public (accessible by any local + class Name of a class of local transport channel end- + points, either public (accessible by any local user) or private (administrative access only). service - The name of a local transport endpoint within the + The name of a local transport endpoint within the named class. request - A string. The list of valid requests is service- + A string. The list of valid requests is service- specific. DIAGNOSTICS @@ -53,12 +54,11 @@ POSTKICK(1) POSTKICK(1) Enable verbose logging for debugging purposes. CONFIGURATION PARAMETERS - The following main.cf parameters are especially relevant - to this program. See the Postfix main.cf file for syntax + The following main.cf parameters are especially relevant + to this program. See the Postfix main.cf file for syntax details and for default values. - queue_directory - Location of the Postfix queue, and of the local IPC + @@ -71,6 +71,8 @@ POSTKICK(1) POSTKICK(1) POSTKICK(1) POSTKICK(1) + queue_directory + Location of the Postfix queue, and of the local IPC communication endpoints. SEE ALSO @@ -78,7 +80,7 @@ POSTKICK(1) POSTKICK(1) pickup(8) local pickup daemon LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) @@ -123,8 +125,6 @@ POSTKICK(1) POSTKICK(1) - - diff --git a/postfix/html/postlock.1.html b/postfix/html/postlock.1.html index b061bc96f..1a7b5356d 100644 --- a/postfix/html/postlock.1.html +++ b/postfix/html/postlock.1.html @@ -19,34 +19,35 @@ POSTLOCK(1) POSTLOCK(1) Options: -c config_dir - Read configuration information from main.cf in the - named configuration directory. + Read the main.cf configuration file in the named + directory instead of the default configuration + directory. -v Enable verbose logging for debugging purposes. Mul- - tiple -v options make the software increasingly + tiple -v options make the software increasingly verbose. Arguments: - file A mailbox file. The user should have read/write + file A mailbox file. The user should have read/write permission. command... - The command to execute while file is locked for - exclusive access. The command is executed - directly, i.e. without interpretation by a shell + The command to execute while file is locked for + exclusive access. The command is executed + directly, i.e. without interpretation by a shell command interpreter. DIAGNOSTICS - The result status is 75 (EX_TEMPFAIL) when the file is - locked by another process, 255 (on some systems: -1) when - postlock could not perform the requested operation. Oth- - erwise, the exit status is the exit status from the com- + The result status is 75 (EX_TEMPFAIL) when the file is + locked by another process, 255 (on some systems: -1) when + postlock could not perform the requested operation. Oth- + erwise, the exit status is the exit status from the com- mand. BUGS - With remote file systems, the ability to acquire a lock - does not necessarily eliminate access conflicts. Avoid + With remote file systems, the ability to acquire a lock + does not necessarily eliminate access conflicts. Avoid file access by processes running on different machines. ENVIRONMENT @@ -57,8 +58,7 @@ POSTLOCK(1) POSTLOCK(1) Enable verbose logging for debugging purposes. CONFIGURATION PARAMETERS - The following main.cf parameters are especially relevant - to this program. See the Postfix main.cf file for syntax + The following main.cf parameters are especially relevant @@ -71,15 +71,16 @@ POSTLOCK(1) POSTLOCK(1) POSTLOCK(1) POSTLOCK(1) + to this program. See the Postfix main.cf file for syntax details and for default values. Locking controls deliver_lock_attempts - Limit the number of attempts to acquire an exclu- + Limit the number of attempts to acquire an exclu- sive lock. deliver_lock_delay - Time in seconds between successive attempts to + Time in seconds between successive attempts to acquire an exclusive lock. stale_lock_time @@ -87,15 +88,15 @@ POSTLOCK(1) POSTLOCK(1) Resource controls fork_attempts - Number of attempts to fork() a process before giv- + Number of attempts to fork() a process before giv- ing up. fork_delay - Delay in seconds between successive fork() + Delay in seconds between successive fork() attempts. LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) @@ -125,7 +126,6 @@ POSTLOCK(1) POSTLOCK(1) - 2 diff --git a/postfix/html/postmap.1.html b/postfix/html/postmap.1.html index c818e43e0..9dee8109d 100644 --- a/postfix/html/postmap.1.html +++ b/postfix/html/postmap.1.html @@ -9,7 +9,7 @@ POSTMAP(1) POSTMAP(1) postmap - Postfix lookup table management SYNOPSIS - postmap [-Ninvw] [-c config_dir] [-q key] + postmap [-Ninvw] [-c config_dir] [-d key] [-q key] [file_type:]file_name ... DESCRIPTION @@ -52,12 +52,12 @@ POSTMAP(1) POSTMAP(1) -c config_dir Read the main.cf configuration file in the named + directory instead of the default configuration directory. - -i Incremental mode. Read entries from standard input - and do not truncate an existing database. By - default, postmap creates a new database from the - entries in file_name. + -d key Search the specified maps for key and remove one + entry per map. The exit status is non-zero if the + requested information was not found. @@ -71,47 +71,52 @@ POSTMAP(1) POSTMAP(1) POSTMAP(1) POSTMAP(1) - -n Don't include the terminating null character that - terminates lookup keys and values. By default, - Postfix does whatever is the default for the host + -i Incremental mode. Read entries from standard input + and do not truncate an existing database. By + default, postmap creates a new database from the + entries in file_name. + + -n Don't include the terminating null character that + terminates lookup keys and values. By default, + Postfix does whatever is the default for the host operating system. - -q key Search the specified maps for key and print the - first value found on the standard output stream. + -q key Search the specified maps for key and print the + first value found on the standard output stream. The exit status is non-zero if the requested infor- mation was not found. -v Enable verbose logging for debugging purposes. Mul- - tiple -v options make the software increasingly + tiple -v options make the software increasingly verbose. - -w Do not warn about duplicate entries; silently - ignore them. + -w When updating a table, do not warn about duplicate + entries; silently ignore them. Arguments: file_type The type of database to be produced. - btree The output file is a btree file, named - file_name.db. This is available only on + btree The output file is a btree file, named + file_name.db. This is available only on systems with support for db databases. - dbm The output consists of two files, named - file_name.pag and file_name.dir. This is - available only on systems with support for + dbm The output consists of two files, named + file_name.pag and file_name.dir. This is + available only on systems with support for dbm databases. - hash The output file is a hashed file, named - file_name.db. This is available only on + hash The output file is a hashed file, named + file_name.db. This is available only on systems with support for db databases. - When no file_type is specified, the software uses - the database type specified via the database_type + When no file_type is specified, the software uses + the database type specified via the database_type configuration parameter. file_name - The name of the lookup table source file when + The name of the lookup table source file when rebuilding a database. DIAGNOSTICS @@ -119,12 +124,7 @@ POSTMAP(1) POSTMAP(1) stream. No output means no problems. Duplicate entries are skipped and are flagged with a warning. -ENVIRONMENT - MAIL_CONFIG - Directory with Postfix configuration files. - MAIL_VERBOSE - Enable verbose logging for debugging purposes. @@ -137,6 +137,17 @@ POSTMAP(1) POSTMAP(1) POSTMAP(1) POSTMAP(1) +BUGS + The "delete key" support is limited to one delete opera- + tion per command invocation. + +ENVIRONMENT + MAIL_CONFIG + Directory with Postfix configuration files. + + MAIL_VERBOSE + Enable verbose logging for debugging purposes. + CONFIGURATION PARAMETERS database_type Default output database type. On many UNIX sys- @@ -172,17 +183,6 @@ POSTMAP(1) POSTMAP(1) - - - - - - - - - - - diff --git a/postfix/html/smtp.8.html b/postfix/html/smtp.8.html index 5c6a4dd39..35baf5a2c 100644 --- a/postfix/html/smtp.8.html +++ b/postfix/html/smtp.8.html @@ -119,12 +119,12 @@ SMTP(8) SMTP(8) send mail to the postmaster with transcripts of SMTP sessions with protocol errors. + smtp_always_send_ehlo + Always send EHLO at the start of a connection. + smtp_skip_4xx_greeting Skip servers that greet us with a 4xx status code. - smtp_skip_5xx_greeting - Skip servers that greet us with a 5xx status code. - @@ -137,6 +137,9 @@ SMTP(8) SMTP(8) SMTP(8) SMTP(8) + smtp_skip_5xx_greeting + Skip servers that greet us with a 5xx status code. + smtp_skip_quit_response Do not wait for the server response after sending QUIT. @@ -188,9 +191,6 @@ SMTP(8) SMTP(8) smtp_data_done_timeout Timeout in seconds for sending the "." command, and - for receiving the server response. When no response - is received, a warning is logged that the mail may - be delivered multiple times. @@ -203,6 +203,10 @@ SMTP(8) SMTP(8) SMTP(8) SMTP(8) + for receiving the server response. When no response + is received, a warning is logged that the mail may + be delivered multiple times. + smtp_quit_timeout Timeout in seconds for sending the QUIT command, and for receiving the server response. @@ -251,10 +255,6 @@ SMTP(8) SMTP(8) - - - - diff --git a/postfix/local/.indent.pro b/postfix/local/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/local/.indent.pro +++ b/postfix/local/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/local/alias.c b/postfix/local/alias.c index 00c241eec..69e0b4e79 100644 --- a/postfix/local/alias.c +++ b/postfix/local/alias.c @@ -32,10 +32,10 @@ /* .PP /* Arguments: /* .IP state -/* Attributes that specify the message, recipient and more. +/* Attributes that specify the message, recipient and more. /* Expansion type (alias, include, .forward). -/* A table with the results from expanding aliases or lists. -/* A table with delivered-to: addresses taken from the message. +/* A table with the results from expanding aliases or lists. +/* A table with delivered-to: addresses taken from the message. /* .IP usr_attr /* User attributes (rights, environment). /* .IP name diff --git a/postfix/local/resolve.c b/postfix/local/resolve.c index b18d14da6..3f99dce0c 100644 --- a/postfix/local/resolve.c +++ b/postfix/local/resolve.c @@ -21,9 +21,9 @@ /* /* Arguments: /* .IP state -/* The attributes that specify the message, sender and more. -/* A table with the results from expanding aliases or lists. -/* A table with delivered-to: addresses taken from the message. +/* The attributes that specify the message, sender and more. +/* A table with the results from expanding aliases or lists. +/* A table with delivered-to: addresses taken from the message. /* .IP addr /* An address from, e.g., alias expansion. /* DIAGNOSTICS diff --git a/postfix/local/token.c b/postfix/local/token.c index 9f6f8ac14..18a2a22b0 100644 --- a/postfix/local/token.c +++ b/postfix/local/token.c @@ -41,10 +41,10 @@ /* /* Arguments: /* .IP state -/* The attributes that specify the message, recipient and more. +/* The attributes that specify the message, recipient and more. /* Attributes describing alias, include or forward expansion. -/* A table with the results from expanding aliases or lists. -/* A table with delivered-to: addresses taken from the message. +/* A table with the results from expanding aliases or lists. +/* A table with delivered-to: addresses taken from the message. /* .IP usr_attr /* Attributes describing user rights and environment. /* .IP addr diff --git a/postfix/man/Makefile.in b/postfix/man/Makefile.in index 08b328e09..008206c8b 100644 --- a/postfix/man/Makefile.in +++ b/postfix/man/Makefile.in @@ -1,3 +1,5 @@ +SHELL = /bin/sh + # For now, just hard-coded rules for daemons, commands, config files. DAEMONS = man8/bounce.8 man8/defer.8 man8/cleanup.8 man8/error.8 man8/local.8 \ @@ -101,26 +103,26 @@ man1/mailq.1: man1/newaliases.1: echo .so man1/sendmail.1 >$@ -man5/access.5: ../conf/access +man5/access.5: ../proto/access srctoman - $? >$@ -man5/aliases.5: ../conf/aliases +man5/aliases.5: ../proto/aliases srctoman - $? >$@ -man5/canonical.5: ../conf/canonical +man5/canonical.5: ../proto/canonical srctoman - $? >$@ -man5/pcre_table.5: ../conf/pcre_table +man5/pcre_table.5: ../proto/pcre_table srctoman - $? >$@ -man5/regexp_table.5: ../conf/regexp_table +man5/regexp_table.5: ../proto/regexp_table srctoman - $? >$@ -man5/relocated.5: ../conf/relocated +man5/relocated.5: ../proto/relocated srctoman - $? >$@ -man5/transport.5: ../conf/transport +man5/transport.5: ../proto/transport srctoman - $? >$@ -man5/virtual.5: ../conf/virtual +man5/virtual.5: ../proto/virtual srctoman - $? >$@ diff --git a/postfix/man/man1/postalias.1 b/postfix/man/man1/postalias.1 index 8c3880a4a..a2b3e652e 100644 --- a/postfix/man/man1/postalias.1 +++ b/postfix/man/man1/postalias.1 @@ -10,7 +10,8 @@ Postfix alias database maintenance .nf .fi \fBpostalias\fR [\fB-Ninvw\fR] [\fB-c \fIconfig_dir\fR] -[\fB-q \fIkey\fR] [\fIfile_type\fR:]\fIfile_name\fR ... +[\fB-d \fIkey\fR] [\fB-q \fIkey\fR] +[\fIfile_type\fR:]\fIfile_name\fR ... .SH DESCRIPTION .ad .fi @@ -30,7 +31,11 @@ Include the terminating null character that terminates lookup keys and values. By default, Postfix does whatever is the default for the host operating system. .IP "\fB-c \fIconfig_dir\fR" -Read the \fBmain.cf\fR configuration file in the named directory. +Read the \fBmain.cf\fR configuration file in the named directory +instead of the default configuration directory. +.IP "\fB-d \fIkey\fR" +Search the specified maps for \fIkey\fR and remove one entry per map. +The exit status is non-zero if the requested information was not found. .IP \fB-i\fR Incremental mode. Read entries from standard input and do not truncate an existing database. By default, \fBpostalias\fR creates @@ -47,7 +52,8 @@ if the requested information was not found. Enable verbose logging for debugging purposes. Multiple \fB-v\fR options make the software increasingly verbose. .IP \fB-w\fR -Do not warn about duplicate entries; silently ignore them. +When updating a table, do not warn about duplicate entries; silently +ignore them. .PP Arguments: .IP \fIfile_type\fR @@ -76,6 +82,11 @@ The name of the alias database source file when rebuilding a database. Problems are logged to the standard error stream. No output means no problems were detected. Duplicate entries are skipped and are flagged with a warning. +.SH BUGS +.ad +.fi +The "delete key" support is limited to one delete operation +per command invocation. .SH ENVIRONMENT .na .nf diff --git a/postfix/man/man1/postconf.1 b/postfix/man/man1/postconf.1 index df036eb3c..babab721a 100644 --- a/postfix/man/man1/postconf.1 +++ b/postfix/man/man1/postconf.1 @@ -24,7 +24,8 @@ information about the Postfix mail system. Options: .IP "\fB-c \fIconfig_dir\fR" -The \fBmain.cf\fR configuration file is in the named directory. +The \fBmain.cf\fR configuration file is in the named directory +instead of the default configuration directory. .IP \fB-d\fR Print default parameter settings instead of actual settings. .IP \fB-e\fR diff --git a/postfix/man/man1/postfix.1 b/postfix/man/man1/postfix.1 index 8ea3a8999..e3230a053 100644 --- a/postfix/man/man1/postfix.1 +++ b/postfix/man/man1/postfix.1 @@ -48,7 +48,8 @@ earliest convenience. .PP The following options are implemented: .IP "\fB-c \fIconfig_dir\fR" -The absolute path to a directory with Postfix configuration files. +Read the \fBmain.cf\fR and \fBmaster.cf\fR configuration files in +the named directory instead of the default configuration directory. Use this to distinguish between multiple Postfix instances on the same host. .IP "\fB-D\fR (with \fBpostfix start\fR only)" diff --git a/postfix/man/man1/postkick.1 b/postfix/man/man1/postkick.1 index 3b48ef77f..67d647e91 100644 --- a/postfix/man/man1/postkick.1 +++ b/postfix/man/man1/postkick.1 @@ -21,8 +21,8 @@ for use in, for example, shell scripts. Options: .IP "\fB-c\fR \fIconfig_dir\fR" -Read configuration information from \fBmain.cf\fR in the named -configuration directory. +Read the \fBmain.cf\fR configuration file in the named directory +instead of the default configuration directory. .IP \fB-v\fR Enable verbose logging for debugging purposes. Multiple \fB-v\fR options make the software increasingly verbose. diff --git a/postfix/man/man1/postlock.1 b/postfix/man/man1/postlock.1 index 586eca3ea..6cec0621c 100644 --- a/postfix/man/man1/postlock.1 +++ b/postfix/man/man1/postlock.1 @@ -20,8 +20,8 @@ compatible with the Postfix UNIX-style local delivery agent. Options: .IP "\fB-c \fIconfig_dir\fR" -Read configuration information from \fBmain.cf\fR in the named -configuration directory. +Read the \fBmain.cf\fR configuration file in the named directory +instead of the default configuration directory. .IP \fB-v\fR Enable verbose logging for debugging purposes. Multiple \fB-v\fR options make the software increasingly verbose. diff --git a/postfix/man/man1/postmap.1 b/postfix/man/man1/postmap.1 index 0b8b593ee..1db5db8ac 100644 --- a/postfix/man/man1/postmap.1 +++ b/postfix/man/man1/postmap.1 @@ -9,8 +9,8 @@ Postfix lookup table management .na .nf .fi -\fBpostmap\fR [\fB-Ninvw\fR] [\fB-c \fIconfig_dir\fR] [\fB-q \fIkey\fR] -[\fIfile_type\fR:]\fIfile_name\fR ... +\fBpostmap\fR [\fB-Ninvw\fR] [\fB-c \fIconfig_dir\fR] [\fB-d \fIkey\fR] +[\fB-q \fIkey\fR] [\fIfile_type\fR:]\fIfile_name\fR ... .SH DESCRIPTION .ad .fi @@ -49,7 +49,11 @@ Include the terminating null character that terminates lookup keys and values. By default, Postfix does whatever is the default for the host operating system. .IP "\fB-c \fIconfig_dir\fR" -Read the \fBmain.cf\fR configuration file in the named directory. +Read the \fBmain.cf\fR configuration file in the named directory +instead of the default configuration directory. +.IP "\fB-d \fIkey\fR" +Search the specified maps for \fIkey\fR and remove one entry per map. +The exit status is non-zero if the requested information was not found. .IP \fB-i\fR Incremental mode. Read entries from standard input and do not truncate an existing database. By default, \fBpostmap\fR creates @@ -66,7 +70,8 @@ if the requested information was not found. Enable verbose logging for debugging purposes. Multiple \fB-v\fR options make the software increasingly verbose. .IP \fB-w\fR -Do not warn about duplicate entries; silently ignore them. +When updating a table, do not warn about duplicate entries; silently +ignore them. .PP Arguments: .IP \fIfile_type\fR @@ -94,6 +99,11 @@ The name of the lookup table source file when rebuilding a database. Problems and transactions are logged to the standard error stream. No output means no problems. Duplicate entries are skipped and are flagged with a warning. +.SH BUGS +.ad +.fi +The "delete key" support is limited to one delete operation +per command invocation. .SH ENVIRONMENT .na .nf diff --git a/postfix/man/man8/master.8 b/postfix/man/man8/master.8 index 8293ef493..855d3ee20 100644 --- a/postfix/man/man8/master.8 +++ b/postfix/man/man8/master.8 @@ -33,7 +33,7 @@ respective daemons. Options: .IP "\fB-c \fIconfig_dir\fR" Read the \fBmain.cf\fR and \fBmaster.cf\fR configuration files in -the named directory. +the named directory instead of the default configuration directory. .IP \fB-D\fR After initialization, run a debugger on the master process. The debugging command is specified with the \fBdebugger_command\fR in diff --git a/postfix/man/man8/smtp.8 b/postfix/man/man8/smtp.8 index a4fc99e3c..cee4dac96 100644 --- a/postfix/man/man8/smtp.8 +++ b/postfix/man/man8/smtp.8 @@ -101,6 +101,8 @@ avoid mail delivery loops. .IP \fBnotify_classes\fR When this parameter includes the \fBprotocol\fR class, send mail to the postmaster with transcripts of SMTP sessions with protocol errors. +.IP \fBsmtp_always_send_ehlo\fR +Always send EHLO at the start of a connection. .IP \fBsmtp_skip_4xx_greeting\fR Skip servers that greet us with a 4xx status code. .IP \fBsmtp_skip_5xx_greeting\fR diff --git a/postfix/master/.indent.pro b/postfix/master/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/master/.indent.pro +++ b/postfix/master/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/master/master.c b/postfix/master/master.c index ecc70bf18..8bcbf4e66 100644 --- a/postfix/master/master.c +++ b/postfix/master/master.c @@ -27,7 +27,7 @@ /* Options: /* .IP "\fB-c \fIconfig_dir\fR" /* Read the \fBmain.cf\fR and \fBmaster.cf\fR configuration files in -/* the named directory. +/* the named directory instead of the default configuration directory. /* .IP \fB-D\fR /* After initialization, run a debugger on the master process. The /* debugging command is specified with the \fBdebugger_command\fR in diff --git a/postfix/master/multi_server.c b/postfix/master/multi_server.c index 8e1bebd4b..1f58f2170 100644 --- a/postfix/master/multi_server.c +++ b/postfix/master/multi_server.c @@ -62,26 +62,34 @@ /* order as specified, and multiple instances of the same type /* are allowed. Raw parameters are not subjected to $name /* evaluation. -/* .IP "MAIL_SERVER_PRE_INIT (void *(char *service_name char **argv))" +/* .IP "MAIL_SERVER_PRE_INIT (void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has read the global configuration file /* and after it has processed command-line arguments, but before /* the skeleton has optionally relinquished the process privileges. -/* .IP "MAIL_SERVER_POST_INIT (void *(char *service_name char **argv))" +/* .sp +/* Only the last instance of this parameter type is remembered. +/* .IP "MAIL_SERVER_POST_INIT (void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has optionally relinquished the process /* privileges, but before servicing client connection requests. -/* .IP "MAIL_SERVER_LOOP (int *(char *service_name char **argv))" +/* .sp +/* Only the last instance of this parameter type is remembered. +/* .IP "MAIL_SERVER_LOOP (int *(char *service_name, char **argv))" /* A pointer to function that is executed from /* within the event loop, whenever an I/O or timer event has happened, /* or whenever nothing has happened for a specified amount of time. /* The result value of the function specifies how long to wait until /* the next event. Specify -1 to wait for "as long as it takes". -/* .IP "MAIL_SERVER_EXIT (void *(char *service_name char **argv))" +/* .sp +/* Only the last instance of this parameter type is remembered. +/* .IP "MAIL_SERVER_EXIT (void *(char *service_name, char **argv))" /* A pointer to function that is executed immediately before normal /* process termination. -/* .IP "MAIL_SERVER_PRE_ACCEPT (void *(char *service_name char **argv))" +/* .IP "MAIL_SERVER_PRE_ACCEPT (void *(char *service_name, char **argv))" /* Function to be executed prior to accepting a new connection. +/* .sp +/* Only the last instance of this parameter type is remembered. /* .PP /* multi_server_disconnect() should be called by the application /* when a client disconnects. diff --git a/postfix/master/single_server.c b/postfix/master/single_server.c index 328e35c66..7f64733c6 100644 --- a/postfix/master/single_server.c +++ b/postfix/master/single_server.c @@ -57,26 +57,36 @@ /* order as specified, and multiple instances of the same type /* are allowed. Raw parameters are not subjected to $name /* evaluation. -/* .IP "MAIL_SERVER_PRE_INIT (void *(char *service_name char **argv))" +/* .IP "MAIL_SERVER_PRE_INIT (void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has read the global configuration file /* and after it has processed command-line arguments, but before /* the skeleton has optionally relinquished the process privileges. -/* .IP "MAIL_SERVER_POST_INIT (void *(char *service_name char **argv))" +/* .sp +/* Only the last instance of this parameter type is remembered. +/* .IP "MAIL_SERVER_POST_INIT (void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has optionally relinquished the process /* privileges, but before servicing client connection requests. -/* .IP "MAIL_SERVER_LOOP (int *(char *service_name char **argv))" +/* .sp +/* Only the last instance of this parameter type is remembered. +/* .IP "MAIL_SERVER_LOOP (int *(char *service_name, char **argv))" /* A pointer to function that is executed from /* within the event loop, whenever an I/O or timer event has happened, /* or whenever nothing has happened for a specified amount of time. /* The result value of the function specifies how long to wait until /* the next event. Specify -1 to wait for "as long as it takes". +/* .sp +/* Only the last instance of this parameter type is remembered. /* .IP "MAIL_SERVER_EXIT (void *(void))" /* A pointer to function that is executed immediately before normal /* process termination. -/* .IP "MAIL_SERVER_PRE_ACCEPT (void *(char *service_name char **argv))" +/* .sp +/* Only the last instance of this parameter type is remembered. +/* .IP "MAIL_SERVER_PRE_ACCEPT (void *(char *service_name, char **argv))" /* Function to be executed prior to accepting a new connection. +/* .sp +/* Only the last instance of this parameter type is remembered. /* .PP /* The var_use_limit variable limits the number of clients that /* a server can service before it commits suicide. diff --git a/postfix/master/trigger_server.c b/postfix/master/trigger_server.c index 23bdf3b19..60a00f880 100644 --- a/postfix/master/trigger_server.c +++ b/postfix/master/trigger_server.c @@ -69,21 +69,31 @@ /* by the skeleton after it has read the global configuration file /* and after it has processed command-line arguments, but before /* the skeleton has optionally relinquished the process privileges. +/* .sp +/* Only the last instance of this parameter type is remembered. /* .IP "MAIL_SERVER_POST_INIT (void *(char *service_name, char **argv))" /* A pointer to a function that is called once /* by the skeleton after it has optionally relinquished the process /* privileges, but before servicing client connection requests. +/* .sp +/* Only the last instance of this parameter type is remembered. /* .IP "MAIL_SERVER_LOOP (int *(char *service_name, char **argv))" /* A pointer to function that is executed from /* within the event loop, whenever an I/O or timer event has happened, /* or whenever nothing has happened for a specified amount of time. /* The result value of the function specifies how long to wait until /* the next event. Specify -1 to wait for "as long as it takes". +/* .sp +/* Only the last instance of this parameter type is remembered. /* .IP "MAIL_SERVER_EXIT (void *(char *service_name, char **argv))" /* A pointer to function that is executed immediately before normal /* process termination. +/* .sp +/* Only the last instance of this parameter type is remembered. /* .IP "MAIL_SERVER_PRE_ACCEPT (void *(char *service_name, char **argv))" /* Function to be executed prior to accepting a new request. +/* .sp +/* Only the last instance of this parameter type is remembered. /* .PP /* The var_use_limit variable limits the number of clients that /* a server can service before it commits suicide. diff --git a/postfix/pickup/.indent.pro b/postfix/pickup/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/pickup/.indent.pro +++ b/postfix/pickup/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/pickup/pickup.c b/postfix/pickup/pickup.c index 1c76dd2cb..0f1b30bf5 100644 --- a/postfix/pickup/pickup.c +++ b/postfix/pickup/pickup.c @@ -36,19 +36,19 @@ /* CONFIGURATION PARAMETERS /* .ad /* .fi -/* The following \fBmain.cf\fR parameters are especially relevant to -/* this program. See the Postfix \fBmain.cf\fR file for syntax details -/* and for default values. Use the \fBpostfix reload\fR command after -/* a configuration change. +/* The following \fBmain.cf\fR parameters are especially relevant to +/* this program. See the Postfix \fBmain.cf\fR file for syntax details +/* and for default values. Use the \fBpostfix reload\fR command after +/* a configuration change. /* .SH Miscellaneous /* .ad /* .fi /* .IP \fBalways_bcc\fR /* Address to send a copy of each message that enters the system. /* .IP \fBmail_owner\fR -/* The process privileges used while not opening a \fBmaildrop\fR file. +/* The process privileges used while not opening a \fBmaildrop\fR file. /* .IP \fBqueue_directory\fR -/* Top-level directory of the Postfix queue. +/* Top-level directory of the Postfix queue. /* SEE ALSO /* cleanup(8) message canonicalization /* master(8) process manager diff --git a/postfix/pipe/.indent.pro b/postfix/pipe/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/pipe/.indent.pro +++ b/postfix/pipe/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/postalias/.indent.pro b/postfix/postalias/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/postalias/.indent.pro +++ b/postfix/postalias/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/postalias/postalias.c b/postfix/postalias/postalias.c index 2b002e88a..dedf87c8e 100644 --- a/postfix/postalias/postalias.c +++ b/postfix/postalias/postalias.c @@ -6,7 +6,8 @@ /* SYNOPSIS /* .fi /* \fBpostalias\fR [\fB-Ninvw\fR] [\fB-c \fIconfig_dir\fR] -/* [\fB-q \fIkey\fR] [\fIfile_type\fR:]\fIfile_name\fR ... +/* [\fB-d \fIkey\fR] [\fB-q \fIkey\fR] +/* [\fIfile_type\fR:]\fIfile_name\fR ... /* DESCRIPTION /* The \fBpostalias\fR command creates or queries one or more Postfix /* alias databases, or updates an existing one. The input and output @@ -24,7 +25,11 @@ /* and values. By default, Postfix does whatever is the default for /* the host operating system. /* .IP "\fB-c \fIconfig_dir\fR" -/* Read the \fBmain.cf\fR configuration file in the named directory. +/* Read the \fBmain.cf\fR configuration file in the named directory +/* instead of the default configuration directory. +/* .IP "\fB-d \fIkey\fR" +/* Search the specified maps for \fIkey\fR and remove one entry per map. +/* The exit status is non-zero if the requested information was not found. /* .IP \fB-i\fR /* Incremental mode. Read entries from standard input and do not /* truncate an existing database. By default, \fBpostalias\fR creates @@ -41,7 +46,8 @@ /* Enable verbose logging for debugging purposes. Multiple \fB-v\fR /* options make the software increasingly verbose. /* .IP \fB-w\fR -/* Do not warn about duplicate entries; silently ignore them. +/* When updating a table, do not warn about duplicate entries; silently +/* ignore them. /* .PP /* Arguments: /* .IP \fIfile_type\fR @@ -68,6 +74,9 @@ /* Problems are logged to the standard error stream. No output means /* no problems were detected. Duplicate entries are skipped and are /* flagged with a warning. +/* BUGS +/* The "delete key" support is limited to one delete operation +/* per command invocation. /* ENVIRONMENT /* .ad /* .fi @@ -301,11 +310,29 @@ static int postalias_query(const char *map_type, const char *map_name, return (value != 0); } +/* postalias_delete - delete a key value pair from a map */ + +static int postalias_delete(const char *map_type, const char *map_name, + const char *key) +{ + DICT *dict; + int status; + + /* + * XXX This must be generalized to multi-key (read from stdin) and + * multi-map (given on command line) updates. + */ + dict = dict_open3(map_type, map_name, O_RDWR, DICT_FLAG_LOCK); + status = dict_del(dict, key); + dict_close(dict); + return (status); +} + /* usage - explain */ static NORETURN usage(char *myname) { - msg_fatal("usage: %s [-Ninvw] [-c config_dir] [-q key] [map_type:]file...", + msg_fatal("usage: %s [-Ninvw] [-c config_dir] [-d key] [-q key] [map_type:]file...", myname); } @@ -319,6 +346,7 @@ int main(int argc, char **argv) int open_flags = O_RDWR | O_CREAT | O_TRUNC; int dict_flags = DICT_FLAG_DUP_WARN; char *query = 0; + char *delkey = 0; int found; /* @@ -354,7 +382,7 @@ int main(int argc, char **argv) /* * Parse JCL. */ - while ((ch = GETOPT(argc, argv, "Nc:inq:vw")) > 0) { + while ((ch = GETOPT(argc, argv, "Nc:d:inq:vw")) > 0) { switch (ch) { default: usage(argv[0]); @@ -367,6 +395,11 @@ int main(int argc, char **argv) if (setenv(CONF_ENV_PATH, optarg, 1) < 0) msg_fatal("out of memory"); break; + case 'd': + if (query || delkey) + msg_fatal("specify only one of -q or -d"); + delkey = optarg; + break; case 'i': open_flags &= ~O_TRUNC; break; @@ -375,6 +408,8 @@ int main(int argc, char **argv) dict_flags &= ~DICT_FLAG_TRY1NULL; break; case 'q': + if (query || delkey) + msg_fatal("specify only one of -q or -d"); query = optarg; break; case 'v': @@ -392,19 +427,20 @@ int main(int argc, char **argv) * Use the map type specified by the user, or fall back to a default * database type. */ - if (query == 0) { /* create/update map(s) */ + if (delkey) { /* remove entry */ if (optind + 1 > argc) usage(argv[0]); + found = 0; while (optind < argc) { if ((path_name = split_at(argv[optind], ':')) != 0) { - postalias(argv[optind], path_name, open_flags, dict_flags); + found |= postalias_delete(argv[optind], path_name, delkey); } else { - postalias(var_db_type, argv[optind], open_flags, dict_flags); + found |= postalias_delete(var_db_type, argv[optind], delkey); } optind++; } - exit(0); - } else { /* query map(s) */ + exit(found ? 0 : 1); + } else if (query) { /* query map(s) */ if (optind + 1 > argc) usage(argv[0]); while (optind < argc) { @@ -418,5 +454,17 @@ int main(int argc, char **argv) optind++; } exit(1); + } else { /* create/update map(s) */ + if (optind + 1 > argc) + usage(argv[0]); + while (optind < argc) { + if ((path_name = split_at(argv[optind], ':')) != 0) { + postalias(argv[optind], path_name, open_flags, dict_flags); + } else { + postalias(var_db_type, argv[optind], open_flags, dict_flags); + } + optind++; + } + exit(0); } } diff --git a/postfix/postcat/.indent.pro b/postfix/postcat/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/postcat/.indent.pro +++ b/postfix/postcat/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/postconf/.indent.pro b/postfix/postconf/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/postconf/.indent.pro +++ b/postfix/postconf/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/postconf/extract.awk b/postfix/postconf/extract.awk index 53b83b485..8cd8cfc09 100644 --- a/postfix/postconf/extract.awk +++ b/postfix/postconf/extract.awk @@ -3,19 +3,19 @@ /^(static| )*CONFIG_INT_TABLE .*{/,/};/ { if ($1 ~ /VAR/) { print "int " substr($3,2,length($3)-2) ";" > "int_vars.h" - print | "sort -u >int_table.h" + print | "sed 's/[ ][ ]*/ /g' | sort -u >int_table.h" } } /^(static| )*CONFIG_STR_TABLE .*{/,/};/ { if ($1 ~ /VAR/) { print "char *" substr($3,2,length($3)-2) ";" > "str_vars.h" - print | "sort -u >str_table.h" + print | "sed 's/[ ][ ]*/ /g' | sort -u >str_table.h" } } /^(static| )*CONFIG_BOOL_TABLE .*{/,/};/ { if ($1 ~ /VAR/) { print "int " substr($3,2,length($3)-2) ";" > "bool_vars.h" - print | "sort -u >bool_table.h" + print | "sed 's/[ ][ ]*/ /g' | sort -u >bool_table.h" } } diff --git a/postfix/postconf/postconf.c b/postfix/postconf/postconf.c index f4695a44d..9062d63af 100644 --- a/postfix/postconf/postconf.c +++ b/postfix/postconf/postconf.c @@ -18,7 +18,8 @@ /* /* Options: /* .IP "\fB-c \fIconfig_dir\fR" -/* The \fBmain.cf\fR configuration file is in the named directory. +/* The \fBmain.cf\fR configuration file is in the named directory +/* instead of the default configuration directory. /* .IP \fB-d\fR /* Print default parameter settings instead of actual settings. /* .IP \fB-e\fR diff --git a/postfix/postdrop/.indent.pro b/postfix/postdrop/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/postdrop/.indent.pro +++ b/postfix/postdrop/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/postfix/.indent.pro b/postfix/postfix/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/postfix/.indent.pro +++ b/postfix/postfix/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/postfix/postfix.c b/postfix/postfix/postfix.c index 80ca7dca8..0d0edc889 100644 --- a/postfix/postfix/postfix.c +++ b/postfix/postfix/postfix.c @@ -42,7 +42,8 @@ /* .PP /* The following options are implemented: /* .IP "\fB-c \fIconfig_dir\fR" -/* The absolute path to a directory with Postfix configuration files. +/* Read the \fBmain.cf\fR and \fBmaster.cf\fR configuration files in +/* the named directory instead of the default configuration directory. /* Use this to distinguish between multiple Postfix instances on the /* same host. /* .IP "\fB-D\fR (with \fBpostfix start\fR only)" diff --git a/postfix/postkick/.indent.pro b/postfix/postkick/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/postkick/.indent.pro +++ b/postfix/postkick/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/postkick/postkick.c b/postfix/postkick/postkick.c index 453277a00..c756c14ae 100644 --- a/postfix/postkick/postkick.c +++ b/postfix/postkick/postkick.c @@ -15,8 +15,8 @@ /* /* Options: /* .IP "\fB-c\fR \fIconfig_dir\fR" -/* Read configuration information from \fBmain.cf\fR in the named -/* configuration directory. +/* Read the \fBmain.cf\fR configuration file in the named directory +/* instead of the default configuration directory. /* .IP \fB-v\fR /* Enable verbose logging for debugging purposes. Multiple \fB-v\fR /* options make the software increasingly verbose. @@ -43,9 +43,9 @@ /* CONFIGURATION PARAMETERS /* .ad /* .fi -/* The following \fBmain.cf\fR parameters are especially relevant to -/* this program. See the Postfix \fBmain.cf\fR file for syntax details -/* and for default values. +/* The following \fBmain.cf\fR parameters are especially relevant to +/* this program. See the Postfix \fBmain.cf\fR file for syntax details +/* and for default values. /* .IP \fBqueue_directory\fR /* Location of the Postfix queue, and of the local IPC communication /* endpoints. diff --git a/postfix/postlock/.indent.pro b/postfix/postlock/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/postlock/.indent.pro +++ b/postfix/postlock/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/postlock/postlock.c b/postfix/postlock/postlock.c index ea9ec6aa6..b810d8829 100644 --- a/postfix/postlock/postlock.c +++ b/postfix/postlock/postlock.c @@ -14,8 +14,8 @@ /* /* Options: /* .IP "\fB-c \fIconfig_dir\fR" -/* Read configuration information from \fBmain.cf\fR in the named -/* configuration directory. +/* Read the \fBmain.cf\fR configuration file in the named directory +/* instead of the default configuration directory. /* .IP \fB-v\fR /* Enable verbose logging for debugging purposes. Multiple \fB-v\fR /* options make the software increasingly verbose. @@ -46,9 +46,9 @@ /* CONFIGURATION PARAMETERS /* .ad /* .fi -/* The following \fBmain.cf\fR parameters are especially relevant to -/* this program. See the Postfix \fBmain.cf\fR file for syntax details -/* and for default values. +/* The following \fBmain.cf\fR parameters are especially relevant to +/* this program. See the Postfix \fBmain.cf\fR file for syntax details +/* and for default values. /* .SH "Locking controls" /* .ad /* .fi diff --git a/postfix/postlog/.indent.pro b/postfix/postlog/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/postlog/.indent.pro +++ b/postfix/postlog/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/postmap/.indent.pro b/postfix/postmap/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/postmap/.indent.pro +++ b/postfix/postmap/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/postmap/postmap.c b/postfix/postmap/postmap.c index d42909c13..3743bd971 100644 --- a/postfix/postmap/postmap.c +++ b/postfix/postmap/postmap.c @@ -5,8 +5,8 @@ /* Postfix lookup table management /* SYNOPSIS /* .fi -/* \fBpostmap\fR [\fB-Ninvw\fR] [\fB-c \fIconfig_dir\fR] [\fB-q \fIkey\fR] -/* [\fIfile_type\fR:]\fIfile_name\fR ... +/* \fBpostmap\fR [\fB-Ninvw\fR] [\fB-c \fIconfig_dir\fR] [\fB-d \fIkey\fR] +/* [\fB-q \fIkey\fR] [\fIfile_type\fR:]\fIfile_name\fR ... /* DESCRIPTION /* The \fBpostmap\fR command creates or queries one or more Postfix /* lookup tables, or updates an existing one. The input and output @@ -43,7 +43,11 @@ /* and values. By default, Postfix does whatever is the default for /* the host operating system. /* .IP "\fB-c \fIconfig_dir\fR" -/* Read the \fBmain.cf\fR configuration file in the named directory. +/* Read the \fBmain.cf\fR configuration file in the named directory +/* instead of the default configuration directory. +/* .IP "\fB-d \fIkey\fR" +/* Search the specified maps for \fIkey\fR and remove one entry per map. +/* The exit status is non-zero if the requested information was not found. /* .IP \fB-i\fR /* Incremental mode. Read entries from standard input and do not /* truncate an existing database. By default, \fBpostmap\fR creates @@ -60,7 +64,8 @@ /* Enable verbose logging for debugging purposes. Multiple \fB-v\fR /* options make the software increasingly verbose. /* .IP \fB-w\fR -/* Do not warn about duplicate entries; silently ignore them. +/* When updating a table, do not warn about duplicate entries; silently +/* ignore them. /* .PP /* Arguments: /* .IP \fIfile_type\fR @@ -86,6 +91,9 @@ /* Problems and transactions are logged to the standard error /* stream. No output means no problems. Duplicate entries are /* skipped and are flagged with a warning. +/* BUGS +/* The "delete key" support is limited to one delete operation +/* per command invocation. /* ENVIRONMENT /* .ad /* .fi @@ -255,11 +263,29 @@ static int postmap_query(const char *map_type, const char *map_name, return (value != 0); } +/* postmap_delete - delete a (key, value) pair from a map */ + +static int postmap_delete(const char *map_type, const char *map_name, + const char *key) +{ + DICT *dict; + int status; + + /* + * XXX This must be generalized to multi-key (read from stdin) and + * multi-map (given on command line) updates. + */ + dict = dict_open3(map_type, map_name, O_RDWR, DICT_FLAG_LOCK); + status = dict_del(dict, key); + dict_close(dict); + return (status); +} + /* usage - explain */ static NORETURN usage(char *myname) { - msg_fatal("usage: %s [-Ninvw] [-c config_dir] [-q key] [map_type:]file...", + msg_fatal("usage: %s [-Ninvw] [-c config_dir] [-d key] [-q key] [map_type:]file...", myname); } @@ -273,6 +299,7 @@ int main(int argc, char **argv) int open_flags = O_RDWR | O_CREAT | O_TRUNC; int dict_flags = DICT_FLAG_DUP_WARN; char *query = 0; + char *delkey = 0; int found; /* @@ -308,7 +335,7 @@ int main(int argc, char **argv) /* * Parse JCL. */ - while ((ch = GETOPT(argc, argv, "Nc:inq:vw")) > 0) { + while ((ch = GETOPT(argc, argv, "Nc:d:inq:vw")) > 0) { switch (ch) { default: usage(argv[0]); @@ -321,6 +348,11 @@ int main(int argc, char **argv) if (setenv(CONF_ENV_PATH, optarg, 1) < 0) msg_fatal("out of memory"); break; + case 'd': + if (query || delkey) + msg_fatal("specify only one of -q or -d"); + delkey = optarg; + break; case 'i': open_flags &= ~O_TRUNC; break; @@ -329,6 +361,8 @@ int main(int argc, char **argv) dict_flags &= ~DICT_FLAG_TRY1NULL; break; case 'q': + if (query || delkey) + msg_fatal("specify only one of -q or -d"); query = optarg; break; case 'v': @@ -346,19 +380,20 @@ int main(int argc, char **argv) * Use the map type specified by the user, or fall back to a default * database type. */ - if (query == 0) { /* create/update map(s) */ + if (delkey) { /* remove entry */ if (optind + 1 > argc) usage(argv[0]); + found = 0; while (optind < argc) { if ((path_name = split_at(argv[optind], ':')) != 0) { - postmap(argv[optind], path_name, open_flags, dict_flags); + found |= postmap_delete(argv[optind], path_name, delkey); } else { - postmap(var_db_type, argv[optind], open_flags, dict_flags); + found |= postmap_delete(var_db_type, argv[optind], delkey); } optind++; } - exit(0); - } else { /* query map(s) */ + exit(found ? 0 : 1); + } else if (query) { /* query map(s) */ if (optind + 1 > argc) usage(argv[0]); while (optind < argc) { @@ -372,5 +407,17 @@ int main(int argc, char **argv) optind++; } exit(1); + } else { /* create/update map(s) */ + if (optind + 1 > argc) + usage(argv[0]); + while (optind < argc) { + if ((path_name = split_at(argv[optind], ':')) != 0) { + postmap(argv[optind], path_name, open_flags, dict_flags); + } else { + postmap(var_db_type, argv[optind], open_flags, dict_flags); + } + optind++; + } + exit(0); } } diff --git a/postfix/postsuper/.indent.pro b/postfix/postsuper/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/postsuper/.indent.pro +++ b/postfix/postsuper/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/postsuper/postsuper.c b/postfix/postsuper/postsuper.c index 18c2c9b28..ccd3f09af 100644 --- a/postfix/postsuper/postsuper.c +++ b/postfix/postsuper/postsuper.c @@ -36,8 +36,8 @@ /* CONFIGURATION PARAMETERS /* .ad /* .fi -/* See the Postfix \fBmain.cf\fR file for syntax details and for -/* default values. +/* See the Postfix \fBmain.cf\fR file for syntax details and for +/* default values. /* .IP \fBhash_queue_depth\fR /* Number of subdirectory levels for hashed queues. /* .IP \fBhash_queue_names\fR diff --git a/postfix/proto/Makefile.in b/postfix/proto/Makefile.in new file mode 100644 index 000000000..02397426d --- /dev/null +++ b/postfix/proto/Makefile.in @@ -0,0 +1,44 @@ +SHELL = /bin/sh + +# For now, just hard-coded rules. + +CONFIG = ../conf/access ../conf/aliases ../conf/canonical ../conf/relocated \ + ../conf/transport ../conf/virtual ../conf/pcre_table \ + ../conf/regexp_table + +update: $(CONFIG) + +Makefile: Makefile.in + (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@ + +clean: + : + +tidy: clean + +clobber: + rm -f $(CONFIG) + +../conf/access: access + srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@ + +../conf/aliases: aliases0 aliases + (cat aliases0; srctoman - aliases | nroff -man | col -bx | uniq | sed 's/^/# /') >$@ + +../conf/canonical: canonical + srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@ + +../conf/pcre_table: pcre_table + srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@ + +../conf/regexp_table: regexp_table + srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@ + +../conf/relocated: relocated + srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@ + +../conf/transport: transport + srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@ + +../conf/virtual: virtual + srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@ diff --git a/postfix/proto/access b/postfix/proto/access new file mode 100644 index 000000000..e994a9473 --- /dev/null +++ b/postfix/proto/access @@ -0,0 +1,103 @@ +#++ +# NAME +# access 5 +# SUMMARY +# format of Postfix access table +# SYNOPSIS +# \fBpostmap /etc/postfix/access\fR +# DESCRIPTION +# The optional \fBaccess\fR table directs the Postfix SMTP server +# to selectively reject or accept mail from or to specific hosts, +# domains, networks, host addresses or mail addresses. +# +# Normally, the table serves as input to the \fBpostmap\fR(1) command. +# The result, an indexed file in \fBdbm\fR or \fBdb\fR format, +# is used for fast searching by the mail system. After an update +# it may take a minute or so before the change becomes visible. +# Issue a \fBpostfix reload\fR command to eliminate the delay. +# +# When the table is provided via other means such as NIS, LDAP +# or SQL, the same lookups are done as for ordinary indexed files. +# +# Alternatively, the table can be provided as a regular-expression +# map where patterns are given as regular expressions. In that case, +# the lookups are done in a slightly different way as described below. +# TABLE FORMAT +# .ad +# .fi +# The format of the access table is as follows: +# .IP "blanks and comments" +# Blank lines are ignored, as are lines beginning with `#'. +# .IP "\fIpattern action\fR" +# When \fIpattern\fR matches a mail address, domain or host address, +# perform the corresponding \fIaction\fR. +# PATTERNS +# .ad +# .fi +# With lookups from indexed files such as DB or DBM, or from networked +# tables such as NIS, LDAP or SQL, patterns are tried in the order as +# listed below: +# .IP \fIuser\fR@\fIdomain\fR +# Matches the specified mail address. +# .IP \fIdomain.name\fR +# Matches the \fIdomain.name\fR itself and any subdomain thereof, +# either in hostnames or in mail addresses. Top-level domains will +# never be matched. +# .IP \fIuser\fR@ +# Matches all mail addresses with the specified user part. +# .IP \fInet.work.addr.ess\fR +# .IP \fInet.work.addr\fR +# .IP \fInet.work\fR +# .IP \fInet\fR +# Matches any host address in the specified network. A network +# address is a sequence of one or more octets separated by ".". +# ACTIONS +# .ad +# .fi +# .IP "[\fB45\fR]\fIXX text\fR" +# Reject the address etc. that matches the pattern, and respond with +# the numerical code and text. +# .IP \fBREJECT\fR +# Reject the address etc. that matches the pattern. A generic +# error response message is generated. +# .IP \fBOK\fR +# .IP "\fIAny other text\fR" +# Accept the address etc. that matches the pattern. +# REGULAR EXPRESSION TABLES +# .ad +# .fi +# This section describes how the table lookups change when the table +# is given in the form of regular expressions. For a description of +# regular expression lookup table syntax, see \fBregexp_table\fR(5) +# or \fBpcre_table\fR(5). +# +# Each pattern is a regular expression that is applied to the entire +# string being looked up. Depending on the application, that string +# is an entire client hostname, an entire client IP address, or an +# entire mail address. Thus, no parent domain or parent network search +# is done, and \fIuser@domain\fR mail addresses are not broken up into +# their \fIuser@\fR and \fIdomain\fR constituent parts. +# +# Patterns are applied in the order as specified in the table, until a +# pattern is found that matches the search string. +# +# Actions are the same as with normal indexed file lookups, with +# the additional feature that parenthesized substrings from the +# pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on. +# BUGS +# The table format does not understand quoting conventions. +# SEE ALSO +# postmap(1) create mapping table +# smtpd(8) smtp server +# pcre_table(5) format of PCRE tables +# regexp_table(5) format of POSIX regular expression tables +# LICENSE +# .ad +# .fi +# The Secure Mailer license must be distributed with this software. +# AUTHOR(S) +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +#-- diff --git a/postfix/proto/aliases b/postfix/proto/aliases new file mode 100644 index 000000000..9e2edc344 --- /dev/null +++ b/postfix/proto/aliases @@ -0,0 +1,152 @@ +# +# >>>>>>>>>> The program "newaliases" must be run after +# >> NOTE >> this file is updated for any changes to +# >>>>>>>>>> show through to Postfix. +# + +# Basic system aliases -- these MUST be present +MAILER-DAEMON: postmaster +postmaster: root + +# General redirections for pseudo accounts +bin: root +daemon: root +named: root +nobody: root +uucp: root +www: root +ftp-bugs: root +postfix: root + +# Put your local aliases here. + +# Well-known aliases +manager: root +dumper: root +operator: root +abuse: postmaster + +# trap decode to catch security attacks +decode: root + +# Person who should get root's mail +#root: you + +#++ +# NAME +# aliases 5 +# SUMMARY +# format of the Postfix alias database +# SYNOPSIS +# .fi +# \fBpostalias\fR [\fB-c\fR \fIconfig_dir\fR] [\fB-v\fR] +# [\fIfile_type\fR:]\fIinput_file\fR +# DESCRIPTION +# The \fBaliases\fR file provides a system-wide mechanism to +# redirect mail for local recipients. +# +# The file serves as input to the \fBpostalias\fR(1) command. The +# result, an indexed file in \fBdbm\fR or \fBdb\fR format, is +# used for fast lookup by the mail system. After an update +# it may take a minute or so before the change becomes visible. +# Issue a \fBpostfix reload\fR command to eliminate the delay. +# +# The input and output file formats are expected to be compatible +# with Sendmail version 8, and are expected to be suitable for the +# use as NIS maps. +# +# Users can control delivery of their own mail by setting +# up \fB.forward\fR files in their home directory. +# Lines in per-user \fB.forward\fR files have the same syntax +# as the right-hand side of \fBaliases\fR entries. +# +# The format of the alias database input file is as follows: +# .IP \(bu +# An alias definition has the form +# .sp +# .ti +5 +# \fIname\fR: \fIvalue1\fR, \fIvalue2\fR, \fI...\fR +# .IP \(bu +# Lines that begin with whitespace continue the previous line. +# .IP \(bu +# Blank lines are ignored, as are lines beginning with `#'. +# .PP +# The \fIname\fR is a local address (no domain part). +# Use double quotes when the name contains any special characters +# such as whitespace, `#', `:', or `@'. The \fIname\fR is folded to +# lowercase, in order to make database lookups case insensitive. +# .PP +# In addition, when an alias exists for \fBowner-\fIname\fR, delivery +# diagnostics are directed to that address, instead of to the originator. +# This is typically used to direct delivery errors to the owner of +# a mailing list, who is in a better position to deal with mailing +# list delivery problems than the originator of the undelivered mail. +# .PP +# The \fIvalue\fR contains one or more of the following: +# .IP \fIaddress\fR +# Mail is forwarded to \fIaddress\fR, which is compatible +# with the RFC 822 standard. +# .IP \fI/file/name\fR +# Mail is appended to \fI/file/name\fR. See \fBlocal\fR(8) +# for details of delivery to file. +# Delivery is not limited to regular files. For example, to dispose +# of unwanted mail, deflect it to \fB/dev/null\fR. +# .IP "|\fIcommand\fR" +# Mail is piped into \fIcommand\fR. Commands that contain special +# characters, such as whitespace, should be enclosed between double +# quotes. See \fBlocal\fR(8) for details of delivery to command. +# .sp +# When the command fails, a limited amount of command output is +# mailed back to the sender. The file \fB/usr/include/sysexits.h\fR +# defines the expected exit status codes. For example, use +# \fB|"exit 67"\fR to simulate a "user unknown" error, and +# \fB|"exit 0"\fR to implement an expensive black hole. +# .IP \fB:include:\fI/file/name\fR +# Mail is sent to the destinations listed in the named file. +# Lines in \fB:include:\fR files have the same syntax +# as the right-hand side of alias entries. +# .sp +# A destination can be any destination that is described in this +# manual page. However, delivery to "|\fIcommand\fR" and +# \fI/file/name\fR is disallowed by default. To enable, edit the +# \fBallow_mail_to_commands\fR and \fBallow_mail_to_files\fR +# configuration parameters. +# ADDRESS EXTENSION +# .ad +# .fi +# When alias database search fails, and the recipient localpart +# contains the optional recipient delimiter (e.g., \fIuser+foo\fR), +# the search is repeated for the unextended address (e.g., \fIuser\fR). +# CONFIGURATION PARAMETERS +# .ad +# .fi +# The following \fBmain.cf\fR parameters are especially relevant to +# this topic. See the Postfix \fBmain.cf\fR file for syntax details +# and for default values. Use the \fBpostfix reload\fR command after +# a configuration change. +# .IP \fBalias_maps\fR +# List of alias databases. +# .IP \fBallow_mail_to_commands\fR +# Restrict the usage of mail delivery to external command. +# .IP \fBallow_mail_to_files\fR +# Restrict the usage of mail delivery to external file. +# .IP \fBowner_request_special\fR +# Give special treatment to \fBowner-\fIxxx\fR and \fIxxx\fB-request\fR +# addresses. +# .IP \fBrecipient_delimiter\fR +# Delimiter that separates recipients from address extensions. +# STANDARDS +# RFC 822 (ARPA Internet Text Messages) +# SEE ALSO +# local(8) local delivery agent +# postalias(1) alias database management +# LICENSE +# .ad +# .fi +# The Secure Mailer license must be distributed with this software. +# AUTHOR(S) +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +#-- diff --git a/postfix/proto/aliases0 b/postfix/proto/aliases0 new file mode 100644 index 000000000..d6cf7666b --- /dev/null +++ b/postfix/proto/aliases0 @@ -0,0 +1,34 @@ +# +# >>>>>>>>>> The program "newaliases" must be run after +# >> NOTE >> this file is updated for any changes to +# >>>>>>>>>> show through to Postfix. +# + +# Basic system aliases -- these MUST be present +MAILER-DAEMON: postmaster +postmaster: root + +# General redirections for pseudo accounts +bin: root +daemon: root +named: root +nobody: root +uucp: root +www: root +ftp-bugs: root +postfix: root + +# Put your local aliases here. + +# Well-known aliases +manager: root +dumper: root +operator: root +abuse: postmaster + +# trap decode to catch security attacks +decode: root + +# Person who should get root's mail +#root: you + diff --git a/postfix/proto/canonical b/postfix/proto/canonical new file mode 100644 index 000000000..448ae5040 --- /dev/null +++ b/postfix/proto/canonical @@ -0,0 +1,151 @@ +#++ +# NAME +# canonical 5 +# SUMMARY +# format of Postfix canonical table +# SYNOPSIS +# \fBpostmap /etc/postfix/canonical\fR +# DESCRIPTION +# The optional \fBcanonical\fR file specifies an address mapping for +# local and non-local addresses. The mapping is used by the +# \fBcleanup\fR(8) daemon. The address mapping is recursive. +# +# Normally, the file serves as input to the \fBpostmap\fR(1) command. +# The result, an indexed file in \fBdbm\fR or \fBdb\fR format, +# is used for fast searching by the mail system. After an update +# it may take a minute or so before the change becomes visible. +# Issue a \fBpostfix reload\fR command to eliminate the delay. +# +# When the table is provided via other means such as NIS, LDAP +# or SQL, the same lookups are done as for ordinary indexed files. +# +# Alternatively, the table can be provided as a regular-expression +# map where patterns are given as regular expressions. In that case, +# the lookups are done in a slightly different way as described below. +# +# The \fBcanonical\fR mapping affects both message header addresses +# (i.e. addresses that appear inside messages) and message envelope +# addresses (for example, the addresses that are used in SMTP protocol +# commands). Think Sendmail rule set \fBS3\fR, if you like. +# +# Typically, one would use the \fBcanonical\fR table to replace login +# names by \fIFirstname.Lastname\fR, or to clean up addresses produced +# by legacy mail systems. +# +# The \fBcanonical\fR mapping is not to be confused with \fIvirtual +# domain\fR support. Use the \fBvirtual\fR(5) map for that purpose. +# +# The \fBcanonical\fR mapping is not to be confused with local aliasing. +# Use the \fBaliases\fR(5) map for that purpose. +# TABLE FORMAT +# .ad +# .fi +# The format of the \fBcanonical\fR table is as follows: +# .IP "blanks and comments" +# Blank lines are ignored, as are lines beginning with `#'. +# .IP "\fIpattern result\fR" +# When \fIpattern\fR matches a mail address, replace it by the +# corresponding \fIresult\fR. +# .PP +# With lookups from indexed files such as DB or DBM, or from networked +# tables such as NIS, LDAP or SQL, patterns are tried in the order as +# listed below: +# .IP "\fIuser\fR@\fIdomain address\fR" +# \fIuser\fR@\fIdomain\fR is replaced by \fIaddress\fR. This form +# has the highest precedence. +# .sp +# This form useful to clean up addresses produced by legacy mail systems. +# It can also be used to produce \fIFirstname.Lastname\fR style +# addresses, but see below for a simpler solution. +# .IP "\fIuser address\fR" +# \fIuser\fR@\fIsite\fR is replaced by \fIaddress\fR when \fIsite\fR is +# equal to $\fBmyorigin\fR, when \fIsite\fR is listed in +# $\fBmydestination\fR, or when it is listed in $\fBinet_interfaces\fR. +# .sp +# This form is useful for replacing login names by +# \fIFirstname.Lastname\fR. +# .IP "@\fIdomain address\fR" +# Every address in \fIdomain\fR is replaced by \fIaddress\fR. +# This form has the lowest precedence. +# .PP +# In all the above forms, when \fIaddress\fR has the form +# @\fIotherdomain\fR, the result is the same user in \fIotherdomain\fR. +# ADDRESS EXTENSION +# .fi +# .ad +# When table lookup fails, and the address localpart contains the +# optional recipient delimiter (e.g., \fIuser+foo\fR@\fIdomain\fR), the +# search is repeated for the unextended address (e.g. +# \fIuser\fR@\fIdomain\fR), and the unmatched extension is propagated +# to the result of table lookup. The matching order is: +# \fIuser+foo\fR@\fIdomain\fR, \fIuser\fR@\fIdomain\fR, +# \fIuser+foo\fR, \fIuser\fR, and @\fIdomain\fR. +# REGULAR EXPRESSION TABLES +# .ad +# .fi +# This section describes how the table lookups change when the table +# is given in the form of regular expressions. For a description of +# regular expression lookup table syntax, see \fBregexp_table\fR(5) +# or \fBpcre_table\fR(5). +# +# Each pattern is a regular expression that is applied to the entire +# address being looked up. Thus, \fIuser@domain\fR mail addresses are not +# broken up into their \fIuser\fR and \fI@domain\fR constituent parts, +# nor is \fIuser+foo\fR broken up into \fIuser\fR and \fIfoo\fR. +# +# Patterns are applied in the order as specified in the table, until a +# pattern is found that matches the search string. +# +# Results are the same as with normal indexed file lookups, with +# the additional feature that parenthesized substrings from the +# pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on. +# BUGS +# The table format does not understand quoting conventions. +# CONFIGURATION PARAMETERS +# .ad +# .fi +# The following \fBmain.cf\fR parameters are especially relevant to +# this topic. See the Postfix \fBmain.cf\fR file for syntax details +# and for default values. Use the \fBpostfix reload\fR command after +# a configuration change. +# .IP \fBcanonical_maps\fR +# List of canonical mapping tables. +# .IP \fBrecipient_canonical_maps\fR +# Address mapping lookup table for envelope and header recipient +# addresses. +# .IP \fBsender_canonical_maps\fR +# Address mapping lookup table for envelope and header sender +# addresses. +# .PP +# Other parameters of interest: +# .IP \fBinet_interfaces\fR +# The network interface addresses that this system receives mail on. +# .IP \fBmasquerade_domains\fR +# List of domains that hide their subdomain structure. +# .IP \fBmasquerade_exceptions\fR +# List of user names that are not subject to address masquerading. +# .IP \fBmydestination\fR +# List of domains that this mail system considers local. +# .IP \fBmyorigin\fR +# The domain that is appended to locally-posted mail. +# .IP \fBowner_request_special\fR +# Give special treatment to \fBowner-\fIxxx\fR and \fIxxx\fB-request\fR +# addresses. +# SEE ALSO +# cleanup(8) canonicalize and enqueue mail +# postmap(1) create mapping table +# virtual(5) virtual domain mapping +# pcre_table(5) format of PCRE tables +# regexp_table(5) format of POSIX regular expression tables +# LICENSE +# .ad +# .fi +# The Secure Mailer license must be distributed with this software. +# AUTHOR(S) +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +#-- + +# By default, this file is not used. See sample-canonical.cf diff --git a/postfix/proto/pcre_table b/postfix/proto/pcre_table new file mode 100644 index 000000000..d6967b3a2 --- /dev/null +++ b/postfix/proto/pcre_table @@ -0,0 +1,79 @@ +#++ +# NAME +# pcre_table 5 +# SUMMARY +# format of Postfix PCRE tables +# SYNOPSIS +# pcre:/etc/postfix/filename +# DESCRIPTION +# The Postfix mail system uses optional tables for address +# rewriting or mail routing. These tables are usually in +# \fBdbm\fR or \fBdb\fR format. Alternatively, lookup tables +# can be specified in Perl Compatible Regular Expression form. +# +# To find out what types of lookup tables your Postfix system +# supports use the \fBpostconf -m\fR command. +# +# The general form of a PCRE table is: +# .IP "blanks and comments" +# Blank lines are ignored, as are lines beginning with `#'. +# .IP "\fIpattern result\fR" +# When \fIpattern\fR matches a search string, use the corresponding +# \fIresult\fR. A line that starts with white space continues the +# preceding line. +# .PP +# Each pattern is a perl-like regular expression. The expression +# delimiter can be any character, except whitespace or characters +# that have special meaning (traditionally the forward slash is used). +# The regular expression can contain whitespace. +# +# By default, matching is case-insensitive, although following +# the second slash with an `i' flag will reverse this. Other flags +# are supported, but the only other useful one is `U', which makes +# matching ungreedy (see PCRE documentation and source for more +# info). +# +# Each pattern is applied to the entire string being looked up. +# Depending on the application, that string is an entire client +# hostname, an entire client IP address, or an entire mail address. +# Thus, no parent domain or parent network search is done, and +# \fIuser@domain\fR mail addresses are not broken up into their +# \fIuser\fR and \fIdomain\fR constituent parts, nor is \fIuser+foo\fR +# broken up into \fIuser\fR and \fIfoo\fR. +# +# Patterns are applied in the order as specified in the table, until a +# pattern is found that matches the search string. +# +# Substitution of sub-strings from the matched expression is +# possible using the conventional perl syntax ($1, $2, etc.). The +# macros in the replacement string may need to be written as ${n} +# or $(n) if they aren't followed by whitespace. +# EXAMPLES +# # Protect your outgoing majordomo exploders +# /^(?!owner-)(.*)-outgoing@(my\.domain)$/ 550 Use ${1}@${2} instead +# +# # Bounce friend@whatever, except when whatever is our domain (you would +# # be better just bouncing all friend@ mail - this is just an example). +# /^friend@(?!my\.domain).*$/ 550 Stick this in your pipe $0 +# +# # A multi-line entry. The text is sent as one line. +# # +# /^noddy@connect\.com\.au$/ +# \ 550 This user is a funny one. You really don't want to send mail to +# \ them as it only makes their head spin. +# SEE ALSO +# regexp_table(5) format of POSIX regular expression tables +# AUTHOR(S) +# The PCRE table lookup code was originally written by: +# Andrew McNamara +# andrewm@connect.com.au +# connect.com.au Pty. Ltd. +# Level 3, 213 Miller St +# North Sydney, NSW, Australia +# +# Adopted and adapted by: +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +#-- diff --git a/postfix/proto/regexp_table b/postfix/proto/regexp_table new file mode 100644 index 000000000..4eb43cc55 --- /dev/null +++ b/postfix/proto/regexp_table @@ -0,0 +1,83 @@ +#++ +# NAME +# regexp_table 5 +# SUMMARY +# format of Postfix regular expression tables +# SYNOPSIS +# regexp:/etc/postfix/filename +# DESCRIPTION +# The Postfix mail system uses optional tables for address +# rewriting or mail routing. These tables are usually in +# \fBdbm\fR or \fBdb\fR format. Alternatively, lookup tables +# can be specified in POSIX regular expression form. +# +# To find out what types of lookup tables your Postfix system +# supports use the \fBpostconf -m\fR command. +# +# The general form of a Postfix regular expression table is: +# .IP "blanks and comments" +# Blank lines are ignored, as are lines beginning with `#'. +# .IP "\fIpattern result\fR" +# When \fIpattern\fR matches a search string, use the corresponding +# \fIresult\fR. A line that starts with white space continues the +# preceding line. +# .IP "\fIpattern1!pattern2 result\fR" +# Matches \fIpattern1\fR but not \fIpattern2\fR. +# .PP +# Each pattern is a regular expression enclosed by a pair of delimiters. +# The regular expression syntax is described in \fIre_format\fR(7). +# The expression delimiter can be any character, except whitespace +# or characters that have special meaning (traditionally the forward +# slash is used). The regular expression can contain whitespace. +# +# By default, matching is case-insensitive, although following +# the second slash with an `i' flag will reverse this. Other flags +# are `x' (disable extended expression syntax), and `m' (enable +# multi-line mode). +# +# Each pattern is applied to the entire string being looked up. +# Depending on the application, that string is an entire client +# hostname, an entire client IP address, or an entire mail address. +# Thus, no parent domain or parent network search is done, and +# \fIuser@domain\fR mail addresses are not broken up into their +# \fIuser\fR and \fIdomain\fR constituent parts, nor is \fIuser+foo\fR +# broken up into \fIuser\fR and \fIfoo\fR. +# +# Patterns are applied in the order as specified in the table, until a +# pattern is found that matches the search string. +# +# Substitution of sub-strings from the matched expression is +# possible using $1, $2, etc.. The macros in the replacement string +# may need to be written as ${n} or $(n) if they aren't followed +# by whitespace. +# EXAMPLES +# # Disallow sender-specified routing. This is a must if you relay mail +# # for other domains. +# /[%!@].*[%!@]/ 550 Sender-specified routing rejected +# +# # Postmaster is OK, that way they can talk to us about how to fix +# # their problem. +# /^postmaster@.*$/ OK +# +# # Protect your outgoing majordomo exploders +# /^(.*)-outgoing@(.*)$/!/^owner-.*/ 550 Use ${1}@${2} instead +# SEE ALSO +# pcre_table(5) format of PCRE tables +# AUTHOR(S) +# The regexp table lookup code was originally written by: +# LaMont Jones +# lamont@hp.com +# +# That code was based on the PCRE dictionary contributed by: +# Andrew McNamara +# andrewm@connect.com.au +# connect.com.au Pty. Ltd. +# Level 3, 213 Miller St +# North Sydney, NSW, Australia +# +# Adopted and adapted by: +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +#-- diff --git a/postfix/proto/relocated b/postfix/proto/relocated new file mode 100644 index 000000000..aa736cccc --- /dev/null +++ b/postfix/proto/relocated @@ -0,0 +1,112 @@ +#++ +# NAME +# relocated 5 +# SUMMARY +# format of Postfix relocated table +# SYNOPSIS +# \fBpostmap /etc/postfix/relocated\fR +# DESCRIPTION +# The optional \fBrelocated\fR file provides the information that is +# used in "user has moved to \fInew_location\fR" bounce messages. +# +# Normally, the file serves as input to the \fBpostmap\fR(1) command. +# The result, an indexed file in \fBdbm\fR or \fBdb\fR format, +# is used for fast searching by the mail system. After an update +# issue a \fBpostfix reload\fR command to make the change visible. +# +# When the table is provided via other means such as NIS, LDAP +# or SQL, the same lookups are done as for ordinary indexed files. +# +# Alternatively, the table can be provided as a regular-expression +# map where patterns are given as regular expressions. In that case, +# the lookups are done in a slightly different way as described below. +# +# Table lookups are case insensitive. +# TABLE FORMAT +# .ad +# .fi +# The format of the table is as follows: +# .IP \(bu +# Blank lines are ignored, as are lines beginning with `#'. +# .IP \(bu +# An entry has one of the following form: +# .ti +5 +# \fIkey new_location\fR +# .br +# Where \fInew_location\fR specifies contact information such as +# an email address, or perhaps a street address or telephone number. +# .PP +# With lookups from indexed files such as DB or DBM, or from networked +# tables such as NIS, LDAP or SQL, the \fIkey\fR field is one of the +# following: +# .IP \fIuser\fR@\fIdomain\fR +# Matches \fIuser\fR@\fIdomain\fR. This form has precedence over all +# other forms. +# .IP \fIuser\fR +# Matches \fIuser\fR@\fIsite\fR when \fIsite\fR is $\fBmyorigin\fR, +# when \fIsite\fR is listed in $\fBmydestination\fR, or when \fIsite\fR +# is listed in $\fBinet_interfaces\fR. +# .IP @\fIdomain\fR +# Matches every address in \fIdomain\fR. This form has the lowest +# precedence. +# ADDRESS EXTENSION +# .fi +# .ad +# When the search fails, and the address localpart contains the +# optional recipient delimiter (e.g., \fIuser+foo\fR@\fIdomain\fR), +# the search is repeated for the unextended address (e.g. +# \fIuser\fR@\fIdomain\fR). +# REGULAR EXPRESSION TABLES +# .ad +# .fi +# This section describes how the table lookups change when the table +# is given in the form of regular expressions. For a description of +# regular expression lookup table syntax, see \fBregexp_table\fR(5) +# or \fBpcre_table\fR(5). +# +# Each pattern is a regular expression that is applied to the entire +# address being looked up. Thus, \fIuser@domain\fR mail addresses are not +# broken up into their \fIuser\fR and \fI@domain\fR constituent parts, +# nor is \fIuser+foo\fR broken up into \fIuser\fR and \fIfoo\fR. +# +# Patterns are applied in the order as specified in the table, until a +# pattern is found that matches the search string. +# +# Results are the same as with normal indexed file lookups, with +# the additional feature that parenthesized substrings from the +# pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on. +# BUGS +# The table format does not understand quoting conventions. +# CONFIGURATION PARAMETERS +# .ad +# .fi +# The following \fBmain.cf\fR parameters are especially relevant to +# this topic. See the Postfix \fBmain.cf\fR file for syntax details +# and for default values. Use the \fBpostfix reload\fR command after +# a configuration change. +# .IP \fBrelocated_maps\fR +# List of lookup tables for relocated users or sites. +# .PP +# Other parameters of interest: +# .IP \fBinet_interfaces\fR +# The network interface addresses that this system receives mail on. +# .IP \fBmydestination\fR +# List of domains that this mail system considers local. +# .IP \fBmyorigin\fR +# The domain that is appended to locally-posted mail. +# SEE ALSO +# postmap(1) create lookup table +# pcre_table(5) format of PCRE tables +# regexp_table(5) format of POSIX regular expression tables +# LICENSE +# .ad +# .fi +# The Secure Mailer license must be distributed with this software. +# AUTHOR(S) +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +#-- + +# By default, this file is not used. See sample-relocated.cf diff --git a/postfix/proto/transport b/postfix/proto/transport new file mode 100644 index 000000000..8b80bb00c --- /dev/null +++ b/postfix/proto/transport @@ -0,0 +1,158 @@ +#++ +# NAME +# transport 5 +# SUMMARY +# format of Postfix transport table +# SYNOPSIS +# \fBpostmap /etc/postfix/transport\fR +# DESCRIPTION +# The optional \fBtransport\fR file specifies a mapping from domain +# hierarchies to message delivery transports and/or relay hosts. The +# mapping is used by the \fBtrivial-rewrite\fR(8) daemon. +# +# Normally, the file serves as input to the \fBpostmap\fR(1) command. +# The result, an indexed file in \fBdbm\fR or \fBdb\fR format, is used +# for fast searching by the mail system. After updating this table, +# issue the \fBpostfix reload\fR command to make the change visible. +# +# When the table is provided via other means such as NIS, LDAP +# or SQL, the same lookups are done as for ordinary indexed files. +# +# Alternatively, the table can be provided as a regular-expression +# map where patterns are given as regular expressions. In that case, +# the lookups are done in a slightly different way as described below. +# TABLE FORMAT +# .ad +# .fi +# The format of the transport table is as follows: +# .IP "blanks and comments" +# Blank lines are ignored, as are lines beginning with `#'. +# .IP "\fIpattern result\fR" +# When \fIpattern\fR matches the domain, use the corresponding +# \fIresult\fR. +# .PP +# With lookups from indexed files such as DB or DBM, or from networked +# tables such as NIS, LDAP or SQL, patterns are tried in the order as +# listed below: +# .IP "\fIdomain transport\fR:\fInexthop\fR" +# Mail for \fIdomain\fR is delivered through \fItransport\fR to +# \fInexthop\fR. +# .IP "\fI.domain transport\fR:\fInexthop\fR" +# Mail for any subdomain of \fIdomain\fR is delivered through +# \fItransport\fR to \fInexthop\fR. +# .PP +# Note: transport map entries take precedence over domains +# specified in the \fBmydestination\fR parameter. If you use +# the optional transport map, it may be safer to specify explicit +# entries for all domains specified in \fBmydestination\fR, +# for example: +# +# .ti +5 +# \fBhostname.my.domain local:\fR +# .ti +5 +# \fBlocalhost.my.domain local:\fR +# +# The interpretation of the \fInexthop\fR field is transport +# dependent. In the case of SMTP, specify \fIhost\fR:\fIservice\fR for a +# non-default server port, and use [\fIhost\fR] or [\fIhost\fR:\fIport\fR] +# in order to disable MX (mail exchanger) DNS lookups. The [] form +# can also be used with IP addresses instead of hostnames. +# EXAMPLES +# .ad +# In order to send mail for \fBfoo.org\fR and its subdomains +# via the \fBuucp\fR transport to the UUCP host named \fBfoo\fR: +# +# .ti +5 +# \fBfoo.org uucp:foo\fR +# .ti +5 +# \fB\&.foo.org uucp:foo\fR +# +# When no \fInexthop\fR host name is specified, the destination domain +# name is used instead. For example, the following directs mail for +# \fIuser\fR@\fBfoo.org\fR via the \fBslow\fR transport to a mail +# exchanger for \fBfoo.org\fR. The \fBslow\fR transport could be +# something that runs at most one delivery process at a time: +# +# .ti +5 +# \fBfoo.org slow:\fR +# +# When no \fItransport\fR is specified, the default transport is +# used, as specified via the \fBdefault_transport\fR configuration +# parameter. The following sends all mail for \fBfoo.org\fR and its +# subdomains to host \fBgateway.foo.org\fR: +# +# .ti +5 +# \fBfoo.org :[gateway.foo.org]\fR +# .ti +5 +# \fB\&.foo.org :[gateway.foo.org]\fR +# +# In the above example, the [] are used to suppress MX lookups. +# The result would likely point to your local machine. +# +# In the case of delivery via SMTP, one may specify +# \fIhostname\fR:\fIservice\fR instead of just a host: +# +# .ti +5 +# \fBfoo.org smtp:bar.org:2025\fR +# +# This directs mail for \fIuser\fR@\fBfoo.org\fR to host \fBbar.org\fR +# port \fB2025\fR. Instead of a numerical port a symbolic name may be +# used. Specify [] around the destination in order to disable MX lookups. +# +# The error mailer can be used to bounce mail: +# +# .ti +5 +# \fB\&.foo.org error:mail for *.foo.org is not deliverable\fR +# +# This causes all mail for \fIuser\fR@\fIanything\fBfoo.org\fR +# to be bounced. +# REGULAR EXPRESSION TABLES +# .ad +# .fi +# This section describes how the table lookups change when the table +# is given in the form of regular expressions. For a description of +# regular expression lookup table syntax, see \fBregexp_table\fR(5) +# or \fBpcre_table\fR(5). +# +# Each pattern is a regular expression that is applied to the entire +# domain being looked up. Thus, \fIsome.domain.hierarchy\fR is not +# broken up into parent domains. +# +# Patterns are applied in the order as specified in the table, until a +# pattern is found that matches the search string. +# +# Results are the same as with normal indexed file lookups, with +# the additional feature that parenthesized substrings from the +# pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on. +# CONFIGURATION PARAMETERS +# .ad +# .fi +# The following \fBmain.cf\fR parameters are especially relevant to +# this topic. See the Postfix \fBmain.cf\fR file for syntax details +# and for default values. Use the \fBpostfix reload\fR command after +# a configuration change. +# .IP \fBtransport_maps\fR +# List of transport lookup tables. +# .PP +# Other parameters of interest: +# .IP \fBdefault_transport\fR +# The transport to use when no transport is explicitly specified. +# .IP \fBrelayhost\fR +# The default host to send to when no transport table entry matches. +# SEE ALSO +# postmap(1) create mapping table +# trivial-rewrite(8) rewrite and resolve addresses +# pcre_table(5) format of PCRE tables +# regexp_table(5) format of POSIX regular expression tables +# LICENSE +# .ad +# .fi +# The Secure Mailer license must be distributed with this software. +# AUTHOR(S) +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +#-- + +# By default, this file is not used. See sample-transport.cf diff --git a/postfix/proto/virtual b/postfix/proto/virtual new file mode 100644 index 000000000..bc29dca1a --- /dev/null +++ b/postfix/proto/virtual @@ -0,0 +1,142 @@ +#++ +# NAME +# virtual 5 +# SUMMARY +# format of Postfix virtual table +# SYNOPSIS +# \fBpostmap /etc/postfix/virtual\fR +# DESCRIPTION +# The optional \fBvirtual\fR table specifies redirections for local +# and non-local recipients or domains. The redirections are used by +# the \fBcleanup\fR(8) daemon. The redirections are recursive. +# +# The \fBvirtual\fR redirection is applied only to the recipient +# envelope address, and does not affect message headers. +# Think Sendmail rule set \fBS0\fR, if you like. Use \fBcanonical\fR(5) +# mapping to rewrite header and envelope addresses in general. +# +# Normally, the file serves as input to the \fBpostmap\fR(1) command. +# The result, an indexed file in \fBdbm\fR or \fBdb\fR format, +# is used for fast searching by the mail system. After an update +# it may take a minute or so before the change becomes visible. +# Issue a \fBpostfix reload\fR command to eliminate the delay. +# +# When the table is provided via other means such as NIS, LDAP +# or SQL, the same lookups are done as for ordinary indexed files. +# +# Alternatively, the table can be provided as a regular-expression +# map where patterns are given as regular expressions. In that case, +# the lookups are done in a slightly different way as described below. +# TABLE FORMAT +# .ad +# .fi +# Typical support for a virtual domain looks like the following: +# +# .in +4 +# .nf +# \fIvirtual.domain anything\fR (right-hand content does not matter) +# \fIuser1@virtual.domain address1\fR +# \fIuser2@virtual.domain address2, address3\fR +# .fi +# .in -4 +# +# With this, the SMTP server accepts mail for \fIvirtual.domain\fR and +# rejects mail for \fIunknown\fR@\fIvirtual.domain\fR as undeliverable. +# +# The format of the virtual table is as follows, mappings being +# tried in the order as listed in this manual page: +# .IP "blanks and comments" +# Blank lines are ignored, as are lines beginning with `#'. +# .IP "\fIpattern result\fR" +# When \fIpattern\fR matches a mail address, replace it by the +# corresponding \fIresult\fR. +# .PP +# With lookups from indexed files such as DB or DBM, or from networked +# tables such as NIS, LDAP or SQL, patterns are tried in the order as +# listed below: +# .IP "\fIuser\fR@\fIdomain address, address, ...\fR" +# Mail for \fIuser\fR@\fIdomain\fR is redirected to \fIaddress\fR. +# This form has the highest precedence. +# .IP "\fIuser address, address, ...\fR" +# Mail for \fIuser\fR@\fIsite\fR is redirected to \fIaddress\fR when +# \fIsite\fR is equal to $\fBmyorigin\fR, when \fIsite\fR is listed in +# $\fRmydestination\fR, or when it is listed in $\fIinet_interfaces\fR. +# .sp +# This functionality overlaps with functionality of the local +# \fIalias\fR(5) database. The difference is that \fBvirtual\fR +# mapping can be applied to non-local addresses. +# .IP "@\fIdomain address, address, ...\fR" +# Mail for any user in \fIdomain\fR is redirected to \fIaddress\fR. +# This form has the lowest precedence. +# .PP +# In all the above forms, when \fIaddress\fR has the form +# @\fIotherdomain\fR, the result is the same user in \fIotherdomain\fR. +# This works for the first address in the expansion only. +# ADDRESS EXTENSION +# .fi +# .ad +# When the search fails, and the address localpart contains the +# optional recipient delimiter (e.g., \fIuser+foo\fR@\fIdomain\fR), +# the search is repeated for the unextended address (e.g. +# \fIuser\fR@\fIdomain\fR), and the unmatched address extension is +# propagated to the result of expansion. The matching order is: +# \fIuser+foo\fR@\fIdomain\fR, \fIuser\fR@\fIdomain\fR, +# \fIuser+foo\fR, \fIuser\fR, and @\fIdomain\fR. +# REGULAR EXPRESSION TABLES +# .ad +# .fi +# This section describes how the table lookups change when the table +# is given in the form of regular expressions. For a description of +# regular expression lookup table syntax, see \fBregexp_table\fR(5) +# or \fBpcre_table\fR(5). +# +# Each pattern is a regular expression that is applied to the entire +# address being looked up. Thus, \fIuser@domain\fR mail addresses are not +# broken up into their \fIuser\fR and \fI@domain\fR constituent parts, +# nor is \fIuser+foo\fR broken up into \fIuser\fR and \fIfoo\fR. +# +# Patterns are applied in the order as specified in the table, until a +# pattern is found that matches the search string. +# +# Results are the same as with normal indexed file lookups, with +# the additional feature that parenthesized substrings from the +# pattern can be interpolated as \fB$1\fR, \fB$2\fR and so on. +# BUGS +# The table format does not understand quoting conventions. +# CONFIGURATION PARAMETERS +# .ad +# .fi +# The following \fBmain.cf\fR parameters are especially relevant to +# this topic. See the Postfix \fBmain.cf\fR file for syntax details +# and for default values. Use the \fBpostfix reload\fR command after +# a configuration change. +# .IP \fBvirtual_maps\fR +# List of virtual mapping tables. +# .PP +# Other parameters of interest: +# .IP \fBinet_interfaces\fR +# The network interface addresses that this system receives mail on. +# .IP \fBmydestination\fR +# List of domains that this mail system considers local. +# .IP \fBmyorigin\fR +# The domain that is appended to locally-posted mail. +# .IP \fBowner_request_special\fR +# Give special treatment to \fBowner-\fIxxx\fR and \fIxxx\fB-request\fR +# addresses. +# SEE ALSO +# cleanup(8) canonicalize and enqueue mail +# postmap(1) create mapping table +# pcre_table(5) format of PCRE tables +# regexp_table(5) format of POSIX regular expression tables +# LICENSE +# .ad +# .fi +# The Secure Mailer license must be distributed with this software. +# AUTHOR(S) +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +#-- + +# By default, this file is not used. See sample-virtual.cf diff --git a/postfix/qmgr/.indent.pro b/postfix/qmgr/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/qmgr/.indent.pro +++ b/postfix/qmgr/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/qmgr/qmgr.c b/postfix/qmgr/qmgr.c index 3731ff8fa..7508a8d87 100644 --- a/postfix/qmgr/qmgr.c +++ b/postfix/qmgr/qmgr.c @@ -138,10 +138,10 @@ /* CONFIGURATION PARAMETERS /* .ad /* .fi -/* The following \fBmain.cf\fR parameters are especially relevant to -/* this program. See the Postfix \fBmain.cf\fR file for syntax details -/* and for default values. Use the \fBpostfix reload\fR command after -/* a configuration change. +/* The following \fBmain.cf\fR parameters are especially relevant to +/* this program. See the Postfix \fBmain.cf\fR file for syntax details +/* and for default values. Use the \fBpostfix reload\fR command after +/* a configuration change. /* .SH Miscellaneous /* .ad /* .fi diff --git a/postfix/qmgr/qmgr.h b/postfix/qmgr/qmgr.h index b8e0ae6d7..c8cd69dec 100644 --- a/postfix/qmgr/qmgr.h +++ b/postfix/qmgr/qmgr.h @@ -135,9 +135,9 @@ extern QMGR_TRANSPORT *qmgr_transport_find(const char *); * transactions. The "todo" queue contains messages that are to be delivered * to this next hop. When a message is elected for transmission, it is moved * from the "todo" queue to the "busy" queue. Messages are taken from the - * "todo" queue by randomly choosing between the first and the last queue - * entries. This ensures that one problematic message will not block all - * other traffic to that next hop. + * "todo" queue in sequence. An initial destination delivery concurrency > 1 + * ensures that one problematic message will not block all other traffic to + * that next hop. */ struct QMGR_ENTRY_LIST { QMGR_ENTRY *next; diff --git a/postfix/qmgr/qmgr_message.c b/postfix/qmgr/qmgr_message.c index c5c28a300..5ca2fa057 100644 --- a/postfix/qmgr/qmgr_message.c +++ b/postfix/qmgr/qmgr_message.c @@ -209,7 +209,8 @@ static int qmgr_message_read(QMGR_MESSAGE *message) */ if (message->rcpt_offset) { if (message->rcpt_list.len) - msg_panic("%s: recipient list not empty on recipient reload", message->queue_id); + msg_panic("%s: recipient list not empty on recipient reload", + message->queue_id); if (vstream_fseek(message->fp, message->rcpt_offset, SEEK_SET) < 0) msg_fatal("seek file %s: %m", VSTREAM_PATH(message->fp)); message->rcpt_offset = 0; diff --git a/postfix/sendmail/.indent.pro b/postfix/sendmail/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/sendmail/.indent.pro +++ b/postfix/sendmail/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/showq/.indent.pro b/postfix/showq/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/showq/.indent.pro +++ b/postfix/showq/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/smtp/.indent.pro b/postfix/smtp/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/smtp/.indent.pro +++ b/postfix/smtp/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/smtp/smtp.c b/postfix/smtp/smtp.c index a6c8f0f21..29dc70dab 100644 --- a/postfix/smtp/smtp.c +++ b/postfix/smtp/smtp.c @@ -85,6 +85,8 @@ /* .IP \fBnotify_classes\fR /* When this parameter includes the \fBprotocol\fR class, send mail to the /* postmaster with transcripts of SMTP sessions with protocol errors. +/* .IP \fBsmtp_always_send_ehlo\fR +/* Always send EHLO at the start of a connection. /* .IP \fBsmtp_skip_4xx_greeting\fR /* Skip servers that greet us with a 4xx status code. /* .IP \fBsmtp_skip_5xx_greeting\fR @@ -207,6 +209,7 @@ int var_skip_quit_resp; char *var_fallback_relay; char *var_bestmx_transp; char *var_error_rcpt; +int var_smtp_always_ehlo; /* * Global variables. smtp_errno is set by the address lookup routines and by @@ -356,6 +359,7 @@ int main(int argc, char **argv) VAR_SMTP_SKIP_5XX, DEF_SMTP_SKIP_5XX, &var_smtp_skip_5xx_greeting, VAR_IGN_MX_LOOKUP_ERR, DEF_IGN_MX_LOOKUP_ERR, &var_ign_mx_lookup_err, VAR_SKIP_QUIT_RESP, DEF_SKIP_QUIT_RESP, &var_skip_quit_resp, + VAR_SMTP_ALWAYS_EHLO, DEF_SMTP_ALWAYS_EHLO, &var_smtp_always_ehlo, 0, }; diff --git a/postfix/smtp/smtp_connect.c b/postfix/smtp/smtp_connect.c index 0a9ad31fe..ba680cef9 100644 --- a/postfix/smtp/smtp_connect.c +++ b/postfix/smtp/smtp_connect.c @@ -261,6 +261,7 @@ SMTP_SESSION *smtp_connect_host(char *host, unsigned port, VSTRING *why) session->best = 1; break; } + msg_info("%s (port %d)", vstring_str(why), ntohs(port)); } dns_rr_free(addr_list); return (session); diff --git a/postfix/smtp/smtp_proto.c b/postfix/smtp/smtp_proto.c index 1e66f0c92..9be06bd45 100644 --- a/postfix/smtp/smtp_proto.c +++ b/postfix/smtp/smtp_proto.c @@ -183,6 +183,8 @@ int smtp_helo(SMTP_STATE *state) } else if (strcasecmp(word, "ESMTP") == 0) state->features |= SMTP_FEATURE_ESMTP; } + if (var_smtp_always_ehlo) + state->features |= SMTP_FEATURE_ESMTP; /* * Return the compliment. Fall back to SMTP if our ESMTP recognition diff --git a/postfix/smtpd/.indent.pro b/postfix/smtpd/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/smtpd/.indent.pro +++ b/postfix/smtpd/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/smtpd/smtpd.c b/postfix/smtpd/smtpd.c index 185077a9e..6887e0d8d 100644 --- a/postfix/smtpd/smtpd.c +++ b/postfix/smtpd/smtpd.c @@ -866,9 +866,6 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv) } else if ((state->err & CLEANUP_STAT_BAD) != 0) { state->error_mask |= MAIL_ERROR_SOFTWARE; smtpd_chat_reply(state, "451 Error: internal error %d", state->err); - } else if ((state->err & CLEANUP_STAT_RCPT) != 0) { - state->error_mask |= MAIL_ERROR_SOFTWARE; - smtpd_chat_reply(state, "451 Error: internal error %d", state->err); } else if ((state->err & CLEANUP_STAT_SIZE) != 0) { state->error_mask |= MAIL_ERROR_BOUNCE; smtpd_chat_reply(state, "552 Error: message too large"); @@ -881,6 +878,9 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv) } else if ((state->err & CLEANUP_STAT_WRITE) != 0) { state->error_mask |= MAIL_ERROR_RESOURCE; smtpd_chat_reply(state, "451 Error: queue file write error"); + } else if ((state->err & CLEANUP_STAT_RCPT) != 0) { + state->error_mask |= MAIL_ERROR_SOFTWARE; + smtpd_chat_reply(state, "451 Error: internal error %d", state->err); } else { msg_panic("data_cmd: unknown status %d", state->err); } diff --git a/postfix/smtpd/smtpd_check.c b/postfix/smtpd/smtpd_check.c index aa0e87141..5b63353a6 100644 --- a/postfix/smtpd/smtpd_check.c +++ b/postfix/smtpd/smtpd_check.c @@ -1970,16 +1970,19 @@ char *smtpd_check_rcptmap(SMTPD_STATE *state, char *recipient) msg_warn("page and in the FAQ entry for virtual domains"); SMTPD_CHECK_RCPT_RETURN(0); } + dict_errno = 0; if (*var_local_rcpt_maps && !mail_addr_find(rcpt_canon_maps, STR(reply.recipient), NOP) && !mail_addr_find(canonical_maps, STR(reply.recipient), NOP) && !mail_addr_find(relocated_maps, STR(reply.recipient), NOP) && !mail_addr_find(local_rcpt_maps, STR(reply.recipient), NOP)) { (void) smtpd_check_reject(state, MAIL_ERROR_BOUNCE, - "550 <%s>: User unknown", recipient); + "%d <%s>: User unknown", + dict_errno ? 450 : 550, recipient); SMTPD_CHECK_RCPT_RETURN(STR(error_text)); } } else { + dict_errno = 0; if (*var_virtual_maps && !mail_addr_find(rcpt_canon_maps, STR(reply.recipient), NOP) && !mail_addr_find(canonical_maps, STR(reply.recipient), NOP) @@ -1987,7 +1990,8 @@ char *smtpd_check_rcptmap(SMTPD_STATE *state, char *recipient) && !mail_addr_find(virtual_maps, STR(reply.recipient), NOP) && maps_find(virtual_maps, domain, 0)) { (void) smtpd_check_reject(state, MAIL_ERROR_BOUNCE, - "550 <%s>: User unknown", recipient); + "%d <%s>: User unknown", + dict_errno ? 450 : 550, recipient); SMTPD_CHECK_RCPT_RETURN(STR(error_text)); } } diff --git a/postfix/smtpstone/.indent.pro b/postfix/smtpstone/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/smtpstone/.indent.pro +++ b/postfix/smtpstone/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/smtpstone/smtp-sink.c b/postfix/smtpstone/smtp-sink.c index 3a2960271..5619f0b10 100644 --- a/postfix/smtpstone/smtp-sink.c +++ b/postfix/smtpstone/smtp-sink.c @@ -6,7 +6,7 @@ /* SYNOPSIS /* smtp-sink [-c] [-p] [-v] [-w delay] [host]:port backlog /* DESCRIPTION -/* \fIsmtp-sink\fR listens on the named host (or address) and port. +/* \fIsmtp-sink\fR listens on the named host (or address) and port. /* It takes SMTP messages from the network and throws them away. /* The purpose is to measure SMTP client performance, not protocol /* compliance. diff --git a/postfix/smtpstone/smtp-source.c b/postfix/smtpstone/smtp-source.c index d6150beff..5968acf5e 100644 --- a/postfix/smtpstone/smtp-source.c +++ b/postfix/smtpstone/smtp-source.c @@ -69,6 +69,7 @@ #include #include #include +#include /* Utility library. */ @@ -94,14 +95,23 @@ /* * Per-session data structure with state. + * + * This software can maintain multiple parallel connections to the same SMTP + * server. However, it makes no more than one connection request at a time + * to avoid overwhelming the server with SYN packets and having to back off. + * Back-off would screw up the benchmark. Pending connection requests are + * kept in a linear list. */ -typedef struct { +typedef struct SESSION { int xfer_count; /* # of xfers in session */ int rcpt_count; /* # of recipients to go */ VSTREAM *stream; /* open connection */ int connect_count; /* # of connect()s to retry */ + struct SESSION *next; /* connect() queue linkage */ } SESSION; +static SESSION *last_session; /* connect() queue tail */ + /* * Structure with broken-up SMTP server response. */ @@ -133,7 +143,10 @@ static int connect_count = 1; static int random_delay = 0; static int fixed_delay = 0; +static void enqueue_connect(SESSION *); +static void start_connect(SESSION *); static void connect_done(int, char *); +static void read_banner(int, char *); static void send_helo(SESSION *); static void helo_done(int, char *); static void send_mail(SESSION *); @@ -177,6 +190,32 @@ static void command(VSTREAM *stream, char *fmt,...) va_end(ap); } +/* socket_error - look up and reset the last socket error */ + +static int socket_error(int sock) +{ + int error; + SOCKOPT_SIZE error_len; + + /* + * Some Solaris 2 versions have getsockopt() itself return the error, + * instead of returning it via the parameter list. + */ + error = 0; + error_len = sizeof(error); + if (getsockopt(sock, SOL_SOCKET, SO_ERROR, (char *) &error, &error_len) < 0) + return (-1); + if (error) { + errno = error; + return (-1); + } + + /* + * No problems. + */ + return (0); +} + /* response - read and process SMTP server response */ static RESPONSE *response(VSTREAM *stream, VSTRING *buf) @@ -246,31 +285,13 @@ static char *exception_text(int except) static void startup(SESSION *session) { - int fd; - if (message_count-- <= 0) { myfree((char *) session); session_count--; return; } if (session->stream == 0) { - if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) - msg_fatal("socket: %m"); - for (;;) { - if (session->connect_count == 0) - msg_fatal("connect: %m"); - if (!connect(fd, (struct sockaddr *) & sin, sizeof(sin))) - break; - if (session->connect_count-- > 1) -#ifdef MISSING_USLEEP - doze(10); -#else - usleep(10); -#endif - } - session->stream = vstream_fdopen(fd, O_RDWR); - smtp_timeout_setup(session->stream, var_timeout); - event_enable_read(vstream_fileno(session->stream), connect_done, (char *) session); + enqueue_connect(session); } else { send_mail(session); } @@ -299,9 +320,100 @@ static void start_another(SESSION *session) } } +/* enqueue_connect - queue a connection request */ + +static void enqueue_connect(SESSION *session) +{ + session->next = 0; + if (last_session == 0) { + last_session = session; + start_connect(session); + } else { + last_session->next = session; + last_session = session; + } +} + +/* dequeue_connect - connection request completed */ + +static void dequeue_connect(SESSION *session) +{ + if (session == last_session) { + if (session->next != 0) + msg_panic("dequeue_connect: queue ends after last"); + last_session = 0; + } else { + if (session->next == 0) + msg_panic("dequeue_connect: queue ends before last"); + start_connect(session->next); + } +} + +/* fail_connect - handle failed startup */ + +static void fail_connect(SESSION *session) +{ + if (session->connect_count-- == 1) + msg_fatal("connect: %m"); + msg_warn("connect: %m"); + event_disable_readwrite(vstream_fileno(session->stream)); + vstream_fclose(session->stream); + session->stream = 0; +#ifdef MISSING_USLEEP + doze(10); +#else + usleep(10); +#endif + start_connect(session); +} + +/* start_connect - start TCP handshake */ + +static void start_connect(SESSION *session) +{ + int fd; + + /* + * Some systems don't set the socket error when connect() fails early + * (loopback) so we must deal with the error immediately, rather than + * retrieving it later with getsockopt(). We can't use MSG_PEEK to + * distinguish between server disconnect and connection refused. + */ + if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) + msg_fatal("socket: %m"); + (void) non_blocking(fd, NON_BLOCKING); + session->stream = vstream_fdopen(fd, O_RDWR); + event_enable_write(fd, connect_done, (char *) session); + smtp_timeout_setup(session->stream, var_timeout); + if (connect(fd, (struct sockaddr *) & sin, sizeof(sin)) < 0 + && errno != EINPROGRESS) + fail_connect(session); +} + /* connect_done - send message sender info */ static void connect_done(int unused_event, char *context) +{ + SESSION *session = (SESSION *) context; + int fd = vstream_fileno(session->stream); + + /* + * Try again after some delay when the connection failed, in case they + * run a Mickey Mouse protocol stack. + */ + if (socket_error(fd) < 0) { + fail_connect(session); + } else { + non_blocking(fd, BLOCKING); + event_disable_readwrite(fd); + event_enable_read(fd, read_banner, (char *) session); + dequeue_connect(session); + } +} + +/* read_banner - receive SMTP server greeting */ + +static void read_banner(int unused_event, char *context) { SESSION *session = (SESSION *) context; RESPONSE *resp; @@ -733,6 +845,7 @@ int main(int argc, char **argv) session->stream = 0; session->xfer_count = 0; session->connect_count = connect_count; + session->next = 0; session_count++; startup(session); } diff --git a/postfix/spawn/.indent.pro b/postfix/spawn/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/spawn/.indent.pro +++ b/postfix/spawn/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/spawn/Makefile.in b/postfix/spawn/Makefile.in index b04e71303..ecada6188 100644 --- a/postfix/spawn/Makefile.in +++ b/postfix/spawn/Makefile.in @@ -23,10 +23,10 @@ Makefile: Makefile.in test: $(TESTPROG) -update: ../libspawn/$(PROG) +update: ../libexec/$(PROG) -../libspawn/$(PROG): $(PROG) - cp $(PROG) ../libspawn +../libexec/$(PROG): $(PROG) + cp $(PROG) ../libexec printfck: $(OBJS) $(PROG) rm -rf printfck diff --git a/postfix/trivial-rewrite/.indent.pro b/postfix/trivial-rewrite/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/trivial-rewrite/.indent.pro +++ b/postfix/trivial-rewrite/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/trivial-rewrite/resolve.c b/postfix/trivial-rewrite/resolve.c index eb45b6d13..43d932d82 100644 --- a/postfix/trivial-rewrite/resolve.c +++ b/postfix/trivial-rewrite/resolve.c @@ -27,7 +27,7 @@ /* /* resolve_proto() implements the client-server protocol: /* read one address in FQDN form, reply with a (transport, -/* nexthop, internalized recipient) triple. +/* nexthop, internalized recipient) triple. /* /* resolve_addr() gives direct access to the address resolving /* engine. It resolves an internalized address to a (transport, diff --git a/postfix/util/.indent.pro b/postfix/util/.indent.pro index 4a836704c..2cc95193a 100644 --- a/postfix/util/.indent.pro +++ b/postfix/util/.indent.pro @@ -64,6 +64,7 @@ -TNAMADR_LIST -TNAME_MASK -TPEER_NAME +-TPENDING -TPICKUP_INFO -TPIPE_ATTR -TPIPE_PARAMS diff --git a/postfix/util/Makefile.in b/postfix/util/Makefile.in index c1634b0aa..6309d5342 100644 --- a/postfix/util/Makefile.in +++ b/postfix/util/Makefile.in @@ -260,7 +260,7 @@ depend: $(MAKES) stream_test: stream_test.c $(LIB) $(CC) $(CFLAGS) -o $@ $@.c $(LIB) $(SYSLIBS) -tests: valid_hostname_test mac_expand_test +tests: valid_hostname_test mac_expand_test dict_test valid_hostname_test: valid_hostname valid_hostname.in valid_hostname.ref ./valid_hostname valid_hostname.tmp @@ -272,6 +272,18 @@ mac_expand_test: mac_expand mac_expand.in mac_expand.ref diff mac_expand.ref mac_expand.tmp rm -f mac_expand.tmp +DB_TYPE = `../postconf/postconf -h default_database_type` + +dict_test: dict_open testdb dict_test.in dict_test.ref + rm -f testdb.db testdb.dir testdb.pag + ../postmap/postmap -N testdb + ./dict_open $(DB_TYPE):testdb write < dict_test.in > dict_test.tmp 2>&1 + diff dict_test.ref dict_test.tmp + ../postmap/postmap -n testdb + ./dict_open $(DB_TYPE):testdb write < dict_test.in > dict_test.tmp 2>&1 + diff dict_test.ref dict_test.tmp + rm -f testdb.db testdb.dir testdb.pag + # do not edit below this line - it is generated by 'make depend' argv.o: argv.c argv.o: mymalloc.h diff --git a/postfix/util/clean_env.c b/postfix/util/clean_env.c index 8549332d3..969e0a042 100644 --- a/postfix/util/clean_env.c +++ b/postfix/util/clean_env.c @@ -9,7 +9,7 @@ /* void clean_env() /* DESCRIPTION /* clean_env() reduces the process environment to the bare minimum. -/* In the initial version, rules are hard-coded. This will be +/* In the initial version, rules are hard-coded. This will be /* made configurable. /* LICENSE /* .ad diff --git a/postfix/util/dict.h b/postfix/util/dict.h index cb0cc0dad..2173cf607 100644 --- a/postfix/util/dict.h +++ b/postfix/util/dict.h @@ -45,6 +45,7 @@ typedef struct DICT { #define DICT_FLAG_PATTERN (1<<5) /* keys are patterns */ #define DICT_FLAG_LOCK (1<<6) /* lock before access */ #define DICT_FLAG_DUP_REPLACE (1<<7) /* if file, replace dups */ +#define DICT_FLAG_SYNC_UPDATE (1<<8) /* if file, sync updates */ extern int dict_unknown_allowed; extern int dict_errno; diff --git a/postfix/util/dict_db.c b/postfix/util/dict_db.c index db2ed34e7..0a88d8435 100644 --- a/postfix/util/dict_db.c +++ b/postfix/util/dict_db.c @@ -165,10 +165,8 @@ static void dict_db_update(DICT *dict, const char *name, const char *value) && (dict->flags & DICT_FLAG_TRY0NULL)) { #ifdef DB_NO_TRAILING_NULL dict->flags &= ~DICT_FLAG_TRY1NULL; - dict->flags |= DICT_FLAG_TRY0NULL; #else dict->flags &= ~DICT_FLAG_TRY0NULL; - dict->flags |= DICT_FLAG_TRY1NULL; #endif } @@ -200,6 +198,9 @@ static void dict_db_update(DICT *dict, const char *name, const char *value) else msg_fatal("%s: duplicate entry: \"%s\"", dict_db->path, name); } + if (dict->flags & DICT_FLAG_SYNC_UPDATE) + if (db->sync(db, 0) < 0) + msg_fatal("%s: flush dictionary: %m", dict_db->path); /* * Release the exclusive lock. @@ -210,48 +211,45 @@ static void dict_db_update(DICT *dict, const char *name, const char *value) /* delete one entry from the dictionary */ -static int dict_db_delete(DICT *dict, const char *key) +static int dict_db_delete(DICT *dict, const char *name) { DICT_DB *dict_db = (DICT_DB *) dict; DB *db = dict_db->db; DBT db_key; - int status; + int status = 1; int flags = 0; - db_key.data = (void *) key; - db_key.size = strlen(key); - /* - * If undecided about appending a null byte to key and value, choose a - * default depending on the platform. + * Acquire an exclusive lock. */ - if ((dict->flags & DICT_FLAG_TRY1NULL) - && (dict->flags & DICT_FLAG_TRY0NULL)) { -#ifdef DB_NO_TRAILING_NULL - dict->flags = DICT_FLAG_TRY0NULL; -#else - dict->flags = DICT_FLAG_TRY1NULL; -#endif - } + if ((dict->flags & DICT_FLAG_LOCK) && myflock(dict->fd, MYFLOCK_EXCLUSIVE) < 0) + msg_fatal("%s: lock dictionary: %m", dict_db->path); /* - * Optionally append a null byte to key and value. + * See if this DB file was written with one null byte appended to key and + * value. */ if (dict->flags & DICT_FLAG_TRY1NULL) { - db_key.size++; + db_key.data = (void *) name; + db_key.size = strlen(name) + 1; + if ((status = db->del(db, &db_key, flags)) < 0) + msg_fatal("error deleting from %s: %m", dict_db->path); + if (status == 0) + dict->flags &= ~DICT_FLAG_TRY0NULL; } /* - * Acquire an exclusive lock. - */ - if ((dict->flags & DICT_FLAG_LOCK) && myflock(dict->fd, MYFLOCK_EXCLUSIVE) < 0) - msg_fatal("%s: lock dictionary: %m", dict_db->path); - - /* - * Do the delete operation. + * See if this DB file was written with no null byte appended to key and + * value. */ - if ((status = db->del(db, &db_key, flags)) < 0) - msg_fatal("error deleting %s: %m", dict_db->path); + if (status > 0 && (dict->flags & DICT_FLAG_TRY0NULL)) { + db_key.data = (void *) name; + db_key.size = strlen(name); + if ((status = db->del(db, &db_key, flags)) < 0) + msg_fatal("error deleting from %s: %m", dict_db->path); + if (status == 0) + dict->flags &= ~DICT_FLAG_TRY1NULL; + } /* * Release the exclusive lock. diff --git a/postfix/util/dict_dbm.c b/postfix/util/dict_dbm.c index e62688177..b5b462fe4 100644 --- a/postfix/util/dict_dbm.c +++ b/postfix/util/dict_dbm.c @@ -141,10 +141,8 @@ static void dict_dbm_update(DICT *dict, const char *name, const char *value) && (dict->flags & DICT_FLAG_TRY0NULL)) { #ifdef DBM_NO_TRAILING_NULL dict->flags &= ~DICT_FLAG_TRY1NULL; - dict->flags |= DICT_FLAG_TRY0NULL; #else dict->flags &= ~DICT_FLAG_TRY0NULL; - dict->flags |= DICT_FLAG_TRY1NULL; #endif } @@ -186,47 +184,52 @@ static void dict_dbm_update(DICT *dict, const char *name, const char *value) /* dict_dbm_delete - delete one entry from the dictionary */ -static int dict_dbm_delete(DICT *dict, const char *key) +static int dict_dbm_delete(DICT *dict, const char *name) { DICT_DBM *dict_dbm = (DICT_DBM *) dict; datum dbm_key; - int status; + int status = 1; int flags = 0; - dbm_key.dptr = (void *) key; - dbm_key.dsize = strlen(key); - /* - * If undecided about appending a null byte to key and value, choose a - * default depending on the platform. + * Acquire an exclusive lock. */ - if ((dict->flags & DICT_FLAG_TRY1NULL) - && (dict->flags & DICT_FLAG_TRY0NULL)) { -#ifdef DBM_NO_TRAILING_NULL - dict->flags = DICT_FLAG_TRY0NULL; -#else - dict->flags = DICT_FLAG_TRY1NULL; -#endif - } + if ((dict->flags & DICT_FLAG_LOCK) && myflock(dict->fd, MYFLOCK_EXCLUSIVE) < 0) + msg_fatal("%s: lock dictionary: %m", dict_dbm->path); /* - * Optionally append a null byte to key and value. + * See if this DBM file was written with one null byte appended to key + * and value. */ if (dict->flags & DICT_FLAG_TRY1NULL) { - dbm_key.dsize++; + dbm_key.dptr = (void *) name; + dbm_key.dsize = strlen(name) + 1; + dbm_clearerr(dict_dbm->dbm); + if ((status = dbm_delete(dict_dbm->dbm, dbm_key)) < 0) { + if (dbm_error(dict_dbm->dbm) != 0) /* fatal error */ + msg_fatal("error deleting from %s: %m", dict_dbm->path); + status = 1; /* not found */ + } else { + dict->flags &= ~DICT_FLAG_TRY0NULL; /* found */ + } } /* - * Acquire an exclusive lock. - */ - if ((dict->flags & DICT_FLAG_LOCK) && myflock(dict->fd, MYFLOCK_EXCLUSIVE) < 0) - msg_fatal("%s: lock dictionary: %m", dict_dbm->path); - - /* - * Do the delete operation. + * See if this DBM file was written with no null byte appended to key and + * value. */ - if ((status = dbm_delete(dict_dbm->dbm, dbm_key)) < 0) - msg_fatal("error deleting %s: %m", dict_dbm->path); + if (status > 0 && (dict->flags & DICT_FLAG_TRY0NULL)) { + dbm_key.dptr = (void *) name; + dbm_key.dsize = strlen(name); + dbm_clearerr(dict_dbm->dbm); + if ((status = dbm_delete(dict_dbm->dbm, dbm_key)) < 0) { + if (dbm_error(dict_dbm->dbm) != 0) /* fatal error */ + msg_fatal("error deleting from %s: %m", dict_dbm->path); + status = 1; /* not found */ + } else { + dict->flags &= ~DICT_FLAG_TRY1NULL; /* found */ + } + } /* * Release the exclusive lock. diff --git a/postfix/util/dict_open.c b/postfix/util/dict_open.c index 37b560212..670550245 100644 --- a/postfix/util/dict_open.c +++ b/postfix/util/dict_open.c @@ -78,6 +78,9 @@ /* .IP DICT_FLAG_LOCK /* With maps where this is appropriate, acquire an exclusive lock /* before writing, and acquire a shared lock before reading. +/* .IP DICT_FLAG_SYNC_UPDATE +/* With file-based maps, flush I/O buffers to file after each update. +/* Thus feature is not supported with some file-based dictionaries. /* .PP /* The dictionary types are as follows: /* .IP environ @@ -334,6 +337,8 @@ main(int argc, char **argv) DICT *dict; char *dict_name; int open_flags; + char *bufp; + char *cmd; char *key; const char *value; int ch; @@ -363,25 +368,33 @@ main(int argc, char **argv) dict = dict_open(dict_name, open_flags, DICT_FLAG_LOCK); dict_register(dict_name, dict); while (vstring_fgets_nonl(keybuf, VSTREAM_IN)) { - if (dict_changed()) { - msg_warn("dictionary has changed -- exiting"); - exit(0); - } - if ((key = strtok(vstring_str(keybuf), " =")) == 0) + bufp = vstring_str(keybuf); + if ((cmd = mystrtok(&bufp, " ")) == 0) continue; - if ((value = strtok((char *) 0, " =")) == 0) { + key = mystrtok(&bufp, " ="); + value = mystrtok(&bufp, " "); + if (strcmp(cmd, "del") == 0 && key && !value) { + if (dict_del(dict, key)) + vstream_printf("%s: not found\n", key); + else + vstream_printf("%s: deleted\n", key); + } else if (strcmp(cmd, "get") == 0 && key && !value) { if ((value = dict_get(dict, key)) == 0) { - vstream_printf("not found\n"); + vstream_printf("%s: not found\n", key); } else { - vstream_printf("%s\n", value); + vstream_printf("%s=%s\n", key, value); } - } else { + } else if (strcmp(cmd, "put") == 0 && key && value) { dict_put(dict, key, value); + vstream_printf("%s=%s\n", key, value); + } else { + vstream_printf("usage: del key|get key|put key=value"); } vstream_fflush(VSTREAM_OUT); } vstring_free(keybuf); dict_close(dict); + return (0); } #endif diff --git a/postfix/util/dict_test.in b/postfix/util/dict_test.in new file mode 100644 index 000000000..ef838a1bc --- /dev/null +++ b/postfix/util/dict_test.in @@ -0,0 +1,10 @@ +del bar +get bar +get nonexist +del nonexist +get foo +del foo +put baz bazval +get baz +del baz +get baz diff --git a/postfix/util/dict_test.ref b/postfix/util/dict_test.ref new file mode 100644 index 000000000..35d7c1f1b --- /dev/null +++ b/postfix/util/dict_test.ref @@ -0,0 +1,10 @@ +bar: deleted +bar: not found +nonexist: not found +nonexist: not found +foo=fooval +foo: deleted +baz=bazval +baz=bazval +baz: deleted +baz: not found diff --git a/postfix/util/msg_vstream.c b/postfix/util/msg_vstream.c index 154c00438..0d06d4e6d 100644 --- a/postfix/util/msg_vstream.c +++ b/postfix/util/msg_vstream.c @@ -14,7 +14,7 @@ /* to a VSTREAM. /* /* msg_vstream_init() sets the program name that appears in each output -/* record, and directs diagnostics (see msg(3)) to the specified +/* record, and directs diagnostics (see msg(3)) to the specified /* VSTREAM. The \fIprogname\fR argument is not copied. /* SEE ALSO /* msg(3) diff --git a/postfix/util/testdb b/postfix/util/testdb new file mode 100644 index 000000000..097c6c083 --- /dev/null +++ b/postfix/util/testdb @@ -0,0 +1,2 @@ +foo fooval +bar barval