]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-20000929
authorWietse Venema <wietse@porcupine.org>
Fri, 29 Sep 2000 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:26:48 +0000 (06:26 +0000)
42 files changed:
postfix/ETRN_README
postfix/RELEASE_NOTES
postfix/conf/etrn [deleted file]
postfix/conf/main.cf
postfix/conf/sample-misc.cf
postfix/conf/sample-smtpd.cf
postfix/html/Makefile.in
postfix/html/etrn.5.html [deleted file]
postfix/html/flushd.8.html
postfix/html/sendmail.1.html
postfix/html/smtpd.8.html
postfix/html/uce.html
postfix/man/Makefile.in
postfix/man/man1/sendmail.1
postfix/man/man5/etrn.5 [deleted file]
postfix/man/man8/flushd.8
postfix/man/man8/smtpd.8
postfix/proto/Makefile.in
postfix/proto/etrn [deleted file]
postfix/src/flushd/flushd.c
postfix/src/global/deliver_request.c
postfix/src/global/mail_flush.c
postfix/src/global/mail_flush.h
postfix/src/global/mail_params.c
postfix/src/global/mail_params.h
postfix/src/global/mail_queue.c
postfix/src/global/mail_version.h
postfix/src/nqmgr/qmgr.c
postfix/src/nqmgr/qmgr.h
postfix/src/nqmgr/qmgr_defer.c
postfix/src/nqmgr/qmgr_deliver.c
postfix/src/postsuper/postsuper.c
postfix/src/qmgr/Makefile.in
postfix/src/qmgr/qmgr.c
postfix/src/qmgr/qmgr.h
postfix/src/qmgr/qmgr_defer.c
postfix/src/qmgr/qmgr_deliver.c
postfix/src/qmgr/qmgr_message.c
postfix/src/sendmail/sendmail.c
postfix/src/smtpd/smtpd.c
postfix/src/smtpd/smtpd_check.c
postfix/src/smtpd/smtpd_check.h

index c94a14847570e7ad72509fd508b6d77eff0f9ce3..dba879d8dd8e27400c1ac13f1d7ccc46965c6d0c 100644 (file)
@@ -1,33 +1,59 @@
 Enabling the Postfix fast ETRN service
 ======================================
 
-Add an entry to the master.cf file for the new flush daemon:
+Postfix "fast ETRN" speeds up deliveries by looking only at mail
+that is queued for a given destination site. Postfix ordinary ETRN
+attempts to deliver all queued mail. Postfix fast ETRN service is
+available only for destinations that the local MTA is willing to
+relay mail to.
+
+But first you need to configure Postfix to provide fast ETRN service.
+
+- Execute "postfix stop"
+
+- Execute "make install" if you are running an older Postfix version
+  that does not have "fast flush" logfile support,
+
+- Add a "flush" service entry to /etc/postfix/master.cf if you were
+  running an older Postfix version:
 
-    /etc/postfix/master.cf:
        flush     unix  n       -       n       -       0       flushd
 
-Configure a list of domains that have fast ETRN service and
-what clients can use the service:
+- Execute "postconf hash_queue_names" and verify that the output
+  includes at the very least the "active", "bounce", "defer", and
+  "flush" queue names.  If any queue name is missing, edit the
+  main.cf file and either delete the explicit hash_queue_names
+  entry, or add the missing queue names.
+
+- Execute "postconf hash_queue_names" again, just to be sure.
+
+- Edit the main.cf file and specify
 
-    /etc/postfix/etrn:
-       domain.name     permit_mynetworks
+    enable_fast_flush = yes
 
-Run the postmap command:
+- Execute "postconf enable_fast_flush", to verify that the fast
+  flush feature is indeed enabled.
 
-    # postmap /etc/postfix/etrn
+- Execute "postfix start"
 
-Create any missing directories that are needed for fast ETRN service:
+- From a client that is allowed to execute ETRN commands, connect
+  to the Postfix SMTP server and type:
 
-    # postfix check
+       helo my.client.name
+       etrn some.customer.domain
 
-Configure Postfix to use the fast ETRN service:
+  where "some.customer.domain" is the name of a domain that your
+  mail server is willing to relay mail to.
 
-    /etc/postfix/main.cf:
-       etrn_maps = hash:/etc/postfix/etrn
+  In the maillog file, you should see something logged like:
 
-(specify dbm instead of hash if your machine uses DBM databases
-rather than DB).
+       created fast ETRN cache for some.customer.domain
 
-Refresh Postfix:
+  If Postfix logs that it cannot create a fast ETRN cache then
+  execute the command "postfix check". You probably skipped some
+  of the above instructions so that the necessary directories were
+  not created.
 
-    # postfix reload
+  If Postfix logs that it refuses fast ETRN service, then either
+  "some.customer.domain" does not exist, or it is not listed as a
+  valid relay destination. Check your relay_domains setting.
index ed53a86597e5ec78a530b8003ee7c12e4aa30466..4a6edc599dd2bb0e37164c3e025944c19f08a45f 100644 (file)
@@ -1,16 +1,50 @@
-Incompatible changes with snapshot-20000924
+Incompatible changes with snapshot-20000928
 ===========================================
 
-After building and installing, you need to "postfix check"
-and "postfix reload".
+You must execute "postfix stop" before installing this release,
+and "postfix start" after updating the software. Some default
+parameter settings have changed, as detailed below.
+
+If this release does not work for you, you can go back to a previous
+Postfix version without losing your mail, subject to the "incompatible
+changes" listed for previous Postfix releases below.
+
+In order to improve performance of one-to-one deliveries, Postfix
+by default now looks at up to 10000 messages at a time (was: 1000).
+This change affects the following main.cf configuration parameters:
 
-The ETRN service is no longer enabled by default. You need to
-configure what domains and what clients can use ETRN.  See the
-ETRN_README file for more information.
+    qmgr_message_active_limit: default setting increased to 10000
+    hash_queue_names: default setting now includes the active queue
 
-The smtpd_etrn_restrictions are gone.
+With this change, the active queue must no longer be a flat directory.
+
+If your main.cf file has an explicit hash_queue_names setting, and
+the active queue is not listed there, Postfix will perform very
+poorly when delivering lots of mail.
+
+Major changes with snapshot-20000929
+====================================
 
-The "flush" queue should be listed in "hash_queue_names".
+Until now, Postfix does a rather lame effort at implementing the
+SMTP ETRN command - it attempts to deliver all mail in the queue,
+regardless of its destination.  This is slow if your mail server
+queues mail for lots of different sites.
+
+This release introduces "fast ETRN", which delivers only mail that
+is known to be queued for a site. The per-destination queue info
+is kept in so-called "fast flush" logfiles.  A "fast flush" logfile
+is "flushed" after Postfix receives an appropriate ETRN command,
+or after someone executes the command "sendmail -qRsite" for an
+appropriate site.
+
+A missing "fast flush" logfile is created automatically when an
+SMTP client issues the ETRN command - but only for destinations
+that the local MTA is willing to relay mail to. This policy is
+currently hard coded.  Other destinations remain stuck with the
+old "slow" ETRN service that attempts to deliver all mail in the
+queue.
+
+See the file ETRN_README for how to turn on the "fast ETRN" service.
 
 Incompatible changes with snapshot-20000924
 ===========================================
diff --git a/postfix/conf/etrn b/postfix/conf/etrn
deleted file mode 100644 (file)
index 5ed1aea..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-# 
-# ETRN(5)                                                   ETRN(5)
-# 
-# NAME
-#        etrn - format of Postfix etrn table
-# 
-# SYNOPSIS
-#        etrn_maps = hash:/etc/postfix/etrn
-#        etrn_maps = dbm:/etc/postfix/etrn
-# 
-#        postmap /etc/postfix/etrn
-# 
-# DESCRIPTION
-#        The  optional  etrn file specifies what destination domain
-#        names can be specified in SMTP ETRN commands. This  infor-
-#        mation is used by the smtpd(8) and flushd(8) daemon.
-# 
-#        Normally,  the file serves as input to the postmap(1) com-
-#        mand.  The result, an indexed file in dbm or db format, is
-#        used  for  fast  searching by the mail system. Execute the
-#        command postmap /etc/postfix/etrn in order to rebuild  the
-#        indexed file after changing the etrn table.
-# 
-#        When  the  table  is provided via other means such as NIS,
-#        LDAP, SQL, or as regular expressions, the same lookups are
-#        done as for ordinary indexed files.
-# 
-# TABLE FORMAT
-#        The format of the etrn table is as follows:
-# 
-#        blanks and comments
-#               Blank  lines  are  ignored,  as are lines beginning
-#               with `#'.
-# 
-#        domain restrictions
-#               The left-hand side, domain, specifies a destination
-#               domain name that can be specified in ETRN commands.
-# 
-#               The right-hand side specifies one  or  more  access
-#               restrictions.   Restrictions  are  processed in the
-#               given order and  the  search  stops  at  the  first
-#               match.
-# 
-#               reject_unknown_client
-#                      Reject the request if the client hostname is
-#                      unknown.
-# 
-#               permit_mynetworks
-#                      Permit the request  if  the  client  address
-#                      matches $mynetworks.
-# 
-#               reject_maps_rbl
-#                      Reject  the  request  if  the reverse client
-#                      network    address    is    listed     under
-#                      $maps_rbl_domains.
-# 
-#               reject Reject the request. Place this at the end of
-# 
-#                                                                 1
-# 
-# ETRN(5)                                                   ETRN(5)
-# 
-#                      a restriction list.
-# 
-#               permit Permit the request. Place this at the end of
-#                      a restriction list.
-# 
-# CONFIGURATION PARAMETERS
-#        The  following  main.cf parameters are especially relevant
-#        to this topic. See the Postfix  main.cf  file  for  syntax
-#        details  and  for  default  values. Use the postfix reload
-#        command after a configuration change.
-# 
-#        etrn_maps
-#               Tables that specify what domains have ETRN service.
-#               For  each table entry, the left-hand side specifies
-#               a destination domain name that can be specified  in
-#               an  ETRN request, and the right-hand side specifies
-#               a list of access restrictions for SMTP clients that
-#               issue ETRN for the domain.
-# 
-#        fast_flush_maps
-#               The  table with names of destinations that this MTA
-#               provides the fast flush service  for.  By  default,
-#               this is set to $etrn_maps.
-# 
-#        relay_domains
-#               The  list  of  domains  that this MTA is willing to
-#               forward mail from or to. This defaults to $mydesti-
-#               nation, $fast_flush_maps.
-# 
-# SEE ALSO
-#        smtpd(8) Postfix SMTP server
-#        flushd(1) Postfix fast flush service
-#        sendmail(5) sendmail-compatible interface
-#        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.
-# 
-# AUTHOR(S)
-#        Wietse Venema
-#        IBM T.J. Watson Research
-#        P.O. Box 704
-#        Yorktown Heights, NY 10598, USA
-# 
-#                                                                 2
-# 
index ee4eed63e2027107e32e3726e6a8920ee2211492..1cac2bc00cdd3b6c8cd2aec0e5d9c6ae06a5d9a4 100644 (file)
@@ -341,6 +341,20 @@ mail_owner = postfix
 #mynetworks = 168.100.189.0/28, 127.0.0.0/8
 #mynetworks = $config_directory/mynetworks
 
+# FAST ETRN SERVICE
+#
+# By default, Postfix does a rather lame effort at implementing the
+# SMTP ETRN command - it attempts to deliver all queued mail regardless
+# of its destination. This does not work well if your mail server
+# queues mail for lots of sites.  In order to enable a faster ETRN
+# that only delivers mail that is known to be queued for a site,
+# enable the fast flush cache.  Currently, "fast ETRN" is available
+# only for destinations that the local system is willing to relay
+# mail to (as specified in the relay_domains parameter).
+# 
+#enable_fast_flush = yes
+#enable_fast_flush = no
+
 # SHOW SOFTWARE VERSION OR NOT
 #
 # The smtpd_banner parameter specifies the text that follows the 220
index f1f876d2f5b064efdde24a6127bf0b9ed339a5b8..e5b134b36463f5fc3ed930df304c209ed93e7366 100644 (file)
@@ -38,16 +38,6 @@ default_transport = smtp
 #
 double_bounce_sender = double-bounce
 
-# The fast_flush_maps parameter specifies what destination domain
-# names can be used in SMTP ETRN requests and in "sendmail -qRdomain.name"
-# commands.  By default, the value is $etrn_maps, the set of domain names
-# that can be used in SMTP ETRN requests (see sample-smtpd.cf).
-#
-# The fast_flush_maps parameter is also used in the default settings
-# of the relay_domains configuration parameter.
-#
-fast_flush_maps = 
-
 # The hash_queue_depth parameter specifies the number of subdirectory
 # levels below the queue directories listed in the hash_queue_names
 # parameter.
index 8729602b94a5da5f78483c5e15456170ef603498..0539cc551bcc3ee23e251fa7dfbbbfd52af6772d 100644 (file)
 #
 #disable_vrfy_command = no
 
