]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.2-20041207
authorWietse Venema <wietse@porcupine.org>
Tue, 7 Dec 2004 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:30:14 +0000 (06:30 +0000)
38 files changed:
postfix/HISTORY
postfix/conf/master.cf
postfix/html/anvil.8.html
postfix/html/master.5.html
postfix/html/oqmgr.8.html
postfix/html/postalias.1.html
postfix/html/postconf.5.html
postfix/html/postmap.1.html
postfix/html/qmgr.8.html
postfix/html/smtpd.8.html
postfix/man/man1/postalias.1
postfix/man/man1/postmap.1
postfix/man/man5/master.5
postfix/man/man5/postconf.5
postfix/man/man8/anvil.8
postfix/man/man8/oqmgr.8
postfix/man/man8/qmgr.8
postfix/man/man8/smtpd.8
postfix/mantools/postconf2man
postfix/mantools/postlink
postfix/proto/master
postfix/proto/postconf.proto
postfix/src/anvil/anvil.c
postfix/src/global/anvil_clnt.c
postfix/src/global/mail_copy.c
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/global/verify_clnt.c
postfix/src/lmtp/lmtp_proto.c
postfix/src/local/forward.c
postfix/src/oqmgr/qmgr.c
postfix/src/postalias/postalias.c
postfix/src/postmap/postmap.c
postfix/src/qmgr/qmgr.c
postfix/src/smtp/smtp_proto.c
postfix/src/smtpd/smtpd.c
postfix/src/util/dict_open.c
postfix/src/verify/verify.c

index 3217de6ca5419280d9e18c056fcab302127de295..5b207bc8e847c0bd18ebbc8f0a159c68a529a470 100644 (file)
@@ -9880,8 +9880,20 @@ Apologies for any names omitted.
        Victor Duchovni for Solaris 2.5.1, but we play safe and
        enable it unconditionally.
 
+20041124
+
+       Feature: configurable list of forbidden SMTP commands
+       (default: smtpd_forbidden_commands = CONNECT, GET, POST)
+       after which the Postfix SMTP server disconnects immediately.
+       The SMTP server always disconnects immediately when the
+       client sends a message header instead of an SMTP command.
+       Magnus Baeck.  File: smtpd/smtpd.c.
+
 Open problems:
 
+       Med: implement ${name[?:]value} in main.cf or update the
+       postconf(5) manual.
+
        Low: reject HELO with any domain name or IP address that
        this MTA is the final destination for.
 
index 9ef138535e992b3f07615dee48750bfd91063ca5..474dac5db570e8d5a18b385a3dc95d789199c6c5 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Postfix master process configuration file.  For details on the format
-# of the file, see master(5).
+# of the file, see the Postfix master(5) manual page.
 #
 # ==========================================================================
 # service type  private unpriv  chroot  wakeup  maxproc command + args
index 4446dce87ff9e7bc5aef505bbbecc92a4342306d..230934bf251436cc204705c59da6feded787a58f 100644 (file)
@@ -7,7 +7,7 @@
 ANVIL(8)                                                 ANVIL(8)
 
 <b>NAME</b>
-       anvil - Postfix per-client count and rate control
+       anvil - Postfix session count and request rate control
 
 <b>SYNOPSIS</b>
        <b>anvil</b> [generic Postfix daemon options]
@@ -15,10 +15,10 @@ ANVIL(8)                                                 ANVIL(8)
 <b>DESCRIPTION</b>
        The  Postfix  <b>anvil</b> server maintains short-term statistics
        to defend against clients that hammer a server with either
-       too  many parallel connections or with too many successive
-       requests within a configurable time interval.  This server
-       is  designed  to  run  under control by the Postfix master
-       server.
+       too  many  simultaneous sessions, or with too many succes-
+       sive requests within a configurable time  interval.   This
+       server  is  designed  to  run under control by the Postfix
+       master server.
 
        The <b>anvil</b> server maintains no persistent  database.  Stan-
        dard library utilities do not meet Postfix performance and
index 77911f3e5d1588539c3a59e9c583e09c0a167013..67e2b0e20543bce8e88827198964efa45bcb240b 100644 (file)
@@ -65,7 +65,7 @@ MASTER(5)                                               MASTER(5)
               Specify one of the following service types:
 
               <b>inet</b>   The service listens on a TCP/IP  socket  and
-                     is therefore accessible via the network.
+                     is accessible via the network.
 
                      The  service name is specified as <i>host:port</i>,
                      denoting the host and port on which new con-
@@ -75,10 +75,10 @@ MASTER(5)                                               MASTER(5)
                      service name) or in numeric form (IP address
                      or port number).
 
-                     Examples:  a service name of  <b>127.0.0.1:smtp</b>
+                     Examples:  a  service  named  <b>127.0.0.1:smtp</b>
                      receives mail  via  the  loopback  interface
-                     only;  and  a  service name of <b>10025</b> accepts
-                     connections on TCP port 10025 via all inter-
+                     only; and a service named <b>10025</b> accepts con-
+                     nections on TCP port 10025  via  all  inter-
                      faces  configured  with  the <b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b>
                      parameter.
 
@@ -133,11 +133,11 @@ MASTER(5)                                               MASTER(5)
               machine,  and  <a href="BASIC_CONFIGURATION_README.html">BASIC_CONFIGURATION_README</a> discusses
               issues related to running daemons chrooted.
 
