Internet connectivity. With ETRN, a site can tell the mail server
of its provider to "Please deliver all my mail now".
-Postfix versions before 20001003 implemented the ETRN command in
-a lame manner: they would attempt to deliver all queued mail. This
-is slow on mail servers that queue mail for many customers.
+Postfix versions before 20001005 implemented the ETRN command in
+a lame manner: they simply attempted to deliver all queued mail.
+This is slow on mail servers that queue mail for many customers.
-As of version 20001003, Postfix has a faster ETRN implementation.
-At the same time, the command "sendmail -qR" is now implemented by
-sending an ETRN command to the local SMTP server.
+As of version 20001005, Postfix has a fast ETRN implementation that
+does not require Postfix to examine every queue file. The command
+"sendmail -qR" is now implemented by sending an ETRN command to
+the local SMTP server.
-Postfix "fast ETRN/sendmail -qR" speeds up deliveries by looking
-only at mail that is queued for a given destination site. Postfix
-"slow ETRN" is still used as a fall-back method.
+Postfix "fast ETRN/sendmail -qR" speeds up deliveries by attempting
+to deliver only mail that is queued for a given destination site.
+The old Postfix "slow ETRN" is still used as a fall-back method.
How Postfix fast ETRN works
===========================
fast_flush_policy = relay
-The relay_domains parameter specifies what destinations Postfix
-will relay to. For destinations without "fast ETRN/sendmail -qR"
-service, Postfix falls back to the old "slow ETRN" which delivers
-all queued mail.
+The "relay_domains" parameter specifies what destinations Postfix
+will relay to.
+
+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:
become populated as Postfix routinely attempts to deliver delayed
mail, but that will take a couple hours.
-To test the "fast ETRN" service, telnet to the Postfix SMTP server
-from a client that is allowed to execute ETRN commands (by default,
-that's every client), and type:
+After the "sendmail -q" has completed all delivery attempts (that
+can take a while), you're ready to test the "fast ETRN" service.
+Telnet to the Postfix SMTP server from a client that is allowed to
+execute ETRN commands (by default, that's every client), and type:
helo my.client.name
etrn some.customer.domain
-where "some.customer.domain" is the name of a domain that your mail
-server is willing to relay mail to, and that your server has some
-mail queued for.
+where "some.customer.domain" is the name of a domain that has a
+non-empty logfile somewhere under /var/spool/postfix/flush.
In the maillog file, you should immediately see a couple of logfile
records, as evidence that the queue manager has opened queue files:
from=<whatever>, size=4711, nrcpt=1 (queue active)
What happens next depends on whether the destination is reachable.
+If it's not reachable, the mail queue IDs will be added back to
+the some.customer.domain logfile under /var/spool/postfix/flush.
Repeat the exercise with another domain that your server is willing
-to relay to, but that has no mail queued.
+to relay to (domain listed in "relay_domains"), but that has no mail
+queued.
helo my.client.name
etrn some.other.customer.domain
-This time, the "etrn" command should not trigger any mail deliveries
-at all.
+This time, the "etrn" command should trigger NO mail deliveries at
+all. If this triggers delivery of all mail, then you used the wrong
+domain name, or "fast ETRN" service is turned off.
Finally, repeat the exercise with a destination that your mail
server is not willing to relay to. It does not matter if your
20001003
Feature: the fast flush refresh and purge time interval
- parameters can now be specified in seconds or in user-specified
- units by providing an appropriate suffix: s (seconds), m
- (minutes), h (hours), d (days), w (weeks). unit. This
- was needed so that I could test the flush server code in
- a reasonable way. Other time parameters will be migrated
- as time permits. Files: global/mail_conf_time.c,
+ parameters can now be specified in user-specified units by
+ providing an appropriate suffix: s (seconds), m (minutes),
+ h (hours), d (days), w (weeks). unit. This was needed so
+ that I could test the flush server code in a reasonable
+ way (its timeouts are normally specified in days or hours,
+ and I don't have that much time for testing). Other Postfix
+ time interval parameters will be migrated as time permits.
+ Files: conf/sample-flush.cf, global/mail_conf_time.c,
postconf/postconf.c.
Unfeature: qmgr_hog_factor is now disabled by default. It
- was just too confusing.
+ was just too confusing. If you don't know what this means,
+ do not worry.
+
+20001005
+
+ Cleanup: after "postfix reload" do not penalize mail that
+ was in the active queue, but make it ready for immediate
+ delivery so that ETRN etc. works as intended. Files:
+ *qmgr/qmgr.c, *qmgr/qmgr_active.c.
+
+ Portability: Redhat 7 library interfaces have changed
+ incompatibly, which breaks existing software. File makedefs.
-Incompatible changes with snapshot-20001003
+Incompatible changes with snapshot-20001005
===========================================
If this release does not work for you, you can go back to a previous
must be added to the master.cf file before you can start Postfix
again.
-After installing the new Postfix release:
+1 - The recommended Postfix configuration no longer uses flat
+ directories for the "active", "bounce", and "defer" queue
+ directories. The "flush" directory for the new "flush" service
+ directory should not be flat either.
-- Check the output from "postconf hash_queue_names". The recommended
- setting now includes the names of the "active", "bounce", "defer",
- and "flush" directories.
+ Upon start-up, Postfix checks if the hash_queue_names configuration
+ parameter is properly set up, and will add any queue directory
+ names that are missing.
- If your setting does not contain at least these directory names,
- either you need to remove the explicit setting from the main.cf
- file (so that Postfix uses the recommended default setting), or
- you need to update it.
+2 - In order to improve performance of one-to-one mail deliveries
+ the queue manager will now look at up to 10000 queue files
+ (was: 1000). The default qmgr_message_active_limit setting
+ was changed accordingly.
-- Check the output from "postconf qmgr_message_active_limit". The
- recommended value has changed to 10000.
+ If you have a non-default qmgr_message_active_limit in main.cf,
+ you may want adjust it.
- If your setting is lower, either you need to remove the explicit
- setting from the main.cf file (so that Postfix uses the recommended
- default setting), or you need to update it.
+3 - The new "flush" service needs to be configured in master.cf.
-- Add a new entry to the master.cf file for the new flush service:
+ Upon start-up, Postfix checks if the new "flush" service is
+ configured in the master.cf file, and will add an entry if it
+ is missing.
- flush unix - - n 1000? 0 flush
+Should you wish to back out to a previous Postfix release there is
+no need to undo the above changes.
- This entry is not needed if you won't use the fast flush service.
- This service is used by default; to disable the fast flush service,
- you need to specify in the main.cf file:
-
- fast_flush_policy = none
-
- In the new master.cf entry, the 1000? requests that the "fast
- flush" service does some cleaning up every 15 minutes, but only
- if the fast flush service is actually being used. The 0 means
- that Postfix should run as many flush servers as are needed.
- Changing this may cause deadlock.
-
-Now you can start Postfix again.
-
-Major changes with snapshot-20001001
+Major changes with snapshot-20001005
====================================
In order to improve performance of one-to-one deliveries, Postfix
regardless of its destination. This is slow if your mail server
queues mail for lots of different destinations.
-This release introduces fast "ETRN" and "sendmail -qR". Unlike
-their lame predecessor, these deliver only mail that is queued for
-the specified destinations.
+This release introduces fast "ETRN" and "sendmail -qR". These
+deliver only mail that is queued for the specified destination,
+without requiring Postfix to open every file in the mail queue.
Postfix now maintains per-destination logfiles with information
about what mail is queued for specific destinations. By default,
#
# 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, and
-# "none" to turn this feature off.
+# destinations eligible, "relay" for relay destinations only (the
+# default), and "none" to turn this feature off.
#
#fast_flush_policy = all
#fast_flush_policy = relay
done
done
+ # Look for incomplete upgrades.
+
+ test -f $config_directory/master.cf || {
+ $FATAL no $config_directory/master.cf file found
+ exit 1
+ }
+ grep 'flush.*flush' $config_directory/master.cf >/dev/null || {
+ $WARN adding missing entry for flush service to master.cf
+ cat >>$config_directory/master.cf <<EOF
+flush unix - - n 1000? 0 flush
+EOF
+ }
+ found=`$command_directory/postconf -h hash_queue_names`
+ missing=
+ (echo "$found" | grep active >/dev/null) || missing="$missing active"
+ (echo "$found" | grep bounce >/dev/null) || missing="$missing bounce"
+ (echo "$found" | grep defer >/dev/null) || missing="$missing defer"
+ (echo "$found" | grep flush >/dev/null) || missing="$missing flush"
+ test -n "$missing" && {
+ $WARN fixing main.cf hash_queue_names for missing $missing
+ $command_directory/postconf -e hash_queue_names="$found$missing"
+ }
+
+ # See if all queue files are in the right place.
+
$command_directory/postsuper || exit 1
find corrupt -type f -exec $WARN damaged message: {} \;
done
done
+ # Look for incomplete upgrades.
+
+ test -f $config_directory/master.cf || {
+ $FATAL no $config_directory/master.cf file found
+ exit 1
+ }
+ grep 'flush.*flush' $config_directory/master.cf >/dev/null || {
+ $WARN adding missing entry for flush service to master.cf
+ cat >>$config_directory/master.cf <<EOF
+flush unix - - n 1000? 0 flush
+EOF
+ }
+ found=`$command_directory/postconf -h hash_queue_names`
+ missing=
+ (echo "$found" | grep active >/dev/null) || missing="$missing active"
+ (echo "$found" | grep bounce >/dev/null) || missing="$missing bounce"
+ (echo "$found" | grep defer >/dev/null) || missing="$missing defer"
+ (echo "$found" | grep flush >/dev/null) || missing="$missing flush"
+ test -n "$missing" && {
+ $WARN fixing main.cf hash_queue_names for missing $missing
+ $command_directory/postconf -e hash_queue_names="$found$missing"
+ }
+
+ # See if all queue files are in the right place.
+
+
$command_directory/postsuper || exit 1
find corrupt -type f -exec $WARN damaged message: {} \;
# HERE JUST SERVES AS AN EXAMPLE.
#
# This file contains example settings of Postfix parameters that
-# control the fast flush service, which is the engine that implements
-# ETRN and "sendmail -qR".
+# 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
# eligible for per-destination logfiles with mail that is queued to
# those destinations.
#
-# When a destination is eligible, ETRN and "sendmail -qR" are
-# implemented by delivering only messages that are queued for that
-# destination (Postfix will deliver to all recipients of those
-# messages, regardless of their destination).
+# When a destination is eligible for "fast flush" logfiles, ETRN and
+# "sendmail -qR" are implemented by delivering only messages that
+# are listed in the logfile for that destination (in fact, Postfix
+# will deliver to all recipients of those messages, regardless of
+# their destination, but that is not an issue when you relay mail
+# for an eligible site).
#
-# When a destination is not eligible, ETRN and "sendmail -qR" are
-# implemented simply by attempting to deliver all queued mail.
+# When a destination is not eligible for "fast flush" logfiles, ETRN
+# and "sendmail -qR" are implemented simply by attempting to deliver
+# all queued mail. That's the slow service that Postfix used to
+# implement before 20001005.
#
-# By default, Postfix maintains per-destination deferred mail logfiles
-# only for destinations that the Postfix SMTP server is willing to
-# relay to (see the relay_domains parameter in sample-smtpd.cf).
+# By default, Postfix maintains "fast flush" logfiles only for
+# destinations that the Postfix SMTP server is willing to relay to
+# (see the relay_domains parameter in sample-smtpd.cf).
#
-# Specify "all" to enable per-destination deferred mail logfiles
-# for all destinations, "none" to disable the logfiles altogether.
+# Specify "all" to enable "fast flush" logfiles for all destinations,
+# "none" to disable the logfiles altogether.
#
#fast_flush_policy = all
fast_flush_policy = relay
#fast_flush_policy = none
-# The fast_flush_purge_delay parameter controls how long an empty
-# per-destination deferred mail logfile is allowed to live.
+# The fast_flush_purge_time parameter controls how long an empty
+# per-destination "fast flush" logfile is allowed to live.
#
# You can specify the time as a number, or as a number followed by
# a letter that indicates the time unit: s=seconds, m=minutes, h=hours,
# d=days, w=weeks. The default time unit is days.
#
-fast_flush_purge_delay = 7d
+fast_flush_purge_time = 7d
-# The fast_flush_refresh_delay parameter controls how long a non-empty
-# per-destination deferred mail logfile is allowed to remain unread
+# The fast_flush_refresh_time parameter controls how long a non-empty
+# per-destination "fast flush" logfile is allowed to remain unread
# before its contents need to be refreshed. The contents of a logfile
# are refreshed by requesting delivery of messages listed in the
# logfile.
# a letter that indicates the time unit: s=seconds, m=minutes, h=hours,
# d=days, w=weeks. The default time unit is hours.
#
-fast_flush_refresh_delay = 12h
+fast_flush_refresh_time = 12h
<b>NAME</b>
- flush - Postfix fast flush cache manager
+ flush - Postfix fast flush server
<b>SYNOPSIS</b>
<b>flush</b> [generic Postfix daemon options]
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>cache</b><i>_</i><b>policy</b> configuration parameter:
+ 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.
This server implements the following requests:
<b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>ADD</b> <i>sitename</i> <i>queue_id</i>
- Inform the cache manager that the specified message
- is queued for <i>sitename</i>. Depending on caching pol-
- icy, the cache manager stores or ignores the infor-
- mation.
+ Inform the fast flush server that the specified
+ message is queued for <i>sitename</i>. Depending on log-
+ ging policy, the fast flush server stores or
+ ignores the information.
<b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>SEND</b> <i>sitename</i>
Request delivery of mail that is queued for <i>site-</i>
<i>name</i>. If the destination is eligible for a fast
flush logfile, this request triggers delivery of
- specific messages; the per-destination logfile is
- truncated to zero length; if mail is undeliverable,
- it will be logged to the per-destination logfile.
+ messages listed in that destination's logfile, and
+ the logfile is truncated to zero length; if mail is
+ undeliverable it will be added back to the logfile.
If the destination is not eligible for a fast flush
- logfile, this request triggers delivery of all
+ logfile, this request triggers delivery of all
queued mail.
<b>TRIGGER</b><i>_</i><b>REQ</b><i>_</i><b>WAKEUP</b>
- This wakeup request from the master is an alterna-
+ 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>delay</b> hours,
- by simulating send requests (see above) for the
- corresponding destinations.
+ 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>delay</b> days.
+ updated in <b>fast</b><i>_</i><b>flush</b><i>_</i><b>purge</b><i>_</i><b>time</b> days.
<b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>PURGE</b> (completes in the background)
- Refresh all non-empty per-destination logfiles, by
+ Refresh all non-empty per-destination logfiles, by
simulating send requests (see above) for the corre-
sponding destinations. This can be incredibly
- expensive when caching is enabled for all deferred
+ expensive when logging is enabled for all deferred
mail, and is not recommended.
Delete empty per-destination logfiles that were not
- updated in <b>fast</b><i>_</i><b>flush</b><i>_</i><b>purge</b><i>_</i><b>delay</b> days.
-
- Fast flush logfiles are truncated only after a
- <b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>SEND</b> request, not when mail is actually deliv-
- ered, and therefore can accumulate outdated or redundant
- data. In order to maintain sanity, <b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>REFRESH</b> must
- be executed periodically.
+ updated in <b>fast</b><i>_</i><b>flush</b><i>_</i><b>purge</b><i>_</i><b>time</b> days.
The server response is one of:
The request completed normally.
<b>FLUSH</b><i>_</i><b>STAT</b><i>_</i><b>BAD</b>
- The flush server rejected the request (bad request
+ The flush server rejected the request (bad request
name, bad request parameter value).
<b>FLUSH</b><i>_</i><b>STAT</b><i>_</i><b>FAIL</b>
The request failed.
<b>SECURITY</b>
- The fast flush server is not security-sensitive. It does
- not talk to the network, and it does not talk to local
- users. The fast flush server can run chrooted at fixed
+ The fast flush server is not security-sensitive. It does
+ not talk to the network, and it does not talk to local
+ users. The fast flush server can run chrooted at fixed
low privilege.
<b>DIAGNOSTICS</b>
Problems and transactions are logged to <b>syslogd</b>(8).
<b>BUGS</b>
- In reality, this server schedules delivery of all recipi-
- ents of a deferred message. This limitation is due to the
- fact that one queue runner has to handle mail for multiple
+ Fast flush logfiles are truncated only after a
+ <b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>SEND</b> request, not when mail is actually deliv-
+ ered, and therefore can accumulate outdated or redundant
+ data. In order to maintain sanity, <b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>REFRESH</b> must
+ be executed periodically. This can be automated with a
+ suitable wakeup timer setting in the <b>master.cf</b> configura-
+ tion file.
+
+ Upon receipt of a request to deliver all mail for an
FLUSH(8) FLUSH(8)
- destinations.
+ 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.
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>cache</b><i>_</i><b>policy</b>
+ <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>refresh</b><i>_</i><b>delay</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
not read in this amount of time (default time unit:
hours), by simulating a send request for the corre-
sponding destination.
- <b>fast</b><i>_</i><b>flush</b><i>_</i><b>purge</b><i>_</i><b>delay</b>
+ <b>fast</b><i>_</i><b>flush</b><i>_</i><b>purge</b><i>_</i><b>time</b>
Remove an empty "fast flush" logfile that was not
updated in this amount of time (default time unit:
days).
-
-
-
-
-
3
+++ /dev/null
-<html> <head> </head> <body> <pre>
-
-
-
-FLUSHD(8) FLUSHD(8)
-
-
-<b>NAME</b>
- flushd - Postfix fast flush daemon
-
-<b>SYNOPSIS</b>
- <b>flushd</b> [generic Postfix daemon options]
-
-<b>DESCRIPTION</b>
- The flush server maintains so-called "fast flush" logfiles
- with information about what messages are queued for a spe-
- cific site. This program expects to be run from the <a href="master.8.html"><b>mas-</b>
- <b>ter</b>(8)</a> process manager.
-
- This server implements the following requests:
-
- <b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>ADD</b> <i>sitename</i> <i>queue_id</i>
- Append <i>queue_id</i> to the fast flush log for the spec-
- ified site.
-
- <b>FLUSH</b><i>_</i><b>REQ</b><i>_</i><b>SEND</b> <i>sitename</i>
- Arrange for the delivery of all messages that are
- listed in the fast flush logfile for the specified
- site. After the logfile is processed, the file is
- truncated to length zero.
-
- The response to the client is one of:
-
- <b>FLUSH</b><i>_</i><b>STAT</b><i>_</i><b>OK</b>
- The request completed normally.
-
- <b>FLUSH</b><i>_</i><b>STAT</b><i>_</i><b>BAD</b>
- The flush server rejected the request (bad request
- name, bad request parameter value).
-
- <b>FLUSH</b><i>_</i><b>STAT</b><i>_</i><b>UNKNOWN</b>
- The specified site has no fast flush log.
-
- Fast flush logfiles are truncated only after a flush
- request. In order to prevent fast flush logs from growing
- too large, and to prevent them from accumulating too much
- outdated information, the flush service generates a pro-
- active flush request once every every 1000 append
- requests. This should not impact operation.
-
-<b>SECURITY</b>
- The fast flush server is moderately security-sensitive. It
- does not talk to the network, but it does talk to local
- unprivileged users, in order to emulate "sendmail -qRsite"
- behavior. For this reason all strings in a request are
- truncated at <i>line_length_limit</i>, before they are subjected
- to further validation.
-
- The fast flush server can run chrooted at fixed low privi-
- lege.
-
-
-
-
- 1
-
-
-
-
-
-FLUSHD(8) FLUSHD(8)
-
-
-<b>DIAGNOSTICS</b>
- Problems and transactions are logged to <b>syslogd</b>(8).
-
-<b>BUGS</b>
- In reality, this server schedules delivery of messages,
- regardless of their destination. This limitation is due to
- the fact that one queue runner has to handle mail for mul-
- tiple destinations.
-
-<b>CONFIGURATION</b> <b>PARAMETERS</b>
- The following <b>main.cf</b> parameters are especially relevant
- to this program. See the Postfix <b>main.cf</b> file for syntax
- details and for default values. Use the <b>postfix</b> <b>reload</b>
- command after a configuration change.
-
- <b>line</b><i>_</i><b>length</b><i>_</i><b>limit</b>
- Maximal length of strings in a fast flush client
- request.
-
-<b>SEE</b> <b>ALSO</b>
- <a href="smtpd.8.html">smtpd(8)</a> Postfix SMTP server
- <a href="qmgr.8.html">qmgr(8)</a> Postfix queue manager
- syslogd(8) system logging
-
-<b>LICENSE</b>
- 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
- Yorktown Heights, NY 10598, USA
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 2
-
-
-</pre> </body> </html>
*) echo "Unknown AIX version: `uname -v`." 1>&2; exit 1;;
esac;;
Linux.2*) SYSTYPE=LINUX2
- for name in db nsl resolv
+ if [ -f /usr/lib/lib/db-3.1.a -a -f /usr/include/db3/db_185.h ]
+ then
+ CCARGS="$CCARGS -DPATH_DB_H='<db3/db_185.h>'"
+ SYSLIBS="$SYSLIBS -ldb-3.1"
+ else
+ if [ -f /usr/include/db_185.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>'"
+ fi
+ test -f /usr/lib/libdb.a && SYSLIBS="$SYSLIBS -ldb"
+ fi
+ for name in nsl resolv
do
test -f /usr/lib/lib$name.a && SYSLIBS="$SYSLIBS -l$name"
done
- if [ -f /usr/include/db_185.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>'"
- fi
;;
IRIX*.5.*) SYSTYPE=IRIX5
# Use the native compiler by default
.SH NAME
flush
\-
-Postfix fast flush cache manager
+Postfix fast flush server
.SH SYNOPSIS
.na
.nf
Per-destination logfiles of deferred mail are maintained only for
eligible destinations. The policy is specified with the
-\fBfast_flush_cache_policy\fR configuration parameter:
+\fBfast_flush_policy\fR configuration parameter:
.IP \fBall\fR
Maintain per-destination logfiles for all destinations.
.IP "\fBrelay\fR (default policy)"
.PP
This server implements the following requests:
.IP "\fBFLUSH_REQ_ADD\fI sitename queue_id\fR"
-Inform the cache manager that the specified message is queued for
-\fIsitename\fR. Depending on caching policy, the cache manager
+Inform the fast flush server that the specified message is queued for
+\fIsitename\fR. Depending on logging policy, the fast flush server
stores or ignores the information.
.IP "\fBFLUSH_REQ_SEND\fI sitename\fR"
Request delivery of mail that is queued for \fIsitename\fR.
If the destination is eligible for a fast flush logfile,
-this request triggers delivery of specific messages; the
-per-destination logfile is truncated to zero length; if mail
-is undeliverable, it will be logged to the per-destination
-logfile.
+this request triggers delivery of messages listed in that
+destination's logfile, and the logfile is truncated to zero length;
+if mail is undeliverable it will be added back to the logfile.
.sp
If the destination is not eligible for a fast flush logfile,
this request triggers delivery of all queued mail.
request \fBFLUSH_REQ_REFRESH\fR.
.IP "\fBFLUSH_REQ_REFRESH\fR (completes in the background)"
Refresh non-empty per-destination logfiles that were not read in
-$\fBfast_flush_refresh_delay\fR hours, by simulating
+$\fBfast_flush_refresh_time\fR hours, by simulating
send requests (see above) for the corresponding destinations.
.sp
Delete empty per-destination logfiles that were not updated in
-\fBfast_flush_purge_delay\fR days.
+\fBfast_flush_purge_time\fR days.
.IP "\fBFLUSH_REQ_PURGE\fR (completes in the background)"
Refresh all non-empty per-destination logfiles, by simulating
send requests (see above) for the corresponding destinations.
-This can be incredibly expensive when caching is enabled for
+This can be incredibly expensive when logging is enabled for
all deferred mail, and is not recommended.
.sp
Delete empty per-destination logfiles that were not updated in
-\fBfast_flush_purge_delay\fR days.
+\fBfast_flush_purge_time\fR days.
.PP
-Fast flush logfiles are truncated only after a \fBFLUSH_REQ_SEND\fR
-request, not when mail is actually delivered, and therefore can
-accumulate outdated or redundant data. In order to maintain sanity,
-\fBFLUSH_REQ_REFRESH\fR must be executed periodically.
-
The server response is one of:
.IP \fBFLUSH_STAT_OK\fR
The request completed normally.
.SH BUGS
.ad
.fi
-In reality, this server schedules delivery of all recipients
-of a deferred message. This limitation is due to the fact that
-one queue runner has to handle mail for multiple destinations.
+Fast flush logfiles are truncated only after a \fBFLUSH_REQ_SEND\fR
+request, not when mail is actually delivered, and therefore can
+accumulate outdated or redundant data. In order to maintain sanity,
+\fBFLUSH_REQ_REFRESH\fR must be executed periodically. This can
+be automated with a suitable wakeup timer setting in the
+\fBmaster.cf\fR configuration file.
+
+Upon receipt of a request to deliver all mail for an 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 \fBrelay_domains\fR destination because
+such mail typically only has recipients in one domain.
.SH FILES
.na
.nf
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_cache_policy\fR
+.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_refresh_delay\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
a send request for the corresponding destination.
-.IP \fBfast_flush_purge_delay\fR
+.IP \fBfast_flush_purge_time\fR
Remove an empty "fast flush" logfile that was not updated in
this amount of time (default time unit: days).
.SH SEE ALSO
+++ /dev/null
-.TH FLUSHD 8
-.ad
-.fi
-.SH NAME
-flushd
-\-
-Postfix fast flush daemon
-.SH SYNOPSIS
-.na
-.nf
-\fBflushd\fR [generic Postfix daemon options]
-.SH DESCRIPTION
-.ad
-.fi
-The flush server maintains so-called "fast flush" logfiles with
-information about what messages are queued for a specific site.
-This program expects to be run from the \fBmaster\fR(8) process
-manager.
-
-This server implements the following requests:
-.IP "\fBFLUSH_REQ_ADD\fI sitename queue_id\fR"
-Append \fIqueue_id\fR to the fast flush log for the
-specified site.
-.IP "\fBFLUSH_REQ_SEND\fI sitename\fR"
-Arrange for the delivery of all messages that are listed in the fast
-flush logfile for the specified site. After the logfile is processed,
-the file is truncated to length zero.
-.PP
-The response to the client is one of:
-.IP \fBFLUSH_STAT_OK\fR
-The request completed normally.
-.IP \fBFLUSH_STAT_BAD\fR
-The flush server rejected the request (bad request name, bad
-request parameter value).
-.IP \fBFLUSH_STAT_UNKNOWN\fR
-The specified site has no fast flush log.
-.PP
-Fast flush logfiles are truncated only after a flush request. In
-order to prevent fast flush logs from growing too large, and to
-prevent them from accumulating too much outdated information, the
-flush service generates a pro-active flush request once every
-every 1000 append requests. This should not impact operation.
-.SH SECURITY
-.na
-.nf
-.ad
-.fi
-The fast flush server is moderately security-sensitive. It does not
-talk to the network, but it does talk to local unprivileged users, in
-order to emulate "sendmail -qRsite" behavior. For this reason all
-strings in a request are truncated at \fIline_length_limit\fR,
-before they are subjected to further validation.
-
-The fast flush server can run chrooted at fixed low privilege.
-.SH DIAGNOSTICS
-.ad
-.fi
-Problems and transactions are logged to \fBsyslogd\fR(8).
-.SH BUGS
-.ad
-.fi
-In reality, this server schedules delivery of messages, regardless
-of their destination. This limitation is due to the fact that
-one queue runner has to handle mail for multiple destinations.
-.SH CONFIGURATION PARAMETERS
-.na
-.nf
-.ad
-.fi
-The following \fBmain.cf\fR parameters are especially relevant to
-this program. See the Postfix \fBmain.cf\fR file for syntax details
-and for default values. Use the \fBpostfix reload\fR command after
-a configuration change.
-.IP \fBline_length_limit\fR
-Maximal length of strings in a fast flush client request.
-.SH SEE ALSO
-.na
-.nf
-smtpd(8) Postfix SMTP server
-qmgr(8) Postfix queue manager
-syslogd(8) system logging
-.SH LICENSE
-.na
-.nf
-.ad
-.fi
-The Secure Mailer license must be distributed with this software.
-.SH AUTHOR(S)
-.na
-.nf
-Wietse Venema
-IBM T.J. Watson Research
-P.O. Box 704
-Yorktown Heights, NY 10598, USA
/* NAME
/* flush 8
/* SUMMARY
-/* Postfix fast flush cache manager
+/* Postfix fast flush server
/* SYNOPSIS
/* \fBflush\fR [generic Postfix daemon options]
/* DESCRIPTION
/*
/* Per-destination logfiles of deferred mail are maintained only for
/* eligible destinations. The policy is specified with the
-/* \fBfast_flush_cache_policy\fR configuration parameter:
+/* \fBfast_flush_policy\fR configuration parameter:
/* .IP \fBall\fR
/* Maintain per-destination logfiles for all destinations.
/* .IP "\fBrelay\fR (default policy)"
/* .PP
/* This server implements the following requests:
/* .IP "\fBFLUSH_REQ_ADD\fI sitename queue_id\fR"
-/* Inform the cache manager that the specified message is queued for
-/* \fIsitename\fR. Depending on caching policy, the cache manager
+/* Inform the fast flush server that the specified message is queued for
+/* \fIsitename\fR. Depending on logging policy, the fast flush server
/* stores or ignores the information.
/* .IP "\fBFLUSH_REQ_SEND\fI sitename\fR"
/* Request delivery of mail that is queued for \fIsitename\fR.
/* If the destination is eligible for a fast flush logfile,
-/* this request triggers delivery of specific messages; the
-/* per-destination logfile is truncated to zero length; if mail
-/* is undeliverable, it will be logged to the per-destination
-/* logfile.
+/* this request triggers delivery of messages listed in that
+/* destination's logfile, and the logfile is truncated to zero length;
+/* if mail is undeliverable it will be added back to the logfile.
/* .sp
/* If the destination is not eligible for a fast flush logfile,
/* this request triggers delivery of all queued mail.
/* request \fBFLUSH_REQ_REFRESH\fR.
/* .IP "\fBFLUSH_REQ_REFRESH\fR (completes in the background)"
/* Refresh non-empty per-destination logfiles that were not read in
-/* $\fBfast_flush_refresh_delay\fR hours, by simulating
+/* $\fBfast_flush_refresh_time\fR hours, by simulating
/* send requests (see above) for the corresponding destinations.
/* .sp
/* Delete empty per-destination logfiles that were not updated in
-/* \fBfast_flush_purge_delay\fR days.
+/* \fBfast_flush_purge_time\fR days.
/* .IP "\fBFLUSH_REQ_PURGE\fR (completes in the background)"
/* Refresh all non-empty per-destination logfiles, by simulating
/* send requests (see above) for the corresponding destinations.
-/* This can be incredibly expensive when caching is enabled for
+/* This can be incredibly expensive when logging is enabled for
/* all deferred mail, and is not recommended.
/* .sp
/* Delete empty per-destination logfiles that were not updated in
-/* \fBfast_flush_purge_delay\fR days.
+/* \fBfast_flush_purge_time\fR days.
/* .PP
-/* Fast flush logfiles are truncated only after a \fBFLUSH_REQ_SEND\fR
-/* request, not when mail is actually delivered, and therefore can
-/* accumulate outdated or redundant data. In order to maintain sanity,
-/* \fBFLUSH_REQ_REFRESH\fR must be executed periodically.
-/*
/* The server response is one of:
/* .IP \fBFLUSH_STAT_OK\fR
/* The request completed normally.
/* DIAGNOSTICS
/* Problems and transactions are logged to \fBsyslogd\fR(8).
/* BUGS
-/* In reality, this server schedules delivery of all recipients
-/* of a deferred message. This limitation is due to the fact that
-/* one queue runner has to handle mail for multiple destinations.
+/* Fast flush logfiles are truncated only after a \fBFLUSH_REQ_SEND\fR
+/* request, not when mail is actually delivered, and therefore can
+/* accumulate outdated or redundant data. In order to maintain sanity,
+/* \fBFLUSH_REQ_REFRESH\fR must be executed periodically. This can
+/* be automated with a suitable wakeup timer setting in the
+/* \fBmaster.cf\fR configuration file.
+/*
+/* Upon receipt of a request to deliver all mail for an 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 \fBrelay_domains\fR destination because
+/* such mail typically only has recipients in one domain.
/* FILES
/* /var/spool/postfix/flush, location of "fast flush" logfiles.
/* CONFIGURATION PARAMETERS
/* 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_cache_policy\fR
+/* .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_refresh_delay\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
/* a send request for the corresponding destination.
-/* .IP \fBfast_flush_purge_delay\fR
+/* .IP \fBfast_flush_purge_time\fR
/* Remove an empty "fast flush" logfile that was not updated in
/* this amount of time (default time unit: days).
/* SEE ALSO
}
}
-/* flush_policy_ok - check caching policy */
+/* flush_policy_ok - check logging policy */
static int flush_policy_ok(const char *site)
{
msg_info("%s: site %s queue_id %s", myname, site, queue_id);
/*
- * If this site is not eligible for caching, just ignore the request.
+ * If this site is not eligible for logging, just ignore the request.
*/
if (flush_policy_ok(site) == 0)
return (FLUSH_STAT_OK);
msg_info("%s: site %s", myname, site);
/*
- * If this site is not eligible for caching, deliver all queued mail.
+ * If this site is not eligible for logging, deliver all queued mail.
*/
if (flush_policy_ok(site) == 0)
return (mail_flush_deferred());
if (errno != ENOENT)
msg_warn("%s: update %s time stamps: %m",
myname, STR(queue_file));
+ /* XXX Wart... */
+ mail_queue_path(queue_file, MAIL_QUEUE_INCOMING, STR(queue_id));
+ if (utime(STR(queue_file), &tbuf) < 0)
+ if (errno != ENOENT)
+ msg_warn("%s: update %s time stamps: %m",
+ myname, STR(queue_file));
} else if (mail_queue_rename(STR(queue_id), MAIL_QUEUE_DEFERRED,
MAIL_QUEUE_INCOMING) < 0) {
if (errno != ENOENT)
#define FFLUSH_POLICY_RELAY "relay"
#define FFLUSH_POLICY_NONE "none"
-#define VAR_FFLUSH_PURGE "fast_flush_purge_delay"
+#define VAR_FFLUSH_PURGE "fast_flush_purge_time"
#define DEF_FFLUSH_PURGE "7d"
extern int var_fflush_purge;
-#define VAR_FFLUSH_REFRESH "fast_flush_refresh_delay"
+#define VAR_FFLUSH_REFRESH "fast_flush_refresh_time"
#define DEF_FFLUSH_REFRESH "12h"
extern int var_fflush_refresh;
* Version of this program.
*/
#define VAR_MAIL_VERSION "mail_version"
-#define DEF_MAIL_VERSION "Snapshot-20001004"
+#define DEF_MAIL_VERSION "Snapshot-20001005"
extern char *var_mail_version;
/* LICENSE
*/
var_use_limit = 0;
var_idle_limit = 0;
- qmgr_move(MAIL_QUEUE_ACTIVE, MAIL_QUEUE_INCOMING,
- event_time() + var_min_backoff_time);
+ qmgr_move(MAIL_QUEUE_ACTIVE, MAIL_QUEUE_INCOMING, event_time());
qmgr_incoming = qmgr_scan_create(MAIL_QUEUE_INCOMING);
qmgr_deferred = qmgr_scan_create(MAIL_QUEUE_DEFERRED);
qmgr_scan_request(qmgr_incoming, QMGR_SCAN_START);
/* qmgr_active_defer - defer queue file */
static void qmgr_active_defer(const char *queue_name, const char *queue_id,
- int delay)
+ const char *dest_queue, int delay)
{
char *myname = "qmgr_active_defer";
const char *path;
path = mail_queue_path((VSTRING *) 0, queue_name, queue_id);
if (utime(path, &tbuf) < 0)
msg_fatal("%s: update %s time stamps: %m", myname, path);
- if (mail_queue_rename(queue_id, queue_name, MAIL_QUEUE_DEFERRED)) {
+ if (mail_queue_rename(queue_id, queue_name, dest_queue)) {
if (errno != ENOENT)
msg_fatal("%s: rename %s from %s to %s: %m", myname,
- queue_id, queue_name, MAIL_QUEUE_DEFERRED);
+ queue_id, queue_name, dest_queue);
msg_warn("%s: rename %s from %s to %s: %m", myname,
- queue_id, queue_name, MAIL_QUEUE_DEFERRED);
+ queue_id, queue_name, dest_queue);
} else if (msg_verbose) {
msg_info("%s: defer %s", myname, queue_id);
}
scan_info->flags)) == 0) {
qmgr_active_corrupt(queue_id);
} else if (message == QMGR_MESSAGE_LOCKED) {
- qmgr_active_defer(MAIL_QUEUE_ACTIVE, queue_id, var_min_backoff_time);
+ qmgr_active_defer(MAIL_QUEUE_ACTIVE, queue_id, MAIL_QUEUE_INCOMING, 60);
} else {
/*
} else {
delay = var_min_backoff_time;
}
- qmgr_active_defer(message->queue_name, message->queue_id, delay);
+ qmgr_active_defer(message->queue_name, message->queue_id,
+ MAIL_QUEUE_DEFERRED, delay);
}
/*
*/
var_use_limit = 0;
var_idle_limit = 0;
- qmgr_move(MAIL_QUEUE_ACTIVE, MAIL_QUEUE_INCOMING,
- event_time() + var_min_backoff_time);
+ qmgr_move(MAIL_QUEUE_ACTIVE, MAIL_QUEUE_INCOMING, event_time());
qmgr_incoming = qmgr_scan_create(MAIL_QUEUE_INCOMING);
qmgr_deferred = qmgr_scan_create(MAIL_QUEUE_DEFERRED);
qmgr_scan_request(qmgr_incoming, QMGR_SCAN_START);
/* qmgr_active_defer - defer queue file */
static void qmgr_active_defer(const char *queue_name, const char *queue_id,
- int delay)
+ const char *dest_queue, int delay)
{
char *myname = "qmgr_active_defer";
const char *path;
path = mail_queue_path((VSTRING *) 0, queue_name, queue_id);
if (utime(path, &tbuf) < 0)
msg_fatal("%s: update %s time stamps: %m", myname, path);
- if (mail_queue_rename(queue_id, queue_name, MAIL_QUEUE_DEFERRED)) {
+ if (mail_queue_rename(queue_id, queue_name, dest_queue)) {
if (errno != ENOENT)
msg_fatal("%s: rename %s from %s to %s: %m", myname,
- queue_id, queue_name, MAIL_QUEUE_DEFERRED);
+ queue_id, queue_name, dest_queue);
msg_warn("%s: rename %s from %s to %s: %m", myname,
- queue_id, queue_name, MAIL_QUEUE_DEFERRED);
+ queue_id, queue_name, dest_queue);
} else if (msg_verbose) {
msg_info("%s: defer %s", myname, queue_id);
}
scan_info->flags)) == 0) {
qmgr_active_corrupt(queue_id);
} else if (message == QMGR_MESSAGE_LOCKED) {
- qmgr_active_defer(MAIL_QUEUE_ACTIVE, queue_id, var_min_backoff_time);
+ qmgr_active_defer(MAIL_QUEUE_ACTIVE, queue_id, MAIL_QUEUE_INCOMING, 60);
} else {
/*
} else {
delay = var_min_backoff_time;
}
- qmgr_active_defer(message->queue_name, message->queue_id, delay);
+ qmgr_active_defer(message->queue_name, message->queue_id,
+ MAIL_QUEUE_DEFERRED, delay);
}
/*
* to perform the request.
*/
if (SMTPD_STAND_ALONE(state)) {
+ msg_warn("do not use ETRN in \"sendmail -bs\" mode");
smtpd_chat_reply(state, "458 Unable to queue messages");
return (-1);
}