-# The etrn_maps parameter specifies what domains have ETRN service.
-# For each table entry, the left-hand side specifies a destination
-# domain name, and the right-hand side specifies a list of access
-# restrictions for clients that issue ETRN for the domain.
-# 
-# The default is to disallow ETRN commands.  The following restrictions
-# are available:
-#
-#   reject_unknown_client: reject the request if the client hostname is unknown.
-#   permit_mynetworks: permit if the client address matches $mynetworks.
-#   reject_maps_rbl: reject if the reverse client network address
-#      is listed under $maps_rbl_domains.
-#   reject: reject the request. Place this at the end of a restriction.
-#   permit: permit the request. Place this at the end of a restriction.
-#
-# etrn_maps is also the default value for the fast_flush_maps parameter
-# which controls the fast flush service which is used for ETRN and for
-# "sendmail -qRdomain.name"
-#
-etrn_maps = 
-
 # The smtpd_banner parameter specifies the text that follows the 220
 # status code in the SMTP greeting banner. Some people like to see
 # the mail version advertised. By default, Postfix shows no version.
@@ -47,6 +26,27 @@ etrn_maps =
 # smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
 smtpd_banner = $myhostname ESMTP $mail_name
 
+# The smtpd_etrn_restrictions parameter restricts what clients are
+# allowed to issue the ETRN command. The present Postfix ETRN differs
+# from other ETRN implementations in that it flushes mail for all
+# destinations. This will change in the future.
+#
+# The default is to allow ETRN from any host.  The following restrictions
+# are available:
+#
+#   reject_unknown_client: reject the request if the client hostname is unknown.
+#   permit_mynetworks: permit if the client address matches $mynetworks.
+#   check_client_access maptype:mapname
+#   maptype:mapname: look up client name, parent domains, client address,
+#      or networks obtained by stripping octets.
+#      Reject if result is REJECT or "[45]xx text"
+#      Permit otherwise.
+#   reject_maps_rbl: reject if the reverse client network address
+#      is listed under $maps_rbl_domains.
+#   reject: reject the request. Place this at the end of a restriction.
+#   permit: permit the request. Place this at the end of a restriction.
+smtpd_etrn_restrictions =
+
 # The smtpd_recipient_limit parameter restricts the number of recipients
 # that the SMTP server accepts per message delivery.
 #
@@ -313,7 +313,7 @@ maps_rbl_domains = rbl.maps.vix.com
 # permit_mx_backup restriction, in the description of the
 # smtpd_recipient_restrictions parameter.
 #
-relay_domains = $mydestination $fast_flush_maps
+relay_domains = $mydestination
 
 #
 # RESPONSE CODES
index 4fed7b9802084b93616683946e52d18b060f41fe..35f235000f2f3d3702471376753ddff60e094b08 100644 (file)
@@ -11,8 +11,7 @@ COMMANDS= mailq.1.html newaliases.1.html postalias.1.html postcat.1.html \
        postlog.1.html postdrop.1.html postmap.1.html sendmail.1.html \
        postsuper.1.html
 CONFIG = access.5.html aliases.5.html canonical.5.html relocated.5.html \
-       transport.5.html virtual.5.html pcre_table.5.html regexp_table.5.html \
-       etrn.5.html
+       transport.5.html virtual.5.html pcre_table.5.html regexp_table.5.html
 
 update:        $(DAEMONS) $(COMMANDS) $(CONFIG)
 
@@ -132,9 +131,6 @@ aliases.5.html: ../proto/aliases
 canonical.5.html: ../proto/canonical
        srctoman - $? | nroff -man | man2html | postlink >$@
 
-etrn.5.html: ../proto/etrn
-       srctoman - $? | nroff -man | man2html | postlink >$@
-
 pcre_table.5.html: ../proto/pcre_table
        srctoman - $? | nroff -man | man2html | postlink >$@
 