-       <b>Wakeup time (default: 0)</b>
+       <b>Wake up time (default: 0)</b>
               Automatically wake up the named service  after  the
               specified  number of seconds. The wake up is imple-
               mented by connecting to the service and  sending  a
-              wake  up  request.   A  ? at the end of the wake up
+              wake  up  request.   A  ? at the end of the wake-up
               time field requests that wake  up  events  be  sent
               only  to  services  that  are  actually being used.
               Specify 0 for no automatic wake up.
index 5cb185143fa9064215aef19760745fd2d6f985b6..68709fead8eb07bb442a24ccafeddb59d1befb2e 100644 (file)
@@ -175,8 +175,8 @@ OQMGR(8)                                                 OQMGR(8)
 
 <b>CONFIGURATION PARAMETERS</b>
        Changes to <b>main.cf</b> are not  picked  up  automatically,  as
-       <a href="qmgr.8.html">oqmgr(8)</a>  processes are persistent. Use the command "<b>post-</b>
-       <b>fix reload</b>" after a configuration change.
+       <a href="qmgr.8.html">oqmgr(8)</a> is a persistent process. Use the command "<b>postfix</b>
+       <b>reload</b>" after a configuration change.
 
        The text below provides  only  a  parameter  summary.  See
        <a href="postconf.5.html">postconf(5)</a> for more details including examples.
index b7a25a69b501a527483224592d7864417c79feb8..90b821025787dc8449e6b0d28682c4c28ea51acc 100644 (file)
@@ -87,15 +87,17 @@ POSTALIAS(1)                                         POSTALIAS(1)
               that was found. The exit status  is  zero  when  at
               least one of the requested keys was found.
 
-       <b>-r</b>     When  updating a table, do not warn about duplicate
-              entries; silently replace them.
+       <b>-r</b>     When  updating  a  table,  do  not  complain  about
+              attempts to update existing entries, and make those
+              updates anyway.
 
        <b>-v</b>     Enable verbose logging for debugging purposes. Mul-
-              tiple  <b>-v</b>  options  make  the software increasingly
+              tiple <b>-v</b> options  make  the  software  increasingly
               verbose.
 
-       <b>-w</b>     When updating a table, do not warn about  duplicate
-              entries; silently ignore them.
+       <b>-w</b>     When  updating  a  table,  do  not  complain  about
+              attempts to update  existing  entries,  and  ignore
+              those attempts.
 
        Arguments:
 
index e058eaf8073be64ef51c7b28c3f868de681c01c0..d4b4f2afc592588f998a9bb1badd0d54056aa4d3 100644 (file)
@@ -6776,6 +6776,24 @@ This feature is available in Postfix 2.0 and later.
 </p>
 
 
+</DD>
+
+<DT><b><a name="smtpd_forbidden_commands">smtpd_forbidden_commands</a>
+(default: CONNECT, GET, POST)</b></DT><DD>
+
+<p>
+List of commands that causes the Postfix SMTP server to immediately
+terminate the session with a 221 code. This can be used to disconnect
+clients that obviously attempt to abuse the system. In addition to the
+commands listed in this parameter, commands that follow the "Label:"
+format of message headers will also cause a disconnect.
+</p>
+
+<p>
+This feature is available in Postfix 2.2 and later.
+</p>
+
+
 </DD>
 
 <DT><b><a name="smtpd_hard_error_limit">smtpd_hard_error_limit</a>
index 93c11d520bf4de3fd06e9c86742ffb4be75f68de..1bbe2b48b1c8181ec55c0de045a8ba0f2176f480 100644 (file)
@@ -105,15 +105,17 @@ POSTMAP(1)                                             POSTMAP(1)
               that was found. The exit status  is  zero  when  at
               least one of the requested keys was found.
 
-       <b>-r</b>     When  updating a table, do not warn about duplicate
-              entries; silently replace them.
+       <b>-r</b>     When  updating  a  table,  do  not  complain  about
+              attempts to update existing entries, and make those
+              updates anyway.
 
        <b>-v</b>     Enable verbose logging for debugging purposes. Mul-
-              tiple  <b>-v</b>  options  make  the software increasingly
+              tiple <b>-v</b> options  make  the  software  increasingly
               verbose.
 
-       <b>-w</b>     When updating a table, do not warn about  duplicate
-              entries; silently ignore them.
+       <b>-w</b>     When  updating  a  table,  do  not  complain  about
+              attempts to update  existing  entries,  and  ignore
+              those attempts.
 
        Arguments:
 
index 91c289655a802310ebd185a09055609d188a4046..a152608201214f28d1556ab466e289a6fb49a74a 100644 (file)
@@ -180,7 +180,7 @@ QMGR(8)                                                   QMGR(8)
 
 <b>CONFIGURATION PARAMETERS</b>
        Changes to <b>main.cf</b> are  not  picked  up  automatically  as
-       <a href="qmgr.8.html">qmgr(8)</a>  processes  are persistent. Use the <b>postfix reload</b>
+       <a href="qmgr.8.html">qmgr(8)</a>  is  a  persistent process. Use the <b>postfix reload</b>
        command after a configuration change.
 
        The text below provides  only  a  parameter  summary.  See
index 047ff5faf9c4d8b6b38431e05151a12d34c58120..b02b18f8fc19cbc8054a90312c4e937425618e53 100644 (file)
@@ -780,8 +780,15 @@ SMTPD(8)                                                 SMTPD(8)
               cess  name  in  syslog  records,  so  that  "smtpd"
               becomes, for example, "postfix/smtpd".
 
