mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-30 13:48:06 +00:00
snapshot-20001027
This commit is contained in:
committed by
Viktor Dukhovni
parent
92472d4e5d
commit
14ffa91298
@@ -49,8 +49,8 @@ Mail addresses (PLEASE send questions to the mailing list)
|
||||
|
||||
In order to subscribe to a mailing list, see http://www.postfix.org/.
|
||||
|
||||
Acknowledgements
|
||||
================
|
||||
Acknowledgments
|
||||
===============
|
||||
|
||||
This release could not have happened without the input from a team
|
||||
of competent alpha testers. Their names appear in numerous places
|
||||
|
@@ -2,7 +2,7 @@ LINUX SYSLOGD PERFORMANCE
|
||||
=========================
|
||||
|
||||
LINUX syslogd uses synchronous writes by default, which is very
|
||||
expensive. For services such a mail it is recommended that you
|
||||
expensive. For services such as mail it is recommended that you
|
||||
disable synchronous logfile writes by editing /etc/syslog.conf and
|
||||
by prepending a - to the logfile name:
|
||||
|
||||
|
@@ -14,7 +14,7 @@ delivered-to yes
|
||||
dsn not yet
|
||||
errors-to: yes
|
||||
esmtp yes
|
||||
etrn support yes (flushes entire queue)
|
||||
etrn support yes (uses per-destination log or flushes entire queue)
|
||||
fcntl locking yes (compile time)
|
||||
flock locking yes (compile time)
|
||||
home mailbox yes
|
||||
|
21
postfix/DB_README
Normal file
21
postfix/DB_README
Normal file
@@ -0,0 +1,21 @@
|
||||
Purpose of this document
|
||||
========================
|
||||
|
||||
This document describes how to build Postfix with Berkeley DB
|
||||
support on systems that ship without DB library. The canonical
|
||||
third-party source for Berkeley DB is www.sleepycat.com.
|
||||
|
||||
The information can also be used to build Postfix with a non-default
|
||||
Berkeley DB version. However, the file formats of Berkeley DB
|
||||
version 2 and later are not compatible with the older Berkeley DB
|
||||
version that ships with, for example, 4.4BSD.
|
||||
|
||||
Building Postfix with third-party Berkeley DB support
|
||||
=====================================================
|
||||
|
||||
If you installed the Berkeley DB from Sleepycat, use something like:
|
||||
|
||||
% make tidy
|
||||
% make makefiles CCARGS="-DHAS_DB -I/usr/local/BerkeleyDB/include" \
|
||||
AUXLIBS=/usr/local/BerkeleyDB/lib/libdb.a
|
||||
% make
|
@@ -128,7 +128,7 @@ In order to compile Postfix with optimizations turned off:
|
||||
% make makefiles OPT=
|
||||
|
||||
This produces a set of Makefiles that do not request compiler
|
||||
optomization.
|
||||
optimization.
|
||||
|
||||
Once the makefiles are set up, build the software:
|
||||
|
||||
|
@@ -45,7 +45,7 @@ in the main.cf configuration file.
|
||||
By default, Postfix "fast ETRN/sendmail -qR" service is available
|
||||
only for destinations that Postfix is willing to relay mail to:
|
||||
|
||||
fast_flush_policy = relay
|
||||
fast_flush_domains = $relay_domains
|
||||
|
||||
The "relay_domains" parameter specifies what destinations Postfix
|
||||
will relay to.
|
||||
@@ -54,14 +54,14 @@ For destinations that are not eligible for the new "fast ETRN/sendmail
|
||||
-qR" service, Postfix falls back to the old "slow ETRN" method
|
||||
which attempts to deliver all queued mail.
|
||||
|
||||
To enable "fast ETRN/sendmail -qR" for all destinations, specify:
|
||||
To enable "fast ETRN/sendmail -qR" for some other destination, specify:
|
||||
|
||||
fast_flush_policy = all
|
||||
fast_flush_domains = $relay_domains, some.other.domain
|
||||
|
||||
To disable "fast ETRN/sendmail -qR", so that Postfix always uses
|
||||
the old "slow ETRN" which delivers all queued mail, specify:
|
||||
|
||||
fast_flush_policy = none
|
||||
fast_flush_domains =
|
||||
|
||||
Testing the fast ETRN service
|
||||
=============================
|
||||
|
@@ -104,7 +104,7 @@ Apologies for any names omitted.
|
||||
that use short hostnames will have to specify their FQDN
|
||||
in main.cf (this will eventually be done by the system
|
||||
installation/configuration procedure). Should the config
|
||||
language support backtics so one can say `domainname`? What
|
||||
language support backticks so one can say `domainname`? What
|
||||
about $name stuff between the backtics?
|
||||
|
||||
Security: the master now creates FIFOs and UNIX-domain
|
||||
@@ -822,7 +822,7 @@ Apologies for any names omitted.
|
||||
Feature: hashed queues. Rewrote parts of the mail queue
|
||||
API. Configuration parameters: "hash_queue_names" specifies
|
||||
what queue directories will be hashed (default: the defer
|
||||
log drectory), "hash_queue_depth" specifies the number of
|
||||
log directory), "hash_queue_depth" specifies the number of
|
||||
subdirectories used for hashing (default 2).
|
||||
|
||||
19980802
|
||||
@@ -2321,7 +2321,7 @@ Apologies for any names omitted.
|
||||
|
||||
Bugfix: the SMTPD check scaffolding didn't apply the same
|
||||
sanity checks as the production code. Problem reported by
|
||||
Alain Thivillon, Herv<EFBFBD> Schauer Consultants, France. File:
|
||||
Alain Thivillon, Herve Schauer Consultants, France. File:
|
||||
smtpd/smtpd_check.c.
|
||||
|
||||
Portability: some systems can have more than 59 seconds in
|
||||
@@ -2491,7 +2491,7 @@ Apologies for any names omitted.
|
||||
This needed the partial lookup key support to avoid passing
|
||||
partial addresses to regexp-based lookup tables (user,
|
||||
@domain, user@, domain). Files: global/maps.c
|
||||
globl/mail_addr_find.c.
|
||||
global/mail_addr_find.c.
|
||||
|
||||
Feature: new dictionary types can be registered with
|
||||
dict_open_register(). File: util/dict_open.c.
|
||||
@@ -2670,7 +2670,7 @@ Apologies for any names omitted.
|
||||
|
||||
Workaround: renamed config.h to mail_conf.h etc. in order
|
||||
to avoid name collisions with LINUX (yes, they have a system
|
||||
include file calle config.h). For compatibility with people
|
||||
include file called config.h). For compatibility with people
|
||||
who have written software for Postfix, there's a config.h
|
||||
that aliases the old names to the new ones. That file will
|
||||
go away eventually.
|
||||
@@ -2906,7 +2906,7 @@ Apologies for any names omitted.
|
||||
Workaround: in the INSTALL file, use `&&' instead of `;'
|
||||
in (cd path; tar ...) pipelines because some UNIX re-invented
|
||||
shells don't bail out when cd fails. Matthias Andree
|
||||
@dosis.uni-dortmund.de.
|
||||
@stud.uni-dortmund.de.
|
||||
|
||||
19990709
|
||||
|
||||
@@ -3566,7 +3566,7 @@ Apologies for any names omitted.
|
||||
Workaround: rename() over NFS can fail with ENOENT even
|
||||
when the operation succeeds (Graham Orndorff @ WebTV). This
|
||||
is not news. Any non-idempotent operation can fail over
|
||||
NFS when the NFS server's acknowledgement is lost and the
|
||||
NFS when the NFS server's acknowledgment is lost and the
|
||||
NFS client code retries the operation (other examples are:
|
||||
create, symlink, link, unlink, mkdir, rmdir). Postfix has
|
||||
workarounds for the cases where this is most likely to
|
||||
@@ -3658,7 +3658,7 @@ Apologies for any names omitted.
|
||||
Robustness: limit the number of recipient addresses that
|
||||
can be extracted from message headers. Parameter:
|
||||
extract_recipient_limit (default: 10240). Files:
|
||||
cleaup/cleanup_message.c, cleanup/cleanup_extracted.c.
|
||||
cleanup/cleanup_message.c, cleanup/cleanup_extracted.c.
|
||||
|
||||
Cleanup: the message header reject logging now includes
|
||||
sender and recipient address (if possible), so that the
|
||||
@@ -3712,7 +3712,7 @@ Apologies for any names omitted.
|
||||
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.
|
||||
Requested by Matthias Andree @ stud.uni-dortmund.de.
|
||||
|
||||
20000308
|
||||
|
||||
@@ -3853,7 +3853,7 @@ Apologies for any names omitted.
|
||||
VSTREAM_CTL_TIMEOUT...) sets the timeout deadline on a
|
||||
stream, and vstream_ftimeout(stream) queries a stream for
|
||||
timeout errors. This change simplified timeout handling
|
||||
considerably. Files: util/vbuf.h, util/vstrean.[hc],
|
||||
considerably. Files: util/vbuf.h, util/vstream.[hc],
|
||||
global/smtp_stream.c, global/timed_ipc.c.
|
||||
|
||||
20000504
|
||||
@@ -4063,7 +4063,7 @@ Apologies for any names omitted.
|
||||
20000623
|
||||
|
||||
Bugfix: the SMTP server did not reset the so-called junk
|
||||
command counter after successfull delivery (Mark Hoffman
|
||||
command counter after successful delivery (Mark Hoffman
|
||||
@ wallst.com). File: smtpd/smtpd.c.
|
||||
|
||||
20000625
|
||||
@@ -4286,7 +4286,7 @@ Apologies for any names omitted.
|
||||
|
||||
Feature: Postfix bounced mail and delayed mail notifications
|
||||
now have the standard RFC 1894 form (DSN). The bounce
|
||||
service now uses the's generic bounce logfile API. File:
|
||||
service now uses the generic bounce logfile API. File:
|
||||
bounce/bounce_notify_service.c, bounce/bounce_notify_util.c.
|
||||
|
||||
Cleanup: deleted the per-recipient bounce protocol. Future
|
||||
@@ -4353,3 +4353,45 @@ Apologies for any names omitted.
|
||||
|
||||
Portability: Redhat 7 library interfaces have changed
|
||||
incompatibly, which breaks existing software. File makedefs.
|
||||
|
||||
Bugfix: the fallback_relay parameter did not work with []
|
||||
or with network ports, and Postfix would always attempt to
|
||||
perform MX record lookups. Files: smtp/smtp_addr.c
|
||||
|
||||
Convenience: you can now specify multiple destinations in
|
||||
the relayhost configuration parameter. They will be tried
|
||||
in the specified order. File: smtp/smtp_connect.c.
|
||||
|
||||
Typographical corrections by Matthias Andree.
|
||||
|
||||
20001024
|
||||
|
||||
Documentation: the canonical, virtual etc. manual pages
|
||||
did not document the effect of leading whitespace.
|
||||
|
||||
20001025
|
||||
|
||||
Bugfix: virtual map expansion stopped too early with
|
||||
self-referential aliases. Reported by Michael Douglass
|
||||
@ datafoundry.net. File: cleanup/cleanup_map1n.c.
|
||||
|
||||
20001026
|
||||
|
||||
Horror: postmap and postalias (newaliases) silently lose
|
||||
the file lock while building a lookup table with Berkeley
|
||||
DB 2.x and later on Solaris, HP-UX or IRIX. The result is
|
||||
that table lookups fail while the table is being built, so
|
||||
that mail is lost. In order to avoid this misbehavior one
|
||||
has to use an undocumented feature that is NOT available
|
||||
with the DB1.85 compatibility interface. Therefore, Postfix
|
||||
now supports three Berkeley DB programming interfaces of
|
||||
increasing complexity. File: util/dict_db.c.
|
||||
|
||||
Bugfix: made some character manipulations independent of
|
||||
signed/unsigned characters. Files: global/quote_821_local.c,
|
||||
global/quote_822_local.c.
|
||||
|
||||
Workaround: some software sends SMTP mail that begins with
|
||||
"From sender time-stamp". Sendmail accepts such RFC vioating
|
||||
garbage, and therefore Postfix needs to jump another hoop.
|
||||
File: smtpd/smtpd.c.
|
||||
|
@@ -31,7 +31,7 @@ should be executed as an unprivileged user.
|
||||
=================
|
||||
|
||||
Documentation is available as HTML web pages (point your browser
|
||||
to html/index.html) and as UNIX-style manpages (point your MANPATH
|
||||
to html/index.html) and as UNIX-style man pages (point your MANPATH
|
||||
environment variable to the `man' subdirectory; be sure to use an
|
||||
absolute path).
|
||||
|
||||
@@ -419,7 +419,7 @@ 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:
|
||||
highly 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
|
||||
@@ -432,7 +432,7 @@ Postfix systems.
|
||||
12 - Security: writable versus protected maildrop directory
|
||||
===========================================================
|
||||
|
||||
Postfix offers a choice of submission mechanims.
|
||||
Postfix offers a choice of submission mechanisms.
|
||||
|
||||
1 - Postfix can use a world-writable, sticky, mode 1733 maildrop
|
||||
directory where local users can submit mail. This approach
|
||||
|
@@ -31,7 +31,7 @@ Next, put the following in /etc/inetd.conf:
|
||||
/usr/sbin/tcpd is from the tcp_wrappers package. You want this to
|
||||
make sure only your mail relay(s) can talk to the LMTP server.
|
||||
Postfix by default does multiple deliveries per LMTP session
|
||||
(connection cacheing), so do not worry about the overhead of
|
||||
(connection caching), so do not worry about the overhead of
|
||||
tcp_wrapping the LMTP port.
|
||||
|
||||
On some systems, tcpd is built into inetd, so you do not have to
|
||||
@@ -63,15 +63,15 @@ Instead of "hash", use the map type of your choice. Some systems
|
||||
use "dbm" instead. Use "postconf -m" to find out what map types
|
||||
are supported.
|
||||
|
||||
Improving connection cacheing performance
|
||||
=========================================
|
||||
Improving connection caching performance
|
||||
========================================
|
||||
|
||||
After delivering a message via LMTP, Postfix will keep the connection
|
||||
open for a while, so that it can be reused for a subsequent delivery.
|
||||
This reduces overhead of LMTP servers that create one process per
|
||||
connection.
|
||||
|
||||
For LMTP connection cacheing to work, the Postfix LMTP client should
|
||||
For LMTP connection caching to work, the Postfix LMTP client should
|
||||
not switch destination hosts. This is no problem when you run only
|
||||
one LMTP server. However, if you run multiple LMTP servers, this
|
||||
can be an issue.
|
||||
|
@@ -37,7 +37,7 @@ map config file follows:
|
||||
|
||||
# the user name and password to log into the mysql server
|
||||
user = someone
|
||||
password = some_passwordd
|
||||
password = some_password
|
||||
|
||||
# the database name on the servers
|
||||
dbname = customer_database
|
||||
@@ -79,7 +79,7 @@ databases on two or more hosts. Whenever queries fail with an error
|
||||
at one host, the rest of the hosts will be tried in order. Each host
|
||||
that is in an error state will undergo a reconnection attempt every so
|
||||
often, and if no mysql server hosts are reachable, then mail will be
|
||||
deferred until atleast one of those hosts is reachable.
|
||||
deferred until at least one of those hosts is reachable.
|
||||
|
||||
Performance of postfix with mysql has not been thoroughly tested,
|
||||
however, we have found it to be stable. Busy mail servers using mysql
|
||||
|
@@ -1,3 +1,17 @@
|
||||
Incompatible changes with snapshot-20001027
|
||||
===========================================
|
||||
|
||||
Berkeley DB support has changed for Solaris, HP-UX, UNIXWARE, IRIX.
|
||||
You can no longer use the DB 1.85 compatibility interface, because
|
||||
that interface loses the file lock while building a table, so that
|
||||
table lookups fail and mail is lost. See the DB_README file for
|
||||
instructions on how to build with third-party Berkeley DB support.
|
||||
|
||||
The "fast ETRN" policy configuration has changed. You now specify
|
||||
the list of eligible "fast ETRN" domains with the fast_flush_domains
|
||||
parameter (default: $relay_domains). In order to disable the feature,
|
||||
specify an empty value (fast_flush_domains =).
|
||||
|
||||
Incompatible changes with snapshot-20001005
|
||||
===========================================
|
||||
|
||||
@@ -229,12 +243,12 @@ connections to a specific local interface. Or override the default
|
||||
setting in master.cf with "smtp -o smtp_bind_address=x.x.x.x".
|
||||
For now, you must specify a numeric IP address.
|
||||
|
||||
Preliminary LMTP client support over TCP with connection cacheing.
|
||||
Preliminary LMTP client support over TCP with connection caching.
|
||||
Support for LMTP over UNIX-domain sockets will be added later as
|
||||
an enhancement to the transport table syntax. See the LMTP_README
|
||||
file for more details.
|
||||
|
||||
By the way, LMTP client-side connection cacheing is a good example
|
||||
By the way, LMTP client-side connection caching is a good example
|
||||
for how to do the same in the SMTP client.
|
||||
|
||||
Preliminary support for SASL authentication, both in the SMTP server
|
||||
@@ -684,7 +698,7 @@ Incompatible changes with postfix-beta-19990122:
|
||||
customer.org smtp:[gateway.customer.org]
|
||||
.customer.org smtp:[gateway.customer.org]
|
||||
|
||||
This change makes tranport tables more compatible with
|
||||
This change makes transport tables more compatible with
|
||||
sendmail mailer tables.
|
||||
|
||||
- The format of syslog records has changed. A client is now always
|
||||
|
@@ -35,43 +35,47 @@
|
||||
# Blank lines are ignored, as are lines beginning
|
||||
# with `#'.
|
||||
#
|
||||
# leading whitespace
|
||||
# Lines that begin with whitespace continue the pre-
|
||||
# vious line.
|
||||
#
|
||||
# pattern action
|
||||
# When pattern matches a mail address, domain or host
|
||||
# address, perform the corresponding action.
|
||||
#
|
||||
# PATTERNS
|
||||
# With lookups from indexed files such as DB or DBM, or from
|
||||
# networked tables such as NIS, LDAP or SQL, patterns are
|
||||
# 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.
|
||||
# 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)
|
||||
#
|
||||
# user@ Matches all mail addresses with the specified user
|
||||
# part.
|
||||
#
|
||||
# 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
|
||||
# net Matches any host address in the specified network.
|
||||
# A network address is a sequence of one or more
|
||||
# octets separated by ".".
|
||||
#
|
||||
# ACTIONS
|
||||
# [45]XX text
|
||||
# Reject the address etc. that matches the pattern,
|
||||
# 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
|
||||
@@ -83,42 +87,43 @@
|
||||
# Accept the address etc. that matches the pattern.
|
||||
#
|
||||
# REGULAR EXPRESSION TABLES
|
||||
# This section describes how the table lookups change when
|
||||
# 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,
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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.
|
||||
# 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
|
||||
#
|
||||
# 2
|
||||
#
|
||||
# ACCESS(5) ACCESS(5)
|
||||
#
|
||||
# pcre_table(5) format of PCRE tables
|
||||
# regexp_table(5) format of POSIX regular expression tables
|
||||
#
|
||||
# LICENSE
|
||||
# The Secure Mailer license must be distributed with this
|
||||
# The Secure Mailer license must be distributed with this
|
||||
# software.
|
||||
#
|
||||
# AUTHOR(S)
|
||||
|
@@ -50,84 +50,87 @@
|
||||
# Blank lines are ignored, as are lines beginning
|
||||
# with `#'.
|
||||
#
|
||||
# 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
|
||||
# leading whitespace
|
||||
# Lines that begin with whitespace continue the pre-
|
||||
# vious line.
|
||||
#
|
||||
# 1
|
||||
#
|
||||
# CANONICAL(5) CANONICAL(5)
|
||||
#
|
||||
# networked tables such as NIS, LDAP or SQL, patterns are
|
||||
# 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
|
||||
# user@domain is replaced by address. This form has
|
||||
# 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
|
||||
# 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-
|
||||
# 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
|
||||
# This form is useful for replacing login names by
|
||||
# Firstname.Lastname.
|
||||
#
|
||||
# @domain address
|
||||
# Every address in domain is replaced by 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-
|
||||
# In all the above forms, when address has the form @other-
|
||||
# domain, the result is the same user in otherdomain.
|
||||
#
|
||||
# ADDRESS EXTENSION
|
||||
# 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
|
||||
# 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
|
||||
# This section describes how the table lookups change when
|
||||
# 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,
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# Patterns are applied in the order as specified in the
|
||||
#
|
||||
# 2
|
||||
#
|
||||
# CANONICAL(5) CANONICAL(5)
|
||||
#
|
||||
# from the pattern can be interpolated as $1, $2 and so on.
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
@@ -144,19 +147,19 @@
|
||||
# Other parameters of interest:
|
||||
#
|
||||
# inet_interfaces
|
||||
# The network interface addresses that this system
|
||||
# The network interface addresses that this system
|
||||
# receives mail on.
|
||||
#
|
||||
# masquerade_domains
|
||||
# List of domains that hide their subdomain struc-
|
||||
# List of domains that hide their subdomain struc-
|
||||
# ture.
|
||||
#
|
||||
# masquerade_exceptions
|
||||
# List of user names that are not subject to address
|
||||
# List of user names that are not subject to address
|
||||
# masquerading.
|
||||
#
|
||||
# mydestination
|
||||
# List of domains that this mail system considers
|
||||
# List of domains that this mail system considers
|
||||
# local.
|
||||
#
|
||||
# myorigin
|
||||
@@ -168,17 +171,18 @@
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# 3
|
||||
#
|
||||
# CANONICAL(5) CANONICAL(5)
|
||||
#
|
||||
# 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
|
||||
# The Secure Mailer license must be distributed with this
|
||||
# The Secure Mailer license must be distributed with this
|
||||
# software.
|
||||
#
|
||||
# AUTHOR(S)
|
||||
|
@@ -288,7 +288,8 @@ mail_owner = postfix
|
||||
# headers. This requires that POSIX or PCRE regular expression support
|
||||
# is built-in. Specify "/^header-name: stuff you do not want/ REJECT"
|
||||
# in the pattern file. Patterns are case-insensitive by default. Note:
|
||||
# specify only patterns ending in REJECT. Patterns ending in OK are
|
||||
# specify only patterns ending in REJECT (reject entire message) or
|
||||
# IGNORE (silently discard this header). Patterns ending in OK are
|
||||
# mostly a waste of cycles.
|
||||
#
|
||||
#header_checks = regexp:/etc/postfix/filename
|
||||
@@ -354,14 +355,11 @@ mail_owner = postfix
|
||||
# SMTP "ETRN domain.name" command, or after execution of "sendmail
|
||||
# -qRdomain.name". This can be slow when a lot of mail is queued.
|
||||
#
|
||||
# The fast_flush_policy controls what destinations are eligible for
|
||||
# this "fast ETRN/sendmail -qR" service. Specify "all" to make all
|
||||
# destinations eligible, "relay" for relay destinations only (the
|
||||
# default), and "none" to turn this feature off.
|
||||
# The fast_flush_domains controls what destinations are eligible for
|
||||
# this "fast ETRN/sendmail -qR" service.
|
||||
#
|
||||
#fast_flush_policy = all
|
||||
#fast_flush_policy = relay
|
||||
#fast_flush_policy = none
|
||||
#fast_flush_domains = $relay_domains
|
||||
#fast_flush_policy =
|
||||
|
||||
# SHOW SOFTWARE VERSION OR NOT
|
||||
#
|
||||
|
@@ -22,45 +22,48 @@
|
||||
# Blank lines are ignored, as are lines beginning
|
||||
# with `#'.
|
||||
#
|
||||
# leading whitespace
|
||||
# Lines that begin with whitespace continue the pre-
|
||||
# vious line.
|
||||
#
|
||||
# pattern result
|
||||
# When pattern matches a search string, use the cor-
|
||||
# responding result. A line that starts with white
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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.
|
||||
# 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 whites-
|
||||
# pace.
|
||||
#
|
||||
# EXAMPLES
|
||||
# # Protect your outgoing majordomo exploders
|
||||
|
@@ -22,9 +22,13 @@
|
||||
# Blank lines are ignored, as are lines beginning
|
||||
# with `#'.
|
||||
#
|
||||
# leading whitespace
|
||||
# Lines that begin with whitespace continue the pre-
|
||||
# vious line.
|
||||
#
|
||||
# pattern result
|
||||
# When pattern matches a search string, use the cor-
|
||||
# responding result. A line that starts with white
|
||||
# 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
|
||||
@@ -33,35 +37,35 @@
|
||||
# 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
|
||||
# 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),
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# Patterns are applied in the order as specified in the
|
||||
#
|
||||
# 1
|
||||
#
|
||||
# REGEXP_TABLE(5) REGEXP_TABLE(5)
|
||||
#
|
||||
# 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
|
||||
# string may need to be written as ${n} or $(n) if they
|
||||
# aren't followed by whitespace.
|
||||
#
|
||||
# EXAMPLES
|
||||
|
@@ -35,66 +35,68 @@
|
||||
# o Blank lines are ignored, as are lines beginning
|
||||
# with `#'.
|
||||
#
|
||||
# o Lines that begin with whitespace continue the pre-
|
||||
# vious line.
|
||||
#
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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)
|
||||
#
|
||||
# @domain
|
||||
# Matches every address in domain. This form has the
|
||||
# lowest precedence.
|
||||
#
|
||||
# ADDRESS EXTENSION
|
||||
# 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.
|
||||
# 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
|
||||
# This section describes how the table lookups change when
|
||||
# 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,
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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.
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
@@ -103,11 +105,11 @@
|
||||
# Other parameters of interest:
|
||||
#
|
||||
# inet_interfaces
|
||||
# The network interface addresses that this system
|
||||
# The network interface addresses that this system
|
||||
# receives mail on.
|
||||
#
|
||||
# mydestination
|
||||
# List of domains that this mail system considers
|
||||
# List of domains that this mail system considers
|
||||
# local.
|
||||
#
|
||||
# myorigin
|
||||
@@ -123,7 +125,7 @@
|
||||
# regexp_table(5) format of POSIX regular expression tables
|
||||
#
|
||||
# LICENSE
|
||||
# The Secure Mailer license must be distributed with this
|
||||
# The Secure Mailer license must be distributed with this
|
||||
# software.
|
||||
#
|
||||
# AUTHOR(S)
|
||||
|
@@ -8,8 +8,15 @@
|
||||
# that each logical message header is matched against, including
|
||||
# headers that span multiple physical lines. Patterns are matched
|
||||
# in the specified order, and the search stops upon the first match.
|
||||
# When a pattern matches, and the associated action is REJECT, the
|
||||
# entire message is rejected.
|
||||
# When a pattern matches, what happens next depends on the associated
|
||||
# action:
|
||||
#
|
||||
# REJECT the entire message is rejected.
|
||||
#
|
||||
# IGNORE the header line is silently discarded.
|
||||
#
|
||||
# OK Nothing happens. the message will still be rejected when some
|
||||
# other header line matches a REJECT pattern.
|
||||
#
|
||||
# These patterns do not apply to MIME headers in the message body.
|
||||
#
|
||||
@@ -21,7 +28,14 @@ header_checks = regexp:/etc/postfix/header_checks
|
||||
# recognize multi-line MIME headers). Lines are matched one at a
|
||||
# time. Long lines are matched in chunks of at most $line_length_limit
|
||||
# characters. Patterns are matched in the specified order, and the
|
||||
# search stops upon the first match. When a pattern matches, and
|
||||
# the associated action is REJECT, the entire message is rejected.
|
||||
# search stops upon the first match. When a pattern matches, what
|
||||
# happens next depends on the associated action:
|
||||
#
|
||||
# REJECT the entire message is rejected.
|
||||
#
|
||||
# IGNORE the body line is silently discarded.
|
||||
#
|
||||
# OK Nothing happens. The message will still be rejected when some
|
||||
# other body line matches a REJECT pattern.
|
||||
#
|
||||
body_checks = regexp:/etc/postfix/body_checks
|
||||
|
@@ -5,7 +5,7 @@
|
||||
# control the fast flush service, which is the code that implements
|
||||
# fast ETRN and fast "sendmail -qR".
|
||||
|
||||
# The fast_flush_policy parameter specifies what destinations are
|
||||
# The fast_flush_domains parameter specifies what destinations are
|
||||
# eligible for per-destination logfiles with mail that is queued to
|
||||
# those destinations.
|
||||
#
|
||||
@@ -25,12 +25,10 @@
|
||||
# destinations that the Postfix SMTP server is willing to relay to
|
||||
# (see the relay_domains parameter in sample-smtpd.cf).
|
||||
#
|
||||
# Specify "all" to enable "fast flush" logfiles for all destinations,
|
||||
# "none" to disable the logfiles altogether.
|
||||
# Specify "fast_flush_policy =" to disable the feature altogether.
|
||||
#
|
||||
#fast_flush_policy = all
|
||||
fast_flush_policy = relay
|
||||
#fast_flush_policy = none
|
||||
fast_flush_policy = $relay_domains
|
||||
#fast_flush_policy =
|
||||
|
||||
# The fast_flush_purge_time parameter controls how long an empty
|
||||
# per-destination "fast flush" logfile is allowed to live.
|
||||
|
@@ -35,115 +35,118 @@
|
||||
# Blank lines are ignored, as are lines beginning
|
||||
# with `#'.
|
||||
#
|
||||
# leading whitespace
|
||||
# Lines that begin with whitespace continue the pre-
|
||||
# vious line.
|
||||
#
|
||||
# pattern result
|
||||
# When pattern matches the domain, use the corre-
|
||||
# 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
|
||||
# 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
|
||||
# Mail for domain is delivered through transport to
|
||||
# nexthop.
|
||||
#
|
||||
# .domain transport:nexthop
|
||||
# Mail for any subdomain of domain is delivered
|
||||
# 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:
|
||||
# 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 mydestina-
|
||||
# tion, for example:
|
||||
#
|
||||
# hostname.my.domain local:
|
||||
# localhost.my.domain local:
|
||||
#
|
||||
# The interpretation of the nexthop field is transport
|
||||
# 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-
|
||||
# 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
|
||||
# In order to send mail for foo.org and its subdomains via
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
# 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 host-
|
||||
# In the case of delivery via SMTP, one may specify host-
|
||||
# name: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 hostname in order to disable
|
||||
# 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 hostname in order to disable
|
||||
# MX lookups.
|
||||
#
|
||||
# The error mailer can be used to bounce mail:
|
||||
#
|
||||
# .foo.org error:mail for *.foo.org is not deliv-
|
||||
# erable
|
||||
#
|
||||
# 2
|
||||
#
|
||||
# TRANSPORT(5) TRANSPORT(5)
|
||||
#
|
||||
# This causes all mail for user@anything.foo.org to be
|
||||
# The error mailer can be used to bounce mail:
|
||||
#
|
||||
# .foo.org error:mail for *.foo.org is not deliv-
|
||||
# erable
|
||||
#
|
||||
# This causes all mail for user@anything.foo.org to be
|
||||
# bounced.
|
||||
#
|
||||
# REGULAR EXPRESSION TABLES
|
||||
# This section describes how the table lookups change when
|
||||
# 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,
|
||||
# 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
|
||||
# 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
|
||||
# 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.
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
@@ -152,7 +155,7 @@
|
||||
# Other parameters of interest:
|
||||
#
|
||||
# default_transport
|
||||
# The transport to use when no transport is explic-
|
||||
# The transport to use when no transport is explic-
|
||||
# itly specified.
|
||||
#
|
||||
# relayhost
|
||||
@@ -166,18 +169,17 @@
|
||||
# regexp_table(5) format of POSIX regular expression tables
|
||||
#
|
||||
# LICENSE
|
||||
# The Secure Mailer license must be distributed with this
|
||||
# The Secure Mailer license must be distributed with this
|
||||
# software.
|
||||
#
|
||||
# AUTHOR(S)
|
||||
# Wietse Venema
|
||||
# IBM T.J. Watson Research
|
||||
# P.O. Box 704
|
||||
#
|
||||
# 3
|
||||
#
|
||||
# TRANSPORT(5) TRANSPORT(5)
|
||||
#
|
||||
# AUTHOR(S)
|
||||
# Wietse Venema
|
||||
# IBM T.J. Watson Research
|
||||
# P.O. Box 704
|
||||
# Yorktown Heights, NY 10598, USA
|
||||
#
|
||||
# 4
|
||||
|
@@ -58,76 +58,80 @@
|
||||
#
|
||||
# VIRTUAL(5) VIRTUAL(5)
|
||||
#
|
||||
# leading whitespace
|
||||
# Lines that begin with whitespace continue the pre-
|
||||
# vious line.
|
||||
#
|
||||
# pattern result
|
||||
# When pattern matches a mail address, replace it by
|
||||
# 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
|
||||
# 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.
|
||||
# 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
|
||||
# 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
|
||||
# This functionality overlaps with functionality of
|
||||
# the local alias(5) database. The difference is that
|
||||
# virtual mapping can be applied to non-local
|
||||
# virtual mapping can be applied to non-local
|
||||
# addresses.
|
||||
#
|
||||
# @domain address, address, ...
|
||||
# Mail for any user in domain is redirected to
|
||||
# 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
|
||||
# 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
|
||||
# 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.
|
||||
# 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:
|
||||
# agated to the result of expansion. The matching order is:
|
||||
# user+foo@domain, user@domain, user+foo, user, and @domain.
|
||||
#
|
||||
# REGULAR EXPRESSION TABLES
|
||||
# This section describes how the table lookups change when
|
||||
# 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,
|
||||
# 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
|
||||
# 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
|
||||
# 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.
|
||||
# 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
|
||||
# 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
|
||||
# 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
|
||||
@@ -136,11 +140,11 @@
|
||||
# Other parameters of interest:
|
||||
#
|
||||
# inet_interfaces
|
||||
# The network interface addresses that this system
|
||||
# The network interface addresses that this system
|
||||
# receives mail on.
|
||||
#
|
||||
# mydestination
|
||||
# List of domains that this mail system considers
|
||||
# List of domains that this mail system considers
|
||||
# local.
|
||||
#
|
||||
# myorigin
|
||||
@@ -157,7 +161,7 @@
|
||||
# regexp_table(5) format of POSIX regular expression tables
|
||||
#
|
||||
# LICENSE
|
||||
# The Secure Mailer license must be distributed with this
|
||||
# The Secure Mailer license must be distributed with this
|
||||
# software.
|
||||
#
|
||||
# AUTHOR(S)
|
||||
|
@@ -39,27 +39,27 @@ ACCESS(5) ACCESS(5)
|
||||
Blank lines are ignored, as are lines beginning
|
||||
with `#'.
|
||||
|
||||
leading whitespace
|
||||
Lines that begin with whitespace continue the pre-
|
||||
vious line.
|
||||
|
||||
<i>pattern</i> <i>action</i>
|
||||
When <i>pattern</i> matches a mail address, domain or host
|
||||
address, perform the corresponding <i>action</i>.
|
||||
|
||||
<b>PATTERNS</b>
|
||||
With lookups from indexed files such as DB or DBM, or from
|
||||
networked tables such as NIS, LDAP or SQL, patterns are
|
||||
networked tables such as NIS, LDAP or SQL, patterns are
|
||||
tried in the order as listed below:
|
||||
|
||||
<i>user</i>@<i>domain</i>
|
||||
Matches the specified mail address.
|
||||
|
||||
<i>domain.name</i>
|
||||
Matches the <i>domain.name</i> itself and any subdomain
|
||||
thereof, either in hostnames or in mail addresses.
|
||||
Matches the <i>domain.name</i> itself and any subdomain
|
||||
thereof, either in hostnames or in mail addresses.
|
||||
Top-level domains will never be matched.
|
||||
|
||||
<i>user</i>@ Matches all mail addresses with the specified user
|
||||
part.
|
||||
|
||||
|
||||
|
||||
|
||||
1
|
||||
@@ -71,19 +71,22 @@ ACCESS(5) ACCESS(5)
|
||||
ACCESS(5) ACCESS(5)
|
||||
|
||||
|
||||
<i>user</i>@ Matches all mail addresses with the specified user
|
||||
part.
|
||||
|
||||
<i>net.work.addr.ess</i>
|
||||
|
||||
<i>net.work.addr</i>
|
||||
|
||||
<i>net.work</i>
|
||||
|
||||
<i>net</i> Matches any host address in the specified network.
|
||||
A network address is a sequence of one or more
|
||||
<i>net</i> Matches any host address in the specified network.
|
||||
A network address is a sequence of one or more
|
||||
octets separated by ".".
|
||||
|
||||
<b>ACTIONS</b>
|
||||
[<b>45</b>]<i>XX</i> <i>text</i>
|
||||
Reject the address etc. that matches the pattern,
|
||||
Reject the address etc. that matches the pattern,
|
||||
and respond with the numerical code and text.
|
||||
|
||||
<b>REJECT</b> Reject the address etc. that matches the pattern. A
|
||||
@@ -95,36 +98,33 @@ ACCESS(5) ACCESS(5)
|
||||
Accept the address etc. that matches the pattern.
|
||||
|
||||
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
|
||||
This section describes how the table lookups change when
|
||||
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,
|
||||
a description of regular expression lookup table syntax,
|
||||
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
|
||||
|
||||
Each pattern is a regular expression that is applied to
|
||||
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
|
||||
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
|
||||
<i>user@domain</i> mail addresses are not broken up into their
|
||||
no parent domain or parent network search is done, and
|
||||
<i>user@domain</i> mail addresses are not broken up into their
|
||||
<i>user@</i> and <i>domain</i> constituent parts.
|
||||
|
||||
Patterns are applied in the order as specified in the
|
||||
table, until a pattern is found that matches the search
|
||||
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 <b>$1</b>, <b>$2</b> and so on.
|
||||
Actions are the same as with normal indexed file lookups,
|
||||
with the additional feature that parenthesized substrings
|
||||
from the pattern can be interpolated as <b>$1</b>, <b>$2</b> and so on.
|
||||
|
||||
<b>BUGS</b>
|
||||
The table format does not understand quoting conventions.
|
||||
The table format does not understand quoting conventions.
|
||||
|
||||
<b>SEE</b> <b>ALSO</b>
|
||||
<a href="postmap.1.html">postmap(1)</a> create mapping table
|
||||
<a href="smtpd.8.html">smtpd(8)</a> smtp server
|
||||
<a href="pcre_table.5.html">pcre_table(5)</a> format of PCRE tables
|
||||
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -137,8 +137,11 @@ ACCESS(5) ACCESS(5)
|
||||
ACCESS(5) ACCESS(5)
|
||||
|
||||
|
||||
<a href="pcre_table.5.html">pcre_table(5)</a> format of PCRE tables
|
||||
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
|
||||
|
||||
<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>
|
||||
@@ -187,9 +190,6 @@ ACCESS(5) ACCESS(5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -54,11 +54,11 @@ CANONICAL(5) CANONICAL(5)
|
||||
Blank lines are ignored, as are lines beginning
|
||||
with `#'.
|
||||
|
||||
<i>pattern</i> <i>result</i>
|
||||
When <i>pattern</i> matches a mail address, replace it by
|
||||
the corresponding <i>result</i>.
|
||||
leading whitespace
|
||||
Lines that begin with whitespace continue the pre-
|
||||
vious line.
|
||||
|
||||
|
||||
With lookups from indexed files such as DB or DBM, or from
|
||||
|
||||
|
||||
|
||||
@@ -71,60 +71,60 @@ CANONICAL(5) CANONICAL(5)
|
||||
CANONICAL(5) CANONICAL(5)
|
||||
|
||||
|
||||
networked tables such as NIS, LDAP or SQL, patterns are
|
||||
<i>pattern</i> <i>result</i>
|
||||
When <i>pattern</i> matches a mail address, replace it by
|
||||
the corresponding <i>result</i>.
|
||||
|
||||
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:
|
||||
|
||||
<i>user</i>@<i>domain</i> <i>address</i>
|
||||
<i>user</i>@<i>domain</i> is replaced by <i>address</i>. This form has
|
||||
<i>user</i>@<i>domain</i> is replaced by <i>address</i>. 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 <i>Firstname.Lastname</i> style addresses, but see
|
||||
This form useful to clean up addresses produced by
|
||||
legacy mail systems. It can also be used to pro-
|
||||
duce <i>Firstname.Lastname</i> style addresses, but see
|
||||
below for a simpler solution.
|
||||
|
||||
<i>user</i> <i>address</i>
|
||||
<i>user</i>@<i>site</i> is replaced by <i>address</i> when <i>site</i> is equal
|
||||
to $<b>myorigin</b>, when <i>site</i> is listed in $<b>mydestina-</b>
|
||||
to $<b>myorigin</b>, when <i>site</i> is listed in $<b>mydestina-</b>
|
||||
<b>tion</b>, or when it is listed in $<b>inet</b><i>_</i><b>interfaces</b>.
|
||||
|
||||
This form is useful for replacing login names by
|
||||
This form is useful for replacing login names by
|
||||
<i>Firstname.Lastname</i>.
|
||||
|
||||
@<i>domain</i> <i>address</i>
|
||||
Every address in <i>domain</i> is replaced by <i>address</i>.
|
||||
Every address in <i>domain</i> is replaced by <i>address</i>.
|
||||
This form has the lowest precedence.
|
||||
|
||||
In all the above forms, when <i>address</i> has the form @<i>other-</i>
|
||||
In all the above forms, when <i>address</i> has the form @<i>other-</i>
|
||||
<i>domain</i>, the result is the same user in <i>otherdomain</i>.
|
||||
|
||||
<b>ADDRESS</b> <b>EXTENSION</b>
|
||||
When table lookup fails, and the address localpart con-
|
||||
tains the optional recipient delimiter (e.g.,
|
||||
<i>user+foo</i>@<i>domain</i>), the search is repeated for the unex-
|
||||
tended address (e.g. <i>user</i>@<i>domain</i>), and the unmatched
|
||||
When table lookup fails, and the address localpart con-
|
||||
tains the optional recipient delimiter (e.g.,
|
||||
<i>user+foo</i>@<i>domain</i>), the search is repeated for the unex-
|
||||
tended address (e.g. <i>user</i>@<i>domain</i>), and the unmatched
|
||||
extension is propagated to the result of table lookup. The
|
||||
matching order is: <i>user+foo</i>@<i>domain</i>, <i>user</i>@<i>domain</i>, <i>user+foo</i>,
|
||||
<i>user</i>, and @<i>domain</i>.
|
||||
|
||||
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
|
||||
This section describes how the table lookups change when
|
||||
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,
|
||||
a description of regular expression lookup table syntax,
|
||||
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
|
||||
|
||||
Each pattern is a regular expression that is applied to
|
||||
Each pattern is a regular expression that is applied to
|
||||
the entire address being looked up. Thus, <i>user@domain</i> mail
|
||||
addresses are not broken up into their <i>user</i> and <i>@domain</i>
|
||||
addresses are not broken up into their <i>user</i> and <i>@domain</i>
|
||||
constituent parts, nor is <i>user+foo</i> broken up into <i>user</i> and
|
||||
<i>foo</i>.
|
||||
|
||||
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
|
||||
Patterns are applied in the order as specified in the
|
||||
|
||||
|
||||
|
||||
@@ -137,15 +137,20 @@ CANONICAL(5) CANONICAL(5)
|
||||
CANONICAL(5) CANONICAL(5)
|
||||
|
||||
|
||||
from the pattern can be interpolated as <b>$1</b>, <b>$2</b> and so on.
|
||||
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 <b>$1</b>, <b>$2</b> and so on.
|
||||
|
||||
<b>BUGS</b>
|
||||
The table format does not understand quoting conventions.
|
||||
The table format does not understand quoting conventions.
|
||||
|
||||
<b>CONFIGURATION</b> <b>PARAMETERS</b>
|
||||
The following <b>main.cf</b> parameters are especially relevant
|
||||
to this topic. 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 topic. 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>canonical</b><i>_</i><b>maps</b>
|
||||
@@ -162,19 +167,19 @@ CANONICAL(5) CANONICAL(5)
|
||||
Other parameters of interest:
|
||||
|
||||
<b>inet</b><i>_</i><b>interfaces</b>
|
||||
The network interface addresses that this system
|
||||
The network interface addresses that this system
|
||||
receives mail on.
|
||||
|
||||
<b>masquerade</b><i>_</i><b>domains</b>
|
||||
List of domains that hide their subdomain struc-
|
||||
List of domains that hide their subdomain struc-
|
||||
ture.
|
||||
|
||||
<b>masquerade</b><i>_</i><b>exceptions</b>
|
||||
List of user names that are not subject to address
|
||||
List of user names that are not subject to address
|
||||
masquerading.
|
||||
|
||||
<b>mydestination</b>
|
||||
List of domains that this mail system considers
|
||||
List of domains that this mail system considers
|
||||
local.
|
||||
|
||||
<b>myorigin</b>
|
||||
@@ -186,11 +191,6 @@ CANONICAL(5) CANONICAL(5)
|
||||
|
||||
<b>SEE</b> <b>ALSO</b>
|
||||
<a href="cleanup.8.html">cleanup(8)</a> canonicalize and enqueue mail
|
||||
<a href="postmap.1.html">postmap(1)</a> create mapping table
|
||||
<a href="virtual.5.html">virtual(5)</a> virtual domain mapping
|
||||
<a href="pcre_table.5.html">pcre_table(5)</a> format of PCRE tables
|
||||
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -203,8 +203,13 @@ CANONICAL(5) CANONICAL(5)
|
||||
CANONICAL(5) CANONICAL(5)
|
||||
|
||||
|
||||
<a href="postmap.1.html">postmap(1)</a> create mapping table
|
||||
<a href="virtual.5.html">virtual(5)</a> virtual domain mapping
|
||||
<a href="pcre_table.5.html">pcre_table(5)</a> format of PCRE tables
|
||||
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
|
||||
|
||||
<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>
|
||||
@@ -249,11 +254,6 @@ CANONICAL(5) CANONICAL(5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -26,40 +26,40 @@ FLUSH(8) FLUSH(8)
|
||||
an email address.
|
||||
|
||||
Per-destination logfiles of deferred mail are maintained
|
||||
only for eligible destinations. The policy is specified
|
||||
with the <b>fast</b><i>_</i><b>flush</b><i>_</i><b>policy</b> configuration parameter:
|
||||
|
||||
<b>all</b> Maintain per-destination logfiles for all destina-
|
||||
tions.
|
||||
|
||||
<b>relay</b> (default policy)
|
||||
Maintain per-destination logfiles only for destina-
|
||||
tions that this system is willing to relay mail to
|
||||
(as controlled by the <b>relay</b><i>_</i><b>domains</b> configuration
|
||||
parameter).
|
||||
|
||||
<b>none</b> Do not maintain per-destination logfiles.
|
||||
only for eligible destinations. The list of eligible des-
|
||||
tinations is specified with the <b>fast</b><i>_</i><b>flush</b><i>_</i><b>domains</b> config-
|
||||
uration parameter, which defaults to <b>$relay</b><i>_</i><b>domains</b>.
|
||||
|
||||
This server implements the following requests:
|
||||
|
||||
<b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>ADD</b> <i>sitename</i> <i>queue_id</i>
|
||||
Inform the fast flush server that the specified
|
||||
message is queued for <i>sitename</i>. Depending on log-
|
||||
Inform the fast flush server that the specified
|
||||
message is queued for <i>sitename</i>. Depending on log-
|
||||
ging policy, the fast flush server stores or
|
||||
ignores the information.
|
||||
|
||||
<b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>SEND</b> <i>sitename</i>
|
||||
Request delivery of mail that is queued for <i>site-</i>
|
||||
<i>name</i>. If the destination is eligible for a fast
|
||||
flush logfile, this request triggers delivery of
|
||||
messages listed in that destination's logfile, and
|
||||
Request delivery of mail that is queued for <i>site-</i>
|
||||
<i>name</i>. If the destination is eligible for a fast
|
||||
flush logfile, this request triggers delivery of
|
||||
messages listed in that destination's logfile, and
|
||||
the logfile is truncated to zero length; if mail is
|
||||
undeliverable it will be added back to the logfile.
|
||||
|
||||
If the destination is not eligible for a fast flush
|
||||
logfile, this request triggers delivery of all
|
||||
logfile, this request triggers delivery of all
|
||||
queued mail.
|
||||
|
||||
<b>TRIGGER</b><i>_</i><b>REQ</b><i>_</i><b>WAKEUP</b>
|
||||
This wakeup request from the master is an alterna-
|
||||
tive way to request <b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>REFRESH</b>.
|
||||
|
||||
<b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>REFRESH</b> (completes in the background)
|
||||
Refresh non-empty per-destination logfiles that
|
||||
were not read in $<b>fast</b><i>_</i><b>flush</b><i>_</i><b>refresh</b><i>_</i><b>time</b> hours, by
|
||||
simulating send requests (see above) for the corre-
|
||||
sponding destinations.
|
||||
|
||||
|
||||
|
||||
1
|
||||
@@ -71,24 +71,14 @@ FLUSH(8) FLUSH(8)
|
||||
FLUSH(8) FLUSH(8)
|
||||
|
||||
|
||||
<b>TRIGGER</b><i>_</i><b>REQ</b><i>_</i><b>WAKEUP</b>
|
||||
This wakeup request from the master is an alterna-
|
||||
tive way to request <b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>REFRESH</b>.
|
||||
|
||||
<b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>REFRESH</b> (completes in the background)
|
||||
Refresh non-empty per-destination logfiles that
|
||||
were not read in $<b>fast</b><i>_</i><b>flush</b><i>_</i><b>refresh</b><i>_</i><b>time</b> hours, by
|
||||
simulating send requests (see above) for the corre-
|
||||
sponding destinations.
|
||||
|
||||
Delete empty per-destination logfiles that were not
|
||||
updated in <b>fast</b><i>_</i><b>flush</b><i>_</i><b>purge</b><i>_</i><b>time</b> days.
|
||||
|
||||
<b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>PURGE</b> (completes in the background)
|
||||
Refresh all non-empty per-destination logfiles, by
|
||||
Refresh all non-empty per-destination logfiles, by
|
||||
simulating send requests (see above) for the corre-
|
||||
sponding destinations. This can be incredibly
|
||||
expensive when logging is enabled for all deferred
|
||||
expensive when logging is enabled for all deferred
|
||||
mail, and is not recommended.
|
||||
|
||||
Delete empty per-destination logfiles that were not
|
||||
@@ -100,31 +90,41 @@ FLUSH(8) FLUSH(8)
|
||||
The request completed normally.
|
||||
|
||||
<b>FLUSH</b><i>_</i><b>STAT</b><i>_</i><b>BAD</b>
|
||||
The flush server rejected the request (bad request
|
||||
The flush server rejected the request (bad request
|
||||
name, bad request parameter value).
|
||||
|
||||
<b>FLUSH</b><i>_</i><b>STAT</b><i>_</i><b>FAIL</b>
|
||||
The request failed.
|
||||
|
||||
<b>SECURITY</b>
|
||||
The fast flush server is not security-sensitive. It does
|
||||
not talk to the network, and it does not talk to local
|
||||
users. The fast flush server can run chrooted at fixed
|
||||
The fast flush server is not security-sensitive. It does
|
||||
not talk to the network, and it does not talk to local
|
||||
users. The fast flush server can run chrooted at fixed
|
||||
low privilege.
|
||||
|
||||
<b>DIAGNOSTICS</b>
|
||||
Problems and transactions are logged to <b>syslogd</b>(8).
|
||||
|
||||
<b>BUGS</b>
|
||||
Fast flush logfiles are truncated only after a
|
||||
<b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>SEND</b> request, not when mail is actually deliv-
|
||||
ered, and therefore can accumulate outdated or redundant
|
||||
data. In order to maintain sanity, <b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>REFRESH</b> must
|
||||
be executed periodically. This can be automated with a
|
||||
suitable wakeup timer setting in the <b>master.cf</b> configura-
|
||||
Fast flush logfiles are truncated only after a
|
||||
<b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>SEND</b> request, not when mail is actually deliv-
|
||||
ered, and therefore can accumulate outdated or redundant
|
||||
data. In order to maintain sanity, <b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>REFRESH</b> must
|
||||
be executed periodically. This can be automated with a
|
||||
suitable wakeup timer setting in the <b>master.cf</b> configura-
|
||||
tion file.
|
||||
|
||||
Upon receipt of a request to deliver all mail for an
|
||||
Upon receipt of a request to deliver all mail for an eli-
|
||||
gible destination, this server requests delivery of all
|
||||
messages that are listed in that destination's logfile,
|
||||
regardless of the recipients of those messages. This is
|
||||
not an issue for mail that is sent to a <b>relay</b><i>_</i><b>domains</b> des-
|
||||
tination because such mail typically only has recipients
|
||||
in one domain.
|
||||
|
||||
<b>FILES</b>
|
||||
/var/spool/postfix/flush, location of "fast flush" logfiles.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -137,34 +137,24 @@ FLUSH(8) FLUSH(8)
|
||||
FLUSH(8) FLUSH(8)
|
||||
|
||||
|
||||
eligible destination, this server requests delivery of all
|
||||
messages that are listed in that destination's logfile,
|
||||
regardless of the recipients of those messages. This is
|
||||
not an issue for mail that is sent to a <b>relay</b><i>_</i><b>domains</b> des-
|
||||
tination because such mail typically only has recipients
|
||||
in one domain.
|
||||
|
||||
<b>FILES</b>
|
||||
/var/spool/postfix/flush, location of "fast flush" logfiles.
|
||||
|
||||
<b>CONFIGURATION</b> <b>PARAMETERS</b>
|
||||
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
|
||||
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>fast</b><i>_</i><b>flush</b><i>_</i><b>policy</b>
|
||||
What destinations can have a "fast flush" logfile:
|
||||
<b>all</b>, <b>relay</b> (relay destinations) or <b>none</b>.
|
||||
<b>fast</b><i>_</i><b>flush</b><i>_</i><b>domains</b>
|
||||
What destinations can have a "fast flush" logfile.
|
||||
By default, this is set to <b>$relay</b><i>_</i><b>domains</b>.
|
||||
|
||||
<b>fast</b><i>_</i><b>flush</b><i>_</i><b>refresh</b><i>_</i><b>time</b>
|
||||
Refresh a non-empty "fast flush" logfile that was
|
||||
Refresh a non-empty "fast flush" logfile that was
|
||||
not read in this amount of time (default time unit:
|
||||
hours), by simulating a send request for the corre-
|
||||
sponding destination.
|
||||
|
||||
<b>fast</b><i>_</i><b>flush</b><i>_</i><b>purge</b><i>_</i><b>time</b>
|
||||
Remove an empty "fast flush" logfile that was not
|
||||
updated in this amount of time (default time unit:
|
||||
Remove an empty "fast flush" logfile that was not
|
||||
updated in this amount of time (default time unit:
|
||||
days).
|
||||
|
||||
<b>SEE</b> <b>ALSO</b>
|
||||
@@ -173,7 +163,7 @@ FLUSH(8) FLUSH(8)
|
||||
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>
|
||||
@@ -191,6 +181,16 @@ FLUSH(8) FLUSH(8)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -26,39 +26,39 @@ PCRE_TABLE(5) PCRE_TABLE(5)
|
||||
Blank lines are ignored, as are lines beginning
|
||||
with `#'.
|
||||
|
||||
leading whitespace
|
||||
Lines that begin with whitespace continue the pre-
|
||||
vious line.
|
||||
|
||||
<i>pattern</i> <i>result</i>
|
||||
When <i>pattern</i> matches a search string, use the cor-
|
||||
responding <i>result</i>. A line that starts with white
|
||||
When <i>pattern</i> matches a search string, use the cor-
|
||||
responding <i>result</i>. 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
|
||||
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
|
||||
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
|
||||
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
|
||||
entire mail address. Thus, no parent domain or parent
|
||||
network search is done, and <i>user@domain</i> mail addresses are
|
||||
not broken up into their <i>user</i> and <i>domain</i> constituent
|
||||
not broken up into their <i>user</i> and <i>domain</i> constituent
|
||||
parts, nor is <i>user+foo</i> broken up into <i>user</i> and <i>foo</i>.
|
||||
|
||||
Patterns are applied in the order as specified in the
|
||||
table, until a pattern is found that matches the search
|
||||
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
|
||||
|
||||
|
||||
|
||||
@@ -71,7 +71,11 @@ PCRE_TABLE(5) PCRE_TABLE(5)
|
||||
PCRE_TABLE(5) PCRE_TABLE(5)
|
||||
|
||||
|
||||
whitespace.
|
||||
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 whites-
|
||||
pace.
|
||||
|
||||
<b>EXAMPLES</b>
|
||||
# Protect your outgoing majordomo exploders
|
||||
@@ -119,10 +123,6 @@ PCRE_TABLE(5) PCRE_TABLE(5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -26,9 +26,13 @@ REGEXP_TABLE(5) REGEXP_TABLE(5)
|
||||
Blank lines are ignored, as are lines beginning
|
||||
with `#'.
|
||||
|
||||
leading whitespace
|
||||
Lines that begin with whitespace continue the pre-
|
||||
vious line.
|
||||
|
||||
<i>pattern</i> <i>result</i>
|
||||
When <i>pattern</i> matches a search string, use the cor-
|
||||
responding <i>result</i>. A line that starts with white
|
||||
When <i>pattern</i> matches a search string, use the cor-
|
||||
responding <i>result</i>. A line that starts with white
|
||||
space continues the preceding line.
|
||||
|
||||
<i>pattern1!pattern2</i> <i>result</i>
|
||||
@@ -37,28 +41,24 @@ REGEXP_TABLE(5) REGEXP_TABLE(5)
|
||||
Each pattern is a regular expression enclosed by a pair of
|
||||
delimiters. The regular expression syntax is described in
|
||||
<i>re_format</i>(7). The expression delimiter can be any charac-
|
||||
ter, except whitespace or characters that have special
|
||||
meaning (traditionally the forward slash is used). The
|
||||
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),
|
||||
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
|
||||
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
|
||||
entire mail address. Thus, no parent domain or parent
|
||||
network search is done, and <i>user@domain</i> mail addresses are
|
||||
not broken up into their <i>user</i> and <i>domain</i> constituent
|
||||
not broken up into their <i>user</i> and <i>domain</i> constituent
|
||||
parts, nor is <i>user+foo</i> broken up into <i>user</i> and <i>foo</i>.
|
||||
|
||||
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
|
||||
Patterns are applied in the order as specified in the
|
||||
|
||||
|
||||
|
||||
@@ -71,8 +71,12 @@ REGEXP_TABLE(5) REGEXP_TABLE(5)
|
||||
REGEXP_TABLE(5) REGEXP_TABLE(5)
|
||||
|
||||
|
||||
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
|
||||
string may need to be written as ${n} or $(n) if they
|
||||
aren't followed by whitespace.
|
||||
|
||||
<b>EXAMPLES</b>
|
||||
@@ -123,10 +127,6 @@ REGEXP_TABLE(5) REGEXP_TABLE(5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2
|
||||
|
||||
|
@@ -39,27 +39,27 @@ RELOCATED(5) RELOCATED(5)
|
||||
<b>o</b> Blank lines are ignored, as are lines beginning
|
||||
with `#'.
|
||||
|
||||
<b>o</b> Lines that begin with whitespace continue the pre-
|
||||
vious line.
|
||||
|
||||
<b>o</b> An entry has one of the following form:
|
||||
<i>key</i> <i>new_location</i>
|
||||
Where <i>new_location</i> specifies contact information
|
||||
such as an email address, or perhaps a street
|
||||
Where <i>new_location</i> 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 <i>key</i> field
|
||||
networked tables such as NIS, LDAP or SQL, the <i>key</i> field
|
||||
is one of the following:
|
||||
|
||||
<i>user</i>@<i>domain</i>
|
||||
Matches <i>user</i>@<i>domain</i>. This form has precedence over
|
||||
Matches <i>user</i>@<i>domain</i>. This form has precedence over
|
||||
all other forms.
|
||||
|
||||
<i>user</i> Matches <i>user</i>@<i>site</i> when <i>site</i> is $<b>myorigin</b>, when <i>site</i>
|
||||
is listed in $<b>mydestination</b>, or when <i>site</i> is listed
|
||||
in $<b>inet</b><i>_</i><b>interfaces</b>.
|
||||
|
||||
@<i>domain</i>
|
||||
Matches every address in <i>domain</i>. This form has the
|
||||
|
||||
|
||||
|
||||
1
|
||||
@@ -71,41 +71,43 @@ RELOCATED(5) RELOCATED(5)
|
||||
RELOCATED(5) RELOCATED(5)
|
||||
|
||||
|
||||
@<i>domain</i>
|
||||
Matches every address in <i>domain</i>. This form has the
|
||||
lowest precedence.
|
||||
|
||||
<b>ADDRESS</b> <b>EXTENSION</b>
|
||||
When the search fails, and the address localpart contains
|
||||
the optional recipient delimiter (e.g., <i>user+foo</i>@<i>domain</i>),
|
||||
the search is repeated for the unextended address (e.g.
|
||||
When the search fails, and the address localpart contains
|
||||
the optional recipient delimiter (e.g., <i>user+foo</i>@<i>domain</i>),
|
||||
the search is repeated for the unextended address (e.g.
|
||||
<i>user</i>@<i>domain</i>).
|
||||
|
||||
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
|
||||
This section describes how the table lookups change when
|
||||
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,
|
||||
a description of regular expression lookup table syntax,
|
||||
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
|
||||
|
||||
Each pattern is a regular expression that is applied to
|
||||
Each pattern is a regular expression that is applied to
|
||||
the entire address being looked up. Thus, <i>user@domain</i> mail
|
||||
addresses are not broken up into their <i>user</i> and <i>@domain</i>
|
||||
addresses are not broken up into their <i>user</i> and <i>@domain</i>
|
||||
constituent parts, nor is <i>user+foo</i> broken up into <i>user</i> and
|
||||
<i>foo</i>.
|
||||
|
||||
Patterns are applied in the order as specified in the
|
||||
table, until a pattern is found that matches the search
|
||||
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 <b>$1</b>, <b>$2</b> and so on.
|
||||
Results are the same as with normal indexed file lookups,
|
||||
with the additional feature that parenthesized substrings
|
||||
from the pattern can be interpolated as <b>$1</b>, <b>$2</b> and so on.
|
||||
|
||||
<b>BUGS</b>
|
||||
The table format does not understand quoting conventions.
|
||||
The table format does not understand quoting conventions.
|
||||
|
||||
<b>CONFIGURATION</b> <b>PARAMETERS</b>
|
||||
The following <b>main.cf</b> parameters are especially relevant
|
||||
to this topic. 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 topic. 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>relocated</b><i>_</i><b>maps</b>
|
||||
@@ -114,11 +116,11 @@ RELOCATED(5) RELOCATED(5)
|
||||
Other parameters of interest:
|
||||
|
||||
<b>inet</b><i>_</i><b>interfaces</b>
|
||||
The network interface addresses that this system
|
||||
The network interface addresses that this system
|
||||
receives mail on.
|
||||
|
||||
<b>mydestination</b>
|
||||
List of domains that this mail system considers
|
||||
List of domains that this mail system considers
|
||||
local.
|
||||
|
||||
<b>myorigin</b>
|
||||
@@ -126,8 +128,6 @@ RELOCATED(5) RELOCATED(5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ RELOCATED(5) RELOCATED(5)
|
||||
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
|
||||
|
||||
<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>
|
||||
|
@@ -39,26 +39,26 @@ TRANSPORT(5) TRANSPORT(5)
|
||||
Blank lines are ignored, as are lines beginning
|
||||
with `#'.
|
||||
|
||||
leading whitespace
|
||||
Lines that begin with whitespace continue the pre-
|
||||
vious line.
|
||||
|
||||
<i>pattern</i> <i>result</i>
|
||||
When <i>pattern</i> matches the domain, use the corre-
|
||||
When <i>pattern</i> matches the domain, use the corre-
|
||||
sponding <i>result</i>.
|
||||
|
||||
With lookups from indexed files such as DB or DBM, or from
|
||||
networked tables such as NIS, LDAP or SQL, patterns are
|
||||
networked tables such as NIS, LDAP or SQL, patterns are
|
||||
tried in the order as listed below:
|
||||
|
||||
<i>domain</i> <i>transport</i>:<i>nexthop</i>
|
||||
Mail for <i>domain</i> is delivered through <i>transport</i> to
|
||||
Mail for <i>domain</i> is delivered through <i>transport</i> to
|
||||
<i>nexthop</i>.
|
||||
|
||||
<i>.domain</i> <i>transport</i>:<i>nexthop</i>
|
||||
Mail for any subdomain of <i>domain</i> is delivered
|
||||
Mail for any subdomain of <i>domain</i> is delivered
|
||||
through <i>transport</i> to <i>nexthop</i>.
|
||||
|
||||
Note: transport map entries take precedence over domains
|
||||
specified in the <b>mydestination</b> parameter. If you use the
|
||||
optional transport map, it may be safer to specify
|
||||
explicit entries for all domains specified in
|
||||
|
||||
|
||||
|
||||
@@ -71,60 +71,60 @@ TRANSPORT(5) TRANSPORT(5)
|
||||
TRANSPORT(5) TRANSPORT(5)
|
||||
|
||||
|
||||
<b>mydestination</b>, for example:
|
||||
Note: transport map entries take precedence over domains
|
||||
specified in the <b>mydestination</b> parameter. If you use the
|
||||
optional transport map, it may be safer to specify
|
||||
explicit entries for all domains specified in <b>mydestina-</b>
|
||||
<b>tion</b>, for example:
|
||||
|
||||
<b>hostname.my.domain</b> <b>local:</b>
|
||||
<b>localhost.my.domain</b> <b>local:</b>
|
||||
|
||||
The interpretation of the <i>nexthop</i> field is transport
|
||||
The interpretation of the <i>nexthop</i> field is transport
|
||||
dependent. In the case of SMTP, specify <i>host</i>:<i>service</i> for a
|
||||
non-default server port, and use [<i>host</i>] or [<i>host</i>]:<i>port</i> in
|
||||
order to disable MX (mail exchanger) DNS lookups. The []
|
||||
form can also be used with IP addresses instead of host-
|
||||
non-default server port, and use [<i>host</i>] or [<i>host</i>]:<i>port</i> in
|
||||
order to disable MX (mail exchanger) DNS lookups. The []
|
||||
form can also be used with IP addresses instead of host-
|
||||
names.
|
||||
|
||||
<b>EXAMPLES</b>
|
||||
In order to send mail for <b>foo.org</b> and its subdomains via
|
||||
In order to send mail for <b>foo.org</b> and its subdomains via
|
||||
the <b>uucp</b> transport to the UUCP host named <b>foo</b>:
|
||||
|
||||
<b>foo.org</b> <b>uucp:foo</b>
|
||||
<b>.foo.org</b> <b>uucp:foo</b>
|
||||
|
||||
When no <i>nexthop</i> host name is specified, the destination
|
||||
domain name is used instead. For example, the following
|
||||
directs mail for <i>user</i>@<b>foo.org</b> via the <b>slow</b> transport to a
|
||||
mail exchanger for <b>foo.org</b>. The <b>slow</b> transport could be
|
||||
something that runs at most one delivery process at a
|
||||
When no <i>nexthop</i> host name is specified, the destination
|
||||
domain name is used instead. For example, the following
|
||||
directs mail for <i>user</i>@<b>foo.org</b> via the <b>slow</b> transport to a
|
||||
mail exchanger for <b>foo.org</b>. The <b>slow</b> transport could be
|
||||
something that runs at most one delivery process at a
|
||||
time:
|
||||
|
||||
<b>foo.org</b> <b>slow:</b>
|
||||
|
||||
When no <i>transport</i> is specified, the default transport is
|
||||
When no <i>transport</i> is specified, the default transport is
|
||||
used, as specified via the <b>default</b><i>_</i><b>transport</b> configuration
|
||||
parameter. The following sends all mail for <b>foo.org</b> and
|
||||
parameter. The following sends all mail for <b>foo.org</b> and
|
||||
its subdomains to host <b>gateway.foo.org</b>:
|
||||
|
||||
<b>foo.org</b> <b>:[gateway.foo.org]</b>
|
||||
<b>.foo.org</b> <b>:[gateway.foo.org]</b>
|
||||
|
||||
In the above example, the [] are used to suppress MX
|
||||
lookups. The result would likely point to your local
|
||||
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 <i>host-</i>
|
||||
In the case of delivery via SMTP, one may specify <i>host-</i>
|
||||
<i>name</i>:<i>service</i> instead of just a host:
|
||||
|
||||
<b>foo.org</b> <b>smtp:bar.org:2025</b>
|
||||
|
||||
This directs mail for <i>user</i>@<b>foo.org</b> to host <b>bar.org</b> port
|
||||
<b>2025</b>. Instead of a numerical port a symbolic name may be
|
||||
used. Specify [] around the hostname in order to disable
|
||||
This directs mail for <i>user</i>@<b>foo.org</b> to host <b>bar.org</b> port
|
||||
<b>2025</b>. Instead of a numerical port a symbolic name may be
|
||||
used. Specify [] around the hostname in order to disable
|
||||
MX lookups.
|
||||
|
||||
The error mailer can be used to bounce mail:
|
||||
|
||||
<b>.foo.org</b> <b>error:mail</b> <b>for</b> <b>*.foo.org</b> <b>is</b> <b>not</b> <b>deliv-</b>
|
||||
<b>erable</b>
|
||||
|
||||
|
||||
|
||||
@@ -137,31 +137,36 @@ TRANSPORT(5) TRANSPORT(5)
|
||||
TRANSPORT(5) TRANSPORT(5)
|
||||
|
||||
|
||||
This causes all mail for <i>user</i>@<i>anything</i><b>.foo.org</b> to be
|
||||
The error mailer can be used to bounce mail:
|
||||
|
||||
<b>.foo.org</b> <b>error:mail</b> <b>for</b> <b>*.foo.org</b> <b>is</b> <b>not</b> <b>deliv-</b>
|
||||
<b>erable</b>
|
||||
|
||||
This causes all mail for <i>user</i>@<i>anything</i><b>.foo.org</b> to be
|
||||
bounced.
|
||||
|
||||
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
|
||||
This section describes how the table lookups change when
|
||||
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,
|
||||
a description of regular expression lookup table syntax,
|
||||
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
|
||||
|
||||
Each pattern is a regular expression that is applied to
|
||||
Each pattern is a regular expression that is applied to
|
||||
the entire domain being looked up. Thus, <i>some.domain.hier-</i>
|
||||
<i>archy</i> 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
|
||||
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 <b>$1</b>, <b>$2</b> and so on.
|
||||
Results are the same as with normal indexed file lookups,
|
||||
with the additional feature that parenthesized substrings
|
||||
from the pattern can be interpolated as <b>$1</b>, <b>$2</b> and so on.
|
||||
|
||||
<b>CONFIGURATION</b> <b>PARAMETERS</b>
|
||||
The following <b>main.cf</b> parameters are especially relevant
|
||||
to this topic. 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 topic. 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>transport</b><i>_</i><b>maps</b>
|
||||
@@ -170,7 +175,7 @@ TRANSPORT(5) TRANSPORT(5)
|
||||
Other parameters of interest:
|
||||
|
||||
<b>default</b><i>_</i><b>transport</b>
|
||||
The transport to use when no transport is explic-
|
||||
The transport to use when no transport is explic-
|
||||
itly specified.
|
||||
|
||||
<b>relayhost</b>
|
||||
@@ -184,14 +189,9 @@ TRANSPORT(5) TRANSPORT(5)
|
||||
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
|
||||
|
||||
<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>
|
||||
Wietse Venema
|
||||
IBM T.J. Watson Research
|
||||
P.O. Box 704
|
||||
|
||||
|
||||
|
||||
3
|
||||
@@ -203,6 +203,10 @@ TRANSPORT(5) TRANSPORT(5)
|
||||
TRANSPORT(5) TRANSPORT(5)
|
||||
|
||||
|
||||
<b>AUTHOR(S)</b>
|
||||
Wietse Venema
|
||||
IBM T.J. Watson Research
|
||||
P.O. Box 704
|
||||
Yorktown Heights, NY 10598, USA
|
||||
|
||||
|
||||
@@ -251,10 +255,6 @@ TRANSPORT(5) TRANSPORT(5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -71,61 +71,61 @@ VIRTUAL(5) VIRTUAL(5)
|
||||
VIRTUAL(5) VIRTUAL(5)
|
||||
|
||||
|
||||
leading whitespace
|
||||
Lines that begin with whitespace continue the pre-
|
||||
vious line.
|
||||
|
||||
<i>pattern</i> <i>result</i>
|
||||
When <i>pattern</i> matches a mail address, replace it by
|
||||
When <i>pattern</i> matches a mail address, replace it by
|
||||
the corresponding <i>result</i>.
|
||||
|
||||
With lookups from indexed files such as DB or DBM, or from
|
||||
networked tables such as NIS, LDAP or SQL, patterns are
|
||||
networked tables such as NIS, LDAP or SQL, patterns are
|
||||
tried in the order as listed below:
|
||||
|
||||
<i>user</i>@<i>domain</i> <i>address,</i> <i>address,</i> <i>...</i>
|
||||
Mail for <i>user</i>@<i>domain</i> is redirected to <i>address</i>.
|
||||
Mail for <i>user</i>@<i>domain</i> is redirected to <i>address</i>.
|
||||
This form has the highest precedence.
|
||||
|
||||
<i>user</i> <i>address,</i> <i>address,</i> <i>...</i>
|
||||
Mail for <i>user</i>@<i>site</i> is redirected to <i>address</i> when
|
||||
<i>site</i> is equal to $<b>myorigin</b>, when <i>site</i> is listed in
|
||||
Mail for <i>user</i>@<i>site</i> is redirected to <i>address</i> when
|
||||
<i>site</i> is equal to $<b>myorigin</b>, when <i>site</i> is listed in
|
||||
$mydestination, or when it is listed in
|
||||
$<i>inet_interfaces</i>.
|
||||
|
||||
This functionality overlaps with functionality of
|
||||
This functionality overlaps with functionality of
|
||||
the local <i>alias</i>(5) database. The difference is that
|
||||
<b>virtual</b> mapping can be applied to non-local
|
||||
<b>virtual</b> mapping can be applied to non-local
|
||||
addresses.
|
||||
|
||||
@<i>domain</i> <i>address,</i> <i>address,</i> <i>...</i>
|
||||
Mail for any user in <i>domain</i> is redirected to
|
||||
Mail for any user in <i>domain</i> is redirected to
|
||||
<i>address</i>. This form has the lowest precedence.
|
||||
|
||||
In all the above forms, when <i>address</i> has the form @<i>other-</i>
|
||||
<i>domain</i>, the result is the same user in <i>otherdomain</i>. This
|
||||
In all the above forms, when <i>address</i> has the form @<i>other-</i>
|
||||
<i>domain</i>, the result is the same user in <i>otherdomain</i>. This
|
||||
works for the first address in the expansion only.
|
||||
|
||||
<b>ADDRESS</b> <b>EXTENSION</b>
|
||||
When the search fails, and the address localpart contains
|
||||
the optional recipient delimiter (e.g., <i>user+foo</i>@<i>domain</i>),
|
||||
the search is repeated for the unextended address (e.g.
|
||||
When the search fails, and the address localpart contains
|
||||
the optional recipient delimiter (e.g., <i>user+foo</i>@<i>domain</i>),
|
||||
the search is repeated for the unextended address (e.g.
|
||||
<i>user</i>@<i>domain</i>), and the unmatched address extension is prop-
|
||||
agated to the result of expansion. The matching order is:
|
||||
agated to the result of expansion. The matching order is:
|
||||
<i>user+foo</i>@<i>domain</i>, <i>user</i>@<i>domain</i>, <i>user+foo</i>, <i>user</i>, and @<i>domain</i>.
|
||||
|
||||
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
|
||||
This section describes how the table lookups change when
|
||||
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,
|
||||
a description of regular expression lookup table syntax,
|
||||
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
|
||||
|
||||
Each pattern is a regular expression that is applied to
|
||||
Each pattern is a regular expression that is applied to
|
||||
the entire address being looked up. Thus, <i>user@domain</i> mail
|
||||
addresses are not broken up into their <i>user</i> and <i>@domain</i>
|
||||
addresses are not broken up into their <i>user</i> and <i>@domain</i>
|
||||
constituent parts, nor is <i>user+foo</i> broken up into <i>user</i> and
|
||||
<i>foo</i>.
|
||||
|
||||
Patterns are applied in the order as specified in the
|
||||
table, until a pattern is found that matches the search
|
||||
string.
|
||||
|
||||
|
||||
|
||||
2
|
||||
@@ -137,17 +137,21 @@ VIRTUAL(5) VIRTUAL(5)
|
||||
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 <b>$1</b>, <b>$2</b> and so on.
|
||||
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 <b>$1</b>, <b>$2</b> and so on.
|
||||
|
||||
<b>BUGS</b>
|
||||
The table format does not understand quoting conventions.
|
||||
The table format does not understand quoting conventions.
|
||||
|
||||
<b>CONFIGURATION</b> <b>PARAMETERS</b>
|
||||
The following <b>main.cf</b> parameters are especially relevant
|
||||
to this topic. 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 topic. 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>virtual</b><i>_</i><b>maps</b>
|
||||
@@ -156,11 +160,11 @@ VIRTUAL(5) VIRTUAL(5)
|
||||
Other parameters of interest:
|
||||
|
||||
<b>inet</b><i>_</i><b>interfaces</b>
|
||||
The network interface addresses that this system
|
||||
The network interface addresses that this system
|
||||
receives mail on.
|
||||
|
||||
<b>mydestination</b>
|
||||
List of domains that this mail system considers
|
||||
List of domains that this mail system considers
|
||||
local.
|
||||
|
||||
<b>myorigin</b>
|
||||
@@ -177,7 +181,7 @@ VIRTUAL(5) VIRTUAL(5)
|
||||
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
|
||||
|
||||
<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>
|
||||
@@ -190,10 +194,6 @@ VIRTUAL(5) VIRTUAL(5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
3
|
||||
|
||||
|
||||
|
@@ -159,17 +159,14 @@ case "$SYSTEM.$RELEASE" in
|
||||
*) echo "Unknown AIX version: `uname -v`." 1>&2; exit 1;;
|
||||
esac;;
|
||||
Linux.2*) SYSTYPE=LINUX2
|
||||
if [ -f /usr/lib/lib/db-3.1.a -a -f /usr/include/db3/db_185.h ]
|
||||
if [ -f /usr/lib/libdb-3.1.a ]
|
||||
then
|
||||
CCARGS="$CCARGS -DPATH_DB_H='<db3/db_185.h>'"
|
||||
CCARGS="$CCARGS -I/usr/include/db3"
|
||||
SYSLIBS="$SYSLIBS -ldb-3.1"
|
||||
else
|
||||
if [ -f /usr/include/db_185.h ]
|
||||
if [ -f /usr/include/db/db.h ]
|
||||
then
|
||||
CCARGS="$CCARGS -DPATH_DB_H='<db_185.h>'"
|
||||
elif [ -f /usr/include/db/db.h ]
|
||||
then
|
||||
CCARGS="$CCARGS -DPATH_DB_H='<db/db.h>'"
|
||||
CCARGS="$CCARGS -I/usr/include/db"
|
||||
fi
|
||||
test -f /usr/lib/libdb.a && SYSLIBS="$SYSLIBS -ldb"
|
||||
fi
|
||||
|
@@ -36,6 +36,8 @@ the lookups are done in a slightly different way as described below.
|
||||
The format of the access table is as follows:
|
||||
.IP "blanks and comments"
|
||||
Blank lines are ignored, as are lines beginning with `#'.
|
||||
.IP "leading whitespace"
|
||||
Lines that begin with whitespace continue the previous line.
|
||||
.IP "\fIpattern action\fR"
|
||||
When \fIpattern\fR matches a mail address, domain or host address,
|
||||
perform the corresponding \fIaction\fR.
|
||||
|
@@ -51,6 +51,8 @@ Use the \fBaliases\fR(5) map for that purpose.
|
||||
The format of the \fBcanonical\fR table is as follows:
|
||||
.IP "blanks and comments"
|
||||
Blank lines are ignored, as are lines beginning with `#'.
|
||||
.IP "leading whitespace"
|
||||
Lines that begin with whitespace continue the previous line.
|
||||
.IP "\fIpattern result\fR"
|
||||
When \fIpattern\fR matches a mail address, replace it by the
|
||||
corresponding \fIresult\fR.
|
||||
|
@@ -23,6 +23,8 @@ 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 "leading whitespace"
|
||||
Lines that begin with whitespace continue the previous line.
|
||||
.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
|
||||
|
@@ -23,6 +23,8 @@ 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 "leading whitespace"
|
||||
Lines that begin with whitespace continue the previous line.
|
||||
.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
|
||||
|
@@ -38,6 +38,8 @@ The format of the table is as follows:
|
||||
.IP \(bu
|
||||
Blank lines are ignored, as are lines beginning with `#'.
|
||||
.IP \(bu
|
||||
Lines that begin with whitespace continue the previous line.
|
||||
.IP \(bu
|
||||
An entry has one of the following form:
|
||||
.ti +5
|
||||
\fIkey new_location\fR
|
||||
|
@@ -36,6 +36,8 @@ the lookups are done in a slightly different way as described below.
|
||||
The format of the transport table is as follows:
|
||||
.IP "blanks and comments"
|
||||
Blank lines are ignored, as are lines beginning with `#'.
|
||||
.IP "leading whitespace"
|
||||
Lines that begin with whitespace continue the previous line.
|
||||
.IP "\fIpattern result\fR"
|
||||
When \fIpattern\fR matches the domain, use the corresponding
|
||||
\fIresult\fR.
|
||||
|
@@ -56,6 +56,8 @@ 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 "leading whitespace"
|
||||
Lines that begin with whitespace continue the previous line.
|
||||
.IP "\fIpattern result\fR"
|
||||
When \fIpattern\fR matches a mail address, replace it by the
|
||||
corresponding \fIresult\fR.
|
||||
|
@@ -27,17 +27,10 @@ part on the right-hand side of the right-most \fB@\fR in
|
||||
an email address.
|
||||
|
||||
Per-destination logfiles of deferred mail are maintained only for
|
||||
eligible destinations. The policy is specified with the
|
||||
\fBfast_flush_policy\fR configuration parameter:
|
||||
.IP \fBall\fR
|
||||
Maintain per-destination logfiles for all destinations.
|
||||
.IP "\fBrelay\fR (default policy)"
|
||||
Maintain per-destination logfiles only for destinations
|
||||
that this system is willing to relay mail to (as controlled
|
||||
by the \fBrelay_domains\fR configuration parameter).
|
||||
.IP \fBnone\fR
|
||||
Do not maintain per-destination logfiles.
|
||||
.PP
|
||||
eligible destinations. The list of eligible destinations is
|
||||
specified with the \fBfast_flush_domains\fR configuration parameter,
|
||||
which defaults to \fB$relay_domains\fR.
|
||||
|
||||
This server implements the following requests:
|
||||
.IP "\fBFLUSH_REQ_ADD\fI sitename queue_id\fR"
|
||||
Inform the fast flush server that the specified message is queued for
|
||||
@@ -119,9 +112,9 @@ such mail typically only has recipients in one domain.
|
||||
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 \fBfast_flush_policy\fR
|
||||
What destinations can have a "fast flush" logfile: \fBall\fR,
|
||||
\fBrelay\fR (relay destinations) or \fBnone\fR.
|
||||
.IP \fBfast_flush_domains\fR
|
||||
What destinations can have a "fast flush" logfile. By default,
|
||||
this is set to \fB$relay_domains\fR.
|
||||
.IP \fBfast_flush_refresh_time\fR
|
||||
Refresh a non-empty "fast flush" logfile that was not read in
|
||||
this amount of time (default time unit: hours), by simulating
|
||||
|
@@ -28,6 +28,8 @@
|
||||
# The format of the access table is as follows:
|
||||
# .IP "blanks and comments"
|
||||
# Blank lines are ignored, as are lines beginning with `#'.
|
||||
# .IP "leading whitespace"
|
||||
# Lines that begin with whitespace continue the previous line.
|
||||
# .IP "\fIpattern action\fR"
|
||||
# When \fIpattern\fR matches a mail address, domain or host address,
|
||||
# perform the corresponding \fIaction\fR.
|
||||
|
@@ -43,6 +43,8 @@
|
||||
# The format of the \fBcanonical\fR table is as follows:
|
||||
# .IP "blanks and comments"
|
||||
# Blank lines are ignored, as are lines beginning with `#'.
|
||||
# .IP "leading whitespace"
|
||||
# Lines that begin with whitespace continue the previous line.
|
||||
# .IP "\fIpattern result\fR"
|
||||
# When \fIpattern\fR matches a mail address, replace it by the
|
||||
# corresponding \fIresult\fR.
|
||||
|
@@ -17,6 +17,8 @@
|
||||
# The general form of a PCRE table is:
|
||||
# .IP "blanks and comments"
|
||||
# Blank lines are ignored, as are lines beginning with `#'.
|
||||
# .IP "leading whitespace"
|
||||
# Lines that begin with whitespace continue the previous line.
|
||||
# .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
|
||||
|
@@ -17,6 +17,8 @@
|
||||
# The general form of a Postfix regular expression table is:
|
||||
# .IP "blanks and comments"
|
||||
# Blank lines are ignored, as are lines beginning with `#'.
|
||||
# .IP "leading whitespace"
|
||||
# Lines that begin with whitespace continue the previous line.
|
||||
# .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
|
||||
|
@@ -30,6 +30,8 @@
|
||||
# .IP \(bu
|
||||
# Blank lines are ignored, as are lines beginning with `#'.
|
||||
# .IP \(bu
|
||||
# Lines that begin with whitespace continue the previous line.
|
||||
# .IP \(bu
|
||||
# An entry has one of the following form:
|
||||
# .ti +5
|
||||
# \fIkey new_location\fR
|
||||
|
@@ -28,6 +28,8 @@
|
||||
# The format of the transport table is as follows:
|
||||
# .IP "blanks and comments"
|
||||
# Blank lines are ignored, as are lines beginning with `#'.
|
||||
# .IP "leading whitespace"
|
||||
# Lines that begin with whitespace continue the previous line.
|
||||
# .IP "\fIpattern result\fR"
|
||||
# When \fIpattern\fR matches the domain, use the corresponding
|
||||
# \fIresult\fR.
|
||||
|
@@ -48,6 +48,8 @@
|
||||
# tried in the order as listed in this manual page:
|
||||
# .IP "blanks and comments"
|
||||
# Blank lines are ignored, as are lines beginning with `#'.
|
||||
# .IP "leading whitespace"
|
||||
# Lines that begin with whitespace continue the previous line.
|
||||
# .IP "\fIpattern result\fR"
|
||||
# When \fIpattern\fR matches a mail address, replace it by the
|
||||
# corresponding \fIresult\fR.
|
||||
|
@@ -199,10 +199,10 @@ cleanup_map1n.o: ../../include/mail_addr_map.h
|
||||
cleanup_map1n.o: ../../include/maps.h
|
||||
cleanup_map1n.o: ../../include/cleanup_user.h
|
||||
cleanup_map1n.o: ../../include/quote_822_local.h
|
||||
cleanup_map1n.o: ../../include/been_here.h
|
||||
cleanup_map1n.o: cleanup.h
|
||||
cleanup_map1n.o: ../../include/tok822.h
|
||||
cleanup_map1n.o: ../../include/resolve_clnt.h
|
||||
cleanup_map1n.o: ../../include/been_here.h
|
||||
cleanup_map1n.o: ../../include/mail_stream.h
|
||||
cleanup_map1n.o: ../../include/mail_conf.h
|
||||
cleanup_masquerade.o: cleanup_masquerade.c
|
||||
|
@@ -54,6 +54,7 @@
|
||||
#include <mail_addr_map.h>
|
||||
#include <cleanup_user.h>
|
||||
#include <quote_822_local.h>
|
||||
#include <been_here.h>
|
||||
|
||||
/* Application-specific. */
|
||||
|
||||
@@ -69,7 +70,7 @@ ARGV *cleanup_map1n_internal(CLEANUP_STATE *state, char *addr,
|
||||
int count;
|
||||
int i;
|
||||
int arg;
|
||||
int expand_to_self;
|
||||
BH_TABLE *been_here;
|
||||
char *saved_lhs;
|
||||
|
||||
/*
|
||||
@@ -78,6 +79,7 @@ ARGV *cleanup_map1n_internal(CLEANUP_STATE *state, char *addr,
|
||||
argv = argv_alloc(1);
|
||||
argv_add(argv, addr, ARGV_END);
|
||||
argv_terminate(argv);
|
||||
been_here = been_here_init(0, BH_FLAG_FOLD);
|
||||
|
||||
/*
|
||||
* Rewrite the address vector in place. With each map lookup result,
|
||||
@@ -90,14 +92,17 @@ ARGV *cleanup_map1n_internal(CLEANUP_STATE *state, char *addr,
|
||||
#define MAX_RECURSION 1000
|
||||
#define MAX_EXPANSION 1000
|
||||
#define STR vstring_str
|
||||
#define RETURN(x) { been_here_free(been_here); return (x); }
|
||||
|
||||
for (expand_to_self = 0, arg = 0; arg < argv->argc; arg++) {
|
||||
for (arg = 0; arg < argv->argc; arg++) {
|
||||
if (argv->argc > MAX_EXPANSION) {
|
||||
msg_warn("%s: unreasonable %s map expansion size for %s",
|
||||
state->queue_id, maps->title, addr);
|
||||
break;
|
||||
}
|
||||
for (count = 0; /* void */ ; count++) {
|
||||
if (been_here_fixed(been_here, argv->argv[arg]) != 0)
|
||||
break;
|
||||
if (count >= MAX_RECURSION) {
|
||||
msg_warn("%s: unreasonable %s map nesting for %s",
|
||||
state->queue_id, maps->title, addr);
|
||||
@@ -107,8 +112,6 @@ ARGV *cleanup_map1n_internal(CLEANUP_STATE *state, char *addr,
|
||||
saved_lhs = mystrdup(argv->argv[arg]);
|
||||
for (i = 0; i < lookup->argc; i++) {
|
||||
unquote_822_local(state->temp1, lookup->argv[i]);
|
||||
if (strcasecmp(saved_lhs, STR(state->temp1)) == 0)
|
||||
expand_to_self = 1;
|
||||
if (i == 0) {
|
||||
UPDATE(argv->argv[arg], STR(state->temp1));
|
||||
} else {
|
||||
@@ -118,17 +121,15 @@ ARGV *cleanup_map1n_internal(CLEANUP_STATE *state, char *addr,
|
||||
}
|
||||
myfree(saved_lhs);
|
||||
argv_free(lookup);
|
||||
if (expand_to_self)
|
||||
return (argv);
|
||||
} else if (dict_errno != 0) {
|
||||
msg_warn("%s: %s map lookup problem for %s",
|
||||
state->queue_id, maps->title, addr);
|
||||
state->errs |= CLEANUP_STAT_WRITE;
|
||||
return (argv);
|
||||
RETURN(argv);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (argv);
|
||||
RETURN(argv);
|
||||
}
|
||||
|
@@ -21,17 +21,10 @@
|
||||
/* an email address.
|
||||
/*
|
||||
/* Per-destination logfiles of deferred mail are maintained only for
|
||||
/* eligible destinations. The policy is specified with the
|
||||
/* \fBfast_flush_policy\fR configuration parameter:
|
||||
/* .IP \fBall\fR
|
||||
/* Maintain per-destination logfiles for all destinations.
|
||||
/* .IP "\fBrelay\fR (default policy)"
|
||||
/* Maintain per-destination logfiles only for destinations
|
||||
/* that this system is willing to relay mail to (as controlled
|
||||
/* by the \fBrelay_domains\fR configuration parameter).
|
||||
/* .IP \fBnone\fR
|
||||
/* Do not maintain per-destination logfiles.
|
||||
/* .PP
|
||||
/* eligible destinations. The list of eligible destinations is
|
||||
/* specified with the \fBfast_flush_domains\fR configuration parameter,
|
||||
/* which defaults to \fB$relay_domains\fR.
|
||||
/*
|
||||
/* This server implements the following requests:
|
||||
/* .IP "\fBFLUSH_REQ_ADD\fI sitename queue_id\fR"
|
||||
/* Inform the fast flush server that the specified message is queued for
|
||||
@@ -103,9 +96,9 @@
|
||||
/* 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 \fBfast_flush_policy\fR
|
||||
/* What destinations can have a "fast flush" logfile: \fBall\fR,
|
||||
/* \fBrelay\fR (relay destinations) or \fBnone\fR.
|
||||
/* .IP \fBfast_flush_domains\fR
|
||||
/* What destinations can have a "fast flush" logfile. By default,
|
||||
/* this is set to \fB$relay_domains\fR.
|
||||
/* .IP \fBfast_flush_refresh_time\fR
|
||||
/* Refresh a non-empty "fast flush" logfile that was not read in
|
||||
/* this amount of time (default time unit: hours), by simulating
|
||||
@@ -173,18 +166,11 @@
|
||||
*/
|
||||
int var_fflush_refresh;
|
||||
int var_fflush_purge;
|
||||
char *var_relay_domains;
|
||||
|
||||
/*
|
||||
* Flush policy stuff.
|
||||
*/
|
||||
#define FLUSH_POLICY_UNKNOWN 0
|
||||
#define FLUSH_POLICY_ALL 1
|
||||
#define FLUSH_POLICY_RELAY 2
|
||||
#define FLUSH_POLICY_NONE 3
|
||||
|
||||
static DOMAIN_LIST *flush_domains;
|
||||
static int flush_policy = FLUSH_POLICY_UNKNOWN;
|
||||
|
||||
/*
|
||||
* Some hard-wired policy: how many queue IDs we remember while we're
|
||||
@@ -199,41 +185,14 @@ static int flush_policy = FLUSH_POLICY_UNKNOWN;
|
||||
#define STR(x) vstring_str(x)
|
||||
#define STREQ(x,y) (strcmp(x,y) == 0)
|
||||
|
||||
/* flush_policy_init - initialize fast flush policy stuff */
|
||||
|
||||
static int flush_policy_init(void)
|
||||
{
|
||||
|
||||
if (STREQ(var_fflush_policy, FFLUSH_POLICY_ALL)) {
|
||||
flush_policy = FLUSH_POLICY_ALL;
|
||||
} else if (STREQ(var_fflush_policy, FFLUSH_POLICY_RELAY)) {
|
||||
flush_domains = domain_list_init(var_relay_domains);
|
||||
flush_policy = FLUSH_POLICY_RELAY;
|
||||
} else if (STREQ(var_fflush_policy, FFLUSH_POLICY_NONE)) {
|
||||
flush_policy = FLUSH_POLICY_NONE;
|
||||
} else {
|
||||
msg_fatal("invalid %s configuration parameter value: %s",
|
||||
VAR_FFLUSH_POLICY, var_fflush_policy);
|
||||
}
|
||||
}
|
||||
|
||||
/* flush_policy_ok - check logging policy */
|
||||
|
||||
static int flush_policy_ok(const char *site)
|
||||
{
|
||||
if (flush_policy == FLUSH_POLICY_UNKNOWN)
|
||||
flush_policy_init();
|
||||
if (flush_domains == 0)
|
||||
flush_domains = domain_list_init(var_fflush_domains);
|
||||
|
||||
switch (flush_policy) {
|
||||
case FLUSH_POLICY_ALL:
|
||||
return (1);
|
||||
case FLUSH_POLICY_RELAY:
|
||||
return (domain_list_match(flush_domains, site));
|
||||
case FLUSH_POLICY_NONE:
|
||||
return (0);
|
||||
default:
|
||||
msg_panic("invalid fast flush policy %d", flush_policy);
|
||||
}
|
||||
return (domain_list_match(flush_domains, site));
|
||||
}
|
||||
|
||||
/* flush_add_service - append queue ID to per-site fast flush log */
|
||||
@@ -547,13 +506,8 @@ int main(int argc, char **argv)
|
||||
VAR_FFLUSH_PURGE, DEF_FFLUSH_PURGE, &var_fflush_purge, 'd', 1, 0,
|
||||
0,
|
||||
};
|
||||
static CONFIG_STR_TABLE str_table[] = {
|
||||
VAR_RELAY_DOMAINS, DEF_RELAY_DOMAINS, &var_relay_domains, 0, 0,
|
||||
0,
|
||||
};
|
||||
|
||||
single_server_main(argc, argv, flush_service,
|
||||
MAIL_SERVER_TIME_TABLE, time_table,
|
||||
MAIL_SERVER_STR_TABLE, str_table,
|
||||
0);
|
||||
}
|
||||
|
BIN
postfix/src/fsstone/fsstone
Executable file
BIN
postfix/src/fsstone/fsstone
Executable file
Binary file not shown.
@@ -4,7 +4,8 @@
|
||||
/* SUMMARY
|
||||
/* measure directory operation overhead
|
||||
/* SYNOPSIS
|
||||
/* \fBfsstone\fR [\fB-c\fR] [\fB-r\fR] \fImsg_count files_per_dir\fR
|
||||
/* \fBfsstone\fR [\fB-cr\fR] [\fB-s \fIsize\fR]
|
||||
/* \fImsg_count files_per_dir\fR
|
||||
/* DESCRIPTION
|
||||
/* The \fBfsstone\fR command measures the cost of creating, renaming
|
||||
/* and deleting queue files versus appending messages to existing
|
||||
@@ -19,6 +20,8 @@
|
||||
/* Create and delete files.
|
||||
/* .IP \fB-r\fR
|
||||
/* Rename files twice (requires \fB-c\fR).
|
||||
/* .IP \fB-s \fIsize\fR
|
||||
/* Specify the file size in kbytes.
|
||||
/* DIAGNOSTICS
|
||||
/* Problems are reported to the standard error stream.
|
||||
/* BUGS
|
||||
@@ -66,17 +69,20 @@ static void rename_file(int old, int new)
|
||||
|
||||
/* make_file - create a little file and use it */
|
||||
|
||||
static void make_file(int seqno)
|
||||
static void make_file(int seqno, int size)
|
||||
{
|
||||
char path[BUFSIZ];
|
||||
char buf[1024];
|
||||
FILE *fp;
|
||||
int i;
|
||||
|
||||
sprintf(path, "%06d", seqno);
|
||||
if ((fp = fopen(path, "w")) == 0)
|
||||
msg_fatal("open %s: %m", path);
|
||||
for (i = 0; i < 400; i++)
|
||||
fprintf(fp, "hello");
|
||||
memset(buf, 'x', sizeof(buf));
|
||||
for (i = 0; i < size; i++)
|
||||
if (fwrite(buf, 1, sizeof(buf), fp) != sizeof(buf))
|
||||
msg_fatal("fwrite: %m");
|
||||
if (fsync(fileno(fp)))
|
||||
msg_fatal("fsync: %m");
|
||||
if (fclose(fp))
|
||||
@@ -141,7 +147,7 @@ static void remove_silent(int seq)
|
||||
|
||||
static void usage(char *myname)
|
||||
{
|
||||
msg_fatal("usage: %s [-c [-r]] messages directory_entries", myname);
|
||||
msg_fatal("usage: %s [-cr] [-s size] messages directory_entries", myname);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
@@ -153,9 +159,10 @@ int main(int argc, char **argv)
|
||||
int do_create = 0;
|
||||
int seq;
|
||||
int ch;
|
||||
int size = 2;
|
||||
|
||||
msg_vstream_init(argv[0], VSTREAM_ERR);
|
||||
while ((ch = GETOPT(argc, argv, "cr")) != EOF) {
|
||||
while ((ch = GETOPT(argc, argv, "crs:")) != EOF) {
|
||||
switch (ch) {
|
||||
case 'c':
|
||||
do_create++;
|
||||
@@ -163,6 +170,10 @@ int main(int argc, char **argv)
|
||||
case 'r':
|
||||
do_rename++;
|
||||
break;
|
||||
case 's':
|
||||
if ((size = atoi(optarg)) <= 0)
|
||||
usage(argv[0]);
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
}
|
||||
@@ -179,7 +190,7 @@ int main(int argc, char **argv)
|
||||
* Populate the directory with little files.
|
||||
*/
|
||||
for (seq = 0; seq < max_file; seq++)
|
||||
make_file(seq);
|
||||
make_file(seq, size);
|
||||
|
||||
/*
|
||||
* Simulate arrival and delivery of mail messages.
|
||||
@@ -189,7 +200,7 @@ int main(int argc, char **argv)
|
||||
seq %= max_file;
|
||||
if (do_create) {
|
||||
remove_file(seq);
|
||||
make_file(seq);
|
||||
make_file(seq, size);
|
||||
if (do_rename) {
|
||||
rename_file(seq, seq + max_file);
|
||||
rename_file(seq + max_file, seq);
|
||||
|
@@ -6,8 +6,9 @@
|
||||
/* SYNOPSIS
|
||||
/* #include <been_here.h>
|
||||
/*
|
||||
/* BH_TABLE *been_here_init(size)
|
||||
/* BH_TABLE *been_here_init(size, flags)
|
||||
/* int size;
|
||||
/* int flags;
|
||||
/*
|
||||
/* int been_here_fixed(dup_filter, string)
|
||||
/* BH_TABLE *dup_filter;
|
||||
|
@@ -94,7 +94,7 @@ int flush_purge(void)
|
||||
/*
|
||||
* Don't bother the server if the service is turned off.
|
||||
*/
|
||||
if (strcmp(var_fflush_policy, FFLUSH_POLICY_NONE) == 0)
|
||||
if (*var_fflush_domains == 0)
|
||||
status = FLUSH_STAT_OK;
|
||||
else
|
||||
status = mail_command_write(MAIL_CLASS_PRIVATE, MAIL_SERVICE_FLUSH,
|
||||
@@ -119,7 +119,7 @@ int flush_refresh(void)
|
||||
/*
|
||||
* Don't bother the server if the service is turned off.
|
||||
*/
|
||||
if (strcmp(var_fflush_policy, FFLUSH_POLICY_NONE) == 0)
|
||||
if (*var_fflush_domains == 0)
|
||||
status = FLUSH_STAT_OK;
|
||||
else
|
||||
status = mail_command_write(MAIL_CLASS_PRIVATE, MAIL_SERVICE_FLUSH,
|
||||
@@ -144,7 +144,7 @@ int flush_send(const char *site)
|
||||
/*
|
||||
* Don't bother the server if the service is turned off.
|
||||
*/
|
||||
if (strcmp(var_fflush_policy, FFLUSH_POLICY_NONE) == 0)
|
||||
if (*var_fflush_domains == 0)
|
||||
status = mail_flush_deferred();
|
||||
else
|
||||
status = mail_command_write(MAIL_CLASS_PRIVATE, MAIL_SERVICE_FLUSH,
|
||||
@@ -169,7 +169,7 @@ int flush_add(const char *site, const char *queue_id)
|
||||
/*
|
||||
* Don't bother the server if the service is turned off.
|
||||
*/
|
||||
if (strcmp(var_fflush_policy, FFLUSH_POLICY_NONE) == 0)
|
||||
if (*var_fflush_domains == 0)
|
||||
status = FLUSH_STAT_OK;
|
||||
else
|
||||
status = mail_command_write(MAIL_CLASS_PRIVATE, MAIL_SERVICE_FLUSH,
|
||||
|
@@ -58,7 +58,8 @@
|
||||
/* int var_ownreq_special;
|
||||
/* int var_daemon_timeout;
|
||||
/* char *var_syslog_facility;
|
||||
/* char *var_fflush_policy;
|
||||
/* char *var_relay_domains;
|
||||
/* char *var_fflush_domains;
|
||||
/*
|
||||
/* void mail_params_init()
|
||||
/* DESCRIPTION
|
||||
@@ -165,7 +166,8 @@ time_t var_starttime;
|
||||
int var_ownreq_special;
|
||||
int var_daemon_timeout;
|
||||
char *var_syslog_facility;
|
||||
char *var_fflush_policy;
|
||||
char *var_relay_domains;
|
||||
char *var_fflush_domains;
|
||||
|
||||
/* check_myhostname - lookup hostname and validate */
|
||||
|
||||
@@ -276,7 +278,8 @@ void mail_params_init()
|
||||
VAR_DB_TYPE, DEF_DB_TYPE, &var_db_type, 1, 0,
|
||||
VAR_HASH_QUEUE_NAMES, DEF_HASH_QUEUE_NAMES, &var_hash_queue_names, 1, 0,
|
||||
VAR_RCPT_DELIM, DEF_RCPT_DELIM, &var_rcpt_delim, 0, 1,
|
||||
VAR_FFLUSH_POLICY, DEF_FFLUSH_POLICY, &var_fflush_policy, 1, 0,
|
||||
VAR_RELAY_DOMAINS, DEF_RELAY_DOMAINS, &var_relay_domains, 0, 0,
|
||||
VAR_FFLUSH_DOMAINS, DEF_FFLUSH_DOMAINS, &var_fflush_domains, 0, 0,
|
||||
0,
|
||||
};
|
||||
static CONFIG_STR_FN_TABLE function_str_defaults_2[] = {
|
||||
|
@@ -1067,13 +1067,9 @@ extern char *var_filter_xport;
|
||||
/*
|
||||
* Fast flush service support.
|
||||
*/
|
||||
#define VAR_FFLUSH_POLICY "fast_flush_policy"
|
||||
#define DEF_FFLUSH_POLICY FFLUSH_POLICY_RELAY
|
||||
extern char *var_fflush_policy;
|
||||
|
||||
#define FFLUSH_POLICY_ALL "all"
|
||||
#define FFLUSH_POLICY_RELAY "relay"
|
||||
#define FFLUSH_POLICY_NONE "none"
|
||||
#define VAR_FFLUSH_DOMAINS "fast_flush_domains"
|
||||
#define DEF_FFLUSH_DOMAINS "$relay_domains"
|
||||
extern char *var_fflush_domains;
|
||||
|
||||
#define VAR_FFLUSH_PURGE "fast_flush_purge_time"
|
||||
#define DEF_FFLUSH_PURGE "7d"
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* Version of this program.
|
||||
*/
|
||||
#define VAR_MAIL_VERSION "mail_version"
|
||||
#define DEF_MAIL_VERSION "Snapshot-20001005"
|
||||
#define DEF_MAIL_VERSION "Snapshot-20001027"
|
||||
extern char *var_mail_version;
|
||||
|
||||
/* LICENSE
|
||||
|
@@ -33,6 +33,7 @@
|
||||
/* System library. */
|
||||
|
||||
#include <sys_defs.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* Utility library. */
|
||||
|
||||
|
@@ -67,7 +67,7 @@ static int is_821_dot_string(char *local_part, char *end)
|
||||
*/
|
||||
if (local_part[0] == 0 || local_part[0] == '.')
|
||||
return (NO);
|
||||
for (cp = local_part; cp < end && (ch = *cp) != 0; cp++) {
|
||||
for (cp = local_part; cp < end && (ch = *(unsigned char *) cp) != 0; cp++) {
|
||||
if (ch == '.' && cp[1] == '.')
|
||||
return (NO);
|
||||
if (ch > 127)
|
||||
|
@@ -80,7 +80,7 @@ static int is_822_dot_string(const char *local_part, const char *end)
|
||||
*/
|
||||
if (local_part[0] == 0 || local_part[0] == '.')
|
||||
return (NO);
|
||||
for (cp = local_part; cp < end && (ch = *cp) != 0; cp++) {
|
||||
for (cp = local_part; cp < end && (ch = *(unsigned char *) cp) != 0; cp++) {
|
||||
if (ch == '.' && (cp + 1) < end && cp[1] == '.')
|
||||
return (NO);
|
||||
#if 0
|
||||
|
@@ -172,8 +172,10 @@ int main(int argc, char **argv)
|
||||
* privileges for selected operations. That's right - it takes privileges
|
||||
* to toss privileges.
|
||||
*/
|
||||
if ((uid = getuid()) != 0)
|
||||
msg_fatal("must be run by the superuser, not by userid %d", uid);
|
||||
if ((uid = getuid()) != 0) {
|
||||
msg_error("to submit mail, use the Postfix sendmail command");
|
||||
msg_fatal("the postfix command must be run by the superuser");
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse switches.
|
||||
|
@@ -129,6 +129,7 @@ smtp_connect.o: ../../include/mymalloc.h
|
||||
smtp_connect.o: ../../include/inet_addr_list.h
|
||||
smtp_connect.o: ../../include/iostuff.h
|
||||
smtp_connect.o: ../../include/timed_connect.h
|
||||
smtp_connect.o: ../../include/stringops.h
|
||||
smtp_connect.o: ../../include/mail_params.h
|
||||
smtp_connect.o: ../../include/own_inet_addr.h
|
||||
smtp_connect.o: ../../include/dns.h
|
||||
|
@@ -51,6 +51,8 @@
|
||||
/* The request failed due to a soft error, and should be retried later.
|
||||
/* .IP SMTP_FAIL
|
||||
/* The request attempt failed due to a hard error.
|
||||
/* .IP SMTP_OK
|
||||
/* The local machine is the best mail exchanger.
|
||||
/* .PP
|
||||
/* In addition, a textual description of the problem is made available
|
||||
/* via the \fIwhy\fR argument.
|
||||
@@ -212,83 +214,6 @@ static DNS_RR *smtp_addr_list(DNS_RR *mx_names, VSTRING *why)
|
||||
return (addr_list);
|
||||
}
|
||||
|
||||
/* smtp_addr_fallback - add list of fallback addresses */
|
||||
|
||||
static DNS_RR *smtp_addr_fallback(DNS_RR *addr_list)
|
||||
{
|
||||
static DNS_RR *fallback_list = 0;
|
||||
DNS_RR *mx_names;
|
||||
DNS_RR *mx_addr_list;
|
||||
DNS_RR *addr;
|
||||
char *saved_fallback_relay;
|
||||
char *cp;
|
||||
char *relay;
|
||||
int saved_smtp_errno = smtp_errno;
|
||||
VSTRING *why;
|
||||
DNS_RR *rr;
|
||||
unsigned int pref;
|
||||
|
||||
/*
|
||||
* Build a cached list of fall-back host addresses. Issue a warning when
|
||||
* a fall-back host or domain is not found. This is most likely a local
|
||||
* configuration problem.
|
||||
*
|
||||
* XXX For the sake of admin-friendliness we want to support MX lookups for
|
||||
* fall-back relays. This comes at a price: the fallback relay lookup
|
||||
* routine almost entirely duplicates the smtp_domain_addr() routine.
|
||||
*
|
||||
* Fall-back hosts are given a preference that is outside the range of valid
|
||||
* DNS preferences (unsigned 16-bit integer).
|
||||
*/
|
||||
#define FB_PREF (0xffff + 1)
|
||||
|
||||
if (fallback_list == 0) {
|
||||
why = vstring_alloc(1);
|
||||
cp = saved_fallback_relay = mystrdup(var_fallback_relay);
|
||||
for (pref = FB_PREF; (relay = mystrtok(&cp, " \t\r\n,")) != 0; pref++) {
|
||||
smtp_errno = 0;
|
||||
switch (dns_lookup(relay, T_MX, RES_DEFNAMES, &mx_names, (VSTRING *) 0, why)) {
|
||||
default:
|
||||
smtp_errno = SMTP_RETRY;
|
||||
break;
|
||||
case DNS_FAIL:
|
||||
smtp_errno = SMTP_FAIL;
|
||||
break;
|
||||
case DNS_OK:
|
||||
mx_addr_list = smtp_addr_list(mx_names, why);
|
||||
dns_rr_free(mx_names);
|
||||
for (addr = mx_addr_list; addr; addr = addr->next)
|
||||
addr->pref = pref;
|
||||
fallback_list = dns_rr_append(fallback_list, mx_addr_list);
|
||||
break;
|
||||
case DNS_NOTFOUND:
|
||||
fallback_list = smtp_addr_one(fallback_list, relay, pref, why);
|
||||
break;
|
||||
}
|
||||
if (smtp_errno != SMTP_OK)
|
||||
msg_warn("look up fall-back relay %s: %s",
|
||||
relay, vstring_str(why));
|
||||
}
|
||||
vstring_free(why);
|
||||
myfree(saved_fallback_relay);
|
||||
}
|
||||
|
||||
/*
|
||||
* Append a copy of the fall-back address list to the mail exchanger
|
||||
* address list - which may be an empty list if no mail exchanger was
|
||||
* found.
|
||||
*/
|
||||
for (rr = fallback_list; rr; rr = rr->next)
|
||||
addr_list = dns_rr_append(addr_list, dns_rr_copy(rr));
|
||||
|
||||
/*
|
||||
* Clean up.
|
||||
*/
|
||||
smtp_errno = saved_smtp_errno;
|
||||
|
||||
return (addr_list);
|
||||
}
|
||||
|
||||
/* smtp_find_self - spot myself in a crowd of mail exchangers */
|
||||
|
||||
static DNS_RR *smtp_find_self(DNS_RR *addr_list)
|
||||
@@ -411,8 +336,6 @@ DNS_RR *smtp_domain_addr(char *name, VSTRING *why)
|
||||
addr_list = smtp_addr_list(mx_names, why);
|
||||
dns_rr_free(mx_names);
|
||||
best_found = (addr_list ? addr_list->pref : IMPOSSIBLE_PREFERENCE);
|
||||
if (*var_fallback_relay)
|
||||
addr_list = smtp_addr_fallback(addr_list);
|
||||
if (msg_verbose)
|
||||
smtp_print_addr(name, addr_list);
|
||||
if ((self = smtp_find_self(addr_list)) != 0) {
|
||||
@@ -455,8 +378,6 @@ DNS_RR *smtp_host_addr(char *host, VSTRING *why)
|
||||
*/
|
||||
#define PREF0 0
|
||||
addr_list = smtp_addr_one((DNS_RR *) 0, host, PREF0, why);
|
||||
if (*var_fallback_relay)
|
||||
addr_list = smtp_addr_fallback(addr_list);
|
||||
if (msg_verbose)
|
||||
smtp_print_addr(host, addr_list);
|
||||
return (addr_list);
|
||||
|
@@ -25,6 +25,11 @@
|
||||
/* smtp_connect() attempts to establish an SMTP session with a host
|
||||
/* that represents the named domain.
|
||||
/*
|
||||
/* No session and an smtp_errno of SMTP_OK means that the local
|
||||
/* machine is the best mail exchanger for the specified destination.
|
||||
/* It is left up to the caller to decide if this is a mailer loop
|
||||
/* or if this is a "do what I mean" request.
|
||||
/*
|
||||
/* The destination is either a host (or domain) name or a numeric
|
||||
/* address. Symbolic or numeric service port information may be
|
||||
/* appended, separated by a colon (":").
|
||||
@@ -105,6 +110,7 @@
|
||||
#include <inet_addr_list.h>
|
||||
#include <iostuff.h>
|
||||
#include <timed_connect.h>
|
||||
#include <stringops.h>
|
||||
|
||||
/* Global library. */
|
||||
|
||||
@@ -379,34 +385,77 @@ static char *smtp_parse_destination(char *destination, char *def_service,
|
||||
|
||||
SMTP_SESSION *smtp_connect(char *destination, VSTRING *why)
|
||||
{
|
||||
SMTP_SESSION *session;
|
||||
char *dest_buf;
|
||||
SMTP_SESSION *session = 0;
|
||||
char *dest_buf = 0;
|
||||
char *host;
|
||||
unsigned port;
|
||||
char *def_service = "smtp"; /* XXX configurable? */
|
||||
char *save;
|
||||
char *dest;
|
||||
char *cp;
|
||||
|
||||
/*
|
||||
* Parse the destination specification. Default is to use the SMTP port.
|
||||
* First try to deliver to the indicated destination, then try to deliver
|
||||
* to the optional fall-back relays. Each can be a list of destinations
|
||||
* by itself, with domain, host, [], numerical address, and port.
|
||||
*/
|
||||
dest_buf = smtp_parse_destination(destination, def_service, &host, &port);
|
||||
cp = save = concatenate(destination, " ", var_fallback_relay, (char *) 0);
|
||||
|
||||
while ((dest = mystrtok(&cp, " \t\r\n")) != 0) {
|
||||
|
||||
/*
|
||||
* Parse the destination. Default is to use the SMTP port.
|
||||
*/
|
||||
dest_buf = smtp_parse_destination(dest, def_service, &host, &port);
|
||||
|
||||
/*
|
||||
* Connect to an SMTP server. Skip mail exchanger lookups when a
|
||||
* quoted host is specified, or when DNS lookups are disabled.
|
||||
*/
|
||||
if (msg_verbose)
|
||||
msg_info("connecting to %s port %d", host, ntohs(port));
|
||||
if (var_disable_dns || *dest == '[') {
|
||||
session = smtp_connect_host(host, port, why);
|
||||
} else {
|
||||
session = smtp_connect_domain(host, port, why);
|
||||
}
|
||||
myfree(dest_buf);
|
||||
|
||||
/*
|
||||
* Done if we have a session, or if we have no session and this host
|
||||
* is the best MX relay for the destination. Agreed, an errno of OK
|
||||
* after failure is a weird way to reporting progress.
|
||||
*/
|
||||
if (session != 0 || smtp_errno == SMTP_OK)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Connect to an SMTP server. Skip mail exchanger lookups when a quoted
|
||||
* host is specified, or when DNS lookups are disabled.
|
||||
* Sanity check. The destination must not be empty or all blanks.
|
||||
*/
|
||||
if (msg_verbose)
|
||||
msg_info("connecting to %s port %d", host, ntohs(port));
|
||||
if (var_disable_dns || *destination == '[') {
|
||||
session = smtp_connect_host(host, port, why);
|
||||
} else {
|
||||
session = smtp_connect_domain(host, port, why);
|
||||
if (session == 0 && dest_buf == 0)
|
||||
msg_panic("null destination: \"%s\"", destination);
|
||||
|
||||
/*
|
||||
* Pay attention to what could be configuration problems, and pretend
|
||||
* that these are recoverable rather than bouncing the mail.
|
||||
*/
|
||||
if (session == 0 && smtp_errno == SMTP_FAIL) {
|
||||
if (strcmp(destination, var_relayhost) == 0) {
|
||||
msg_warn("%s configuration problem: %s",
|
||||
VAR_RELAYHOST, var_relayhost);
|
||||
smtp_errno = SMTP_RETRY;
|
||||
}
|
||||
if (*var_fallback_relay) {
|
||||
msg_warn("%s configuration problem: %s",
|
||||
VAR_FALLBACK_RELAY, var_fallback_relay);
|
||||
smtp_errno = SMTP_RETRY;
|
||||
}
|
||||
}
|
||||
if (session == 0
|
||||
&& smtp_errno == SMTP_FAIL
|
||||
&& strcmp(host, var_relayhost) == 0) {
|
||||
msg_warn("relayhost configuration problem: %s", var_relayhost);
|
||||
smtp_errno = SMTP_RETRY;
|
||||
}
|
||||
myfree(dest_buf);
|
||||
|
||||
/*
|
||||
* Cleanup.
|
||||
*/
|
||||
myfree(save);
|
||||
return (session);
|
||||
}
|
||||
|
@@ -298,7 +298,6 @@
|
||||
*/
|
||||
int var_smtpd_rcpt_limit;
|
||||
int var_smtpd_tmout;
|
||||
char *var_relay_domains;
|
||||
int var_smtpd_soft_erlim;
|
||||
int var_smtpd_hard_erlim;
|
||||
int var_queue_minfree; /* XXX use off_t */
|
||||
@@ -870,6 +869,8 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
|
||||
first = 0;
|
||||
if (len > 0 && ISSPACE(start[0]))
|
||||
rec_put(state->cleanup, REC_TYPE_NORM, "", 0);
|
||||
else if (strncmp(start + strspn(start, ">"), "From ", 5) == 0)
|
||||
continue;
|
||||
}
|
||||
if (prev_rec_type != REC_TYPE_CONT
|
||||
&& *start == '.' && (++start, --len) == 0)
|
||||
@@ -1430,7 +1431,6 @@ int main(int argc, char **argv)
|
||||
0,
|
||||
};
|
||||
static CONFIG_STR_TABLE str_table[] = {
|
||||
VAR_RELAY_DOMAINS, DEF_RELAY_DOMAINS, &var_relay_domains, 0, 0,
|
||||
VAR_SMTPD_BANNER, DEF_SMTPD_BANNER, &var_smtpd_banner, 1, 0,
|
||||
VAR_DEBUG_PEER_LIST, DEF_DEBUG_PEER_LIST, &var_debug_peer_list, 0, 0,
|
||||
VAR_NOTIFY_CLASSES, DEF_NOTIFY_CLASSES, &var_notify_classes, 0, 0,
|
||||
|
@@ -473,6 +473,7 @@ dict_tcp.o: iostuff.h
|
||||
dict_tcp.o: hex_quote.h
|
||||
dict_tcp.o: dict.h
|
||||
dict_tcp.o: argv.h
|
||||
dict_tcp.o: stringops.h
|
||||
dict_tcp.o: dict_tcp.h
|
||||
dict_unix.o: dict_unix.c
|
||||
dict_unix.o: sys_defs.h
|
||||
|
@@ -57,6 +57,30 @@
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(_DB_185_H_) && defined(USE_FCNTL_LOCK)
|
||||
#error "Error: this system must not use the db 1.85 compatibility interface"
|
||||
#endif
|
||||
|
||||
#ifndef DB_VERSION_MAJOR
|
||||
#define DB_VERSION_MAJOR 1
|
||||
#define DICT_DB_GET(db, key, val, flag) db->get(db, key, val, flag)
|
||||
#define DICT_DB_PUT(db, key, val, flag) db->put(db, key, val, flag)
|
||||
#define DICT_DB_DEL(db, key, flag) db->del(db, key, flag)
|
||||
#define DICT_DB_SYNC(db, flag) db->sync(db, flag)
|
||||
#define DICT_DB_CLOSE(db) db->close(db)
|
||||
#define DONT_CLOBBER R_NOOVERWRITE
|
||||
#endif
|
||||
|
||||
#if DB_VERSION_MAJOR > 1
|
||||
#define DICT_DB_GET(db, key, val, flag) sanitize(db->get(db, 0, key, val, flag))
|
||||
#define DICT_DB_PUT(db, key, val, flag) sanitize(db->put(db, 0, key, val, flag))
|
||||
#define DICT_DB_DEL(db, key, flag) sanitize(db->del(db, 0, key, flag))
|
||||
#define DICT_DB_SYNC(db, flag) ((errno = db->sync(db, flag)) ? -1 : 0)
|
||||
#define DICT_DB_CLOSE(db) ((errno = db->close(db, 0)) ? -1 : 0)
|
||||
#define DONT_CLOBBER DB_NOOVERWRITE
|
||||
#endif
|
||||
|
||||
/* Utility library. */
|
||||
|
||||
@@ -78,7 +102,38 @@ typedef struct {
|
||||
} DICT_DB;
|
||||
|
||||
#define DICT_DB_CACHE_SIZE (1024 * 1024)
|
||||
#define DICT_DB_NELM 4096
|
||||
#define DICT_DB_NELM 4096
|
||||
|
||||
#if DB_VERSION_MAJOR > 1
|
||||
|
||||
/* sanitize - sanitize db_get/put/del result */
|
||||
|
||||
static int sanitize(int status)
|
||||
{
|
||||
|
||||
/*
|
||||
* XXX This is unclean but avoids a lot of clutter elsewhere. Categorize
|
||||
* results into non-fatal errors (i.e., errors that we can deal with),
|
||||
* success, or fatal error (i.e., all other errors).
|
||||
*/
|
||||
switch (status) {
|
||||
|
||||
case DB_NOTFOUND: /* get, del */
|
||||
case DB_KEYEXIST: /* put */
|
||||
return (1); /* non-fatal */
|
||||
|
||||
case 0:
|
||||
return (0); /* success */
|
||||
|
||||
case DB_KEYEMPTY: /* get, others? */
|
||||
status = EINVAL;
|
||||
default:
|
||||
errno = status;
|
||||
return (-1); /* fatal */
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* dict_db_lookup - find database entry */
|
||||
|
||||
@@ -93,6 +148,8 @@ static const char *dict_db_lookup(DICT *dict, const char *name)
|
||||
const char *result = 0;
|
||||
|
||||
dict_errno = 0;
|
||||
memset(&db_key, 0, sizeof(db_key));
|
||||
memset(&db_value, 0, sizeof(db_value));
|
||||
|
||||
/*
|
||||
* Acquire a shared lock.
|
||||
@@ -107,7 +164,7 @@ static const char *dict_db_lookup(DICT *dict, const char *name)
|
||||
if (dict->flags & DICT_FLAG_TRY1NULL) {
|
||||
db_key.data = (void *) name;
|
||||
db_key.size = strlen(name) + 1;
|
||||
if ((status = db->get(db, &db_key, &db_value, 0)) < 0)
|
||||
if ((status = DICT_DB_GET(db, &db_key, &db_value, 0)) < 0)
|
||||
msg_fatal("error reading %s: %m", dict_db->path);
|
||||
if (status == 0) {
|
||||
dict->flags &= ~DICT_FLAG_TRY0NULL;
|
||||
@@ -122,7 +179,7 @@ static const char *dict_db_lookup(DICT *dict, const char *name)
|
||||
if (result == 0 && (dict->flags & DICT_FLAG_TRY0NULL)) {
|
||||
db_key.data = (void *) name;
|
||||
db_key.size = strlen(name);
|
||||
if ((status = db->get(db, &db_key, &db_value, 0)) < 0)
|
||||
if ((status = DICT_DB_GET(db, &db_key, &db_value, 0)) < 0)
|
||||
msg_fatal("error reading %s: %m", dict_db->path);
|
||||
if (status == 0) {
|
||||
if (buf == 0)
|
||||
@@ -152,6 +209,8 @@ static void dict_db_update(DICT *dict, const char *name, const char *value)
|
||||
DBT db_value;
|
||||
int status;
|
||||
|
||||
memset(&db_key, 0, sizeof(db_key));
|
||||
memset(&db_value, 0, sizeof(db_value));
|
||||
db_key.data = (void *) name;
|
||||
db_value.data = (void *) value;
|
||||
db_key.size = strlen(name);
|
||||
@@ -187,8 +246,8 @@ static void dict_db_update(DICT *dict, const char *name, const char *value)
|
||||
/*
|
||||
* Do the update.
|
||||
*/
|
||||
if ((status = db->put(db, &db_key, &db_value,
|
||||
(dict->flags & DICT_FLAG_DUP_REPLACE) ? 0 : R_NOOVERWRITE)) < 0)
|
||||
if ((status = DICT_DB_PUT(db, &db_key, &db_value,
|
||||
(dict->flags & DICT_FLAG_DUP_REPLACE) ? 0 : DONT_CLOBBER)) < 0)
|
||||
msg_fatal("error writing %s: %m", dict_db->path);
|
||||
if (status) {
|
||||
if (dict->flags & DICT_FLAG_DUP_IGNORE)
|
||||
@@ -199,7 +258,7 @@ static void dict_db_update(DICT *dict, const char *name, const char *value)
|
||||
msg_fatal("%s: duplicate entry: \"%s\"", dict_db->path, name);
|
||||
}
|
||||
if (dict->flags & DICT_FLAG_SYNC_UPDATE)
|
||||
if (db->sync(db, 0) < 0)
|
||||
if (DICT_DB_SYNC(db, 0) < 0)
|
||||
msg_fatal("%s: flush dictionary: %m", dict_db->path);
|
||||
|
||||
/*
|
||||
@@ -232,7 +291,7 @@ static int dict_db_delete(DICT *dict, const char *name)
|
||||
if (dict->flags & DICT_FLAG_TRY1NULL) {
|
||||
db_key.data = (void *) name;
|
||||
db_key.size = strlen(name) + 1;
|
||||
if ((status = db->del(db, &db_key, flags)) < 0)
|
||||
if ((status = DICT_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;
|
||||
@@ -245,7 +304,7 @@ static int dict_db_delete(DICT *dict, const char *name)
|
||||
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)
|
||||
if ((status = DICT_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;
|
||||
@@ -265,6 +324,9 @@ static int dict_db_delete(DICT *dict, const char *name)
|
||||
static int dict_db_sequence(DICT *dict, const int function,
|
||||
const char **key, const char **value)
|
||||
{
|
||||
#if DB_VERSION_MAJOR > 1
|
||||
msg_fatal("dict_db_sequence - operation is to be implemented");
|
||||
#else
|
||||
char *myname = "dict_db_sequence";
|
||||
DICT_DB *dict_db = (DICT_DB *) dict;
|
||||
DB *db = dict_db->db;
|
||||
@@ -328,6 +390,7 @@ static int dict_db_sequence(DICT *dict, const int function,
|
||||
}
|
||||
}
|
||||
return status;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* dict_db_close - close data base */
|
||||
@@ -336,7 +399,7 @@ static void dict_db_close(DICT *dict)
|
||||
{
|
||||
DICT_DB *dict_db = (DICT_DB *) dict;
|
||||
|
||||
if (dict_db->db->close(dict_db->db) < 0)
|
||||
if (DICT_DB_CLOSE(dict_db->db) < 0)
|
||||
msg_fatal("close database %s: %m", dict_db->path);
|
||||
myfree(dict_db->path);
|
||||
myfree((char *) dict_db);
|
||||
@@ -353,30 +416,76 @@ static DICT *dict_db_open(const char *path, int open_flags, int type,
|
||||
char *db_path;
|
||||
int lock_fd = -1;
|
||||
|
||||
#if DB_VERSION_MAJOR > 1
|
||||
int db_flags;
|
||||
|
||||
#endif
|
||||
|
||||
db_path = concatenate(path, ".db", (char *) 0);
|
||||
|
||||
if (dict_flags & DICT_FLAG_LOCK) {
|
||||
if ((lock_fd = open(db_path, open_flags, 0644)) < 0)
|
||||
msg_fatal("open database %s: %m", db_path);
|
||||
if (myflock(lock_fd, MYFLOCK_SHARED) < 0)
|
||||
msg_fatal("shared-lock database %s for open: %m", db_path);
|
||||
}
|
||||
/*
|
||||
* Use the DB 1.x programming interface. This is the default interface
|
||||
* with 4.4BSD systems. It is also available via the db_185 compatibility
|
||||
* interface, but that interface does not have the undocumented feature
|
||||
* that we need to make file locking safe with POSIX fcntl() locking.
|
||||
*/
|
||||
#if DB_VERSION_MAJOR < 2
|
||||
if ((db = dbopen(db_path, open_flags, 0644, type, tweak)) == 0)
|
||||
msg_fatal("open database %s: %m", db_path);
|
||||
lock_fd = db->fd(db);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Use the DB 2.x programming interface. Jump a couple extra hoops.
|
||||
*/
|
||||
#if DB_VERSION_MAJOR == 2
|
||||
db_flags = DB_FCNTL_LOCKING;
|
||||
if (open_flags == O_RDONLY)
|
||||
db_flags |= DB_RDONLY;
|
||||
if (open_flags & O_CREAT)
|
||||
db_flags |= DB_CREATE;
|
||||
if (open_flags & O_TRUNC)
|
||||
db_flags |= DB_TRUNCATE;
|
||||
if ((errno = db_open(db_path, type, db_flags, 0644, 0, tweak, &db)) != 0)
|
||||
msg_fatal("open database %s: %m", db_path);
|
||||
if (db == 0)
|
||||
msg_panic("db_open null result");
|
||||
if ((errno = db->fd(db, &lock_fd)) != 0)
|
||||
msg_fatal("get database file descriptor: %m");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Use the DB 3.x programming interface. Jump even more hoops.
|
||||
*/
|
||||
#if DB_VERSION_MAJOR > 2
|
||||
db_flags = DB_FCNTL_LOCKING;
|
||||
if (open_flags == O_RDONLY)
|
||||
db_flags |= DB_RDONLY;
|
||||
if (open_flags & O_CREAT)
|
||||
db_flags |= DB_CREATE;
|
||||
if (open_flags & O_TRUNC)
|
||||
db_flags |= DB_TRUNCATE;
|
||||
if ((errno = db_create(&db, 0, 0)) != 0)
|
||||
msg_fatal("create DB database: %m");
|
||||
if (db == 0)
|
||||
msg_panic("db_create null result");
|
||||
if ((errno = db->set_cachesize(db, 0, DICT_DB_CACHE_SIZE, 0)) != 0)
|
||||
msg_fatal("set DB cache size %d: %m", DICT_DB_CACHE_SIZE);
|
||||
if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0)
|
||||
msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM);
|
||||
if ((errno = db->open(db, db_path, 0, type, db_flags, 0644)) != 0)
|
||||
msg_fatal("open database %s: %m", db_path);
|
||||
if ((errno = db->fd(db, &lock_fd)) != 0)
|
||||
msg_fatal("get database file descriptor: %m");
|
||||
#endif
|
||||
|
||||
if (dict_flags & DICT_FLAG_LOCK) {
|
||||
if (myflock(lock_fd, MYFLOCK_NONE) < 0)
|
||||
msg_fatal("unlock database %s for open: %m", db_path);
|
||||
if (close(lock_fd) < 0)
|
||||
msg_fatal("close database %s: %m", db_path);
|
||||
}
|
||||
dict_db = (DICT_DB *) mymalloc(sizeof(*dict_db));
|
||||
dict_db->dict.lookup = dict_db_lookup;
|
||||
dict_db->dict.update = dict_db_update;
|
||||
dict_db->dict.delete = dict_db_delete;
|
||||
dict_db->dict.sequence = dict_db_sequence;
|
||||
dict_db->dict.close = dict_db_close;
|
||||
dict_db->dict.fd = db->fd(db);
|
||||
dict_db->dict.fd = lock_fd;
|
||||
if (fstat(dict_db->dict.fd, &st) < 0)
|
||||
msg_fatal("dict_db_open: fstat: %m");
|
||||
dict_db->dict.mtime = st.st_mtime;
|
||||
@@ -393,11 +502,25 @@ static DICT *dict_db_open(const char *path, int open_flags, int type,
|
||||
|
||||
DICT *dict_hash_open(const char *path, int open_flags, int dict_flags)
|
||||
{
|
||||
#if DB_VERSION_MAJOR < 2
|
||||
HASHINFO tweak;
|
||||
|
||||
memset((char *) &tweak, 0, sizeof(tweak));
|
||||
tweak.nelem = DICT_DB_NELM;
|
||||
tweak.cachesize = DICT_DB_CACHE_SIZE;
|
||||
#endif
|
||||
#if DB_VERSION_MAJOR == 2
|
||||
DB_INFO tweak;
|
||||
|
||||
memset((char *) &tweak, 0, sizeof(tweak));
|
||||
tweak.h_nelem = DICT_DB_NELM;
|
||||
tweak.db_cachesize = DICT_DB_CACHE_SIZE;
|
||||
#endif
|
||||
#if DB_VERSION_MAJOR > 2
|
||||
void *tweak;
|
||||
|
||||
tweak = 0;
|
||||
#endif
|
||||
return (dict_db_open(path, open_flags, DB_HASH, (void *) &tweak, dict_flags));
|
||||
}
|
||||
|
||||
@@ -405,10 +528,23 @@ DICT *dict_hash_open(const char *path, int open_flags, int dict_flags)
|
||||
|
||||
DICT *dict_btree_open(const char *path, int open_flags, int dict_flags)
|
||||
{
|
||||
#if DB_VERSION_MAJOR < 2
|
||||
BTREEINFO tweak;
|
||||
|
||||
memset((char *) &tweak, 0, sizeof(tweak));
|
||||
tweak.cachesize = DICT_DB_CACHE_SIZE;
|
||||
#endif
|
||||
#if DB_VERSION_MAJOR == 2
|
||||
DB_INFO tweak;
|
||||
|
||||
memset((char *) &tweak, 0, sizeof(tweak));
|
||||
tweak.db_cachesize = DICT_DB_CACHE_SIZE;
|
||||
#endif
|
||||
#if DB_VERSION_MAJOR > 2
|
||||
void *tweak;
|
||||
|
||||
tweak = 0;
|
||||
#endif
|
||||
|
||||
return (dict_db_open(path, open_flags, DB_BTREE, (void *) &tweak, dict_flags));
|
||||
}
|
||||
|
@@ -42,6 +42,10 @@
|
||||
#else
|
||||
#include <ndbm.h>
|
||||
#endif
|
||||
#ifdef R_FIRST
|
||||
#error "Error: you are including the Berkeley DB version of ndbm.h"
|
||||
#error "To build with Postfix NDBM support, delete the Berkeley DB ndbm.h file"
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@@ -181,7 +181,7 @@ typedef struct {
|
||||
static DICT_OPEN_INFO dict_open_info[] = {
|
||||
"environ", dict_env_open,
|
||||
"unix", dict_unix_open,
|
||||
#if 0
|
||||
#if 1
|
||||
"tcp", dict_tcp_open,
|
||||
#endif
|
||||
#ifdef HAS_DBM
|
||||
@@ -378,6 +378,8 @@ main(int argc, char **argv)
|
||||
bufp = vstring_str(keybuf);
|
||||
if ((cmd = mystrtok(&bufp, " ")) == 0)
|
||||
continue;
|
||||
if (dict_changed())
|
||||
msg_warn("dictionary has changed");
|
||||
key = mystrtok(&bufp, " =");
|
||||
value = mystrtok(&bufp, " =");
|
||||
if (strcmp(cmd, "del") == 0 && key && !value) {
|
||||
|
@@ -18,10 +18,33 @@
|
||||
/*
|
||||
/* Map names have the form host:port.
|
||||
/*
|
||||
/* The TCP map class implements a very simple protocol: a query is sent
|
||||
/* as one line of text, and a reply is sent back in the same format.
|
||||
/* % and non-printable characters are replaced by %xx, xx being the
|
||||
/* corresponding hexadecimal value.
|
||||
/* The TCP map class implements a very simple protocol: the client
|
||||
/* sends a query, and the server sends one reply. Queries and
|
||||
/* replies are sent as one line of ASCII text, terminated by the
|
||||
/* ASCII newline character. Query and reply parameters (see below)
|
||||
/* are separated by whitespace.
|
||||
/*
|
||||
/* In query and reply parameters, the character % and any non-printable
|
||||
/* characters (including whitespace) are replaced by %XX, XX being the
|
||||
/* corresponding ASCII hexadecimal character value. The hexadecimal codes
|
||||
/* can be specified in any case (upper, lower, mixed).
|
||||
/*
|
||||
/* Queries are strings that serve as lookup key in the simulated
|
||||
/* table.
|
||||
/* .IP "get SPACE key NEWLINE"
|
||||
/* Look up data under the specified key.
|
||||
/* .IP "put SPACE key SPACE value NEWLINE"
|
||||
/*
|
||||
/* .PP
|
||||
/* Replies can have the following form:
|
||||
/* .IP "500 SPACE text NEWLINE"
|
||||
/* The requested data does not exist. The text is ignored.
|
||||
/* .IP "400 SPACE text NEWLINE"
|
||||
/* This indicates an error condition. The text gives the nature of
|
||||
/* the problem.
|
||||
/* .IP "200 SPACE text NEWLINE"
|
||||
/* The requested data was found. The text contains an encoded version
|
||||
/* of the requested data.
|
||||
/* SEE ALSO
|
||||
/* dict(3) generic dictionary manager
|
||||
/* hex_quote(3) http-style quoting
|
||||
@@ -45,6 +68,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
|
||||
/* Utility library. */
|
||||
|
||||
@@ -56,6 +80,7 @@
|
||||
#include "connect.h"
|
||||
#include "hex_quote.h"
|
||||
#include "dict.h"
|
||||
#include "stringops.h"
|
||||
#include "dict_tcp.h"
|
||||
|
||||
/* Application-specific. */
|
||||
@@ -148,13 +173,23 @@ static const char *dict_tcp_lookup(DICT *dict, const char *key)
|
||||
* is mostly text.
|
||||
*/
|
||||
hex_quote(dict_tcp->hex_buf, key);
|
||||
vstream_fprintf(dict_tcp->fp, "%s\n", STR(dict_tcp->hex_buf));
|
||||
vstream_fprintf(dict_tcp->fp, "get %s\n", STR(dict_tcp->hex_buf));
|
||||
errno = 0;
|
||||
if (vstring_get_nonl(dict_tcp->hex_buf, dict_tcp->fp) == VSTREAM_EOF) {
|
||||
msg_warn("read TCP map reply from %s: %m", dict_tcp->map);
|
||||
} else if (!hex_unquote(dict_tcp->raw_buf, STR(dict_tcp->hex_buf))) {
|
||||
msg_warn("read TCP map reply from %s: malformed reply %.100s",
|
||||
dict_tcp->map, STR(dict_tcp->hex_buf));
|
||||
dict_tcp->map,
|
||||
printable(STR(dict_tcp->hex_buf), '_'));
|
||||
dict_errno = DICT_ERR_RETRY;
|
||||
return (0);
|
||||
} else if (ISSPACE(*STR(dict_tcp->raw_buf))) {
|
||||
msg_warn("TCP map reply from %s failed%s%s",
|
||||
dict_tcp->map,
|
||||
STR(dict_tcp->raw_buf)[1] ? ":" : "",
|
||||
printable(STR(dict_tcp->raw_buf), '_'));
|
||||
dict_errno = DICT_ERR_RETRY;
|
||||
return (0);
|
||||
} else {
|
||||
return (STR(dict_tcp->raw_buf));
|
||||
}
|
||||
|
@@ -20,10 +20,11 @@
|
||||
/* value is the hex argument.
|
||||
/*
|
||||
/* hex_unquote() performs the opposite transformation. This function
|
||||
/* understands lowercase and uppercase %XX sequences. The result
|
||||
/* value is the raw argument in case of success, a null pointer otherwise.
|
||||
/* understands, lowercase, uppercase, and mixed case %XX sequences. The
|
||||
/* result value is the raw argument in case of success, a null pointer
|
||||
/* otherwise.
|
||||
/* BUGS
|
||||
/* Cannot process null characters.
|
||||
/* hex_quote() cannot process null characters in data.
|
||||
/* LICENSE
|
||||
/* .ad
|
||||
/* .fi
|
||||
|
Reference in New Issue
Block a user