diff --git a/postfix/html/etrn.5.html b/postfix/html/etrn.5.html
deleted file mode 100644 (file)
index 7b1a13f..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-<html> <head> </head> <body> <pre>
-
-
-
-ETRN(5)                                                   ETRN(5)
-
-
-<b>NAME</b>
-       etrn - format of Postfix etrn table
-
-<b>SYNOPSIS</b>
-       <b>etrn</b><i>_</i><b>maps</b> <b>=</b> <b>hash:/etc/postfix/etrn</b>
-       <b>etrn</b><i>_</i><b>maps</b> <b>=</b> <b>dbm:/etc/postfix/etrn</b>
-
-       <b>postmap</b> <b>/etc/postfix/etrn</b>
-
-<b>DESCRIPTION</b>
-       The  optional  <b>etrn</b> file specifies what destination domain
-       names can be specified in SMTP <b>ETRN</b> commands. This  infor-
-       mation is used by the <a href="smtpd.8.html"><b>smtpd</b>(8)</a> and <a href="flushd.8.html"><b>flushd</b>(8)</a> daemon.
-
-       Normally,  the file serves as input to the <a href="postmap.1.html"><b>postmap</b>(1)</a> com-
-       mand.  The result, an indexed file in <b>dbm</b> or <b>db</b> format, is
-       used  for  fast  searching by the mail system. Execute the
-       command <b>postmap</b> <b>/etc/postfix/etrn</b> in order to rebuild  the
-       indexed file after changing the etrn table.
-
-       When  the  table  is provided via other means such as NIS,
-       LDAP, SQL, or as regular expressions, the same lookups are
-       done as for ordinary indexed files.
-
-<b>TABLE</b> <b>FORMAT</b>
-       The format of the <b>etrn</b> table is as follows:
-
-       blanks and comments
-              Blank  lines  are  ignored,  as are lines beginning
-              with `#'.
-
-       <i>domain</i> <i>restrictions</i>
-              The left-hand side, <i>domain</i>, specifies a destination
-              domain name that can be specified in <b>ETRN</b> commands.
-
-              The right-hand side specifies one  or  more  access
-              restrictions.   Restrictions  are  processed in the
-              given order and  the  search  stops  at  the  first
-              match.
-
-              <b>reject</b><i>_</i><b>unknown</b><i>_</i><b>client</b>
-                     Reject the request if the client hostname is
-                     unknown.
-
-              <b>permit</b><i>_</i><b>mynetworks</b>
-                     Permit the request  if  the  client  address
-                     matches $mynetworks.
-
-              <b>reject</b><i>_</i><b>maps</b><i>_</i><b>rbl</b>
-                     Reject  the  request  if  the reverse client
-                     network    address    is    listed     under
-                     $maps_rbl_domains.
-
-              <b>reject</b> Reject the request. Place this at the end of
-
-
-
-                                                                1
-
-
-
-
-
-ETRN(5)                                                   ETRN(5)
-
-
-                     a restriction list.
-
-              <b>permit</b> Permit the request. Place this at the end of
-                     a restriction list.
-
-
-<b>CONFIGURATION</b> <b>PARAMETERS</b>
-       The  following  <b>main.cf</b> parameters are especially relevant
-       to this topic. See the Postfix  <b>main.cf</b>  file  for  syntax
-       details  and  for  default  values. Use the <b>postfix</b> <b>reload</b>
-       command after a configuration change.
-
-       <b>etrn</b><i>_</i><b>maps</b>
-              Tables that specify what domains have <b>ETRN</b> service.
-              For  each table entry, the left-hand side specifies
-              a destination domain name that can be specified  in
-              an  <b>ETRN</b> request, and the right-hand side specifies
-              a list of access restrictions for SMTP clients that
-              issue <b>ETRN</b> for the domain.
-
-       <b>fast</b><i>_</i><b>flush</b><i>_</i><b>maps</b>
-              The  table with names of destinations that this MTA
-              provides the fast flush service  for.  By  default,
-              this is set to $<b>etrn</b><i>_</i><b>maps</b>.
-
-       <b>relay</b><i>_</i><b>domains</b>
-              The  list  of  domains  that this MTA is willing to
-              forward mail from or to. This defaults to <b>$mydesti-</b>
-              <b>nation,</b> <b>$fast</b><i>_</i><b>flush</b><i>_</i><b>maps</b>.
-
-<b>SEE</b> <b>ALSO</b>
-       <a href="smtpd.8.html">smtpd(8)</a> Postfix SMTP server
-       flushd(1) Postfix fast flush service
-       sendmail(5) sendmail-compatible interface
-       <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.
-
-<b>AUTHOR(S)</b>
-       Wietse Venema
-       IBM T.J. Watson Research
-       P.O. Box 704
-       Yorktown Heights, NY 10598, USA
-
-
-
-
-
-
-
-
-
-
-
-                                                                2
-
-
-</pre> </body> </html>
index fab4a17f6f6f7c86d01660530e89dfd3d3c9f2f2..9da503d69aeef397bcc81c7772d937cf4a7cf03d 100644 (file)
@@ -20,8 +20,8 @@ FLUSHD(8)                                               FLUSHD(8)
        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 logfile  for  the
-              specified site.
+              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
@@ -39,22 +39,22 @@ FLUSHD(8)                                               FLUSHD(8)
               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 logfile and is
-              not configured to have one.
+              The specified site has no fast flush log.
 
-       Fast flush logfiles  are  truncated  only  after  a  flush
-       request.  In  order  to  prevent  fast flush logfiles from
-       growing without bounds, and to prevent them  from  accumu-
-       lating  too  much  outdated information, the flush service
-       generates a pro-active flush request once every every 1000
-       append requests. This should not impact operation.
+       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
+       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>.
+       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.
@@ -86,21 +86,8 @@ FLUSHD(8)                                               FLUSHD(8)
        details  and  for  default  values. Use the <b>postfix</b> <b>reload</b>
        command after a configuration change.
 
-       <b>etrn</b><i>_</i><b>maps</b>
-              Tables that specify what domains have <b>ETRN</b> service.
-              For  each table entry, the left-hand side specifies
-              a destination domain name that can be specified  in
-              an  <b>ETRN</b> request, and the right-hand side specifies
-              a list of access restrictions for SMTP clients that
-              issue <b>ETRN</b> for the domain.
-
-       <b>fast</b><i>_</i><b>flush</b><i>_</i><b>maps</b>
-              The  table with names of destinations that this MTA
-              provides the fast flush service  for.  By  default,
-              this is set to $<b>etrn</b><i>_</i><b>maps</b>.
-
        <b>line</b><i>_</i><b>length</b><i>_</i><b>limit</b>
-              Maximal  length  of  strings in a fast flush client
+              Maximal length of strings in a  fast  flush  client
               request.
 
 <b>SEE</b> <b>ALSO</b>
@@ -109,7 +96,7 @@ FLUSHD(8)                                               FLUSHD(8)
        syslogd(8) system logging
 
 <b>LICENSE</b>
-       The Secure Mailer license must be  distributed  with  this
+       The  Secure  Mailer  license must be distributed with this
        software.
 
 <b>AUTHOR(S)</b>
@@ -120,6 +107,19 @@ FLUSHD(8)                                               FLUSHD(8)
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
index 98f8ed9b8cb76e6d5c7e08ce4f87cbe89974f7d0..dbc6f48707e52f99a3e3e72bd891ccb8c8700f84 100644 (file)
@@ -188,9 +188,9 @@ SENDMAIL(1)                                           SENDMAIL(1)
        <b>-qR</b><i>site</i>
               Schedule immediate delivery of  all  mail  that  is
               queued  for  the named <i>site</i>.  This functionality is
-              available only for sites that  are  configured  for
-              the  <b>fast</b>  <b>flush</b>  service  support  as described in
-              <b>flushd</b>(8).   For  other  sites,  use   the   slower
+              available only for sites that have a so-called <b>fast</b>
+              <b>flush</b> logfile as described in <a href="flushd.8.html"><b>flushd</b>(8)</a>.  For other
+              sites, use the slower <b>sendmail</b> <b>-q</b> command  instead.
 
 
 
@@ -203,8 +203,6 @@ SENDMAIL(1)                                           SENDMAIL(1)
 SENDMAIL(1)                                           SENDMAIL(1)
 
 
-              <b>sendmail</b> <b>-q</b> command instead.
-
        <b>-qS</b><i>site</i>
               This  command  is  not  implemented. Use the slower
               <b>sendmail</b> <b>-q</b> command instead.
@@ -257,6 +255,8 @@ SENDMAIL(1)                                           SENDMAIL(1)
               The amount of original message context that is sent
               along with a non-delivery notification.
 
+       <b>database</b><i>_</i><b>type</b>
+              Default  alias  etc.  database  type.  On many UNIX
 
 
 
@@ -269,9 +269,7 @@ SENDMAIL(1)                                           SENDMAIL(1)
 SENDMAIL(1)                                           SENDMAIL(1)
 
 
-       <b>database</b><i>_</i><b>type</b>
-              Default alias etc. database type. On many UNIX sys-
-              tems the default type is either <b>dbm</b> or <b>hash</b>.
+              systems the default type is either <b>dbm</b> or <b>hash</b>.
 
        <b>debugger</b><i>_</i><b>command</b>
               Command that is executed after a Postfix daemon has
@@ -288,60 +286,36 @@ SENDMAIL(1)                                           SENDMAIL(1)
               ging   level   by   the  amount  specified  in  the
               <b>debug</b><i>_</i><b>peer</b><i>_</i><b>level</b> parameter.
 
-       <b>etrn</b><i>_</i><b>maps</b>
-              Tables that specify what domains have <b>ETRN</b> service.
-              For  each table entry, the left-hand side specifies
-              a destination domain name that can be specified  in
-              an  <b>ETRN</b> request, and the right-hand side specifies
-              a list of access restrictions for SMTP clients that
-              issue <b>ETRN</b> for the domain.
-
-       <b>fast</b><i>_</i><b>flush</b><i>_</i><b>maps</b>
-              The  table with names of destinations that this MTA
-              provides the fast flush service  for.  By  default,
-              this is set to $<b>etrn</b><i>_</i><b>maps</b>.
-
        <b>fork</b><i>_</i><b>attempts</b>
-              Number  of attempts to <b>fork</b>() a process before giv-
+              Number of attempts to <b>fork</b>() a process before  giv-
               ing up.
 
        <b>fork</b><i>_</i><b>delay</b>
-              Delay  in   seconds   between   successive   <b>fork</b>()
+              Delay   in   seconds   between   successive  <b>fork</b>()
               attempts.
 
        <b>hopcount</b><i>_</i><b>limit</b>
               Limit the number of <b>Received:</b> message headers.
 
        <b>mail</b><i>_</i><b>owner</b>
-              The  owner  of  the  mail queue and of most Postfix
+              The owner of the mail queue  and  of  most  Postfix
               processes.
 
        <b>command</b><i>_</i><b>directory</b>
-              Directory with Postfix support  commands  (default:
+              Directory  with  Postfix support commands (default:
               <b>$program</b><i>_</i><b>directory</b>).
 
        <b>daemon</b><i>_</i><b>directory</b>
-              Directory  with  Postfix  daemon programs (default:
+              Directory with Postfix  daemon  programs  (default:
               <b>$program</b><i>_</i><b>directory</b>).
 
-
-
-                                                                5
-
-
-
-
-
-SENDMAIL(1)                                           SENDMAIL(1)
-
-
        <b>queue</b><i>_</i><b>directory</b>
-              Top-level directory of the Postfix queue.  This  is
+              Top-level  directory  of the Postfix queue. This is
               also the root directory of Postfix daemons that run
               chrooted.
 
        <b>queue</b><i>_</i><b>run</b><i>_</i><b>delay</b>
-              The time between successive scans of  the  deferred
+              The  time  between successive scans of the deferred
               queue.
 
 <b>SEE</b> <b>ALSO</b>
@@ -349,15 +323,27 @@ SENDMAIL(1)                                           SENDMAIL(1)
        <a href="postalias.1.html">postalias(1)</a> maintain alias database
        <a href="postdrop.1.html">postdrop(1)</a> privileged posting agent
        <a href="postfix.1.html">postfix(1)</a> mail system control
+
+
+
+                                                                5
+
+
+
+
+
+SENDMAIL(1)                                           SENDMAIL(1)
+
+
        <a href="postkick.1.html">postkick(1)</a> kick a Postfix daemon
        <a href="qmgr.8.html">qmgr(8)</a> queue manager
        <a href="showq.8.html">showq(8)</a> list mail queue
        <a href="smtpd.8.html">smtpd(8)</a> SMTP server
-       flushd(8) fast flush service
+       <a href="flushd.8.html">flushd(8)</a> fast flush service
        syslogd(8) system logging
 
 <b>LICENSE</b>
-       The  Secure  Mailer  license must be distributed with this
+       The Secure Mailer license must be  distributed  with  this
        software.
 
 <b>AUTHOR(S)</b>
@@ -385,6 +371,20 @@ SENDMAIL(1)                                           SENDMAIL(1)
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
index d085f68d14ec3c40f98e17b7eb37956672515117..10e37738127149d046d6ae6c1b3e93ee241a0410 100644 (file)
@@ -27,7 +27,7 @@ SMTPD(8)                                                 SMTPD(8)
 
        The SMTP server implements a variety of policies for  con-
        nection  requests, and for parameters given to <b>HELO,</b> <b>ETRN,</b>
-       <b>MAIL</b> <b>FROM,</b> <b>VRFY</b>, and <b>RCPT</b> <b>TO</b> commands. They  are  detailed
+       <b>MAIL</b> <b>FROM,</b> <b>VRFY</b> and <b>RCPT</b> <b>TO</b> commands.  They  are  detailed
        below and in the <b>main.cf</b> configuration file.
 
 <b>SECURITY</b>
@@ -143,55 +143,55 @@ SMTPD(8)                                                 SMTPD(8)
               ging   level   by   the  amount  specified  in  the
               <b>debug</b><i>_</i><b>peer</b><i>_</i><b>level</b> parameter.
 
+       <b>enable</b><i>_</i><b>fast</b><i>_</i><b>flush</b>
+              Enable the "fast flush"  cache  for  improved  ETRN
+              performance.    By  default,  Postfix  attempts  to
+              deliver all messages in the queue  after  receiving
+              an  ETRN  command.   The "fast flush" cache keeps a
+              record of what mail is queued up for specific  des-
+              tinations.   Currently,  "fast  flush"  support  is
+              available only for destinations that the local  MTA
+              is  willing  to  relay  mail to (i.e. the policy is
+              hard coded).
+
        <b>error</b><i>_</i><b>notice</b><i>_</i><b>recipient</b>
               Recipient   of    protocol/policy/resource/software
               error notices.
 
-       <b>etrn</b><i>_</i><b>maps</b>
-              Tables that specify what domains have <b>ETRN</b> service.
-              For each table entry, the left-hand side  specifies
-              a  destination domain name that can be specified in
-              an <b>ETRN</b> request, and the right-hand side  specifies
-              a  list  of  access  restrictions  for clients that
-              issue <b>ETRN</b> for the domain.
-
        <b>hopcount</b><i>_</i><b>limit</b>
               Limit the number of <b>Received:</b> message headers.
 
        <b>local</b><i>_</i><b>recipient</b><i>_</i><b>maps</b>
-              List of maps with user  names  that  are  local  to
+              List  of  maps  with  user  names that are local to
               <b>$myorigin</b> or <b>$inet</b><i>_</i><b>interfaces</b>. If this parameter is
-              defined, then the  SMTP  server  rejects  mail  for
+              defined,  then  the  SMTP  server  rejects mail for
               unknown local users.
 
        <b>notify</b><i>_</i><b>classes</b>
               List of error classes. Of special interest are:
 
-              <b>policy</b> When  a  client  violates any policy, mail a
+              <b>policy</b> When a client violates any  policy,  mail  a
                      transcript of the entire SMTP session to the
                      postmaster.
 
               <b>protocol</b>
-                     When  a client violates the SMTP protocol or
+                     When a client violates the SMTP protocol  or
                      issues  an  unimplemented  command,  mail  a
                      transcript of the entire SMTP session to the
                      postmaster.
 
        <b>smtpd</b><i>_</i><b>banner</b>
-              Text that follows the <b>220</b> status code in  the  SMTP
+              Text  that  follows the <b>220</b> status code in the SMTP
               greeting banner.
 
        <b>smtpd</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>
-              Restrict  the  number  of  recipients that the SMTP
+              Restrict the number of  recipients  that  the  SMTP
               server accepts per message delivery.
 
        <b>smtpd</b><i>_</i><b>timeout</b>
-              Limit the time to send a  server  response  and  to
+              Limit  the  time  to  send a server response and to
               receive a client request.
 
-<b>Resource</b> <b>controls</b>
-
-
 
 
                                                                 3
@@ -203,8 +203,9 @@ SMTPD(8)                                                 SMTPD(8)
 SMTPD(8)                                                 SMTPD(8)
 
 
+<b>Resource</b> <b>controls</b>
        <b>line</b><i>_</i><b>length</b><i>_</i><b>limit</b>
-              Limit  the  amount  of memory in bytes used for the
+              Limit the amount of memory in bytes  used  for  the
               handling of partial input lines.
 
        <b>message</b><i>_</i><b>size</b><i>_</i><b>limit</b>
@@ -212,8 +213,8 @@ SMTPD(8)                                                 SMTPD(8)
               ing on-disk storage for envelope information.
 
        <b>queue</b><i>_</i><b>minfree</b>
-              Minimal  amount of free space in bytes in the queue
-              file system for the SMTP server to accept any  mail
+              Minimal amount of free space in bytes in the  queue
+              file  system for the SMTP server to accept any mail
               at all.
 
 <b>Tarpitting</b>
@@ -223,41 +224,40 @@ SMTPD(8)                                                 SMTPD(8)
 
        <b>smtpd</b><i>_</i><b>soft</b><i>_</i><b>error</b><i>_</i><b>limit</b>
               When an SMTP client has made this number of errors,
-              wait  <i>error_count</i>  seconds before responding to any
+              wait <i>error_count</i> seconds before responding  to  any
               client request.
 
        <b>smtpd</b><i>_</i><b>hard</b><i>_</i><b>error</b><i>_</i><b>limit</b>
-              Disconnect after a client has made this  number  of
+              Disconnect  after  a client has made this number of
               errors.
 
        <b>smtpd</b><i>_</i><b>junk</b><i>_</i><b>command</b><i>_</i><b>limit</b>
               Limit the number of times a client can issue a junk
-              command such as NOOP, VRFY, ETRN  or  RSET  in  one
-              SMTP  session  before  it  is penalized with tarpit
+              command  such  as  NOOP,  VRFY, ETRN or RSET in one
+              SMTP session before it  is  penalized  with  tarpit
               delays.
 
+<b>ETRN</b> <b>service</b>
+       <b>smtpd</b><i>_</i><b>etrn</b><i>_</i><b>restrictions</b>
+              Restrict what domain names can be used in <b>ETRN</b> com-
+              mands, and what clients may  issue  <b>ETRN</b>  commands.
+              The  restrictions  are  like  the  UCE restrictions
+              below. Fast <b>ETRN</b> service is limited to destinations
+              that list this MTA as mail exchanger.
+
 <b>UCE</b> <b>control</b> <b>restrictions</b>
        <b>smtpd</b><i>_</i><b>client</b><i>_</i><b>restrictions</b>
               Restrict what clients may connect to this mail sys-
               tem.
 
        <b>smtpd</b><i>_</i><b>helo</b><i>_</i><b>required</b>
-              Require  that  clients  introduce themselves at the
+              Require that clients introduce  themselves  at  the
               beginning of an SMTP session.
 
        <b>smtpd</b><i>_</i><b>helo</b><i>_</i><b>restrictions</b>
-              Restrict what client hostnames are allowed in  <b>HELO</b>
+              Restrict  what client hostnames are allowed in <b>HELO</b>
               and <b>EHLO</b> commands.
 
-       <b>smtpd</b><i>_</i><b>sender</b><i>_</i><b>restrictions</b>
-              Restrict  what sender addresses are allowed in <b>MAIL</b>
-              <b>FROM</b> commands.
-
-       <b>smtpd</b><i>_</i><b>recipient</b><i>_</i><b>restrictions</b>
-              Restrict what recipient addresses  are  allowed  in
-              <b>RCPT</b> <b>TO</b> commands.
-
-
 
 
                                                                 4
@@ -269,59 +269,59 @@ SMTPD(8)                                                 SMTPD(8)
 SMTPD(8)                                                 SMTPD(8)
 
 
+       <b>smtpd</b><i>_</i><b>sender</b><i>_</i><b>restrictions</b>
+              Restrict what sender addresses are allowed in  <b>MAIL</b>
+              <b>FROM</b> commands.
+
+       <b>smtpd</b><i>_</i><b>recipient</b><i>_</i><b>restrictions</b>
+              Restrict  what  recipient  addresses are allowed in
+              <b>RCPT</b> <b>TO</b> commands.
+
        <b>allow</b><i>_</i><b>untrusted</b><i>_</i><b>routing</b>
-              Allow  untrusted  clients to specify addresses with
-              sender-specified routing.  Enabling this  opens  up
-              nasty  relay  loopholes involving trusted backup MX
+              Allow untrusted clients to specify  addresses  with
+              sender-specified  routing.   Enabling this opens up
+              nasty relay loopholes involving trusted  backup  MX
               hosts.
 
        <b>restriction</b><i>_</i><b>classes</b>
-              Declares the name of zero or more  parameters  that
-              contain  a  list  of UCE restrictions. The names of
-              these parameters can then be used  instead  of  the
+              Declares  the  name of zero or more parameters that
+              contain a list of UCE restrictions.  The  names  of
+              these  parameters  can  then be used instead of the
               restriction lists that they represent.
 
        <b>maps</b><i>_</i><b>rbl</b><i>_</i><b>domains</b>
-              List  of  DNS domains that publish the addresses of
+              List of DNS domains that publish the  addresses  of
               blacklisted hosts.
 
        <b>relay</b><i>_</i><b>domains</b>
-              Restrict what domains or networks this mail  system
+              Restrict  what domains or networks this mail system
               will relay mail from or to.
 
 <b>UCE</b> <b>control</b> <b>responses</b>
        <b>access</b><i>_</i><b>map</b><i>_</i><b>reject</b><i>_</i><b>code</b>
-              Server  response  when  a client violates an access
+              Server response when a client  violates  an  access
               database restriction.
 
        <b>invalid</b><i>_</i><b>hostname</b><i>_</i><b>reject</b><i>_</i><b>code</b>
-              Server  response  when  a   client   violates   the
+              Server   response   when   a  client  violates  the
               <b>reject</b><i>_</i><b>invalid</b><i>_</i><b>hostname</b> restriction.
 
        <b>maps</b><i>_</i><b>rbl</b><i>_</i><b>reject</b><i>_</i><b>code</b>
-              Server   response   when   a  client  violates  the
+              Server  response  when  a   client   violates   the
               <b>maps</b><i>_</i><b>rbl</b><i>_</i><b>domains</b> restriction.
 
        <b>reject</b><i>_</i><b>code</b>
-              Response code when  the  client  matches  a  <b>reject</b>
+              Response  code  when  the  client  matches a <b>reject</b>
               restriction.
 
        <b>relay</b><i>_</i><b>domains</b><i>_</i><b>reject</b><i>_</i><b>code</b>
-              Server  response  when a client attempts to violate
+              Server response when a client attempts  to  violate
               the mail relay policy.
 
        <b>unknown</b><i>_</i><b>address</b><i>_</i><b>reject</b><i>_</i><b>code</b>
-              Server  response  when  a   client   violates   the
+              Server   response   when   a  client  violates  the
               <b>reject</b><i>_</i><b>unknown</b><i>_</i><b>address</b> restriction.
 
-       <b>unknown</b><i>_</i><b>client</b><i>_</i><b>reject</b><i>_</i><b>code</b>
-              Server  response  when  a client without address to
-              name mapping  violates  the  <b>reject</b><i>_</i><b>unknown</b><i>_</i><b>clients</b>
-              restriction.
-
-       <b>unknown</b><i>_</i><b>hostname</b><i>_</i><b>reject</b><i>_</i><b>code</b>
-              Server   response   when   a  client  violates  the
-              <b>reject</b><i>_</i><b>unknown</b><i>_</i><b>hostname</b> restriction.
 
 
 
@@ -335,13 +335,22 @@ SMTPD(8)                                                 SMTPD(8)
 SMTPD(8)                                                 SMTPD(8)
 
 
+       <b>unknown</b><i>_</i><b>client</b><i>_</i><b>reject</b><i>_</i><b>code</b>
+              Server response when a client  without  address  to
+              name  mapping  violates  the <b>reject</b><i>_</i><b>unknown</b><i>_</i><b>clients</b>
+              restriction.
+
+       <b>unknown</b><i>_</i><b>hostname</b><i>_</i><b>reject</b><i>_</i><b>code</b>
+              Server  response  when  a   client   violates   the
+              <b>reject</b><i>_</i><b>unknown</b><i>_</i><b>hostname</b> restriction.
+
 <b>SEE</b> <b>ALSO</b>
        <a href="cleanup.8.html">cleanup(8)</a> message canonicalization
        <a href="master.8.html">master(8)</a> process manager
        syslogd(8) system logging
 
 <b>LICENSE</b>
-       The Secure Mailer license must be  distributed  with  this
+       The  Secure  Mailer  license must be distributed with this
        software.
 
 <b>AUTHOR(S)</b>
@@ -373,15 +382,6 @@ SMTPD(8)                                                 SMTPD(8)
 
 
 
-
-
-
-
-
-
-
-
-
 
 
 
index 8d88392fea6fdaabbc811ac54069585eff70363c..d35330a2f104c41dddcf100d282e9eea20ea1c20 100644 (file)
@@ -1015,16 +1015,7 @@ restriction list.
 <dt>Default:
 
 <dd><b>relay_domains = <a href="basic.html#mydestination">
-$mydestination $fast_flush_maps</a></b>
-
-<p>
-
-(The <b>$fast_flush_maps</b> parameter specifies, among others,
-what destinations can be used in SMTP ETRN requests or in <b>sendmail
--qR</b><i>sitename</i> commands. This parameter defaults to
-<b>$etrn_maps</b>, the list of destinations that can be used in
-SMTP ETRN requests. More details in the <a href="etrn.5.html">etrn</a>
-manual page.)
+$mydestination</a></b>
 
 <p>
 
index 2ffd04b2ac25077dbc79038e37c8a8c7347df6d5..f82ef92699a56471d2eab423c95a670e6b44c7b5 100644 (file)
@@ -11,8 +11,7 @@ COMMANDS= man1/postalias.1 man1/postcat.1 man1/postconf.1 man1/postfix.1 \
        man1/postmap.1 man1/sendmail.1 man1/mailq.1 man1/newaliases.1 \
        man1/postsuper.1
 CONFIG = man5/access.5 man5/aliases.5 man5/canonical.5 man5/relocated.5 \
-       man5/transport.5 man5/virtual.5 man5/pcre_table.5 man5/regexp_table.5 \
-       man5/etrn.5
+       man5/transport.5 man5/virtual.5 man5/pcre_table.5 man5/regexp_table.5
 
 update:        $(DAEMONS) $(COMMANDS) $(CONFIG)
 
@@ -129,9 +128,6 @@ man5/aliases.5: ../proto/aliases
 man5/canonical.5: ../proto/canonical
        ../mantools/srctoman - $? >$@
 
-man5/etrn.5: ../proto/etrn
-       ../mantools/srctoman - $? >$@
-
 man5/pcre_table.5: ../proto/pcre_table
        ../mantools/srctoman - $? >$@
 
index e9aa0f35ec0cff1b7c03df7e1cc7b60409fd3bca..879301ec2f54c4c7b99b705fb7c42a934d1ffdfe 100644 (file)
@@ -138,10 +138,9 @@ configuration parameter instead.
 .IP \fB-qR\fIsite\fR
 Schedule immediate delivery of all mail that is queued for the named
 \fIsite\fR.
-This functionality is available only for sites that are configured
-for the \fBfast flush\fR service support as described in
-\fBflushd\fR(8).  For other sites, use the slower \fBsendmail -q\fR
-command instead.
+This functionality is available only for sites that have a so-called
+\fBfast flush\fR logfile as described in \fBflushd\fR(8).  For other
+sites, use the slower \fBsendmail -q\fR command instead.
 .IP \fB-qS\fIsite\fR
 This command is not implemented. Use the slower \fBsendmail -q\fR
 command instead.
@@ -208,15 +207,6 @@ pattern in the \fBdebug_peer_list\fR parameter.
 List of domain or network patterns. When a remote host matches
 a pattern, increase the verbose logging level by the amount
 specified in the \fBdebug_peer_level\fR parameter.
-.IP \fBetrn_maps\fR
-Tables that specify what domains have \fBETRN\fR service.  For each
-table entry, the left-hand side specifies a destination domain name
-that can be specified in an \fBETRN\fR request, and the right-hand
-side specifies a list of access restrictions for SMTP clients that
-issue \fBETRN\fR for the domain.
-.IP \fBfast_flush_maps\fR
-The table with names of destinations that this MTA provides the
-fast flush service for. By default, this is set to $\fBetrn_maps\fR.
 .IP \fBfork_attempts\fR
 Number of attempts to \fBfork\fR() a process before giving up.
 .IP \fBfork_delay\fR
diff --git a/postfix/man/man5/etrn.5 b/postfix/man/man5/etrn.5
deleted file mode 100644 (file)
index 8603f82..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-.TH ETRN 5 
-.ad
-.fi
-.SH NAME
-etrn
-\-
-format of Postfix etrn table
-.SH SYNOPSIS
-.na
-.nf
-\fBetrn_maps = hash:/etc/postfix/etrn\fR
-\fBetrn_maps = dbm:/etc/postfix/etrn\fR
-
-\fBpostmap /etc/postfix/etrn\fR
-.SH DESCRIPTION
-.ad
-.fi
-The optional \fBetrn\fR file specifies what destination domain
-names can be specified in SMTP \fBETRN\fR commands. This information
-is used by the \fBsmtpd\fR(8) and \fBflushd\fR(8) daemon.
-
-Normally, the file serves as input to the \fBpostmap\fR(1) command.
-The result, an indexed file in \fBdbm\fR or \fBdb\fR format,
-is used for fast searching by the mail system. Execute the command
-\fBpostmap /etc/postfix/etrn\fR in order to rebuild the indexed
-file after changing the etrn table.
-
-When the table is provided via other means such as NIS, LDAP,
-SQL, or as regular expressions, the same lookups are done as
-for ordinary indexed files.
-.SH TABLE FORMAT
-.na
-.nf
-.ad
-.fi
-The format of the \fBetrn\fR table is as follows:
-.IP "blanks and comments"
-Blank lines are ignored, as are lines beginning with `#'.
-.IP "\fIdomain restrictions\fR"
-The left-hand side, \fIdomain\fR, specifies a destination domain
-name that can be specified in \fBETRN\fR commands.
-.sp
-The right-hand side specifies one or more access restrictions.
-Restrictions are processed in the given order and the search
-stops at the first match.
-.RS
-.IP \fBreject_unknown_client\fR
-Reject the request if the client hostname is unknown.
-.IP \fBpermit_mynetworks\fR
-Permit the request if the client address matches $mynetworks.
-.IP \fBreject_maps_rbl\fR
-Reject the request if the reverse client network address
-is listed under $maps_rbl_domains.
-.IP \fBreject\fR
-Reject the request. Place this at the end of a restriction list.
-.IP \fBpermit\fR
-Permit the request. Place this at the end of a restriction list.
-.RE
-.PP
-.SH CONFIGURATION PARAMETERS
-.na
-.nf
-.ad
-.fi
-The following \fBmain.cf\fR parameters are especially relevant to
-this topic. See the Postfix \fBmain.cf\fR file for syntax details
-and for default values. Use the \fBpostfix reload\fR command after
-a configuration change.
-.IP \fBetrn_maps\fR
-Tables that specify what domains have \fBETRN\fR service.  For each
-table entry, the left-hand side specifies a destination domain name
-that can be specified in an \fBETRN\fR request, and the right-hand
-side specifies a list of access restrictions for SMTP clients that
-issue \fBETRN\fR for the domain.
-.IP \fBfast_flush_maps\fR
-The table with names of destinations that this MTA provides the
-fast flush service for. By default, this is set to $\fBetrn_maps\fR.
-.IP \fBrelay_domains\fR
-The list of domains that this MTA is willing to forward mail from
-or to. This defaults to \fB$mydestination, $fast_flush_maps\fR.
-.SH SEE ALSO
-.na
-.nf
-smtpd(8) Postfix SMTP server
-flushd(1) Postfix fast flush service
-sendmail(5) sendmail-compatible interface
-pcre_table(5) format of PCRE tables
-regexp_table(5) format of POSIX regular expression tables
-.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
index eeb8634dcfcc8d6586996e6e88998e07d9908c77..2f186738dd69b7777d0677ec37a910e1ea009036 100644 (file)
@@ -19,7 +19,7 @@ manager.
 
 This server implements the following requests:
 .IP "\fBFLUSH_REQ_ADD\fI sitename queue_id\fR"
