-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
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
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.
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
===========================================================
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
-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:
===========================================
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
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;
/*
/* 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:
{
/*
- * 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.
/* System library. */
#include <sys_defs.h>
+#include <unistd.h>
+#include <errno.h>
/* Utility library. */
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;
*/
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);
}
/* System library. */
#include <sys_defs.h>
-#include <errno.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
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.
}
/*
- * 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;
}
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);
}
}
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);
}
-#++
+#
+# 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
+#
# 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
+#
-#++
+#
+# 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
+#
-#++
+#
+# 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
+#
-#++
+#
+# 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
+#
-#++
+#
+# 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
+#
-#++
+#
+# 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
+#
-#++
+#
+# 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
+#
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/*
/* 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
#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
/* 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.
* 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
/*
* 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
* 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.
+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 \
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 >$@
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
<p>
-The <b>restriction_classes</b> verbiage exists so that Postfix can
+The <b>smtpd_restriction_classes</b> verbiage exists so that Postfix can
open <b>/etc/postfix/local_domains.db</b> before entering a chroot
jail, so it is only an artefact of implementation.
<b>-c</b> <i>config_dir</i>
Read the <b>main.cf</b> and <b>master.cf</b> configuration files
- in the named directory.
+ in the named directory instead of the default con-
+ figuration directory.
- <b>-D</b> After initialization, run a debugger on the master
- process. The debugging command is specified with
+ <b>-D</b> After initialization, run a debugger on the master
+ process. The debugging command is specified with
the <b>debugger</b><i>_</i><b>command</b> in the <b>main.cf</b> global configu-
ration file.
- <b>-t</b> Test mode. Return a zero exit status when the <b>mas-</b>
- <b>ter.pid</b> lock file does not exist or when that file
- is not locked. This is evidence that the <b>master</b>
+ <b>-t</b> Test mode. Return a zero exit status when the <b>mas-</b>
+ <b>ter.pid</b> lock file does not exist or when that file
+ is not locked. This is evidence that the <b>master</b>
daemon is not running.
<b>-v</b> Enable verbose logging for debugging purposes. This
Signals:
- <b>SIGHUP</b> Upon receipt of a <b>HUP</b> signal (e.g., after <b>postfix</b>
+ <b>SIGHUP</b> Upon receipt of a <b>HUP</b> signal (e.g., after <b>postfix</b>
<b>reload</b>), the master process re-reads its configura-
- tion files. If a service has been removed from the
- <b>master.cf</b> 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
+ <b>master.cf</b> file, its running processes are termi-
+ nated immediately. Otherwise, running processes
+ are allowed to terminate as soon as is convenient,
MASTER(8) MASTER(8)
+ so that changes in configuration settings affect
only new service requests.
<b>SIGTERM</b>
- Upon receipt of a <b>TERM</b> signal (e.g., after <b>postfix</b>
- <b>abort</b>), the master process passes the signal on to
+ Upon receipt of a <b>TERM</b> signal (e.g., after <b>postfix</b>
+ <b>abort</b>), 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 (<b>postfix</b> <b>stop</b>) and allow
+ for an emergency shutdown. Normally one would ter-
+ minate only the master (<b>postfix</b> <b>stop</b>) and allow
running processes to finish what they are doing.
<b>DIAGNOSTICS</b>
<b>ENVIRONMENT</b>
<b>MAIL</b><i>_</i><b>DEBUG</b>
After initialization, start a debugger as specified
- with the <b>debugger</b><i>_</i><b>command</b> configuration parameter
+ with the <b>debugger</b><i>_</i><b>command</b> configuration parameter
in the <b>main.cf</b> configuration file.
<b>MAIL</b><i>_</i><b>CONFIG</b>
Directory with Postfix configuration files.
<b>CONFIGURATION</b> <b>PARAMETERS</b>
- The following <b>main.cf</b> parameters are especially relevant
- to this program. See the Postfix <b>main.cf</b> file for syntax
- details and for default values. Use the <b>postfix</b> <b>reload</b>
+ The following <b>main.cf</b> parameters are especially relevant
+ to this program. See the Postfix <b>main.cf</b> file for syntax
+ details and for default values. Use the <b>postfix</b> <b>reload</b>
command after a configuration change.
<b>Miscellaneous</b>
<b>mail</b><i>_</i><b>owner</b>
- The owner of the mail queue and of most Postfix
+ The owner of the mail queue and of most Postfix
processes.
<b>command</b><i>_</i><b>directory</b>
Directory with Postfix daemon programs.
<b>queue</b><i>_</i><b>directory</b>
- 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.
<b>Resource</b> <b>controls</b>
<b>default</b><i>_</i><b>process</b><i>_</i><b>limit</b>
- Default limit for the number of simultaneous child
+ Default limit for the number of simultaneous child
processes that provide a given service.
<b>max</b><i>_</i><b>idle</b>
- Limit the time in seconds that a child process
+ Limit the time in seconds that a child process
waits between service requests.
-
2
<b>max</b><i>_</i><b>use</b>
- Limit the number of service requests handled by a
+ Limit the number of service requests handled by a
child process.
<b>service</b><i>_</i><b>throttle</b><i>_</i><b>time</b>
- Time to avoid forking a server that appears to be
+ Time to avoid forking a server that appears to be
broken.
<b>FILES</b>
syslogd(8) system logging
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
postalias - Postfix alias database maintenance
<b>SYNOPSIS</b>
- <b>postalias</b> [<b>-Ninvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-q</b> <i>key</i>]
+ <b>postalias</b> [<b>-Ninvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>key</i>] [<b>-q</b> <i>key</i>]
[<i>file_type</i>:]<i>file_name</i> ...
<b>DESCRIPTION</b>
<b>-c</b> <i>config_dir</i>
Read the <b>main.cf</b> configuration file in the named
+ directory instead of the default configuration
directory.
- <b>-i</b> Incremental mode. Read entries from standard input
+ <b>-d</b> <i>key</i> Search the specified maps for <i>key</i> and remove one
+ entry per map. The exit status is non-zero if the
+ requested information was not found.
+
+ <b>-i</b> Incremental mode. Read entries from standard input
and do not truncate an existing database. By
- default, <b>postalias</b> creates a new database from the
+ default, <b>postalias</b> creates a new database from the
entries in <b>file</b><i>_</i><b>name</b>.
- <b>-n</b> Don't include the terminating null character that
- terminates lookup keys and values. By default,
- Postfix does whatever is the default for the host
+ <b>-n</b> 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.
- <b>-q</b> <i>key</i> Search the specified maps for <i>key</i> and print the
- first value found on the standard output stream.
+ <b>-q</b> <i>key</i> Search the specified maps for <i>key</i> 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.
<b>-v</b> Enable verbose logging for debugging purposes. Mul-
- tiple <b>-v</b> options make the software increasingly
+ tiple <b>-v</b> options make the software increasingly
verbose.
- <b>-w</b> Do not warn about duplicate entries; silently
- ignore them.
-
- Arguments:
-
POSTALIAS(1) POSTALIAS(1)
+ <b>-w</b> When updating a table, do not warn about duplicate
+ entries; silently ignore them.
+
+ Arguments:
+
<i>file_type</i>
The type of database to be produced.
- <b>btree</b> The output is a btree file, named
- <i>file_name</i><b>.db</b>. This is available only on
+ <b>btree</b> The output is a btree file, named
+ <i>file_name</i><b>.db</b>. This is available only on
systems with support for <b>db</b> databases.
- <b>dbm</b> The output consists of two files, named
- <i>file_name</i><b>.pag</b> and <i>file_name</i><b>.dir</b>. This is
- available only on systems with support for
+ <b>dbm</b> The output consists of two files, named
+ <i>file_name</i><b>.pag</b> and <i>file_name</i><b>.dir</b>. This is
+ available only on systems with support for
<b>dbm</b> databases.
- <b>hash</b> The output is a hashed file, named
- <i>file_name</i><b>.db</b>. This is available only on
+ <b>hash</b> The output is a hashed file, named
+ <i>file_name</i><b>.db</b>. This is available only on
systems with support for <b>db</b> databases.
- When no <i>file_type</i> is specified, the software uses
- the database type specified via the <b>database</b><i>_</i><b>type</b>
- configuration parameter. The default value for
+ When no <i>file_type</i> is specified, the software uses
+ the database type specified via the <b>database</b><i>_</i><b>type</b>
+ configuration parameter. The default value for
this parameter depends on the host environment.
<i>file_name</i>
- The name of the alias database source file when
+ The name of the alias database source file when
rebuilding a database.
<b>DIAGNOSTICS</b>
- 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.
+<b>BUGS</b>
+ The "delete key" support is limited to one delete opera-
+ tion per command invocation.
+
<b>ENVIRONMENT</b>
<b>MAIL</b><i>_</i><b>CONFIG</b>
Directory with Postfix configuration files.
Default alias database type. On many UNIX systems,
the default type is either <b>dbm</b> or <b>hash</b>.
-<b>STANDARDS</b>
- RFC 822 (ARPA Internet Text Messages)
-
-<b>SEE</b> <b>ALSO</b>
- <a href="aliases.5.html">aliases(5)</a> format of alias database input file.
- <a href="sendmail.1.html">sendmail(1)</a> mail posting and compatibility interface.
-
-
-
2
POSTALIAS(1) POSTALIAS(1)
+<b>STANDARDS</b>
+ RFC 822 (ARPA Internet Text Messages)
+
+<b>SEE</b> <b>ALSO</b>
+ <a href="aliases.5.html">aliases(5)</a> format of alias database input file.
+ <a href="sendmail.1.html">sendmail(1)</a> mail posting and compatibility interface.
+
<b>LICENSE</b>
The Secure Mailer license must be distributed with this
software.
-
-
-
-
-
-
-
<b>-c</b> <i>config_dir</i>
The <b>main.cf</b> configuration file is in the named
+ directory instead of the default configuration
directory.
- <b>-d</b> Print default parameter settings instead of actual
+ <b>-d</b> Print default parameter settings instead of actual
settings.
- <b>-e</b> Edit the <b>main.cf</b> configuration file. The file is
+ <b>-e</b> Edit the <b>main.cf</b> 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.
- <b>-h</b> Show parameter values only, not the ``name = ''
+ <b>-h</b> Show parameter values only, not the ``name = ''
label that normally precedes the value.
<b>-m</b> List the names of all supported lookup table types.
<b>-n</b> Print non-default parameter settings only.
<b>-v</b> Enable verbose logging for debugging purposes. Mul-
- tiple <b>-v</b> options make the software increasingly
+ tiple <b>-v</b> options make the software increasingly
verbose.
<b>DIAGNOSTICS</b>
Problems are reported to the standard error stream.
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
-
1
The following options are implemented:
<b>-c</b> <i>config_dir</i>
- 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 <b>main.cf</b> and <b>master.cf</b> 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.
<b>-D</b> (with <b>postfix</b> <b>start</b> only)
Run each Postfix daemon under control of a debugger
as specified via the <b>debugger</b><i>_</i><b>command</b> configuration
- parameter.
-
POSTFIX(1) POSTFIX(1)
+ parameter.
+
<b>-v</b> Enable verbose logging for debugging purposes. Mul-
tiple <b>-v</b> options make the software increasingly
verbose.
-
-
2
Options:
<b>-c</b> <i>config_dir</i>
- Read configuration information from <b>main.cf</b> in the
- named configuration directory.
+ Read the <b>main.cf</b> configuration file in the named
+ directory instead of the default configuration
+ directory.
<b>-v</b> Enable verbose logging for debugging purposes. Mul-
- tiple <b>-v</b> options make the software increasingly
+ tiple <b>-v</b> options make the software increasingly
verbose.
Arguments:
- <i>class</i> Name of a class of local transport channel end-
- points, either <b>public</b> (accessible by any local
+ <i>class</i> Name of a class of local transport channel end-
+ points, either <b>public</b> (accessible by any local
user) or <b>private</b> (administrative access only).
<i>service</i>
- The name of a local transport endpoint within the
+ The name of a local transport endpoint within the
named class.
<i>request</i>
- A string. The list of valid requests is service-
+ A string. The list of valid requests is service-
specific.
<b>DIAGNOSTICS</b>
Enable verbose logging for debugging purposes.
<b>CONFIGURATION</b> <b>PARAMETERS</b>
- The following <b>main.cf</b> parameters are especially relevant
- to this program. See the Postfix <b>main.cf</b> file for syntax
+ The following <b>main.cf</b> parameters are especially relevant
+ to this program. See the Postfix <b>main.cf</b> file for syntax
details and for default values.
- <b>queue</b><i>_</i><b>directory</b>
- Location of the Postfix queue, and of the local IPC
+
POSTKICK(1) POSTKICK(1)
+ <b>queue</b><i>_</i><b>directory</b>
+ Location of the Postfix queue, and of the local IPC
communication endpoints.
<b>SEE</b> <b>ALSO</b>
<a href="pickup.8.html">pickup(8)</a> local pickup daemon
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
-
-
Options:
<b>-c</b> <i>config_dir</i>
- Read configuration information from <b>main.cf</b> in the
- named configuration directory.
+ Read the <b>main.cf</b> configuration file in the named
+ directory instead of the default configuration
+ directory.
<b>-v</b> Enable verbose logging for debugging purposes. Mul-
- tiple <b>-v</b> options make the software increasingly
+ tiple <b>-v</b> options make the software increasingly
verbose.
Arguments:
- <i>file</i> A mailbox file. The user should have read/write
+ <i>file</i> A mailbox file. The user should have read/write
permission.
<i>command...</i>
- The command to execute while <i>file</i> is locked for
- exclusive access. The command is executed
- directly, i.e. without interpretation by a shell
+ The command to execute while <i>file</i> is locked for
+ exclusive access. The command is executed
+ directly, i.e. without interpretation by a shell
command interpreter.
<b>DIAGNOSTICS</b>
- The result status is 75 (EX_TEMPFAIL) when the file is
- locked by another process, 255 (on some systems: -1) when
- <b>postlock</b> 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
+ <b>postlock</b> could not perform the requested operation. Oth-
+ erwise, the exit status is the exit status from the com-
mand.
<b>BUGS</b>
- 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.
<b>ENVIRONMENT</b>
Enable verbose logging for debugging purposes.
<b>CONFIGURATION</b> <b>PARAMETERS</b>
- The following <b>main.cf</b> parameters are especially relevant
- to this program. See the Postfix <b>main.cf</b> file for syntax
+ The following <b>main.cf</b> parameters are especially relevant
POSTLOCK(1) POSTLOCK(1)
+ to this program. See the Postfix <b>main.cf</b> file for syntax
details and for default values.
<b>Locking</b> <b>controls</b>
<b>deliver</b><i>_</i><b>lock</b><i>_</i><b>attempts</b>
- Limit the number of attempts to acquire an exclu-
+ Limit the number of attempts to acquire an exclu-
sive lock.
<b>deliver</b><i>_</i><b>lock</b><i>_</i><b>delay</b>
- Time in seconds between successive attempts to
+ Time in seconds between successive attempts to
acquire an exclusive lock.
<b>stale</b><i>_</i><b>lock</b><i>_</i><b>time</b>
<b>Resource</b> <b>controls</b>
<b>fork</b><i>_</i><b>attempts</b>
- Number of attempts to <b>fork</b>() a process before giv-
+ Number of attempts to <b>fork</b>() a process before giv-
ing up.
<b>fork</b><i>_</i><b>delay</b>
- Delay in seconds between successive <b>fork</b>()
+ Delay in seconds between successive <b>fork</b>()
attempts.
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
-
2
postmap - Postfix lookup table management
<b>SYNOPSIS</b>
- <b>postmap</b> [<b>-Ninvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-q</b> <i>key</i>]
+ <b>postmap</b> [<b>-Ninvw</b>] [<b>-c</b> <i>config_dir</i>] [<b>-d</b> <i>key</i>] [<b>-q</b> <i>key</i>]
[<i>file_type</i>:]<i>file_name</i> ...
<b>DESCRIPTION</b>
<b>-c</b> <i>config_dir</i>
Read the <b>main.cf</b> configuration file in the named
+ directory instead of the default configuration
directory.
- <b>-i</b> Incremental mode. Read entries from standard input
- and do not truncate an existing database. By
- default, <b>postmap</b> creates a new database from the
- entries in <b>file</b><i>_</i><b>name</b>.
+ <b>-d</b> <i>key</i> Search the specified maps for <i>key</i> and remove one
+ entry per map. The exit status is non-zero if the
+ requested information was not found.
POSTMAP(1) POSTMAP(1)
- <b>-n</b> Don't include the terminating null character that
- terminates lookup keys and values. By default,
- Postfix does whatever is the default for the host
+ <b>-i</b> Incremental mode. Read entries from standard input
+ and do not truncate an existing database. By
+ default, <b>postmap</b> creates a new database from the
+ entries in <b>file</b><i>_</i><b>name</b>.
+
+ <b>-n</b> 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.
- <b>-q</b> <i>key</i> Search the specified maps for <i>key</i> and print the
- first value found on the standard output stream.
+ <b>-q</b> <i>key</i> Search the specified maps for <i>key</i> 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.
<b>-v</b> Enable verbose logging for debugging purposes. Mul-
- tiple <b>-v</b> options make the software increasingly
+ tiple <b>-v</b> options make the software increasingly
verbose.
- <b>-w</b> Do not warn about duplicate entries; silently
- ignore them.
+ <b>-w</b> When updating a table, do not warn about duplicate
+ entries; silently ignore them.
Arguments:
<i>file_type</i>
The type of database to be produced.
- <b>btree</b> The output file is a btree file, named
- <i>file_name</i><b>.db</b>. This is available only on
+ <b>btree</b> The output file is a btree file, named
+ <i>file_name</i><b>.db</b>. This is available only on
systems with support for <b>db</b> databases.
- <b>dbm</b> The output consists of two files, named
- <i>file_name</i><b>.pag</b> and <i>file_name</i><b>.dir</b>. This is
- available only on systems with support for
+ <b>dbm</b> The output consists of two files, named
+ <i>file_name</i><b>.pag</b> and <i>file_name</i><b>.dir</b>. This is
+ available only on systems with support for
<b>dbm</b> databases.
- <b>hash</b> The output file is a hashed file, named
- <i>file_name</i><b>.db</b>. This is available only on
+ <b>hash</b> The output file is a hashed file, named
+ <i>file_name</i><b>.db</b>. This is available only on
systems with support for <b>db</b> databases.
- When no <i>file_type</i> is specified, the software uses
- the database type specified via the <b>database</b><i>_</i><b>type</b>
+ When no <i>file_type</i> is specified, the software uses
+ the database type specified via the <b>database</b><i>_</i><b>type</b>
configuration parameter.
<i>file_name</i>
- The name of the lookup table source file when
+ The name of the lookup table source file when
rebuilding a database.
<b>DIAGNOSTICS</b>
stream. No output means no problems. Duplicate entries are
skipped and are flagged with a warning.
-<b>ENVIRONMENT</b>
- <b>MAIL</b><i>_</i><b>CONFIG</b>
- Directory with Postfix configuration files.
- <b>MAIL</b><i>_</i><b>VERBOSE</b>
- Enable verbose logging for debugging purposes.
POSTMAP(1) POSTMAP(1)
+<b>BUGS</b>
+ The "delete key" support is limited to one delete opera-
+ tion per command invocation.
+
+<b>ENVIRONMENT</b>
+ <b>MAIL</b><i>_</i><b>CONFIG</b>
+ Directory with Postfix configuration files.
+
+ <b>MAIL</b><i>_</i><b>VERBOSE</b>
+ Enable verbose logging for debugging purposes.
+
<b>CONFIGURATION</b> <b>PARAMETERS</b>
<b>database</b><i>_</i><b>type</b>
Default output database type. On many UNIX sys-
-
-
-
-
-
-
-
-
-
-
-
send mail to the postmaster with transcripts of
SMTP sessions with protocol errors.
+ <b>smtp</b><i>_</i><b>always</b><i>_</i><b>send</b><i>_</i><b>ehlo</b>
+ Always send EHLO at the start of a connection.
+
<b>smtp</b><i>_</i><b>skip</b><i>_</i><b>4xx</b><i>_</i><b>greeting</b>
Skip servers that greet us with a 4xx status code.
- <b>smtp</b><i>_</i><b>skip</b><i>_</i><b>5xx</b><i>_</i><b>greeting</b>
- Skip servers that greet us with a 5xx status code.
-
SMTP(8) SMTP(8)
+ <b>smtp</b><i>_</i><b>skip</b><i>_</i><b>5xx</b><i>_</i><b>greeting</b>
+ Skip servers that greet us with a 5xx status code.
+
<b>smtp</b><i>_</i><b>skip</b><i>_</i><b>quit</b><i>_</i><b>response</b>
Do not wait for the server response after sending
QUIT.
<b>smtp</b><i>_</i><b>data</b><i>_</i><b>done</b><i>_</i><b>timeout</b>
Timeout in seconds for sending the "<b>.</b>" command, and
- for receiving the server response. When no response
- is received, a warning is logged that the mail may
- be delivered multiple times.
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.
+
<b>smtp</b><i>_</i><b>quit</b><i>_</i><b>timeout</b>
Timeout in seconds for sending the <b>QUIT</b> command,
and for receiving the server response.
-
-
-
-
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/* .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
/*
/* 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
/*
/* 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
+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 \
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 - $? >$@
.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
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
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
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
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
.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)"
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.
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.
.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
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
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
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
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
.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
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/* 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
/* 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.
/* 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.
/* 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.
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/* 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
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/* 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
/* 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
/* 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
/* 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
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);
}
int open_flags = O_RDWR | O_CREAT | O_TRUNC;
int dict_flags = DICT_FLAG_DUP_WARN;
char *query = 0;
+ char *delkey = 0;
int found;
/*
/*
* 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]);
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;
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':
* 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) {
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);
}
}
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/^(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"
}
}
/*
/* 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
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/* .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)"
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/*
/* 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.
/* 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.
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/*
/* 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.
/* 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
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/* 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
/* 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
/* 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
/* 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
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);
}
int open_flags = O_RDWR | O_CREAT | O_TRUNC;
int dict_flags = DICT_FLAG_DUP_WARN;
char *query = 0;
+ char *delkey = 0;
int found;
/*
/*
* 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]);
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;
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':
* 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) {
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);
}
}
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/* 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
--- /dev/null
+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/^/# /' >$@
--- /dev/null
+#++
+# 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
+#--
--- /dev/null
+#
+# >>>>>>>>>> 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
+#--
--- /dev/null
+#
+# >>>>>>>>>> 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
+
--- /dev/null
+#++
+# 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
--- /dev/null
+#++
+# 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
+#--
--- /dev/null
+#++
+# 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
+#--
--- /dev/null
+#++
+# 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
--- /dev/null
+#++
+# 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
--- /dev/null
+#++
+# 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
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/* 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
* 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;
*/
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;
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/* .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
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
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,
};
session->best = 1;
break;
}
+ msg_info("%s (port %d)", vstring_str(why), ntohs(port));
}
dns_rr_free(addr_list);
return (session);
} 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
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
} 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");
} 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);
}
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)
&& !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));
}
}
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/* 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.
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
+#include <errno.h>
/* Utility library. */
/*
* 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.
*/
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 *);
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)
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);
}
}
}
+/* 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;
session->stream = 0;
session->xfer_count = 0;
session->connect_count = connect_count;
+ session->next = 0;
session_count++;
startup(session);
}
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
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
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
/*
/* 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,
-TNAMADR_LIST
-TNAME_MASK
-TPEER_NAME
+-TPENDING
-TPICKUP_INFO
-TPIPE_ATTR
-TPIPE_PARAMS
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.in 2>valid_hostname.tmp
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
/* 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
#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;
&& (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
}
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.
/* 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.
&& (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
}
/* 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.
/* .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
DICT *dict;
char *dict_name;
int open_flags;
+ char *bufp;
+ char *cmd;
char *key;
const char *value;
int ch;
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
--- /dev/null
+del bar
+get bar
+get nonexist
+del nonexist
+get foo
+del foo
+put baz bazval
+get baz
+del baz
+get baz
--- /dev/null
+bar: deleted
+bar: not found
+nonexist: not found
+nonexist: not found
+foo=fooval
+foo: deleted
+baz=bazval
+baz=bazval
+baz: deleted
+baz: not found
/* 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)
--- /dev/null
+foo fooval
+bar barval