+       Available in Postfix version 2.2 and later:
+
+       <b><a href="postconf.5.html#smtpd_forbidden_commands">smtpd_forbidden_commands</a> (CONNECT, GET, POST)</b>
+              List  of  commands  that  causes  the  Postfix SMTP
+              server to immediately terminate the session with  a
+              221 code.
+
 <b>SEE ALSO</b>
-       <a href="anvil.8.html">anvil(8)</a>, client count and request rate management
+       <a href="anvil.8.html">anvil(8)</a>, connection/rate limiting
        <a href="cleanup.8.html">cleanup(8)</a>, message canonicalization
        <a href="trivial-rewrite.8.html">trivial-rewrite(8)</a>, address resolver
        <a href="verify.8.html">verify(8)</a>, address verification service
index bd34689dc12a3f91c4e962aa59b36565275fa106..9cc04b80922e807f599bcad34d4a9604b5c9237b 100644 (file)
@@ -75,14 +75,14 @@ values from the standard input stream and writes one line of
 \fIkey: value\fR output for each key that was found. The exit
 status is zero when at least one of the requested keys was found.
 .IP \fB-r\fR
-When updating a table, do not warn about duplicate entries; silently
-replace them.
+When updating a table, do not complain about attempts to update
+existing entries, and make those updates anyway.
 .IP \fB-v\fR
 Enable verbose logging for debugging purposes. Multiple \fB-v\fR
 options make the software increasingly verbose.
 .IP \fB-w\fR
-When updating a table, do not warn about duplicate entries; silently
-ignore them.
+When updating a table, do not complain about attempts to update
+existing entries, and ignore those attempts.
 .PP
 Arguments:
 .IP \fIfile_type\fR
index 9a87136c81bd459deca92a14b390d1e1429db427..c1a8e7bad784d315cfbbab394af0759bc569f93b 100644 (file)
@@ -100,14 +100,14 @@ values from the standard input stream and writes one line of
 \fIkey value\fR output for each key that was found. The exit
 status is zero when at least one of the requested keys was found.
 .IP \fB-r\fR
-When updating a table, do not warn about duplicate entries; silently
-replace them.
+When updating a table, do not complain about attempts to update
+existing entries, and make those updates anyway.
 .IP \fB-v\fR
 Enable verbose logging for debugging purposes. Multiple \fB-v\fR
 options make the software increasingly verbose.
 .IP \fB-w\fR
-When updating a table, do not warn about duplicate entries; silently
-ignore them.
+When updating a table, do not complain about attempts to update
+existing entries, and ignore those attempts.
 .PP
 Arguments:
 .IP \fIfile_type\fR
index 925a09e27b87d6a3a325cedf13d0a050f06f93fb..6e251d80d9643064b174046b5ff4e7ad359f7ee3 100644 (file)
@@ -61,8 +61,8 @@ described next.
 Specify one of the following service types:
 .RS
 .IP \fBinet\fR
-The service listens on a TCP/IP socket and is therefore
-accessible via the network.
+The service listens on a TCP/IP socket and is accessible
+via the network.
 
 The service name is specified as \fIhost:port\fR, denoting
 the host and port on which new connections should be
@@ -70,9 +70,9 @@ accepted. The host part (and colon) may be omitted.  Either
 host or port may be given in symbolic form (host or service
 name) or in numeric form (IP address or port number).
 .sp
-Examples: a service name of  \fB127.0.0.1:smtp\fR receives
-mail via the loopback interface only; and a service name
-of \fB10025\fR accepts connections on TCP port 10025 via
+Examples: a service named \fB127.0.0.1:smtp\fR receives
+mail via the loopback interface only; and a service named
+\fB10025\fR accepts connections on TCP port 10025 via
 all interfaces configured with the \fBinet_interfaces\fR
 parameter.
 .IP \fBunix\fR
@@ -120,11 +120,11 @@ Postfix source archive describe how to set up a Postfix
 chroot environment for your type of machine, and
 BASIC_CONFIGURATION_README discusses issues related to
 running daemons chrooted.
-.IP "\fBWakeup time (default: 0)\fR"
+.IP "\fBWake up time (default: 0)\fR"
 Automatically wake up the named service after the specified
 number of seconds. The wake up is implemented by connecting
 to the service and sending a wake up request.  A ? at the
-end of the wake up time field requests that wake up events
+end of the wake-up time field requests that wake up events
 be sent only to services that are actually being used.
 Specify 0 for no automatic wake up.
 .sp
index 90ffcaadb2ca62dbd32189a15aee2c55d00e14bf..d741406db774489194a7b806764714c939e598a9 100644 (file)
@@ -455,7 +455,7 @@ and changed the default to none.
 Specify a list of network/netmask patterns, separated by commas
 and/or whitespace. The mask specifies the number of bits in the
 network part of a host address. You can also specify hostnames or