-Append \fIqueue_id\fR to the fast flush logfile for the
+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
@@ -33,13 +33,12 @@ The request completed normally.
 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 logfile and is not configured
-to have one.
+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 logfiles from growing without bounds,
-and to prevent them from accumulating too much outdated information,
-the flush service generates a pro-active flush request once every
+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
@@ -49,7 +48,8 @@ every 1000 append requests. This should not impact operation.
 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.
+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
@@ -71,15 +71,6 @@ 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 \fBetrn_maps\fR
-Tables that specify what domains have \fBETRN\fR service.  For each
-table entry, the left-hand side specifies a destination domain name
-that can be specified in an \fBETRN\fR request, and the right-hand
-side specifies a list of access restrictions for SMTP clients that
-issue \fBETRN\fR for the domain.
-.IP \fBfast_flush_maps\fR
-The table with names of destinations that this MTA provides the
-fast flush service for. By default, this is set to $\fBetrn_maps\fR.
 .IP \fBline_length_limit\fR
 Maximal length of strings in a fast flush client request.
 .SH SEE ALSO
index 2da91e14233118d35ab1825ed2a34a8f13be6da8..ca306d627316766d79f66a64d64e19c2f13b7cc1 100644 (file)
@@ -26,7 +26,7 @@ mode, the SMTP server can accept mail even while the mail
 system is not running.
 
 The SMTP server implements a variety of policies for connection
-requests, and for parameters given to \fBHELO, ETRN, MAIL FROM, VRFY\fR,
+requests, and for parameters given to \fBHELO, ETRN, MAIL FROM, VRFY\fR
 and \fBRCPT TO\fR commands. They are detailed below and in the
 \fBmain.cf\fR configuration file.
 .SH SECURITY
@@ -111,14 +111,17 @@ pattern in the \fBdebug_peer_list\fR parameter.
 List of domain or network patterns. When a remote host matches
 a pattern, increase the verbose logging level by the amount
 specified in the \fBdebug_peer_level\fR parameter.
+.IP \fBenable_fast_flush\fR
+Enable the "fast flush" cache for improved ETRN performance.
+By default, Postfix attempts to deliver all messages in the queue
+after receiving an ETRN command.
+The "fast flush" cache keeps a record of what mail is queued up for
+specific destinations.
+Currently, "fast flush" support is available only for destinations
+that the local MTA is willing to relay mail to (i.e. the policy
+is hard coded).
 .IP \fBerror_notice_recipient\fR
 Recipient of protocol/policy/resource/software error notices.
-.IP \fBetrn_maps\fR
-Tables that specify what domains have \fBETRN\fR service. For
-each table entry, the left-hand side specifies a destination
-domain name that can be specified in an \fBETRN\fR request, and
-the right-hand side specifies a list of access restrictions for
-clients that issue \fBETRN\fR for the domain.
 .IP \fBhopcount_limit\fR
 Limit the number of \fBReceived:\fR message headers.
 .IP \fBlocal_recipient_maps\fR
