mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-31 06:05:37 +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.
|
||||
|
@@ -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
|
||||
|
@@ -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,6 +35,10 @@
|
||||
# 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.
|
||||
@@ -52,13 +56,13 @@
|
||||
# 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
|
||||
@@ -110,13 +114,14 @@
|
||||
# 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
|
||||
# software.
|
||||
|
@@ -50,16 +50,19 @@
|
||||
# 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)
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
@@ -109,16 +112,16 @@
|
||||
# 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
|
||||
#
|
||||
# 2
|
||||
#
|
||||
# CANONICAL(5) CANONICAL(5)
|
||||
#
|
||||
# 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
|
||||
@@ -168,15 +171,16 @@
|
||||
#
|
||||
# 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
|
||||
# software.
|
||||
|
@@ -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,6 +22,10 @@
|
||||
# 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
|
||||
@@ -51,16 +55,15 @@
|
||||
# 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,6 +22,10 @@
|
||||
# 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
|
||||
@@ -51,15 +55,15 @@
|
||||
# parts, nor is user+foo broken up into user and foo.
|
||||
#
|
||||
# Patterns are applied in the order as specified in the
|
||||
# table, until a pattern is found that matches the search
|
||||
# string.
|
||||
#
|
||||
# Substitution of sub-strings from the matched expression is
|
||||
#
|
||||
# 1
|
||||
#
|
||||
# REGEXP_TABLE(5) REGEXP_TABLE(5)
|
||||
#
|
||||
# table, until a pattern is found that matches the search
|
||||
# string.
|
||||
#
|
||||
# Substitution of sub-strings from the matched expression is
|
||||
# possible using $1, $2, etc.. The macros in the replacement
|
||||
# string may need to be written as ${n} or $(n) if they
|
||||
# aren't followed by whitespace.
|
||||
|
@@ -35,6 +35,9 @@
|
||||
# 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
|
||||
@@ -53,13 +56,12 @@
|
||||
# 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
|
||||
|
@@ -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,6 +35,10 @@
|
||||
# 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-
|
||||
# sponding result.
|
||||
@@ -51,16 +55,15 @@
|
||||
# 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:
|
||||
@@ -110,15 +113,15 @@
|
||||
# used. Specify [] around the hostname in order to disable
|
||||
# MX lookups.
|
||||
#
|
||||
# 2
|
||||
#
|
||||
# TRANSPORT(5) TRANSPORT(5)
|
||||
#
|
||||
# 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
|
||||
# bounced.
|
||||
#
|
||||
@@ -169,15 +172,14 @@
|
||||
# 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,6 +58,10 @@
|
||||
#
|
||||
# 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
|
||||
# the corresponding result.
|
||||
@@ -109,14 +113,14 @@
|
||||
# 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)
|
||||
#
|
||||
# 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.
|
||||
|
@@ -39,6 +39,10 @@ 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>.
|
||||
@@ -56,10 +60,6 @@ ACCESS(5) ACCESS(5)
|
||||
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,6 +71,9 @@ 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>
|
||||
@@ -122,9 +125,6 @@ ACCESS(5) ACCESS(5)
|
||||
<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,6 +137,9 @@ 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
|
||||
software.
|
||||
@@ -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,6 +71,11 @@ CANONICAL(5) CANONICAL(5)
|
||||
CANONICAL(5) CANONICAL(5)
|
||||
|
||||
|
||||
<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:
|
||||
|
||||
@@ -120,11 +125,6 @@ CANONICAL(5) CANONICAL(5)
|
||||
<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
|
||||
|
||||
|
||||
|
||||
@@ -137,6 +137,11 @@ CANONICAL(5) CANONICAL(5)
|
||||
CANONICAL(5) CANONICAL(5)
|
||||
|
||||
|
||||
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>
|
||||
@@ -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,6 +203,11 @@ 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
|
||||
software.
|
||||
@@ -249,11 +254,6 @@ CANONICAL(5) CANONICAL(5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -26,19 +26,9 @@ 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:
|
||||
|
||||
@@ -60,6 +50,16 @@ FLUSH(8) FLUSH(8)
|
||||
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,16 +71,6 @@ 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.
|
||||
|
||||
@@ -124,7 +114,17 @@ FLUSH(8) FLUSH(8)
|
||||
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,24 +137,14 @@ 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
|
||||
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
|
||||
@@ -191,6 +181,16 @@ FLUSH(8) FLUSH(8)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -26,6 +26,10 @@ 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
|
||||
@@ -55,10 +59,6 @@ PCRE_TABLE(5) PCRE_TABLE(5)
|
||||
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,6 +26,10 @@ 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
|
||||
@@ -55,10 +59,6 @@ REGEXP_TABLE(5) REGEXP_TABLE(5)
|
||||
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
|
||||
|
||||
|
||||
|
||||
@@ -71,6 +71,10 @@ 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
|
||||
aren't followed by whitespace.
|
||||
@@ -123,10 +127,6 @@ REGEXP_TABLE(5) REGEXP_TABLE(5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2
|
||||
|
||||
|
@@ -39,6 +39,9 @@ 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
|
||||
@@ -57,9 +60,6 @@ RELOCATED(5) RELOCATED(5)
|
||||
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,6 +71,8 @@ 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>
|
||||
@@ -126,8 +128,6 @@ RELOCATED(5) RELOCATED(5)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2
|
||||
|
||||
|
||||
|
@@ -39,6 +39,10 @@ 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-
|
||||
sponding <i>result</i>.
|
||||
@@ -55,10 +59,6 @@ TRANSPORT(5) TRANSPORT(5)
|
||||
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,7 +71,11 @@ 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>
|
||||
@@ -121,10 +125,6 @@ TRANSPORT(5) TRANSPORT(5)
|
||||
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,6 +137,11 @@ TRANSPORT(5) TRANSPORT(5)
|
||||
TRANSPORT(5) TRANSPORT(5)
|
||||
|
||||
|
||||
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.
|
||||
|
||||
@@ -187,11 +192,6 @@ TRANSPORT(5) TRANSPORT(5)
|
||||
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,6 +71,10 @@ 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
|
||||
the corresponding <i>result</i>.
|
||||
@@ -122,10 +126,6 @@ VIRTUAL(5) VIRTUAL(5)
|
||||
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,6 +137,10 @@ VIRTUAL(5) VIRTUAL(5)
|
||||
VIRTUAL(5) VIRTUAL(5)
|
||||
|
||||
|
||||
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.
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/* 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) {
|
||||
|
||||
/*
|
||||
* Connect to an SMTP server. Skip mail exchanger lookups when a quoted
|
||||
* host is specified, or when DNS lookups are disabled.
|
||||
* 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 || *destination == '[') {
|
||||
if (var_disable_dns || *dest == '[') {
|
||||
session = smtp_connect_host(host, port, why);
|
||||
} else {
|
||||
session = smtp_connect_domain(host, port, why);
|
||||
}
|
||||
if (session == 0
|
||||
&& smtp_errno == SMTP_FAIL
|
||||
&& strcmp(host, var_relayhost) == 0) {
|
||||
msg_warn("relayhost configuration problem: %s", var_relayhost);
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sanity check. The destination must not be empty or all blanks.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
myfree(dest_buf);
|
||||
if (*var_fallback_relay) {
|
||||
msg_warn("%s configuration problem: %s",
|
||||
VAR_FALLBACK_RELAY, var_fallback_relay);
|
||||
smtp_errno = SMTP_RETRY;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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. */
|
||||
|
||||
@@ -80,6 +104,37 @@ typedef struct {
|
||||
#define DICT_DB_CACHE_SIZE (1024 * 1024)
|
||||
#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 */
|
||||
|
||||
static const char *dict_db_lookup(DICT *dict, const char *name)
|
||||
@@ -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