-.domain names (the initial dot causes the domain to match any name
+\&.domain names (the initial dot causes the domain to match any name
 below it),  "/file/name" or "type:table" patterns.  A "/file/name"
 pattern is replaced by its contents; a "type:table" lookup table
 is matched when a table entry matches a lookup string (the lookup
@@ -3285,7 +3285,7 @@ is backwards compatible with Postfix 2.0.
 Specify a list of network/netmask patterns, separated by commas
 and/or whitespace. The mask specifies the number of bits in the
 network part of a host address. You can also specify hostnames or
-.domain names (the initial dot causes the domain to match any name
+\&.domain names (the initial dot causes the domain to match any name
 below it),  "/file/name" or "type:table" patterns.  A "/file/name"
 pattern is replaced by its contents; a "type:table" lookup table
 is matched when a table entry matches a lookup string (the lookup
@@ -3305,7 +3305,7 @@ By default, no clients are allowed to specify XCLIENT.
 Specify a list of network/netmask patterns, separated by commas
 and/or whitespace. The mask specifies the number of bits in the
 network part of a host address. You can also specify hostnames or
-.domain names (the initial dot causes the domain to match any name
+\&.domain names (the initial dot causes the domain to match any name
 below it),  "/file/name" or "type:table" patterns.  A "/file/name"
 pattern is replaced by its contents; a "type:table" lookup table
 is matched when a table entry matches a lookup string (the lookup
@@ -3324,7 +3324,7 @@ By default, no clients are allowed to specify XFORWARD.
 Specify a list of network/netmask patterns, separated by commas
 and/or whitespace. The mask specifies the number of bits in the
 network part of a host address. You can also specify hostnames or
-.domain names (the initial dot causes the domain to match any name
+\&.domain names (the initial dot causes the domain to match any name
 below it),  "/file/name" or "type:table" patterns.  A "/file/name"
 pattern is replaced by its contents; a "type:table" lookup table
 is matched when a table entry matches a lookup string (the lookup
@@ -3684,6 +3684,14 @@ Use C like escapes to specify special characters such as whitespace.
 This parameter is not subjected to $parameter expansion.
 .PP
 This feature is available in Postfix 2.0 and later.
+.SH smtpd_forbidden_commands (default: CONNECT, GET, POST)
+List of commands that causes the Postfix SMTP server to immediately
+terminate the session with a 221 code. This can be used to disconnect
+clients that obviously attempt to abuse the system. In addition to the
+commands listed in this parameter, commands that follow the "Label:"
+format of message headers will also cause a disconnect.
+.PP
+This feature is available in Postfix 2.2 and later.
 .SH smtpd_hard_error_limit (default: 20)
 The maximal number of errors a remote SMTP client is allowed to
 make without delivering mail. The Postfix SMTP server disconnects
index 7f0b4fd5cddeb9ebf03c9655284178c126751261..be2692165a305ec9e857f9977ce6fac7386296bc 100644 (file)
@@ -4,7 +4,7 @@
 .SH NAME
 anvil
 \-
-Postfix per-client count and rate control
+Postfix session count and request rate control
 .SH "SYNOPSIS"
 .na
 .nf
@@ -14,7 +14,7 @@ Postfix per-client count and rate control
 .fi
 The Postfix \fBanvil\fR server maintains short-term statistics
 to defend against clients that hammer a server with either too
-many parallel connections or with too many successive requests
+many simultaneous sessions, or with too many successive requests
 within a configurable time interval.
 This server is designed to run under control by the Postfix
 master server.
index 2e01bbc50a487697a3020d98e80c06970e9bee9c..fad4bbb24a7a1c908a615c1dcdc1ee9594fc655c 100644 (file)
@@ -166,7 +166,7 @@ inbound mail can negatively impact outbound delivery rates.
 .ad
 .fi
 Changes to \fBmain.cf\fR are not picked up automatically, as oqmgr(8)
-processes are persistent. Use the command "\fBpostfix reload\fR" after
+is a persistent process. Use the command "\fBpostfix reload\fR" after
 a configuration change.
 
 The text below provides only a parameter summary. See
index 561674af9480ad5536325a872d0c8b1ec34067b0..432b1ce6faf8fa17c34d41881b17b49fea120ce0 100644 (file)
@@ -170,7 +170,7 @@ inbound mail can negatively impact outbound delivery rates.
 .ad
 .fi
 Changes to \fBmain.cf\fR are not picked up automatically as qmgr(8)
-processes are persistent. Use the \fBpostfix reload\fR command after
+is a persistent process. Use the \fBpostfix reload\fR command after
 a configuration change.
 
 The text below provides only a parameter summary. See
index 954ac2d95a71d720ccdf5b585c294568ccf5d2c8..a5d7d7c7821a661c6b1ac1d688571e0a7620ee87 100644 (file)
@@ -630,10 +630,15 @@ The syslog facility of Postfix logging.
 .IP "\fBsyslog_name (postfix)\fR"
 The mail system name that is prepended to the process name in syslog
 records, so that "smtpd" becomes, for example, "postfix/smtpd".
+.PP
+Available in Postfix version 2.2 and later:
+.IP "\fBsmtpd_forbidden_commands (CONNECT, GET, POST)\fR"
+List of commands that causes the Postfix SMTP server to immediately
+terminate the session with a 221 code.
 .SH "SEE ALSO"
 .na
 .nf
-anvil(8), client count and request rate management
+anvil(8), connection/rate limiting
 cleanup(8), message canonicalization
 trivial-rewrite(8), address resolver
 verify(8), address verification service
index 9d94c07d1e0989e1d4bb6cefbc285555b7d568cb..f9d32521e8fa6dae0af205bbcf4b27e8cad838e4 100755 (executable)
@@ -31,6 +31,7 @@ while(<>) {
        $block .= $_;
     } while(($_ = <>) && /\S/);
 
+    $block =~ s/\n\./\n\\\&./g;
     if ($block =~ /<H2>/) {
        $block =~ s/<H2><a[^>]+>([^<]+)<\/a><\/H2>/\n.SH \1\n/g;
        $block =~ tr/a-z/A-Z/;
index 662883cd66f57943d4eee8023d6545ddfed3a338..2d277c307018f47e91b9f61fb66a2218c0a90905 100755 (executable)
@@ -370,6 +370,7 @@ while (<>) {
     s;\bsmtpd_error_sleep_time\b;<a href="postconf.5.html#smtpd_error_sleep_time">$&</a>;g;
     s;\bsmtpd_etrn_restrictions\b;<a href="postconf.5.html#smtpd_etrn_restrictions">$&</a>;g;
     s;\bsmtpd_expansion_filter\b;<a href="postconf.5.html#smtpd_expansion_filter">$&</a>;g;
+    s;\bsmtpd_forbidden_commands\b;<a href="postconf.5.html#smtpd_forbidden_commands">$&</a>;g;
     s;\bsmtpd_hard_error_limit\b;<a href="postconf.5.html#smtpd_hard_error_limit">$&</a>;g;
     s;\bsmtpd_helo_required\b;<a href="postconf.5.html#smtpd_helo_required">$&</a>;g;
     s;\bsmtpd_helo_restrictions\b;<a href="postconf.5.html#smtpd_helo_restrictions">$&</a>;g;
index b43c65185eda757c2d2e081ab03d496ecb8cfce2..b317c718fd77a8a0169fd9d41212cf6befd0592f 100644 (file)
@@ -55,8 +55,8 @@
 #      Specify one of the following service types:
 # .RS
 # .IP \fBinet\fR
-#      The service listens on a TCP/IP socket and is therefore
-#      accessible via the network.
+#      The service listens on a TCP/IP socket and is accessible
+#      via the network.
 #
 #      The service name is specified as \fIhost:port\fR, denoting
 #      the host and port on which new connections should be
@@ -64,9 +64,9 @@
 #      host or port may be given in symbolic form (host or service
 #      name) or in numeric form (IP address or port number).
 # .sp
-#      Examples: a service name of  \fB127.0.0.1:smtp\fR receives
-#      mail via the loopback interface only; and a service name
-#      of \fB10025\fR accepts connections on TCP port 10025 via
+#      Examples: a service named \fB127.0.0.1:smtp\fR receives
+#      mail via the loopback interface only; and a service named
+#      \fB10025\fR accepts connections on TCP port 10025 via
 #      all interfaces configured with the \fBinet_interfaces\fR
 #      parameter.
 # .IP \fBunix\fR
 #      chroot environment for your type of machine, and
 #      BASIC_CONFIGURATION_README discusses issues related to
 #      running daemons chrooted.
-# .IP "\fBWakeup time (default: 0)\fR"
+# .IP "\fBWake up time (default: 0)\fR"
 #      Automatically wake up the named service after the specified
 #      number of seconds. The wake up is implemented by connecting
 #      to the service and sending a wake up request.  A ? at the
-#      end of the wake up time field requests that wake up events
+#      end of the wake-up time field requests that wake up events
 #      be sent only to services that are actually being used.
 #      Specify 0 for no automatic wake up.
 # .sp
index f462ac8b169706b957de8a19af571cc894442044..f8ea92d197b8a60e697bd6cf6ca399ca426f80fd 100644 (file)
@@ -4424,6 +4424,20 @@ This parameter is not subjected to $parameter expansion.
 This feature is available in Postfix 2.0 and later.
 </p>
 
+%PARAM smtpd_forbidden_commands CONNECT, GET, POST
+
+<p>
+List of commands that causes the Postfix SMTP server to immediately
+terminate the session with a 221 code. This can be used to disconnect
+clients that obviously attempt to abuse the system. In addition to the
+commands listed in this parameter, commands that follow the "Label:"
+format of message headers will also cause a disconnect.
+</p>
+
+<p>
+This feature is available in Postfix 2.2 and later.
+</p>
+
 %PARAM smtpd_helo_required no
 
 <p>
index 07099543a9936e3db6ae4265f42ae7a88b34ef53..5aa6f35a798f8929180da25da838ed86a2fc0bc8 100644 (file)
@@ -2,13 +2,13 @@
 /* NAME
 /*     anvil 8
 /* SUMMARY
-/*     Postfix per-client count and rate control
+/*     Postfix session count and request rate control
 /* SYNOPSIS
 /*     \fBanvil\fR [generic Postfix daemon options]
 /* DESCRIPTION
 /*     The Postfix \fBanvil\fR server maintains short-term statistics
 /*     to defend against clients that hammer a server with either too
-/*     many parallel connections or with too many successive requests
+/*     many simultaneous sessions, or with too many successive requests
 /*     within a configurable time interval.
 /*     This server is designed to run under control by the Postfix
 /*     master server.
index 5ff7538de41e92714e2880ff79ded7c98174b40e..fcc0c7cdcc154e9e7725ba7a248e32c7d56de3fb 100644 (file)
@@ -91,7 +91,7 @@
 /*     (either the communication with the server is broken or the
 /*     server experienced a problem).
 /* SEE ALSO
-/*     anvil(8) Postfix client rate control service
+/*     anvil(8), connection/rate limiting
 /* LICENSE
 /* .ad
 /* .fi
index 463b5a3632f8e9b820218535aa702322d90a0603..07932828ce3f7787080a7f175c51836c0332e95c 100644 (file)
@@ -213,8 +213,11 @@ int     mail_copy(const char *sender,
     if (vstream_ferror(dst) == 0) {
        if (var_fault_inj_code == 1)
            type = 0;
-       if (type != REC_TYPE_XTRA)
+       if (type != REC_TYPE_XTRA) {
+           /* XXX Where is the queue ID? */
+           msg_warn("bad record type: %d in message content", type);
            corrupt_error = mark_corrupt(src);
+       }
        if (prev_type != REC_TYPE_NORM)
            vstream_fputs(eol, dst);
        if (flags & MAIL_COPY_BLANK)
index 197893f2f12af4caf3e9181708bce0673e00c8ed..13ac64290cb21a73ce5165967599ce8684efd087 100644 (file)
@@ -967,6 +967,10 @@ extern int var_smtpd_hist_thrsh;
 #define DEF_SMTPD_NOOP_CMDS    ""
 extern char *var_smtpd_noop_cmds;
 
+#define VAR_SMTPD_FORBID_CMDS  "smtpd_forbidden_commands"
+#define DEF_SMTPD_FORBID_CMDS  "CONNECT GET POST"
+extern char *var_smtpd_forbid_cmds;
+
  /*
   * SASL authentication support, SMTP server side.
   */
index b79e8a2ac62e01153dcd0107fca263cfdd44a844..4386c68529b284e7c0ad51b705d978f1c9e9279f 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change the patchlevel and the release date. Snapshots change the
   * release date only.
   */
-#define MAIL_RELEASE_DATE      "20041119"
+#define MAIL_RELEASE_DATE      "20041207"
 #define MAIL_VERSION_NUMBER    "2.2"
 
 #define VAR_MAIL_VERSION       "mail_version"
index 6ee65183f110f9e7ab874c407ef8f6f776fe20b2..96fe72415d6f01201962aed0363f9b2a6097e246 100644 (file)
@@ -23,7 +23,7 @@
 /*     va_list ap;
 /* DESCRIPTION
 /*     verify_clnt_query() requests information about the given address.
-/*     The result value is one of the valud status values (see
+/*     The result value is one of the valid status values (see
 /*     status description below).
 /*     In all cases the \fBwhy\fR argument provides additional
 /*     information.
index 94551b3b1fbfa8aaa3a59405c1c2a3416e8e4bda..ebfa6323d7ac50e4163009036f8b76772527b494 100644 (file)
@@ -813,8 +813,11 @@ static int lmtp_loop(LMTP_STATE *state, NOCLOBBER int send_state,
                smtp_fputs("", 0, session->stream);
            if (vstream_ferror(state->src))
                msg_fatal("queue file read error");
-           if (rec_type != REC_TYPE_XTRA)
+           if (rec_type != REC_TYPE_XTRA) {
+               msg_warn("%s: bad record type: %d in message content",
+                        request->queue_id, rec_type);
                RETURN(mark_corrupt(state->src));
+           }
        }
 
        /*
index 8c89aede72eba1669999794d59019417c6dc322f..2e987d9bad4043f8cbd4a87166b1c5fd535f5890 100644 (file)
@@ -251,8 +251,11 @@ static int forward_send(FORWARD_INFO *info, DELIVER_REQUEST *request,
            break;
        status = (REC_PUT_BUF(info->cleanup, rec_type, buffer) != rec_type);
     }
-    if (status == 0 && rec_type != REC_TYPE_XTRA)
+    if (status == 0 && rec_type != REC_TYPE_XTRA) {
+       msg_warn("%s: bad record type: %d in message content",
+                info->queue_id, rec_type);
        status |= mark_corrupt(attr.fp);
+    }
 
     /*
      * Send the end-of-data marker only when there were no errors.
index b3148b034908cb1ffe2327c7e3681a493771a619..6335c8910c92340660f10843fca472f4a8115698 100644 (file)
 /* .ad
 /* .fi
 /*     Changes to \fBmain.cf\fR are not picked up automatically, as qmgr(8)
-/*     processes are persistent. Use the command "\fBpostfix reload\fR" after
+/*     is a persistent process. Use the command "\fBpostfix reload\fR" after
 /*     a configuration change.
 /*
 /*     The text below provides only a parameter summary. See
index 6715d904412948c09473cbea8c27e00a36d7919f..53c26ee762940df237030db187a0c019cb653cae 100644 (file)
 /*     \fIkey: value\fR output for each key that was found. The exit
 /*     status is zero when at least one of the requested keys was found.
 /* .IP \fB-r\fR
-/*     When updating a table, do not warn about duplicate entries; silently
-/*     replace them.
+/*     When updating a table, do not complain about attempts to update
+/*     existing entries, and make those updates anyway.
 /* .IP \fB-v\fR
 /*     Enable verbose logging for debugging purposes. Multiple \fB-v\fR
 /*     options make the software increasingly verbose.
 /* .IP \fB-w\fR
-/*     When updating a table, do not warn about duplicate entries; silently
-/*     ignore them.
+/*     When updating a table, do not complain about attempts to update
+/*     existing entries, and ignore those attempts.
 /* .PP
 /*     Arguments:
 /* .IP \fIfile_type\fR
index e6e6f25658d7d5244c72a950d68772883b986da5..b307721c4f543a8e6addb4914151c105c354cc22 100644 (file)
 /*     \fIkey value\fR output for each key that was found. The exit
 /*     status is zero when at least one of the requested keys was found.
 /* .IP \fB-r\fR
-/*     When updating a table, do not warn about duplicate entries; silently
-/*     replace them.
+/*     When updating a table, do not complain about attempts to update
+/*     existing entries, and make those updates anyway.
 /* .IP \fB-v\fR
 /*     Enable verbose logging for debugging purposes. Multiple \fB-v\fR
 /*     options make the software increasingly verbose.
 /* .IP \fB-w\fR
-/*     When updating a table, do not warn about duplicate entries; silently
-/*     ignore them.
+/*     When updating a table, do not complain about attempts to update
+/*     existing entries, and ignore those attempts.
 /* .PP
 /*     Arguments:
 /* .IP \fIfile_type\fR
index 4444cc58e8f240f899f89401ccc60fb01e34bfdb..f9ef04b35ac9562f12685ae239729cb1164da5a9 100644 (file)
 /* .ad
 /* .fi
 /*     Changes to \fBmain.cf\fR are not picked up automatically as qmgr(8)
-/*     processes are persistent. Use the \fBpostfix reload\fR command after
+/*     is a persistent process. Use the \fBpostfix reload\fR command after
 /*     a configuration change.
 /*
 /*     The text below provides only a parameter summary. See
index 8b05780b1648fbc6413ee16a346e7aa6fcfde286..e90ac709539c972331dc0735c73e4acd96eaa81b 100644 (file)
@@ -1064,13 +1064,16 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state,
                - var_smtp_pix_thresh) {
                msg_info("%s: enabling PIX <CRLF>.<CRLF> workaround for %s",
                         request->queue_id, session->namaddr);
-               vstream_fflush(session->stream);/* hurts performance */
+               smtp_flush(session->stream);    /* hurts performance */
                sleep(var_smtp_pix_delay);      /* not to mention this */
            }
            if (vstream_ferror(state->src))
                msg_fatal("queue file read error");
-           if (rec_type != REC_TYPE_XTRA)
+           if (rec_type != REC_TYPE_XTRA) {
+               msg_warn("%s: bad record type: %d in message content",
+                        request->queue_id, rec_type);
                RETURN(mark_corrupt(state->src));
+           }
        }
 
        /*
index 444d7f8bf6d81204da0d7ed3f2d599579ad29a39..beff18fedcc0539c34fff1717b401d3d350c78a1 100644 (file)
@@ -89,7 +89,7 @@
 /* ADDRESS REWRITING CONTROLS
 /* .ad
 /* .fi
-/*      See the ADDRESS_REWRITING_README document for a detailed
+/*     See the ADDRESS_REWRITING_README document for a detailed
 /*     discussion of Postfix address rewriting.
 /* .IP "\fBreceive_override_options (empty)\fR"
 /*     Enable or disable recipient validation, built-in content
 /* .IP "\fBsyslog_name (postfix)\fR"
 /*     The mail system name that is prepended to the process name in syslog
 /*     records, so that "smtpd" becomes, for example, "postfix/smtpd".
+/* .PP
+/*     Available in Postfix version 2.2 and later:
+/* .IP "\fBsmtpd_forbidden_commands (CONNECT, GET, POST)\fR"
+/*     List of commands that causes the Postfix SMTP server to immediately
+/*     terminate the session with a 221 code.
 /* SEE ALSO
-/*     anvil(8), client count and request rate management
+/*     anvil(8), connection/rate limiting
 /*     cleanup(8), message canonicalization
 /*     trivial-rewrite(8), address resolver
 /*     verify(8), address verification service
 #include <lex_822.h>
 #include <namadr_list.h>
 #include <input_transp.h>
+#include <is_header.h>
 #ifdef SNAPSHOT
 #include <anvil_clnt.h>
 #endif
@@ -788,6 +794,7 @@ char   *var_xclient_hosts;
 char   *var_xforward_hosts;
 bool    var_smtpd_rej_unl_from;
 bool    var_smtpd_rej_unl_rcpt;
+char   *var_smtpd_forbid_cmds;
 
 #ifdef SNAPSHOT
 int     var_smtpd_crate_limit;
@@ -2461,7 +2468,6 @@ typedef struct SMTPD_CMD {
 } SMTPD_CMD;
 
 #define SMTPD_CMD_FLAG_LIMIT    (1<<0) /* limit usage */
-#define SMTPD_CMD_FLAG_FORBID  (1<<1)  /* RFC 2822 mail header */
 
 static SMTPD_CMD smtpd_cmd_table[] = {
     "HELO", helo_cmd, SMTPD_CMD_FLAG_LIMIT,
@@ -2481,17 +2487,11 @@ static SMTPD_CMD smtpd_cmd_table[] = {
     "QUIT", quit_cmd, 0,
     "XCLIENT", xclient_cmd, SMTPD_CMD_FLAG_LIMIT,
     "XFORWARD", xforward_cmd, SMTPD_CMD_FLAG_LIMIT,
-    "Received:", 0, SMTPD_CMD_FLAG_FORBID,
-    "Reply-To:", 0, SMTPD_CMD_FLAG_FORBID,
-    "Message-ID:", 0, SMTPD_CMD_FLAG_FORBID,
-    "Subject:", 0, SMTPD_CMD_FLAG_FORBID,
-    "From:", 0, SMTPD_CMD_FLAG_FORBID,
-    "CONNECT", 0, SMTPD_CMD_FLAG_FORBID,
-    "User-Agent:", 0, SMTPD_CMD_FLAG_FORBID,
     0,
 };
 
 static STRING_LIST *smtpd_noop_cmds;
+static STRING_LIST *smtpd_forbid_cmds;
 
 /* smtpd_proto - talk the SMTP protocol */
 
@@ -2614,17 +2614,19 @@ static void smtpd_proto(SMTPD_STATE *state, const char *service)
                if (strcasecmp(argv[0].strval, cmdp->name) == 0)
                    break;
            if (cmdp->name == 0) {
+               if (is_header(argv[0].strval)
+                   || (*var_smtpd_forbid_cmds
+                && string_list_match(smtpd_forbid_cmds, argv[0].strval))) {
+                   msg_warn("%s sent non-SMTP command: %.100s",
+                            state->namaddr, vstring_str(state->buffer));
+                   smtpd_chat_reply(state, "221 Error: I can break rules, too. Goodbye.");
+                   break;
+               }
                smtpd_chat_reply(state, "502 Error: command not implemented");
                state->error_mask |= MAIL_ERROR_PROTOCOL;
                state->error_count++;
                continue;
            }
-           if (cmdp->flags & SMTPD_CMD_FLAG_FORBID) {
-               msg_warn("%s sent non-SMTP command: %.100s",
-                        state->namaddr, vstring_str(state->buffer));
-               smtpd_chat_reply(state, "221 Error: I can break rules, too. Goodbye.");
-               break;
-           }
            /* XXX We use the real client for connect access control. */
            if (state->access_denied && cmdp->action != quit_cmd) {
                smtpd_chat_reply(state, "503 Error: access denied for %s",
@@ -2766,6 +2768,7 @@ static void pre_jail_init(char *unused_name, char **unused_argv)
      * case they specify a filename pattern.
      */
     smtpd_noop_cmds = string_list_init(MATCH_FLAG_NONE, var_smtpd_noop_cmds);
+    smtpd_forbid_cmds = string_list_init(MATCH_FLAG_NONE, var_smtpd_forbid_cmds);
     verp_clients = namadr_list_init(MATCH_FLAG_NONE, var_verp_clients);
     xclient_hosts = namadr_list_init(MATCH_FLAG_NONE, var_xclient_hosts);
     xforward_hosts = namadr_list_init(MATCH_FLAG_NONE, var_xforward_hosts);
@@ -2918,6 +2921,7 @@ int     main(int argc, char **argv)
        VAR_PERM_MX_NETWORKS, DEF_PERM_MX_NETWORKS, &var_perm_mx_networks, 0, 0,
        VAR_SMTPD_SND_AUTH_MAPS, DEF_SMTPD_SND_AUTH_MAPS, &var_smtpd_snd_auth_maps, 0, 0,
        VAR_SMTPD_NOOP_CMDS, DEF_SMTPD_NOOP_CMDS, &var_smtpd_noop_cmds, 0, 0,
+       VAR_SMTPD_FORBID_CMDS, DEF_SMTPD_FORBID_CMDS, &var_smtpd_forbid_cmds, 0, 0,
        VAR_SMTPD_NULL_KEY, DEF_SMTPD_NULL_KEY, &var_smtpd_null_key, 0, 0,
        VAR_RELAY_RCPT_MAPS, DEF_RELAY_RCPT_MAPS, &var_relay_rcpt_maps, 0, 0,
        VAR_VERIFY_SENDER, DEF_VERIFY_SENDER, &var_verify_sender, 0, 0,
index ec21b8e038939a2430a045157b66d28d8f280297..14ccec5723c29f3cf2775a553cc5fde1540e158e 100644 (file)
@@ -26,7 +26,7 @@
 /*     DICT    *dict;
 /*     const char *key;
 /*
-/*     char    *dict_del(dict, key)
+/*     int     dict_del(dict, key)
 /*     DICT    *dict;
 /*     const char *key;
 /*
 /*     dictionary.
 /*
 /*     dict_del() removes a dictionary entry, and returns non-zero
-/*     in case of problems.
+/*     in case of success.
 /*
 /*     dict_seq() iterates over all members in the named dictionary.
 /*     func is define DICT_SEQ_FUN_FIRST (select first member) or
index 0f4f582871d3abbea8ebde0067243dde3bbd550a..7573422aaea2b1d0094f54180251365208c1203e 100644 (file)
@@ -223,11 +223,11 @@ static DICT *verify_map;
   * In the case of TODO, we have no information about the address, and the
   * address is being probed.
   * 
-  * probed: if non-zero, the time of the last outstanding address probe. If
-  * zero, there is no outstanding address probe.
+  * probed: if non-zero, the time the currently outstanding address probe was
+  * sent. If zero, there is no outstanding address probe.
   * 
-  * updated: if non-zero, the time of the last processed address probe. If zero,
-  * we have no information about the address, and the address is being
+  * updated: if non-zero, the time the address probe result was received. If
+  * zero, we have no information about the address, and the address is being
   * probed.
   * 
   * text: descriptive text from delivery agents etc.
@@ -256,7 +256,10 @@ static int verify_parse_entry(char *buf, int *status, long *probed,
 
     if ((probed_text = split_at(buf, ':')) != 0
        && (updated_text = split_at(probed_text, ':')) != 0
-       && (*text = split_at(updated_text, ':')) != 0) {
+       && (*text = split_at(updated_text, ':')) != 0
+       && alldig(buf)
+       && alldig(probed_text)
+       && alldig(updated_text)) {
        *probed = atol(probed_text);
        *updated = atol(updated_text);
        *status = atoi(buf);