@@ -171,6 +174,14 @@ Disconnect after a client has made this number of errors.
 Limit the number of times a client can issue a junk command
 such as NOOP, VRFY, ETRN or RSET in one SMTP session before
 it is penalized with tarpit delays.
+.SH "ETRN service"
+.ad
+.fi
+.IP \fBsmtpd_etrn_restrictions\fR
+Restrict what domain names can be used in \fBETRN\fR commands,
+and what clients may issue \fBETRN\fR commands. The restrictions
+are like the UCE restrictions below. Fast \fBETRN\fR service is
+limited to destinations that list this MTA as mail exchanger.
 .SH "UCE control restrictions"
 .ad
 .fi
index a69634774ab8dfa161dd09011d82c29b3e4d9651..02397426deb71dacdb7cb53d2359a2e5ed57e19d 100644 (file)
@@ -4,7 +4,7 @@ SHELL   = /bin/sh
 
 CONFIG = ../conf/access ../conf/aliases ../conf/canonical ../conf/relocated \
        ../conf/transport ../conf/virtual ../conf/pcre_table \
-       ../conf/regexp_table ../conf/etrn
+       ../conf/regexp_table
 
 update:        $(CONFIG)
 
@@ -28,9 +28,6 @@ clobber:
 ../conf/canonical: canonical
        srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
 
-../conf/etrn: etrn
-       srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
-
 ../conf/pcre_table: pcre_table
        srctoman - $? | nroff -man | col -bx | uniq | sed 's/^/# /' >$@
 
diff --git a/postfix/proto/etrn b/postfix/proto/etrn
deleted file mode 100644 (file)
index 4f145e1..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-#++
-# NAME
-#      etrn 5
-# SUMMARY
-#      format of Postfix etrn table
-# SYNOPSIS
-#      \fBetrn_maps = hash:/etc/postfix/etrn\fR
-#      \fBetrn_maps = dbm:/etc/postfix/etrn\fR
-#
-#      \fBpostmap /etc/postfix/etrn\fR
-# DESCRIPTION
-#      The optional \fBetrn\fR file specifies what destination domain
-#      names can be specified in SMTP \fBETRN\fR commands. This information
-#      is used by the \fBsmtpd\fR(8) and \fBflushd\fR(8) daemon.
-#
-#      Normally, the file serves as input to the \fBpostmap\fR(1) command.
-#      The result, an indexed file in \fBdbm\fR or \fBdb\fR format,
-#      is used for fast searching by the mail system. Execute the command
-#      \fBpostmap /etc/postfix/etrn\fR in order to rebuild the indexed
-#      file after changing the etrn table.
-#
-#      When the table is provided via other means such as NIS, LDAP,
-#      SQL, or as regular expressions, the same lookups are done as
-#      for ordinary indexed files.
-# TABLE FORMAT
-# .ad
-# .fi
-#      The format of the \fBetrn\fR table is as follows:
-# .IP "blanks and comments"
-#      Blank lines are ignored, as are lines beginning with `#'.
-# .IP "\fIdomain restrictions\fR"
-#      The left-hand side, \fIdomain\fR, specifies a destination domain
-#      name that can be specified in \fBETRN\fR commands.
-# .sp
-#      The right-hand side specifies one or more access restrictions.
-#      Restrictions are processed in the given order and the search
-#      stops at the first match.
-# .RS
-# .IP \fBreject_unknown_client\fR
-#      Reject the request if the client hostname is unknown.
-# .IP \fBpermit_mynetworks\fR
-#      Permit the request if the client address matches $mynetworks.
-# .IP \fBreject_maps_rbl\fR
-#      Reject the request if the reverse client network address
-#      is listed under $maps_rbl_domains.
-# .IP \fBreject\fR
-#      Reject the request. Place this at the end of a restriction list.
-# .IP \fBpermit\fR
-#      Permit the request. Place this at the end of a restriction list.
-# .RE
-# .PP
-# CONFIGURATION PARAMETERS
-# .ad
-# .fi
-#      The following \fBmain.cf\fR parameters are especially relevant to
-#      this topic. See the Postfix \fBmain.cf\fR file for syntax details
-#      and for default values. Use the \fBpostfix reload\fR command after
-#      a configuration change.
-# .IP \fBetrn_maps\fR
-#      Tables that specify what domains have \fBETRN\fR service.  For each
-#      table entry, the left-hand side specifies a destination domain name
-#      that can be specified in an \fBETRN\fR request, and the right-hand
-#      side specifies a list of access restrictions for SMTP clients that
-#      issue \fBETRN\fR for the domain.
-# .IP \fBfast_flush_maps\fR
-#      The table with names of destinations that this MTA provides the
-#      fast flush service for. By default, this is set to $\fBetrn_maps\fR.
-# .IP \fBrelay_domains\fR
-#      The list of domains that this MTA is willing to forward mail from
-#      or to. This defaults to \fB$mydestination, $fast_flush_maps\fR.
-# SEE ALSO
-#      smtpd(8) Postfix SMTP server
-#      flushd(1) Postfix fast flush service
-#      sendmail(5) sendmail-compatible interface
-#      pcre_table(5) format of PCRE tables
-#      regexp_table(5) format of POSIX regular expression tables
-# LICENSE
-# .ad
-# .fi
-#      The Secure Mailer license must be distributed with this software.
-# AUTHOR(S)
-#      Wietse Venema
-#      IBM T.J. Watson Research
-#      P.O. Box 704
-#      Yorktown Heights, NY 10598, USA
-#--
-
-# By default, this file is not used.  See sample-smtpd.cf
index e85cd926f3e4d93fcb03cfbf16c25f72415ab4b5..324794c3b6175ac64798c27ede1902cd04dc61b6 100644 (file)
@@ -13,7 +13,7 @@
 /*
 /*     This server implements the following requests:
 /* .IP "\fBFLUSH_REQ_ADD\fI sitename queue_id\fR"
-/*     Append \fIqueue_id\fR to the fast flush logfile for the
+/*     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
 /*     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 logfile and is not configured
-/*     to have one.
+/*     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 logfiles from growing without bounds,
-/*     and to prevent them from accumulating too much outdated information,
-/*     the flush service generates a pro-active flush request once every
+/*     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.
 /* SECURITY
 /* .ad
@@ -41,7 +40,8 @@
 /*     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.
+/*     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.
 /* DIAGNOSTICS
 /*     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 \fBetrn_maps\fR
-/*     Tables that specify what domains have \fBETRN\fR service.  For each
-/*     table entry, the left-hand side specifies a destination domain name
-/*     that can be specified in an \fBETRN\fR request, and the right-hand
-/*     side specifies a list of access restrictions for SMTP clients that
-/*     issue \fBETRN\fR for the domain.
-/* .IP \fBfast_flush_maps\fR
-/*     The table with names of destinations that this MTA provides the
-/*     fast flush service for. By default, this is set to $\fBetrn_maps\fR.
 /* .IP \fBline_length_limit\fR
 /*     Maximal length of strings in a fast flush client request.
 /* SEE ALSO
 
 #include <mail_server.h>
 
- /*
-  * Tunable parameters.
-  */
-char   *var_etrn_maps;
-char   *var_fflush_maps;
-
 /* Application-specific. */
 
 #define STR(x) vstring_str(x)
-#define MAX_DUP_FILTER 10000
-
-static MAPS *fflush_maps;
+#define FLUSHD_DUP_FILTER_SIZE 10000   /* graceful degradation */
+#define FLUSHD_COMMAND_TIMEOUT 60      /* don't get stuck */
+#define FLUSHD_CHECK_RATE      1000    /* don't accumulate cruft */
 
-/* flush_append - append queue ID to per-site fast flush logfile */
+/* flush_append - append queue ID to per-site fast flush log */
 
 static int flush_append(const char *site, const char *queue_id)
 {
@@ -140,19 +125,12 @@ static int flush_append(const char *site, const char *queue_id)
        msg_info("%s: site %s queue_id %s", myname, site, queue_id);
 
     /*
-     * Open or create the logfile. We allow for the fact that a logfile
-     * exists for a site that is no longer listed in the fast flush maps.
+     * Open the logfile.
      */
     if ((log = mail_queue_open(MAIL_QUEUE_FLUSH, site, O_APPEND | O_WRONLY, 0600)) == 0) {
        if (errno != ENOENT)
            msg_fatal("%s: open fast flush log for site %s: %m", myname, site);
-       if (maps_find(fflush_maps, site, 0) == 0) {
-           msg_warn("no fast flush support configured for site %s", site);
-           return (FLUSH_STAT_UNKNOWN);
-       }
-       log = mail_queue_open(MAIL_QUEUE_FLUSH, site, O_CREAT | O_APPEND | O_WRONLY, 0600);
-       if (log == 0)
-           msg_fatal("%s: open fast flush log for site %s: %m", myname, site);
+       return (FLUSH_STAT_UNKNOWN);
     }
 
     /*
@@ -175,10 +153,10 @@ static int flush_append(const char *site, const char *queue_id)
      * Clean up.
      */
     if (myflock(vstream_fileno(log), MYFLOCK_NONE) < 0)
-       msg_fatal("%s: unlock fast flush logfile for site %s: %m",
+       msg_fatal("%s: unlock fast flush log for site %s: %m",
                  myname, site);
     if (vstream_fclose(log) != 0)
-       msg_warn("write fast flush logfile for site %s: %m", site);
+       msg_warn("write fast flush log for site %s: %m", site);
 
     return (FLUSH_STAT_OK);
 }
@@ -207,13 +185,7 @@ static int flush_site(const char *site)
     if ((log = mail_queue_open(MAIL_QUEUE_FLUSH, site, O_RDWR, 0600)) == 0) {
        if (errno != ENOENT)
            msg_fatal("%s: open fast flush log for site %s: %m", myname, site);
-       if (maps_find(fflush_maps, site, 0)) {
-           msg_warn("no fast flush log for site %s", site);
-           return (FLUSH_STAT_OK);
-       } else {
-           msg_warn("no fast flush support configured for site %s", site);
-           return (FLUSH_STAT_UNKNOWN);
-       }
+       return (FLUSH_STAT_UNKNOWN);
     }
 
     /*
@@ -239,12 +211,17 @@ static int flush_site(const char *site)
     dup_filter = htable_create(10);
     tbuf.actime = tbuf.modtime = event_time();
     while (vstring_get_nonl(queue_id, log) != VSTREAM_EOF) {
-       if (dup_filter->used >= MAX_DUP_FILTER
+       if (!mail_queue_id_ok(STR(queue_id))) {
+           msg_warn("bad queue id %.30s... in fast flush log for site %s",
+                    STR(queue_id), site);
+           continue;
+       }
+       if (dup_filter->used >= FLUSHD_DUP_FILTER_SIZE
            || htable_find(dup_filter, STR(queue_id)) == 0) {
            if (msg_verbose)
                msg_info("%s: site %s: update %s time stamps",
                         myname, site, STR(queue_file));
-           if (dup_filter->used <= MAX_DUP_FILTER)
+           if (dup_filter->used <= FLUSHD_DUP_FILTER_SIZE)
                htable_enter(dup_filter, STR(queue_id), 0);
 
            mail_queue_path(queue_file, MAIL_QUEUE_DEFERRED, STR(queue_id));
@@ -271,20 +248,20 @@ static int flush_site(const char *site)
     vstring_free(queue_id);
 
     /*
-     * Truncate the fast flush logfile.
+     * Truncate the fast flush log.
      */
     if (ftruncate(vstream_fileno(log), (off_t) 0) < 0)
-       msg_fatal("%s: truncate fast flush logfile for site %s: %m",
+       msg_fatal("%s: truncate fast flush log for site %s: %m",
                  myname, site);
 
     /*
      * Request delivery and clean up.
      */
     if (myflock(vstream_fileno(log), MYFLOCK_NONE) < 0)
-       msg_fatal("%s: unlock fast flush logfile for site %s: %m",
+       msg_fatal("%s: unlock fast flush log for site %s: %m",
                  myname, site);
     if (vstream_fclose(log) != 0)
-       msg_warn("read fast flush logfile for site %s: %m", site);
+       msg_warn("read fast flush log for site %s: %m", site);
     if (msg_verbose)
        msg_info("%s: requesting delivery for site %s", myname, site);
     mail_trigger(MAIL_CLASS_PUBLIC, MAIL_SERVICE_QUEUE,
@@ -312,11 +289,12 @@ static void flush_service(VSTREAM *client_stream, char *unused_service,
 
     /*
      * Vandalism control. Read no unlimited amounts of garbage from a public
-     * socket.
+     * socket. Of course we also have to make sure the content is sane.
      */
     vstring_ctl(request, VSTRING_CTL_MAXLEN, var_line_limit, VSTRING_CTL_END);
     vstring_ctl(site, VSTRING_CTL_MAXLEN, var_line_limit, VSTRING_CTL_END);
-
+    vstream_control(client_stream, VSTREAM_CTL_TIMEOUT, FLUSHD_COMMAND_TIMEOUT, 
+       VSTREAM_CTL_END);
     /*
      * This routine runs whenever a client connects to the UNIX-domain socket
      * dedicated to the fast flush service. What we see below is a little
@@ -336,7 +314,8 @@ static void flush_service(VSTREAM *client_stream, char *unused_service,
            queue_id = vstring_alloc(10);
            vstring_ctl(queue_id, VSTRING_CTL_MAXLEN, var_line_limit,
                        VSTRING_CTL_END);
-           if (mail_scan(client_stream, "%s", queue_id) == 1)
+           if (mail_scan(client_stream, "%s", queue_id) == 1
+               && mail_queue_id_ok(STR(queue_id)))
                status = flush_append(STR(site), STR(queue_id));
            vstring_free(queue_id);
        } else if (STREQ(STR(request), FLUSH_REQ_SEND)) {
@@ -352,7 +331,7 @@ static void flush_service(VSTREAM *client_stream, char *unused_service,
      * so that it does not have to wait while the pro-active flush happens.
      */
     if (status == FLUSH_STAT_OK && STREQ(STR(request), FLUSH_REQ_ADD)
-       && (++counter + event_time() + getpid()) % 1000 == 0) {
+       && (++counter + event_time() + getpid()) % FLUSHD_CHECK_RATE == 0) {
        vstream_fflush(client_stream);
        if (msg_verbose)
            msg_info("site %s: time for a pro-active flush", STR(site));
@@ -362,40 +341,9 @@ static void flush_service(VSTREAM *client_stream, char *unused_service,
     vstring_free(request);
 }
 
-/* pre_accept - see if tables have changed */
-
-static void pre_accept(char *unused_name, char **unused_argv)
-{
-    if (dict_changed()) {
-       msg_info("table has changed -- exiting");
-       exit(0);
-    }
-}
-
-/* pre_jail_init - pre-chroot initialization */
-
-static void pre_jail_init(char *unused_service, char **unused_argv)
-{
-    fflush_maps = maps_create(VAR_FFLUSH_MAPS, var_fflush_maps,
-                             DICT_FLAG_LOCK);
-}
-
-/* pre_accept_init - check map status */
-
-
 /* main - pass control to the single-threaded skeleton */
 
 int     main(int argc, char **argv)
 {
-    static CONFIG_STR_TABLE str_table[] = {
-       VAR_ETRN_MAPS, DEF_ETRN_MAPS, &var_etrn_maps, 0, 0,
-       VAR_FFLUSH_MAPS, DEF_FFLUSH_MAPS, &var_fflush_maps, 0, 0,
-       0,
-    };
-
-    single_server_main(argc, argv, flush_service,
-                      MAIL_SERVER_PRE_INIT, pre_jail_init,
-                      MAIL_SERVER_PRE_ACCEPT, pre_accept,
-                      MAIL_SERVER_STR_TABLE, str_table,
-                      0);
+    single_server_main(argc, argv, flush_service, 0);
 }
index fee68b991942e78115e7514a9b8cd81d0af3b898..8930b40ccea7f67248431ff1b7f6b2dff004d0c9 100644 (file)
@@ -63,6 +63,9 @@
 /*     closes the queue file,
 /*     and destroys the DELIVER_REQUEST structure. The result is
 /*     non-zero when the status could not be reported to the client.
+/*
+/*     When the fast flush cache is enabled, the fast flush server is
+/*     notified of deferred mail.
 /* DIAGNOSTICS
 /*     Warnings: bad data sent by the client. Fatal errors: out of
 /*     memory, queue file open errors.
 #include "mail_open_ok.h"
 #include "recipient_list.h"
 #include "deliver_request.h"
+#include "mail_flush.h"
+#include "mail_params.h"
 
 /* deliver_request_initial - send initial status code */
 
@@ -323,7 +328,12 @@ int     deliver_request_done(VSTREAM *stream, DELIVER_REQUEST *request, int stat
 {
     int     err;
 
+    /*
+     * Optionally add this message to the fast flush log for this site.
+     */
     err = deliver_request_final(stream, request->hop_status, status);
+    if (var_enable_fflush)
+       mail_flush_append(request->nexthop, request->queue_id);
     deliver_request_free(request);
     return (err);
 }
index e7b8fc8ca3ed581f7f38e24b73e9c3abbf77f539..921f0c3671734c90923058a43a710964f54f9fe3 100644 (file)
 /*     const char *site;
 /*     const char *queue_id;
 /* DESCRIPTION
-/*     This module deals with delivery of backed up mail.
+/*     This module deals with delivery of delayed mail.
 /*
 /*     mail_flush_deferred() triggers delivery of all deferred
 /*     or incoming mail.
 /*
-/*     mail_flush_site() uses the "fash flush" service to trigger
+/*     The following services are available only for sites have a
+/*     "fast flush" logfile. These files list all mail that is queued
+/*     for a given site, and are created on demand when, for example,
+/*     an eligible SMTP client issues the ETRN command.
+/*
+/*     mail_flush_site() uses the "fast flush" service to trigger
 /*     delivery of messages queued for the specified site.
-/*     This service is available only for sites that are configured
-/*     to have a deferred mail logfile.
 /*
-/*     mail_flush_append() appends a record to the "fash flush"
+/*     mail_flush_append() appends a record to the "fast flush"
 /*     logfile of the specified site, with the queue ID of mail
 /*     that should still be delivered.
 /* DIAGNOSTICS
 /*     The request completed normally.
 /* .IP MAIL_FLUSH_FAIL
 /*     The request failed.
-/* .IP "MAIL_FLUSH_UNKNOWN (mail_flush_site() only)"
-/*     The specified site is not configured for the fast flush service.
-/* .IP "MAIL_FLUSH_BAD (mail_flush_site() only)"
-/*     The fast flush server rejected the request.
+/* .IP MAIL_FLUSH_UNKNOWN
+/*     The specified site has no "fast flush" logfile.
+/* .IP MAIL_FLUSH_BAD
+/*     The "fast flush" server rejected the request (invalid request
+/*     parameter).
 /* LICENSE
 /* .ad
 /* .fi
@@ -86,7 +90,7 @@ int     mail_flush_deferred(void)
 
 /* mail_flush_clnt - generic fast flush service client */
 
-static int mail_flush_clnt(const char *format, ...)
+static int mail_flush_clnt(const char *format,...)
 {
     VSTREAM *flush;
     int     status;
index dfce76229b1db0a8182eb2d638517b0feda47bf9..baaabe6ae885f0e16774ba1014bafe34b35ac752 100644 (file)
@@ -34,6 +34,7 @@ extern int mail_flush_append(const char *, const char *);
 
 
 /* LICENSE
+/* .ad
 /* .fi
 /*     The Secure Mailer license must be distributed with this software.
 /* AUTHOR(S)
@@ -42,6 +43,5 @@ extern int mail_flush_append(const char *, const char *);
 /*     P.O. Box 704
 /*     Yorktown Heights, NY 10598, USA
 /*--*/
-/**INDENT** Error@33: Unmatched #endif */
 
 #endif
index bc21ed34717927a90d47e99767d4893ed69a6533..05daccb4689962d3f1847bc293544a006b7ca011 100644 (file)
@@ -58,6 +58,7 @@
 /*     int     var_ownreq_special;
 /*     int     var_daemon_timeout;
 /*     char    *var_syslog_facility;
+/*     int     var_enable_fflush;
 /*
 /*     void    mail_params_init()
 /* DESCRIPTION
@@ -164,6 +165,7 @@ time_t  var_starttime;
 int     var_ownreq_special;
 int     var_daemon_timeout;
 char   *var_syslog_facility;
+int    var_enable_fflush;
 
 /* check_myhostname - lookup hostname and validate */
 
@@ -303,6 +305,7 @@ void    mail_params_init()
        VAR_SOFT_BOUNCE, DEF_SOFT_BOUNCE, &var_soft_bounce,
        VAR_OWNREQ_SPECIAL, DEF_OWNREQ_SPECIAL, &var_ownreq_special,
        VAR_MAILTOOL_COMPAT, DEF_MAILTOOL_COMPAT, &var_mailtool_compat,
+       VAR_ENABLE_FFLUSH, DEF_ENABLE_FFLUSH, &var_enable_fflush,
        0,
     };
 
index 151826785f5dc3ea1ef68d59e7e0aff6e873f2f0..4b19bb828aac45066a3be7ecf36e2eb37f9e67ff 100644 (file)
@@ -441,7 +441,7 @@ extern int var_delay_warn_time;
   * Queue manager: various in-core message and recipient limits.
   */
 #define VAR_QMGR_ACT_LIMIT     "qmgr_message_active_limit"
-#define DEF_QMGR_ACT_LIMIT     1000
+#define DEF_QMGR_ACT_LIMIT     10000
 extern int var_qmgr_active_limit;
 
 #define VAR_QMGR_RCPT_LIMIT    "qmgr_message_recipient_limit"
@@ -592,7 +592,7 @@ extern int var_debug_peer_level;
   * subdirectories, and how deep the forest is.
   */
 #define VAR_HASH_QUEUE_NAMES   "hash_queue_names"
-#define DEF_HASH_QUEUE_NAMES   "defer,flush"
+#define DEF_HASH_QUEUE_NAMES   "active,bounce,defer,flush"
 extern char *var_hash_queue_names;
 
 #define VAR_HASH_QUEUE_DEPTH   "hash_queue_depth"
@@ -896,7 +896,7 @@ extern int var_trigger_timeout;
 extern char *var_mynetworks;
 
 #define VAR_RELAY_DOMAINS      "relay_domains"
-#define DEF_RELAY_DOMAINS      "$mydestination $fast_flush_maps"
+#define DEF_RELAY_DOMAINS      "$mydestination"
 extern char *var_relay_domains;
 
 #define VAR_CLIENT_CHECKS      "smtpd_client_restrictions"
@@ -1065,15 +1065,10 @@ extern void mail_params_init(void);
 extern char *var_filter_xport;
 
  /*
-  * ETRN and fast flush support.
-  */
-#define VAR_ETRN_MAPS                  "etrn_maps"
-#define DEF_ETRN_MAPS                  ""
-extern char *var_etrn_maps;
-
-#define VAR_FFLUSH_MAPS                        "fast_flush_maps"
-#define DEF_FFLUSH_MAPS                        "$etrn_maps"
-extern char *var_fflush_maps;
+Fast flush service support. */
+#define VAR_ENABLE_FFLUSH              "enable_fast_flush"
+#define DEF_ENABLE_FFLUSH              0
+extern bool var_enable_fflush;
 
 /* LICENSE
 /* .ad
index 3f4703561ee2268ae2c29d58df57bd398b3807e2..62f8c030579b5a486c0a942399565445c729b65c 100644 (file)
@@ -273,6 +273,8 @@ int     mail_queue_name_ok(const char *queue_name)
     for (cp = queue_name; *cp; cp++)
        if (!ISALNUM(*cp))
            return (0);
+    if (strlen(queue_name) > 100)
+       return (0);
     return (1);
 }
 
@@ -282,6 +284,9 @@ int     mail_queue_id_ok(const char *queue_id)
 {
     const char *cp;
 
+    if (strlen(queue_id) > 100)
+       return (0);
+
     /*
      * Must be in valid hostname form.
      */
index 3a0ba75b7369f2355a0673ab3237ce5651729b0c..819c8aef17c135bcaaa91b1e4d35bd1a88e628c4 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Snapshot-20000928"
+#define DEF_MAIL_VERSION       "Snapshot-20000929"
 extern char *var_mail_version;
 
 /* LICENSE
index af253cecc472b0589ace0d8df6acd8e4661d6247..7c1d11a950228f7c51589e5ff5b97ca4ad18b9d0 100644 (file)
@@ -332,14 +332,12 @@ char   *var_relocated_maps;
 char   *var_virtual_maps;
 char   *var_defer_xports;
 bool    var_allow_min_user;
-char   *var_fflush_maps;
 
 static QMGR_SCAN *qmgr_incoming;
 static QMGR_SCAN *qmgr_deferred;
 
 MAPS   *qmgr_relocated;
 MAPS   *qmgr_virtual;
-MAPS   *qmgr_fflush;
 
 /* qmgr_deferred_run_event - queue manager heartbeat */
 
@@ -473,9 +471,6 @@ static void qmgr_pre_init(char *unused_name, char **unused_argv)
     if (*var_virtual_maps)
        qmgr_virtual = maps_create("virtual", var_virtual_maps,
                                   DICT_FLAG_LOCK);
-    if (*var_fflush_maps)
-       qmgr_fflush = maps_create(VAR_FFLUSH_MAPS, var_fflush_maps,
-                                 DICT_FLAG_LOCK);
 }
 
 /* qmgr_post_init - post-jail initialization */
@@ -513,7 +508,6 @@ int     main(int argc, char **argv)
        VAR_RELOCATED_MAPS, DEF_RELOCATED_MAPS, &var_relocated_maps, 0, 0,
        VAR_VIRTUAL_MAPS, DEF_VIRTUAL_MAPS, &var_virtual_maps, 0, 0,
        VAR_DEFER_XPORTS, DEF_DEFER_XPORTS, &var_defer_xports, 0, 0,
-       VAR_FFLUSH_MAPS, DEF_FFLUSH_MAPS, &var_fflush_maps, 0, 0,
        0,
     };
     static CONFIG_INT_TABLE int_table[] = {
index b062197592a1a7484541a2efc0636fb074d541ef..2da9dea0b403527621ce6a71a7bfad61701955b3 100644 (file)
@@ -275,7 +275,6 @@ extern int qmgr_message_count;
 extern int qmgr_recipient_count;
 extern MAPS *qmgr_relocated;
 extern MAPS *qmgr_virtual;
-extern MAPS *qmgr_fflush;
 
 extern void qmgr_message_free(QMGR_MESSAGE *);
 extern void qmgr_message_update_warn(QMGR_MESSAGE *);
index 72d30aac927e51395854f7982432a4d638fb7075..504a5b821ef9be4cbe6cb3653603c736c67ec7d5 100644 (file)
@@ -79,6 +79,8 @@
 /* Global library. */
 
 #include <defer.h>
+#include <mail_params.h>
+#include <mail_flush.h>
 
 /* Application-specific. */
 
@@ -138,6 +140,8 @@ void    qmgr_defer_todo(QMGR_QUEUE *queue, const char *reason)
            recipient = entry->rcpt_list.info + nrcpt;
            qmgr_defer_recipient(message, recipient->address, reason);
        }
+       if (var_enable_fflush)
+           mail_flush_append(queue->name, message->queue_id);
        qmgr_entry_done(entry, QMGR_QUEUE_TODO);
     }
 }
index 8d70552c74ee38e3d03307b40ea3f8b45017bac1..aacb8efa54afe17daa67cfb9c2ba0e46d207a5ac 100644 (file)
@@ -212,12 +212,6 @@ static void qmgr_deliver_update(int unused_event, char *context)
            if (queue->window == 0)
                qmgr_defer_todo(queue, queue->reason);
        }
-
-       /*
-        * Optionally add this message to the fast flush log for this site.
-        */
-       if (qmgr_fflush && maps_find(qmgr_fflush, queue->name, 0))
-           mail_flush_append(queue->name, message->queue_id);
     }
 
     /*
index e93ab349afcc2c7c83cbc03d85d8961260b70d01..4f53c3b07f98e8e4fe65f18bb8bf5bc4e6efd9b1 100644 (file)
@@ -143,6 +143,9 @@ static void super(char **queues, int action)
      */
     while ((queue_name = *queues++) != 0) {
 
+       if (msg_verbose)
+           msg_info("queue: %s", queue_name);
+
        /*
         * Look up queue-specific properties: desired hashing depth, what
         * file permissions to look for, and whether or not it is desirable
@@ -294,6 +297,7 @@ main(int argc, char **argv)
        MAIL_QUEUE_DEFERRED,
        MAIL_QUEUE_DEFER,
        MAIL_QUEUE_BOUNCE,
+       MAIL_QUEUE_FLUSH,
        0,
     };
 
index aa974a8c665b8701378c305fa5e00074fea1aa6b..ad3320b48a9ac4682c63dbd85de97dc687096228 100644 (file)
@@ -135,7 +135,6 @@ qmgr_deliver.o: ../../include/mail_proto.h
 qmgr_deliver.o: ../../include/recipient_list.h
 qmgr_deliver.o: ../../include/mail_params.h
 qmgr_deliver.o: ../../include/deliver_request.h
-qmgr_deliver.o: ../../include/mail_flush.h
 qmgr_deliver.o: qmgr.h
 qmgr_deliver.o: ../../include/scan_dir.h
 qmgr_deliver.o: ../../include/maps.h
index f8ae84f02f60956ed9eb0d7f03eb0959354a3b50..374008e921903443f0911b9412e5f05dbdc16430 100644 (file)
@@ -292,14 +292,12 @@ bool    var_allow_min_user;
 int     var_qmgr_fudge;
 int     var_qmgr_hog;
 int     var_local_rcpt_lim;            /* XXX */
-char   *var_fflush_maps;
 
 static QMGR_SCAN *qmgr_incoming;
 static QMGR_SCAN *qmgr_deferred;
 
 MAPS   *qmgr_relocated;
 MAPS   *qmgr_virtual;
-MAPS   *qmgr_fflush;
 
 /* qmgr_deferred_run_event - queue manager heartbeat */
 
@@ -436,9 +434,6 @@ static void qmgr_pre_init(char *unused_name, char **unused_argv)
     if (*var_virtual_maps)
        qmgr_virtual = maps_create("virtual", var_virtual_maps,
                                   DICT_FLAG_LOCK);
-    if (*var_fflush_maps)
-       qmgr_fflush = maps_create(VAR_FFLUSH_MAPS, var_fflush_maps,
-                                 DICT_FLAG_LOCK);
 }
 
 /* qmgr_post_init - post-jail initialization */
@@ -476,7 +471,6 @@ int     main(int argc, char **argv)
        VAR_RELOCATED_MAPS, DEF_RELOCATED_MAPS, &var_relocated_maps, 0, 0,
        VAR_VIRTUAL_MAPS, DEF_VIRTUAL_MAPS, &var_virtual_maps, 0, 0,
        VAR_DEFER_XPORTS, DEF_DEFER_XPORTS, &var_defer_xports, 0, 0,
-       VAR_FFLUSH_MAPS, DEF_FFLUSH_MAPS, &var_fflush_maps, 0, 0,
        0,
     };
     static CONFIG_INT_TABLE int_table[] = {
index 71fe6d777d99c8df165024d9d5df0b8ffbf4b813..45ceac8e99bcd50f03911fde770985d075d7fce9 100644 (file)
@@ -242,7 +242,6 @@ extern int qmgr_message_count;
 extern int qmgr_recipient_count;
 extern MAPS *qmgr_relocated;
 extern MAPS *qmgr_virtual;
-extern MAPS *qmgr_fflush;
 
 extern void qmgr_message_free(QMGR_MESSAGE *);
 extern void qmgr_message_update_warn(QMGR_MESSAGE *);
index 8be8e7247bb82a1d11c6771803a5038185cec61f..c6292390e024ca3655a91536728b9ae589ede3be 100644 (file)
@@ -74,6 +74,8 @@
 /* Global library. */
 
 #include <defer.h>
+#include <mail_params.h>
+#include <mail_flush.h>
 
 /* Application-specific. */
 
@@ -133,6 +135,8 @@ void    qmgr_defer_todo(QMGR_QUEUE *queue, const char *reason)
            recipient = entry->rcpt_list.info + nrcpt;
            qmgr_defer_recipient(message, recipient->address, reason);
        }
+       if (var_enable_fflush)
+           mail_flush_append(queue->name, message->queue_id);
        qmgr_entry_done(entry, QMGR_QUEUE_TODO);
     }
 }
index 0c6685c989b6a95a681ed0d5b6d092120ab0e0d8..cfc49de7333427b8981057f6c0b5239c9f8ce41f 100644 (file)
@@ -62,7 +62,6 @@
 #include <recipient_list.h>
 #include <mail_params.h>
 #include <deliver_request.h>
-#include <mail_flush.h>
 
 /* Application-specific. */
 
@@ -208,12 +207,6 @@ static void qmgr_deliver_update(int unused_event, char *context)
            if (queue->window == 0)
                qmgr_defer_todo(queue, queue->reason);
        }
-
-       /*
-        * Optionally add this message to the fast flush log for this site.
-        */
-       if (qmgr_fflush && maps_find(qmgr_fflush, queue->name, 0))
-           mail_flush_append(queue->name, message->queue_id);
     }
 
     /*
index 31f1a0e38f7078e0453c7ed2b2d492dbf6681e3b..3732e2990cba557bc155cb6329b7ef7da8e832fe 100644 (file)
@@ -501,6 +501,7 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
            } else if (dict_errno != 0) {
                qmgr_defer_recipient(message, recipient->address,
                                     "relocated map lookup failure");
+XXX mail_flush_append
                continue;
            }
        }
@@ -589,6 +590,7 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
            if (*cpp) {
                qmgr_defer_recipient(message, recipient->address,
                                     "deferred transport");
+XXX mail_flush_append
                continue;
            }
        }
@@ -616,6 +618,7 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
         */
        if ((transport->flags & QMGR_TRANSPORT_STAT_DEAD) != 0) {
            qmgr_defer_recipient(message, recipient->address, transport->reason);
+XXX mail_flush_append
            continue;
        }
 
@@ -633,6 +636,7 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
         */
        if (queue->window == 0) {
            qmgr_defer_recipient(message, recipient->address, queue->reason);
+XXX mail_flush_append
            continue;
        }
 
@@ -649,6 +653,7 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
                   qmgr_message_count : var_qmgr_active_limit)) {
                qmgr_defer_recipient(message, recipient->address,
                                     "site destination queue overflow");
+XXX mail_flush_append
                continue;
            }
        }
index 18c89bdfc19c01c4062f4ad6dcc7763818863dbe..874877627c80a038de1ae395b9fa94946f4ee002 100644 (file)
 /* .IP \fB-qR\fIsite\fR
 /*     Schedule immediate delivery of all mail that is queued for the named
 /*     \fIsite\fR.
-/*     This functionality is available only for sites that are configured
-/*     for the \fBfast flush\fR service support as described in
-/*     \fBflushd\fR(8).  For other sites, use the slower \fBsendmail -q\fR
-/*     command instead.
+/*     This functionality is available only for sites that have a so-called
+/*     \fBfast flush\fR logfile as described in \fBflushd\fR(8).  For other 
+/*     sites, use the slower \fBsendmail -q\fR command instead.
 /* .IP \fB-qS\fIsite\fR
 /*     This command is not implemented. Use the slower \fBsendmail -q\fR
 /*     command instead.
 /*     List of domain or network patterns. When a remote host matches
 /*     a pattern, increase the verbose logging level by the amount
 /*     specified in the \fBdebug_peer_level\fR parameter.
-/* .IP \fBetrn_maps\fR
-/*     Tables that specify what domains have \fBETRN\fR service.  For each
-/*     table entry, the left-hand side specifies a destination domain name
-/*     that can be specified in an \fBETRN\fR request, and the right-hand
-/*     side specifies a list of access restrictions for SMTP clients that
-/*     issue \fBETRN\fR for the domain.
-/* .IP \fBfast_flush_maps\fR
-/*     The table with names of destinations that this MTA provides the
-/*     fast flush service for. By default, this is set to $\fBetrn_maps\fR.
 /* .IP \fBfork_attempts\fR
 /*     Number of attempts to \fBfork\fR() a process before giving up.
 /* .IP \fBfork_delay\fR
 #include <tok822.h>
 #include <mail_flush.h>
 #include <mail_stream.h>
-#include <sys_exits.h>
 
 /* Application-specific. */
 
@@ -580,7 +569,7 @@ static void flush_site(const char *site)
     case FLUSH_STAT_OK:
        break;
     case FLUSH_STAT_UNKNOWN:
-       msg_fatal("No \"sendmail -qR\" support is configured for %s", site);
+       msg_fatal("No \"sendmail -qR\" support available for %s - use \"sendmail -q\" instead", site);
        break;
     case FLUSH_STAT_BAD:
        msg_fatal("invalid request: %s", site);
index 90e00398a9ddc91ef5bd0e0016d6940bfcb70b1d..ef52089c64fd8538664b65cecf7e3081ba036470 100644 (file)
@@ -20,7 +20,7 @@
 /*     system is not running.
 /*
 /*     The SMTP server implements a variety of policies for connection
-/*     requests, and for parameters given to \fBHELO, ETRN, MAIL FROM, VRFY\fR,
+/*     requests, and for parameters given to \fBHELO, ETRN, MAIL FROM, VRFY\fR
 /*     and \fBRCPT TO\fR commands. They are detailed below and in the
 /*     \fBmain.cf\fR configuration file.
 /* SECURITY
 /*     List of domain or network patterns. When a remote host matches
 /*     a pattern, increase the verbose logging level by the amount
 /*     specified in the \fBdebug_peer_level\fR parameter.
+/* .IP \fBenable_fast_flush\fR
+/*     Enable the "fast flush" cache for improved ETRN performance.
+/*     By default, Postfix attempts to deliver all messages in the queue
+/*     after receiving an ETRN command.
+/*     The "fast flush" cache keeps a record of what mail is queued up for
+/*     specific destinations.
+/*     Currently, "fast flush" support is available only for destinations
+/*      that the local MTA is willing to relay mail to (i.e. the policy
+/*     is hard coded).
 /* .IP \fBerror_notice_recipient\fR
 /*     Recipient of protocol/policy/resource/software error notices.
-/* .IP \fBetrn_maps\fR
-/*     Tables that specify what domains have \fBETRN\fR service. For
-/*     each table entry, the left-hand side specifies a destination
-/*     domain name that can be specified in an \fBETRN\fR request, and
-/*     the right-hand side specifies a list of access restrictions for
-/*     clients that issue \fBETRN\fR for the domain.
 /* .IP \fBhopcount_limit\fR
 /*     Limit the number of \fBReceived:\fR message headers.
 /* .IP \fBlocal_recipient_maps\fR
 /*     Limit the number of times a client can issue a junk command
 /*     such as NOOP, VRFY, ETRN or RSET in one SMTP session before
 /*     it is penalized with tarpit delays.
+/* .SH "ETRN service"
+/* .ad
+/* .fi
+/* .IP \fBsmtpd_etrn_restrictions\fR
+/*     Restrict what domain names can be used in \fBETRN\fR commands,
+/*     and what clients may issue \fBETRN\fR commands. The restrictions
+/*     are like the UCE restrictions below. Fast \fBETRN\fR service is
+/*     limited to destinations that list this MTA as mail exchanger.
 /* .SH "UCE control restrictions"
 /* .ad
 /* .fi
@@ -344,7 +355,6 @@ bool    var_smtpd_sasl_enable;
 char   *var_smtpd_sasl_opts;
 char   *var_smtpd_sasl_realm;
 char   *var_filter_xport;
-char   *var_fflush_maps;
 
  /*
   * Global state, for stand-alone mode queue file cleanup. When this is
@@ -529,21 +539,7 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg,
      */
     if (msg_verbose)
        msg_info("%s: input: %s", myname, STR(arg->vstrval));
-
-    /*
-     * Workaround: Sendmail allows arbitrary nesting of <>, so that overpaid
-     * peecee programmers can get away with monstrosities such as <the dude
-     * <dude@site>>. By peeling off the outermost <> we can deal with the
-     * most common problem instance. Don't destroy the input so that we can
-     * provide accurate diagnostics.
-     */
-    if (arg->strval[0] == '<' && vstring_end(arg->vstrval)[-1] == '>') {
-       vstring_end(arg->vstrval)[-1] = 0;
-       tree = tok822_parse(STR(arg->vstrval) + 1);
-       vstring_end(arg->vstrval)[-1] = '>';
-    } else {
-       tree = tok822_parse(STR(arg->vstrval));
-    }
+    tree = tok822_parse(STR(arg->vstrval));
 
     /*
      * Find trouble.
@@ -1065,6 +1061,7 @@ static int vrfy_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
 
 static int etrn_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
 {
+    VSTREAM *fp;
     char   *err;
 
     /*
@@ -1092,6 +1089,10 @@ static int etrn_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
        smtpd_chat_reply(state, "501 Error: invalid parameter syntax");
        return (-1);
     }
+    if (SMTPD_STAND_ALONE(state)) {
+       smtpd_chat_reply(state, "458 Unable to queue messages");
+       return (-1);
+    }
 
     /*
      * XXX The implementation borrows heavily from the code that implements
@@ -1099,20 +1100,47 @@ static int etrn_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
      * rejected. RFC 1985 requires that 459 be sent when the server refuses
      * to perform the request.
      */
-    if (SMTPD_STAND_ALONE(state) == 0
-       && (err = smtpd_check_etrn(state, argv[1].strval)) != 0) {
+    if ((err = smtpd_check_etrn(state, argv[1].strval)) != 0) {
        smtpd_chat_reply(state, "%s", err);
        return (-1);
     }
+    if (!var_enable_fflush) {
+       mail_flush_deferred();
+       smtpd_chat_reply(state, "250 Queuing started");
+       return (0);
+    }
 
     /*
-     * XXX The preliminary implementation causes a full deferred queue scan.
+     * Create a fast ETRN cache file on the fly for an eligible site.
      */
-    if (mail_flush_site(argv[1].strval) != 0)
-       smtpd_chat_reply(state, "458 Unable to queue messages");
-    else
+    switch (mail_flush_site(argv[1].strval)) {
+    case FLUSH_STAT_UNKNOWN:
+       if (smtpd_check_etrn_cache_policy_ok(state, argv[1].strval)) {
+           if ((fp = mail_queue_open(MAIL_QUEUE_FLUSH, argv[1].strval,
+                              O_CREAT | O_APPEND | O_WRONLY, 0600)) == 0) {
+               msg_warn("create fast ETRN cache for %s: %m", argv[1].strval);
+           } else {
+               vstream_fclose(fp);
+               msg_info("created fast ETRN cache for %s (client=%s)",
+                        argv[1].strval, state->namaddr);
+           }
+       } else {
+           msg_info("refused fast ETRN service for %s (client=%s)",
+                    argv[1].strval, state->namaddr);
+       }
+       /* Fallthrough. */
+    case FLUSH_STAT_FAIL:
+       mail_flush_deferred();
+       /* Fallthrough. */
+    case FLUSH_STAT_OK:
        smtpd_chat_reply(state, "250 Queuing started");
-    return (0);
+       return (0);
+    default:
+       smtpd_chat_reply(state, "458 Unable to queue messages");
+       msg_warn("bad ETRN destination %.100s... from %s",
+                argv[1].strval, state->namaddr);
+       return (-1);
+    }
 }
 
 /* quit_cmd - process QUIT command */
@@ -1462,7 +1490,6 @@ int     main(int argc, char **argv)
        VAR_SMTPD_SASL_OPTS, DEF_SMTPD_SASL_OPTS, &var_smtpd_sasl_opts, 0, 0,
        VAR_SMTPD_SASL_REALM, DEF_SMTPD_SASL_REALM, &var_smtpd_sasl_realm, 1, 0,
        VAR_FILTER_XPORT, DEF_FILTER_XPORT, &var_filter_xport, 0, 0,
-       VAR_FFLUSH_MAPS, DEF_FFLUSH_MAPS, &var_fflush_maps, 0, 0,
        0,
     };
 
index d0d847a2d5fefd2efab5fb799389cb090ff6683a..8745857f5a84d6dd3d210e454a5766295c81c6ee 100644 (file)
 /*     SMTPD_STATE *state;
 /*     char    *recipient;
 /*
-/*     char    *smtpd_check_etrn(state, recipient)
+/*     char    *smtpd_check_etrn(state, destination)
 /*     SMTPD_STATE *state;
-/*     char    *recipient;
+/*     char    *destination;
+/*
+/*     int     smtpd_check_etrn_cache_policy_ok(state, destination)
+/*     SMTPD_STATE *state;
+/*     char    *destination;
 /* DESCRIPTION
 /*     This module implements additional checks on SMTP client requests.
 /*     A client request is validated in the context of the session state.
@@ -81,9 +85,6 @@
 /* .IP "check_recipient_access maptype:mapname"
 /*     Look up the resolved recipient address in the named access table,
 /*     any parent domains of the recipient domain, and the localpart@.
-/* .IP "check_etrn_access maptype:mapname"
-/*     Look up the client hostname or IP address in the named access table.
-/*     This table is used for ETRN command access control only.
 /* .IP reject_maps_rbl
 /*     Look up the reversed client network address in the real-time blackhole
 /*     DNS zones below the domains listed in the "maps_rbl_domains"
 /*     smtpd_check_etrn() validates the domain name provided with the
 /*     ETRN command, and other client-provided information. Relevant
 /*     configuration parameters:
+/* .IP smtpd_etrn_restrictions
+/*     Restrictions on the hostname that is sent with the HELO/EHLO
+/*     command.
 /* .PP
+/*     smtpd_check_etrn_cache_policy_ok() returns "true" if it is OK to
+/*     create a fast ETRN cache file for the specified destination.
+/*     Currently, the hard-coded policy is that the local MTA must be
+/*     is willing to relay mail to that destination.
+/*
 /*     smtpd_check_size() checks if a message with the given size can
 /*     be received (zero means that the message size is unknown).  The
 /*     message is rejected when:
@@ -313,7 +322,6 @@ static MAPS *rcpt_canon_maps;
 static MAPS *canonical_maps;
 static MAPS *virtual_maps;
 static MAPS *relocated_maps;
-static MAPS *fflush_maps;
 
  /*
   * Pre-opened access control lists.
@@ -328,6 +336,7 @@ static ARGV *client_restrctions;
 static ARGV *helo_restrctions;
 static ARGV *mail_restrctions;
 static ARGV *rcpt_restrctions;
+static ARGV *etrn_restrctions;
 
 static HTABLE *smtpd_rest_classes;
 
@@ -458,8 +467,6 @@ void    smtpd_check_init(void)
                               DICT_FLAG_LOCK);
     relocated_maps = maps_create(VAR_RELOCATED_MAPS, var_relocated_maps,
                                 DICT_FLAG_LOCK);
-    fflush_maps = maps_create(VAR_FFLUSH_MAPS, var_fflush_maps,
-                             DICT_FLAG_LOCK);
 
     /*
      * Reply is used as a cache for resolved addresses, and error_text is
@@ -477,6 +484,7 @@ void    smtpd_check_init(void)
     helo_restrctions = smtpd_check_parse(var_helo_checks);
     mail_restrctions = smtpd_check_parse(var_mail_checks);
     rcpt_restrctions = smtpd_check_parse(var_rcpt_checks);
+    etrn_restrctions = smtpd_check_parse(var_etrn_checks);
 
     /*
      * Parse the pre-defined restriction classes.
@@ -906,7 +914,7 @@ static int has_my_addr(char *host)
        msg_info("%s: host %s", myname, host);
 
     /*
-     * If we can't lookup the host, play safe and assume it is OK.
+     * If we can't lookup the host, say we're not listed.
      */
 #define YUP    1
 #define NOPE   0
@@ -914,12 +922,12 @@ static int has_my_addr(char *host)
     if ((hp = gethostbyname(host)) == 0) {
        if (msg_verbose)
            msg_info("%s: host %s: not found", myname, host);
-       return (YUP);
+       return (NOPE);
     }
     if (hp->h_addrtype != AF_INET || hp->h_length != sizeof(addr)) {
        msg_warn("address type %d length %d for %s",
                 hp->h_addrtype, hp->h_length, host);
-       return (YUP);
+       return (NOPE);
     }
     for (cpp = hp->h_addr_list; *cpp; cpp++) {
        memcpy((char *) &addr, *cpp, sizeof(addr));
@@ -1880,8 +1888,6 @@ char   *smtpd_check_etrn(SMTPD_STATE *state, char *domain)
     int     status;
     char   *saved_etrn_name;
     char   *err;
-    const char *pattern;
-    ARGV   *restrictions;
 
     /*
      * Initialize.
@@ -1909,32 +1915,41 @@ char   *smtpd_check_etrn(SMTPD_STATE *state, char *domain)
            SMTPD_CHECK_ETRN_RETURN(err);
 
     /*
-     * Apply restrictions in the order as specified. If the domain is not
-     * configured for ETRN, reject the request.
+     * Apply restrictions in the order as specified.
      */
-    if (*var_fflush_maps == 0
-       || (pattern = maps_find(fflush_maps, domain, 0)) == 0) {
-       status = smtpd_check_reject(state, MAIL_ERROR_POLICY,
-                                   "458 Unable to start queueing for %s",
-                                   domain);
-    } else if (strchr(pattern, ':') != 0) {
-       msg_warn("A fast flush map has an entry with lookup table: %s",
-                pattern);
-       msg_warn("do not specify lookup tables inside fast flush maps");
-       msg_warn("define a restriction class and specify its name instead");
-       status = SMTPD_CHECK_DUNNO;
-    } else {
-       restrictions = argv_split(pattern, " \t\r\n");
-       state->recursion = 0;
-       status = setjmp(smtpd_check_buf);
-       if (status == 0)
-           status = generic_checks(state, restrictions, domain,
-                                   SMTPD_NAME_ETRN, CHECK_ETRN_ACL);
-       argv_free(restrictions);
-    }
+    state->recursion = 0;
+    status = setjmp(smtpd_check_buf);
+    if (status == 0 && etrn_restrctions->argc)
+       status = generic_checks(state, etrn_restrctions, domain,
+                               SMTPD_NAME_ETRN, CHECK_ETRN_ACL);
+
     SMTPD_CHECK_ETRN_RETURN(status == SMTPD_CHECK_REJECT ? STR(error_text) : 0);
 }
 
+/* smtpd_check_etrn_cache_policy_ok - is it OK to create a fast ETRN cache? */
+
+int     smtpd_check_etrn_cache_policy_ok(SMTPD_STATE *unused_state, char *domain)
+{
+
+    /*
+     * The domain name must be an authorized relay destination.
+     */
+    if (domain_list_match(relay_domains, domain) == 0)
+       return (0);
+
+    /*
+     * The domain name must exist.
+     */
+    if (dns_lookup_types(domain, 0, (DNS_RR **) 0, (VSTRING *) 0,
+                        (VSTRING *) 0, T_A, T_MX, 0) != DNS_OK)
+       return (0);
+
+    /*
+     * Must be OK then.
+     */
+    return (1);
+}
+
 /* smtpd_check_rcptmap - permit if recipient address matches lookup table */
 
 char   *smtpd_check_rcptmap(SMTPD_STATE *state, char *recipient)
@@ -2226,6 +2241,7 @@ static REST_TABLE rest_table[] = {
     "helo_restrictions", &helo_restrctions,
     "sender_restrictions", &mail_restrctions,
     "recipient_restrictions", &rcpt_restrctions,
+    "etrn_restrictions", &etrn_restrctions,
     0,
 };
 
index 00f923a8fdec77144a4d3c08d7f894227aaf09d5..e28c4421d42008ae7f62aa881579b51b051d8cee 100644 (file)
@@ -20,6 +20,7 @@ extern char *smtpd_check_rcptmap(SMTPD_STATE *, char *);
 extern char *smtpd_check_size(SMTPD_STATE *, off_t);
 extern char *smtpd_check_rcpt(SMTPD_STATE *, char *);
 extern char *smtpd_check_etrn(SMTPD_STATE *, char *);
+extern int smtpd_check_etrn_cache_policy_ok(SMTPD_STATE *, char *);
 
 /* LICENSE
 /* .ad