]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-19990407
authorWietse Venema <wietse@porcupine.org>
Wed, 7 Apr 1999 05:00:00 +0000 (00:00 -0500)
committerWietse Venema <wietse@porcupine.org>
Thu, 17 Jan 2013 03:34:07 +0000 (22:34 -0500)
32 files changed:
postfix/HISTORY
postfix/bounce/bounce.c
postfix/bounce/bounce_notify_service.c
postfix/conf/main.cf.default [new file with mode: 0644]
postfix/conf/master.cf
postfix/conf/sample-misc.cf
postfix/conf/sample-smtp.cf
postfix/global/Makefile.in
postfix/global/deliver_pass.c
postfix/global/deliver_pass.h [new file with mode: 0644]
postfix/global/mail_params.h
postfix/global/mail_version.h
postfix/html/bounce.8.html
postfix/html/faq.html
postfix/html/postalias.1.html
postfix/html/postmap.1.html
postfix/html/smtp.8.html
postfix/html/smtpd.8.html
postfix/local/Makefile.in
postfix/local/mailbox.c
postfix/man/man1/postalias.1
postfix/man/man1/postmap.1
postfix/man/man8/bounce.8
postfix/man/man8/smtp.8
postfix/man/man8/smtpd.8
postfix/postconf/Makefile.in
postfix/smtp/Makefile.in
postfix/smtp/smtp.c
postfix/smtp/smtp_addr.c
postfix/smtp/smtp_chat.c
postfix/smtpd/smtpd.c
postfix/smtpd/smtpd_chat.c

index 37978e9afe857a85d482d9df6892f019e72441cf..8928a7d0b975a961aee78a7a0187934c56ae362c 100644 (file)
@@ -2537,7 +2537,23 @@ Apologies for any names omitted.
 19990406
 
        Cleanup: changed MIME header information to make bounces
-       RFC 1892 compliant.
+       more RFC 1892 compliant.
+
+19990407
+
+       Feature: "best_mx_transport = local" delivers mail locally
+       if the local machine is the best mail exchanger (by default,
+       mail is bounced with a "mail loops back to myself" error).
+
+       Config: in order to make feature tracking easier the source
+       code distribution now has a copy of the default settings in
+       conf/main.cf.default.
+
+       Feature: separate configurable postmaster addresses for
+       single bounces (bounce_notice_recipient), double bounces
+       (2bounce_notice_recipient), delayed mail (delay_notice_recipient),
+       and for other mailer errors (error_notice_recipient).  The
+       default for all is "postmaster".
 
 Future:
 
index f550c2190955a631f764925b3b0317c9d3b12df5..8f1300a5362b46ba7d12edef02df3f564f2d18ef 100644 (file)
 /*     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 \fBbounce_notice_recipient\fR
+/*     The recipient of single bounce postmaster notices.
+/* .IP \fB2bounce_notice_recipient\fR
+/*     The recipient of double bounce postmaster notices.
+/* .IP \fBdelay_notice_recipient\fR
+/*     The recipient of "delayed mail" postmaster notices.
 /* .IP \fBbounce_size_limit\fR
 /*     Limit the amount of original message context that is sent in
 /*     a non-delivery notification.
@@ -104,6 +110,9 @@ int     var_bounce_limit;
 int     var_max_queue_time;
 int     var_delay_warn_time;
 char   *var_notify_classes;
+char   *var_bounce_rcpt;
+char   *var_2bounce_rcpt;
+char   *var_delay_rcpt;
 
  /*
   * We're single threaded, so we can avoid some memory allocation overhead.
@@ -276,6 +285,9 @@ int     main(int argc, char **argv)
     };
     static CONFIG_STR_TABLE str_table[] = {
        VAR_NOTIFY_CLASSES, DEF_NOTIFY_CLASSES, &var_notify_classes, 0, 0,
+       VAR_BOUNCE_RCPT, DEF_BOUNCE_RCPT, &var_bounce_rcpt, 1, 0,
+       VAR_2BOUNCE_RCPT, DEF_2BOUNCE_RCPT, &var_2bounce_rcpt, 1, 0,
+       VAR_DELAY_RCPT, DEF_DELAY_RCPT, &var_delay_rcpt, 1, 0,
        0,
     };
 
index 9746a9e3398d10d6d73c470d3de425a2df781373..5b15104fd1209aa2a611e520d992b79a8ff33f81 100644 (file)
@@ -105,11 +105,13 @@ static int bounce_header(VSTREAM *bounce, VSTRING *buf, const char *dest,
                      MAIL_ADDR_MAIL_DAEMON);
 
     if (flush) {
-       post_mail_fputs(bounce, STREQ(dest, mail_addr_postmaster()) ?
+       post_mail_fputs(bounce, dest == var_bounce_rcpt
+                    || dest == var_2bounce_rcpt || dest == var_delay_rcpt ?
                        "Subject: Postmaster Copy: Undelivered Mail" :
                        "Subject: Undelivered Mail Returned to Sender");
     } else {
-       post_mail_fputs(bounce, STREQ(dest, mail_addr_postmaster()) ?
+       post_mail_fputs(bounce, dest == var_bounce_rcpt
+                    || dest == var_2bounce_rcpt || dest == var_delay_rcpt ?
                        "Subject: Postmaster Warning: Delayed Mail" :
                        "Subject: Delayed Mail (still being retried)");
     }
@@ -335,6 +337,7 @@ int     bounce_notify_service(char *service, char *queue_name,
     VSTREAM *bounce;
     int     notify_mask = name_mask(mail_error_masks, var_notify_classes);
     VSTRING *boundary = vstring_alloc(100);
+    char   *postmaster;
 
     /*
      * Unique string for multi-part message boundaries.
@@ -382,8 +385,9 @@ int     bounce_notify_service(char *service, char *queue_name,
        if (SKIP_IF_BOUNCE || SKIP_IF_DELAY) {
            bounce_status = 0;
        } else {
+           postmaster = flush ? var_2bounce_rcpt : var_delay_rcpt;
            if ((bounce = post_mail_fopen_nowait(mail_addr_double_bounce(),
-                                                mail_addr_postmaster(),
+                                                postmaster,
                                                 NULL_CLEANUP_FLAGS,
                                                 "BOUNCE")) != 0) {
 
@@ -393,7 +397,7 @@ int     bounce_notify_service(char *service, char *queue_name,
                 * reason for the bounce, and the headers of the original
                 * message. Don't bother sending the boiler-plate text.
                 */
-               if (!bounce_header(bounce, buf, mail_addr_postmaster(),
+               if (!bounce_header(bounce, buf, postmaster,
                                   STR(boundary), flush)
                    && bounce_diagnostics(service, bounce, buf, queue_id,
                                          STR(boundary)) == 0)
@@ -447,11 +451,12 @@ int     bounce_notify_service(char *service, char *queue_name,
             * don't retransmit the bounce that we just generated, just log a
             * warning.
             */
+           postmaster = flush ? var_bounce_rcpt : var_delay_rcpt;
            if ((bounce = post_mail_fopen_nowait(mail_addr_double_bounce(),
-                                                mail_addr_postmaster(),
+                                                postmaster,
                                                 NULL_CLEANUP_FLAGS,
                                                 "BOUNCE")) != 0) {
-               if (!bounce_header(bounce, buf, mail_addr_postmaster(),
+               if (!bounce_header(bounce, buf, postmaster,
                                   STR(boundary), flush)
                    && bounce_diagnostics(service, bounce, buf,
                                          queue_id, STR(boundary)) == 0)
diff --git a/postfix/conf/main.cf.default b/postfix/conf/main.cf.default
new file mode 100644 (file)
index 0000000..dbb1203
--- /dev/null
@@ -0,0 +1,131 @@
+2bounce_notice_recipient = postmaster
+access_map_reject_code = 550
+alias_database = hash:/etc/aliases
+alias_maps = hash:/etc/aliases
+allow_mail_to_commands = alias,forward
+allow_mail_to_files = alias,forward
+allow_percent_hack = yes
+always_bcc = 
+append_at_myorigin = yes
+append_dot_mydomain = yes
+best_mx_transport = 
+biff = yes
+bounce_notice_recipient = postmaster
+bounce_size_limit = 50000
+canonical_maps = 
+command_directory = $program_directory
+command_time_limit = 1000
+daemon_directory = $program_directory
+daemon_timeout = 18000
+debug_peer_level = 2
+debug_peer_list = 
+default_database_type = hash
+default_destination_concurrency_limit = 10
+default_destination_recipient_limit = 50
+default_privs = nobody
+default_process_limit = 50
+default_transport = smtp
+defer_transports = 
+delay_notice_recipient = postmaster
+delay_warning_time = 0
+deliver_lock_attempts = 5
+deliver_lock_delay = 1
+disable_dns_lookups = no
+dont_remove = 0
+double_bounce_sender = double-bounce
+duplicate_filter_limit = 1000
+empty_address_recipient = MAILER-DAEMON
+error_notice_recipient = postmaster
+fallback_relay = 
+fallback_transport = 
+fork_attempts = 5
+fork_delay = 1
+forward_path = $home/.forward${recipient_delimiter}${extension},$home/.forward
+hash_queue_depth = 2
+hash_queue_names = defer
+header_size_limit = 102400
+home_mailbox = 
+hopcount_limit = 50
+ignore_mx_lookup_error = no
+inet_interfaces = all
+initial_destination_concurrency = 2
+invalid_hostname_reject_code = 501
+ipc_idle = 100
+ipc_timeout = 3600
+line_length_limit = 2048
+local_command_shell = 
+local_destination_concurrency_limit = $default_destination_concurrency_limit
+local_destination_recipient_limit = $default_destination_recipient_limit
+luser_relay = 
+mail_name = Postfix
+mail_owner = postfix
+mail_spool_directory = /var/mail
+mail_version = Snapshot-19990407
+mailbox_command = 
+mailbox_transport = 
+maps_rbl_domains = rbl.maps.vix.com
+maps_rbl_reject_code = 550
+masquerade_domains = 
+masquerade_exceptions = 
+max_idle = 100
+max_use = 100
+maximal_backoff_time = 4000
+maximal_queue_lifetime = 5
+message_size_limit = 10240000
+minimal_backoff_time = 1000
+mydestination = $myhostname, localhost.$mydomain
+myorigin = $myhostname
+non_fqdn_reject_code = 504
+notify_classes = resource,software
+owner_request_special = yes
+process_id_directory = pid
+program_directory = /usr/libexec/postfix
+qmgr_message_active_limit = 1000
+qmgr_message_recipient_limit = 10000
+queue_directory = /var/spool/postfix
+queue_minfree = 0
+queue_run_delay = 1000
+recipient_canonical_maps = 
+recipient_delimiter = 
+recipient_feature_delimiter = 
+reject_code = 550
+relay_domains = $mydestination, $virtual_maps
+relay_domains_reject_code = 550
+relayhost = 
+relocated_maps = 
+sender_canonical_maps = 
+service_throttle_time = 60
+smtp_connect_timeout = 0
+smtp_data_done_timeout = 600
+smtp_data_init_timeout = 120
+smtp_data_xfer_timeout = 180
+smtp_destination_concurrency_limit = $default_destination_concurrency_limit
+smtp_destination_recipient_limit = $default_destination_recipient_limit
+smtp_helo_timeout = 300
+smtp_mail_timeout = 300
+smtp_quit_timeout = 300
+smtp_rcpt_timeout = 300
+smtp_skip_4xx_greeting = no
+smtp_skip_quit_response = yes
+smtpd_banner = $myhostname ESMTP $mail_name
+smtpd_client_restrictions = 
+smtpd_error_sleep_time = 5
+smtpd_etrn_restrictions = 
+smtpd_hard_error_limit = 100
+smtpd_helo_required = no
+smtpd_helo_restrictions = 
+smtpd_recipient_limit = 1000
+smtpd_recipient_restrictions = permit_mynetworks,check_relay_domains
+smtpd_sender_restrictions = 
+smtpd_soft_error_limit = 10
+smtpd_timeout = 300
+soft_bounce = no
+stale_lock_time = 500
+swap_bangpath = yes
+transport_maps = 
+transport_retry_time = 60
+trigger_timeout = 10
+unknown_address_reject_code = 450
+unknown_client_reject_code = 450
+unknown_hostname_reject_code = 450
+virtual_maps = 
index 9b991f612a743a96f76b35d2ee4917d62343cac2..95a929603c59d641526292e4958595c70396cbde 100644 (file)
@@ -7,7 +7,9 @@
 # Service: any name that is valid for the specified transport type
 # (the next field).  With INET transports, a service is specified as
 # host:port.  The host part (and colon) may be omitted. Either host
-# or port may be given in symbolic form or in numeric form.
+# or port may be given in symbolic form or in numeric form. Examples
+# for the SMTP server:  localhost:smtp receives mail via the loopback
+# interface only; 10025 receives mail on port 10025.
 #
 # Transport type: "inet" for Internet sockets, "unix" for UNIX-domain
 # sockets, "fifo" for named pipes.
index 90dea7c219ee860b29402f6a967d1988f62a12f7..fb6544e713f757008f1873ca0f5dbf9161ba3cc9 100644 (file)
@@ -191,6 +191,15 @@ myorigin = $myhostname
 # notify_classes = 2bounce,resource,software
 notify_classes = resource,software
 
+# The following parameters specify who gets postmaster notices if
+# one of the above error conditions is recognized. All parameters
+# default to "postmaster".
+#
+bounce_notice_recipient = postmaster
+2bounce_notice_recipient = postmaster
+delay_notice_recipient = postmaster
+error_notice_recipient = postmaster
+
 # The process_id_directory specifies a lock file directory relative
 # to the Postfix queue directory. This facility is used by the master
 # daemon to lock out other master daemon instances.
index 69819ffbbcfa5124579418839ec3e41f33176488..90bf4d9c2c72922e39524526343d186e80eafcba 100644 (file)
@@ -5,6 +5,14 @@
 # MISCELLANEOUS CONTROLS
 #
 
+# The best_mx_transport parameter controls what happens when the
+# local system is listed as the best MX host for a destination. By
+# default, Postfix reports a "mail loops back to myself" error and
+# bounces the message. Specify "best_mx_transport = local" to pass
+# the mail to the local delivery agent.
+#
+best_mx_transport =
+
 # The fallback_relay parameter specifies zero or more hosts or domains
 # to hand off mail to if a message destination is not found, or if a
 # destination is unreachable.
index 70d6a2f0bb51b99b0b77ae9444da30d415e2c000..ccf259c53280708bcef0331bb096738bbc61be33 100644 (file)
@@ -48,7 +48,7 @@ HDRS  = been_here.h bounce.h canon_addr.h clean_env.h cleanup_user.h \
        quote_822_local.h rec_streamlf.h rec_type.h recipient_list.h \
        record.h resolve_clnt.h resolve_local.h rewrite_clnt.h sent.h \
        smtp_stream.h split_addr.h string_list.h sys_exits.h timed_ipc.h \
-       tok822.h clnt_stream.h
+       tok822.h clnt_stream.h deliver_pass.h
 TESTSRC        = rec2stream.c stream2rec.c recdump.c
 WARN   = -W -Wformat -Wimplicit -Wmissing-prototypes \
        -Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \
@@ -341,10 +341,11 @@ deliver_pass.o: ../include/msg.h
 deliver_pass.o: ../include/vstring.h
 deliver_pass.o: ../include/vbuf.h
 deliver_pass.o: ../include/vstream.h
-deliver_pass.o: mail_proto.h
-deliver_pass.o: ../include/iostuff.h
+deliver_pass.o: deliver_pass.h
 deliver_pass.o: deliver_request.h
 deliver_pass.o: recipient_list.h
+deliver_pass.o: mail_proto.h
+deliver_pass.o: ../include/iostuff.h
 deliver_request.o: deliver_request.c
 deliver_request.o: ../include/sys_defs.h
 deliver_request.o: ../include/msg.h
index 31196be1c6fd3858f90aa058f5c4f2b95085d2c2..fea9faafc74bf718e98fbb4d89ae066da026ec4a 100644 (file)
 /*     DELIVER_REQUEST *request;
 /*     const char *address;
 /*     long    offset;
+/*
+/*     int     deliver_pass_all(class, service, request)
+/*     const char *class;
+/*     const char *service;
+/*     DELIVER_REQUEST *request;
 /* DESCRIPTION
 /*     This module implements the client side of the `queue manager
 /*     to delivery agent' protocol, passing one recipient on from
 /*     one delivery agent to another.
 /*
+/*     deliver_pass() delegates delivery of the named recipient.
+/*
+/*     deliver_pass_all() delegates an entire delivery request.
+/*
 /*     Arguments:
 /* .IP class
 /*     Destination delivery agent service class
@@ -56,8 +65,7 @@
 
 /* Global library. */
 
-#include <mail_proto.h>
-#include <deliver_request.h>
+#include <deliver_pass.h>
 
 /* deliver_pass_initial_reply - retrieve initial delivery process response */
 
@@ -146,3 +154,19 @@ int     deliver_pass(const char *class, const char *service,
 
     return (status);
 }
+
+/* deliver_pass_all - pass entire delivery request */
+
+int     deliver_pass_all(const char *class, const char *service,
+                                DELIVER_REQUEST *request)
+{
+    RECIPIENT_LIST *list;
+    RECIPIENT *rcpt;
+    int     status = 0;
+
+    list = &request->rcpt_list;
+    for (rcpt = list->info; rcpt < list->info + list->len; rcpt++)
+       status |= deliver_pass(class, service, request,
+                              rcpt->address, rcpt->offset);
+    return (status);
+}
diff --git a/postfix/global/deliver_pass.h b/postfix/global/deliver_pass.h
new file mode 100644 (file)
index 0000000..39e3e0f
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef _DELIVER_PASS_H_INCLUDED_
+#define _DELIVER_PASS_H_INCLUDED_
+
+/*++
+/* NAME
+/*     deliver_pass 3h
+/* SUMMARY
+/*     deliver request pass_through
+/* SYNOPSIS
+/*     #include <deliver_pass.h>
+/* DESCRIPTION
+/* .nf
+
+ /*
+  * Global library.
+  */
+#include <deliver_request.h>
+#include <mail_proto.h>
+
+ /*
+  * External interface.
+  */
+extern int deliver_pass(const char *, const char *, DELIVER_REQUEST *, const char *, long);
+extern int deliver_pass_all(const char *, const char *, DELIVER_REQUEST *);
+
+/* 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
+/*--*/
+
+#endif
index ef3f83f60c50b865207e377ccc312a6e43b045e3..bac96d26db37d29a23b9a6b473eb71cd11d704cd 100644 (file)
@@ -80,6 +80,25 @@ extern char *var_myhostname;
 #define VAR_MYDOMAIN           "mydomain"      /* my domain name */
 extern char *var_mydomain;
 
+ /*
+  * Where to send postmaster copies of bounced mail, and other notices.
+  */
+#define VAR_BOUNCE_RCPT                "bounce_notice_recipient"
+#define DEF_BOUNCE_RCPT                "postmaster"
+extern char *var_bounce_rcpt;
+
+#define VAR_2BOUNCE_RCPT       "2bounce_notice_recipient"
+#define DEF_2BOUNCE_RCPT       "postmaster"
+extern char *var_2bounce_rcpt;
+
+#define VAR_DELAY_RCPT         "delay_notice_recipient"
+#define DEF_DELAY_RCPT         "postmaster"
+extern char *var_delay_rcpt;
+
+#define VAR_ERROR_RCPT         "error_notice_recipient"
+#define DEF_ERROR_RCPT         "postmaster"
+extern char *var_error_rcpt;
+
  /*
   * Virtual host support. Default is to listen on all machine interfaces.
   */
@@ -471,6 +490,10 @@ extern int var_hash_queue_depth;
   * each message. Unfortunately, some mailers misbehave and disconnect (smap)
   * when given more recipients than they are willing to handle.
   */
+#define VAR_BESTMX_TRANSP      "best_mx_transport"
+#define DEF_BESTMX_TRANSP      ""
+extern char *var_bestmx_transp;
+
 #define VAR_SMTP_CONN_TMOUT    "smtp_connect_timeout"
 #define DEF_SMTP_CONN_TMOUT    0
 extern int var_smtp_conn_tmout;
index f437158f88e05860b84b081f3f76b7b471775fe1..f43e8f26473d30ed714122528febe4e65b7d3253 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Snapshot-19990406"
+#define DEF_MAIL_VERSION       "Snapshot-19990407"
 extern char *var_mail_version;
 
 /* LICENSE
index 43c762e81f6e24da65b2f7697890343b46058031..5dbe797eda128159dec8bb527e9ddd716d133ff0 100644 (file)
@@ -55,9 +55,9 @@ BOUNCE(8)                                               BOUNCE(8)
        details and for default values.  Use  the  <b>postfix</b>  <b>reload</b>
        command after a configuration change.
 
-       <b>bounce</b><i>_</i><b>size</b><i>_</i><b>limit</b>
-              Limit  the  amount of original message context that
-              is sent in a non-delivery notification.
+       <b>bounce</b><i>_</i><b>notice</b><i>_</i><b>recipient</b>
+              The  recipient of single bounce postmaster notices.
+
 
 
 
@@ -71,13 +71,23 @@ BOUNCE(8)                                               BOUNCE(8)
 BOUNCE(8)                                               BOUNCE(8)
 
 
+       <b>2bounce</b><i>_</i><b>notice</b><i>_</i><b>recipient</b>
+              The recipient of double bounce postmaster  notices.
+
+       <b>delay</b><i>_</i><b>notice</b><i>_</i><b>recipient</b>
+              The recipient of "delayed mail" postmaster notices.
+
+       <b>bounce</b><i>_</i><b>size</b><i>_</i><b>limit</b>
+              Limit the amount of original message  context  that
+              is sent in a non-delivery notification.
+
        <b>mail</b><i>_</i><b>name</b>
-              Use this mail system name in the introductory  text
+              Use  this mail system name in the introductory text
               at the start of a bounce message.
 
        <b>notify</b><i>_</i><b>classes</b>
-              Notify  the  postmaster  of  bounced mail when this
-              parameter includes the <b>bounce</b>  class.  For  privacy
+              Notify the postmaster of  bounced  mail  when  this
+              parameter  includes  the  <b>bounce</b> class. For privacy
               reasons, the message body is not included.
 
 <b>SEE</b> <b>ALSO</b>
@@ -86,7 +96,7 @@ BOUNCE(8)                                               BOUNCE(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>
@@ -107,16 +117,6 @@ BOUNCE(8)                                               BOUNCE(8)
 
 
 
-
-
-
-
-
-
-
-
-
-
 
 
 
index 512b9701eeb52aa58ddfa50592afafd060560574..aabe60783ca1f4aca2f1417489bb308ec122f474 100644 (file)
@@ -42,6 +42,8 @@
 
 <li><a href="#fax">Sending mail to a FAX machine</a>
 
+<li><a href="#timeouts">Mail fails with timeout or lost connection</a>
+
 <li><a href="#bind">Undefined symbols: ___dn_expand, ___res_init etc.</a>
 
 <li><a href="#db">Using DB libraries on Solaris etc.</a>
@@ -598,6 +600,78 @@ Note: be sure to not advertise <b>fax.your.domain</b> in the DNS...
 
 <hr>
 
+<a name="timeouts"><h2>Mail fails with timeout or lost connection</h2></a>
+
+Occasionally, mail fails with "timed out while sending end of data
+-- message may be sent more than once", or with: "lost connection after DATA". 
+Network outages happen, systems crash. There isn't much you can
+do about it.
+
+<p>
+
+However, when you see mail deliveries fail consistently, you may
+have a different problem: broken path MTU discovery.
+
+<p>
+
+A little background is in order. With the SMTP protocol, the HELO,
+MAIL FROM and RCPT TO commands and responses are relatively short.
+When you're talking to sendmail, every command and every response
+is sent as a separate packet, because sendmail cannot implement
+ESMTP command pipelining.
+
+<p>
+
+The message content, however, is sent as a few datagrams, each
+datagram typically a kbyte large or even bigger, depending on your
+local network MTU.
+
+<p>
+
+When mail fails consistently due to a timeout, I suspect that the
+sending machine runs a modern UNIX which implements path MTU
+discovery.  That causes the machine to send packets as large as it
+would send over the LAN, with the IP DONT'T FRAGMENT bit set,
+preventing intermediate routers from fragmenting the packets that
+are too big for their networks.
+
+<p>
+
+Depending on what network path a message follows, some router on
+the way responds with an ICMP MUST FRAGMENT message saying the
+packet is too big. Normally, the sending machine will re-send the
+data after chopping it up into smaller pieces.
+
+<p>
+
+However, things break when some router closer to the sending system
+is dropping such ICMP feedback messages, in a mistaken attempt to
+protect systems against certain attacks. In that case, the ICMP
+feedback message never reaches the sending machine, and the connection
+times out.
+
+<p>
+
+This is the same configuration problem that causes trouble with
+web servers behind a misconfigured packet filter: small images/files
+are sent intact, large images/files time out because the server
+does not see the MUST FRAGMENT ICMP feedback messages.
+
+<p>
+
+Workaround: disable path MTU discovery at the sending machine. Mail
+will get out, but of course everyone else will still suffer. How
+to disable path MTU discovery? It depends. Solaris has an <b>ndd</b>
+command; other systems use different means such as <b>sysctl</b>
+to control kernel parameters on a running system.
+
+<p>
+
+Fix: find the router that drops the ICMP MUST FRAGMENT messages,
+and convince the person responsible for it to fix the configuration.
+
+<hr>
+
 <a name="bind"><h2>Undefined symbols: ___dn_expand, ___res_init etc.</h2></a>
 
 Question: When I build Postfix I get the following errors:
index 4af185bffe6e12211f4c7df26bc33f952c1c6c07..c91c73756e7e68c57ddbf1950209e1d3ab5de384 100644 (file)
@@ -39,27 +39,27 @@ POSTALIAS(1)                                         POSTALIAS(1)
               tiple <b>-v</b> options  make  the  software  increasingly
               verbose.
 
+       B-w    Do  not  warn  about  duplicate  entries;  silently
+              ignore them.
+
        Arguments:
 
        <i>file_type</i>
               The type of database to be produced.
 
-              <b>btree</b>  The   output   is   a   btree   file,  named
-                     <i>file_name</i><b>.db</b>.  This  is  available  only  on
+              <b>btree</b>  The  output   is   a   btree   file,   named
+                     <i>file_name</i><b>.db</b>.   This  is  available  only on
                      systems with support for <b>db</b> databases.
 
-              <b>dbm</b>    The  output  consists  of  two  files, named
-                     <i>file_name</i><b>.pag</b> and  <i>file_name</i><b>.dir</b>.   This  is
-                     available  only  on systems with support for
+              <b>dbm</b>    The output  consists  of  two  files,  named
+                     <i>file_name</i><b>.pag</b>  and  <i>file_name</i><b>.dir</b>.   This is
+                     available only on systems with  support  for
                      <b>dbm</b> databases.
 
-              <b>hash</b>   The  output  is   a   hashed   file,   named
-                     <i>file_name</i><b>.db</b>.   This  is  available  only on
+              <b>hash</b>   The   output   is   a   hashed  file,  named
+                     <i>file_name</i><b>.db</b>.  This  is  available  only  on
                      systems with support for <b>db</b> databases.
 
-              When no <i>file_type</i> is specified, the  software  uses
-              the  database  type specified via the <b>database</b><i>_</i><b>type</b>
-
 
 
                                                                 1
@@ -71,15 +71,17 @@ POSTALIAS(1)                                         POSTALIAS(1)
 POSTALIAS(1)                                         POSTALIAS(1)
 
 
-              configuration parameter.   The  default  value  for
+              When  no  <i>file_type</i> is specified, the software uses
+              the database type specified via  the  <b>database</b><i>_</i><b>type</b>
+              configuration  parameter.   The  default  value for
               this parameter depends on the host environment.
 
        <i>file_name</i>
-              The  name  of  the  alias database source file when
+              The name of the alias  database  source  file  when
               rebuilding a database.
 
 <b>DIAGNOSTICS</b>
-       Problems are logged to the standard error stream. No  out-
+       Problems  are logged to the standard error stream. No out-
        put means no problems were detected. Duplicate entries are
        skipped and are flagged with a warning.
 
@@ -91,12 +93,12 @@ POSTALIAS(1)                                         POSTALIAS(1)
               Enable verbose logging for debugging purposes.
 
 <b>CONFIGURATION</b> <b>PARAMETERS</b>
-       The following <b>main.cf</b> parameters are  especially  relevant
-       to  this  program. See the Postfix <b>main.cf</b> file for syntax
+       The  following  <b>main.cf</b> parameters are especially relevant
+       to this program. See the Postfix <b>main.cf</b> file  for  syntax
        details and for default values.
 
        <b>database</b><i>_</i><b>type</b>
-              Default alias database type. On many UNIX  systems,
+              Default  alias database type. On many UNIX systems,
               the default type is either <b>dbm</b> or <b>hash</b>.
 
 <b>STANDARDS</b>
@@ -107,7 +109,7 @@ POSTALIAS(1)                                         POSTALIAS(1)
        <a href="sendmail.1.html">sendmail(1)</a> mail posting and compatibility interface.
 
 <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>
@@ -126,8 +128,6 @@ POSTALIAS(1)                                         POSTALIAS(1)
 
 
 
-
-
                                                                 2
 
 
index 950b96b2bc8318c5f9e1c25d5b5e6b51feb6eee8..9b01928dcf07b607e517012b38ecb6f84593fdfc 100644 (file)
@@ -57,8 +57,8 @@ POSTMAP(1)                                             POSTMAP(1)
               tiple <b>-v</b> options  make  the  software  increasingly
               verbose.
 
-       Arguments:
-
+       B-w    Do  not  warn  about  duplicate  entries;  silently
+              ignore them.
 
 
 
@@ -71,28 +71,30 @@ POSTMAP(1)                                             POSTMAP(1)
 POSTMAP(1)                                             POSTMAP(1)
 
 
+       Arguments:
+
        <i>file_type</i>
               The type of database to be produced.
 
-              <b>btree</b>  The  output  file  is  a  btree  file, named
-                     <i>file_name</i><b>.db</b>.  This  is  available  only  on
+              <b>btree</b>  The output  file  is  a  btree  file,  named
+                     <i>file_name</i><b>.db</b>.   This  is  available  only on
                      systems with support for <b>db</b> databases.
 
-              <b>dbm</b>    The  output  consists  of  two  files, named
-                     <i>file_name</i><b>.pag</b> and  <i>file_name</i><b>.dir</b>.   This  is
-                     available  only  on systems with support for
+              <b>dbm</b>    The output  consists  of  two  files,  named
+                     <i>file_name</i><b>.pag</b>  and  <i>file_name</i><b>.dir</b>.   This is
+                     available only on systems with  support  for
                      <b>dbm</b> databases.
 
-              <b>hash</b>   The output file  is  a  hashed  file,  named
-                     <i>file_name</i><b>.db</b>.   This  is  available  only on
+              <b>hash</b>   The  output  file  is  a  hashed file, named
+                     <i>file_name</i><b>.db</b>.  This  is  available  only  on
                      systems with support for <b>db</b> databases.
 
-              When no <i>file_type</i> is specified, the  software  uses
-              the  database  type specified via the <b>database</b><i>_</i><b>type</b>
+              When  no  <i>file_type</i> is specified, the software uses
+              the database type specified via  the  <b>database</b><i>_</i><b>type</b>
               configuration parameter.
 
        <i>file_name</i>
-              The name of  the  lookup  table  source  file  when
+              The  name  of  the  lookup  table  source file when
               rebuilding a database.
 
 <b>DIAGNOSTICS</b>
@@ -109,12 +111,12 @@ POSTMAP(1)                                             POSTMAP(1)
 
 <b>CONFIGURATION</b> <b>PARAMETERS</b>
        <b>database</b><i>_</i><b>type</b>
-              Default  output  database  type.  On many UNIX sys-
-              tems, the default database type is either  <b>hash</b>  or
+              Default output database type.  On  many  UNIX  sys-
+              tems,  the  default database type is either <b>hash</b> or
               <b>dbm</b>.
 
 <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>
@@ -126,8 +128,6 @@ POSTMAP(1)                                             POSTMAP(1)
 
 
 
-
-
                                                                 2
 
 
index 036a46c70b7938b63b56f831113e869cfd7a8cd2..2988053e3f2ee122be9607ba474fe45eeb85b468 100644 (file)
@@ -74,16 +74,26 @@ SMTP(8)                                                   SMTP(8)
        command after a configuration change.
 
 <b>Miscellaneous</b>
+       <b>best</b><i>_</i><b>mx</b><i>_</i><b>transport</b>
+              Name  of  the  delivery  transport  to use when the
+              local machine is the most-preferred mail  exchanger
+              (by  default,  a  mailer  loop is reported, and the
+              message is bounced).
+
        <b>debug</b><i>_</i><b>peer</b><i>_</i><b>level</b>
-              Verbose  logging  level  increment  for  hosts that
+              Verbose logging  level  increment  for  hosts  that
               match a pattern in the <b>debug</b><i>_</i><b>peer</b><i>_</i><b>list</b> parameter.
 
        <b>debug</b><i>_</i><b>peer</b><i>_</i><b>list</b>
-              List of domain or network patterns. When  a  remote
-              host  matches  a pattern, increase the verbose log-
-              ging  level  by  the  amount   specified   in   the
+              List  of  domain or network patterns. When a remote
+              host matches a pattern, increase the  verbose  log-
+              ging   level   by   the  amount  specified  in  the
               <b>debug</b><i>_</i><b>peer</b><i>_</i><b>level</b> parameter.
 
+       <b>error</b><i>_</i><b>notice</b><i>_</i><b>recipient</b>
+              Recipient   of    protocol/policy/resource/software
+              error notices.
+
        <b>fallback</b><i>_</i><b>relay</b>
               Hosts  to hand off mail to if a message destination
               is not found or if a destination is unreachable.
@@ -115,16 +125,6 @@ SMTP(8)                                                   SMTP(8)
 <b>Resource</b> <b>controls</b>
        <b>smtp</b><i>_</i><b>destination</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b>
               Limit the number of parallel deliveries to the same
-              destination.   The  default limit is taken from the
-              <b>default</b><i>_</i><b>destination</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b> parameter.
-
-       <b>smtp</b><i>_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>
-              Limit the number of recipients per  message  deliv-
-              ery.    The   default   limit  is  taken  from  the
-              <b>default</b><i>_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b> parameter.
-
-<b>Timeout</b> <b>controls</b>
-
 
 
 
@@ -137,6 +137,15 @@ SMTP(8)                                                   SMTP(8)
 SMTP(8)                                                   SMTP(8)
 
 
+              destination.   The  default limit is taken from the
+              <b>default</b><i>_</i><b>destination</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b> parameter.
+
+       <b>smtp</b><i>_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>
+              Limit the number of recipients per  message  deliv-
+              ery.    The   default   limit  is  taken  from  the
+              <b>default</b><i>_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b> parameter.
+
+<b>Timeout</b> <b>controls</b>
        <b>smtp</b><i>_</i><b>connect</b><i>_</i><b>timeout</b>
               Timeout in seconds for completing a TCP connection.
               When no connection can be made within the deadline,
@@ -182,15 +191,6 @@ SMTP(8)                                                   SMTP(8)
 
 <b>SEE</b> <b>ALSO</b>
        <a href="bounce.8.html">bounce(8)</a> non-delivery status reports
-       <a href="master.8.html">master(8)</a> process manager
-       <a href="qmgr.8.html">qmgr(8)</a> queue manager
-       syslogd(8) system logging
-
-<b>LICENSE</b>
-       The  Secure  Mailer  license must be distributed with this
-       software.
-
-
 
 
 
@@ -203,6 +203,14 @@ SMTP(8)                                                   SMTP(8)
 SMTP(8)                                                   SMTP(8)
 
 
+       <a href="master.8.html">master(8)</a> process manager
+       <a href="qmgr.8.html">qmgr(8)</a> queue manager
+       syslogd(8) system logging
+
+<b>LICENSE</b>
+       The  Secure  Mailer  license must be distributed with this
+       software.
+
 <b>AUTHOR(S)</b>
        Wietse Venema
        IBM T.J. Watson Research
@@ -243,14 +251,6 @@ SMTP(8)                                                   SMTP(8)
 
 
 
-
-
-
-
-
-
-
-
 
 
 
index 1f3636dbaf3c5f291583e1c64957e19e8a47f5a3..354870d1b9262a606634477151cb3fb2bf25a4a2 100644 (file)
@@ -93,38 +93,38 @@ 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>error</b><i>_</i><b>notice</b><i>_</i><b>recipient</b>
+              Recipient   of    protocol/policy/resource/software
+              error notices.
+
        <b>hopcount</b><i>_</i><b>limit</b>
               Limit the number of <b>Received:</b> message headers.
 
        <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>
-       <b>line</b><i>_</i><b>length</b><i>_</i><b>limit</b>
-              Limit the amount of memory in bytes  used  for  the
-              handling of partial input lines.
 
 
 
@@ -137,13 +137,18 @@ 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
+              handling of partial input lines.
+
        <b>message</b><i>_</i><b>size</b><i>_</i><b>limit</b>
               Limit the total size in bytes of a message, includ-
               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>
@@ -153,11 +158,11 @@ 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>UCE</b> <b>control</b> <b>restrictions</b>
@@ -166,31 +171,26 @@ SMTPD(8)                                                 SMTPD(8)
               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>
+              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
+              Restrict  what  recipient  addresses are allowed in
               <b>RCPT</b> <b>TO</b> commands.
 
        <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.
 
-       <b>maps</b><i>_</i><b>rbl</b><i>_</i><b>domains</b>
-              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
 
 
 
@@ -203,40 +203,46 @@ SMTPD(8)                                                 SMTPD(8)
 SMTPD(8)                                                 SMTPD(8)
 
 
+       <b>maps</b><i>_</i><b>rbl</b><i>_</i><b>domains</b>
+              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
               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>
+              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
+              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>
@@ -245,12 +251,24 @@ SMTPD(8)                                                 SMTPD(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>
        Wietse Venema
        IBM T.J. Watson Research
+
+
+
+                                                                4
+
+
+
+
+
+SMTPD(8)                                                 SMTPD(8)
+
+
        P.O. Box 704
        Yorktown Heights, NY 10598, USA
 
@@ -260,7 +278,55 @@ SMTPD(8)                                                 SMTPD(8)
 
 
 
-                                                                4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+                                                                5
 
 
 </pre> </body> </html>
index 91c0f429ee95e23ecd9a9ad9e07f9393854b9992..fabd97719bf9cf8fde7c81d6d99e1189187f5f9f 100644 (file)
@@ -305,13 +305,14 @@ mailbox.o: ../include/sent.h
 mailbox.o: ../include/mypwd.h
 mailbox.o: ../include/been_here.h
 mailbox.o: ../include/mail_params.h
+mailbox.o: ../include/deliver_pass.h
+mailbox.o: ../include/deliver_request.h
+mailbox.o: ../include/recipient_list.h
 mailbox.o: ../include/mail_proto.h
 mailbox.o: ../include/iostuff.h
 mailbox.o: local.h
 mailbox.o: ../include/tok822.h
 mailbox.o: ../include/resolve_clnt.h
-mailbox.o: ../include/deliver_request.h
-mailbox.o: ../include/recipient_list.h
 mailbox.o: biff_notify.h
 maildir.o: maildir.c
 maildir.o: ../include/sys_defs.h
index bb7d736b84413d89f95e3d090fa7ca33b55d0548..8888813d2211e9992385f11a384ae4912fc46bb7 100644 (file)
@@ -74,7 +74,7 @@
 #include <mypwd.h>
 #include <been_here.h>
 #include <mail_params.h>
-#include <mail_proto.h>
+#include <deliver_pass.h>
 
 /* Application-specific. */
 
index d01cfe234dcb98589f95504dfa06a09b5788a3d1..22e0ca9fd8806925d59483852e61b5d7a25cddcb 100644 (file)
@@ -34,6 +34,8 @@ a new database from the entries in \fBfile_name\fR.
 .IP \fB-v\fR
 Enable verbose logging for debugging purposes. Multiple \fB-v\fR
 options make the software increasingly verbose.
+.IP \f\B-w\fR
+Do not warn about duplicate entries; silently ignore them.
 .PP
 Arguments:
 .IP \fIfile_type\fR
index 70df09230eb95780b8b96a613dc8bc40aae0b07e..a70be1401bc7de4247daa0005f88e3b83a8e2502 100644 (file)
@@ -53,6 +53,8 @@ a new database from the entries in \fBfile_name\fR.
 .IP \fB-v\fR
 Enable verbose logging for debugging purposes. Multiple \fB-v\fR
 options make the software increasingly verbose.
+.IP \f\B-w\fR
+Do not warn about duplicate entries; silently ignore them.
 .PP
 Arguments:
 .IP \fIfile_type\fR
index e148cc171a45a21d0f70b7b18b52e9bf4c2941fa..7f74c23734f3b152739fd0b292cb4a70810f9df3 100644 (file)
@@ -59,6 +59,12 @@ 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 \fBbounce_notice_recipient\fR
+The recipient of single bounce postmaster notices.
+.IP \fB2bounce_notice_recipient\fR
+The recipient of double bounce postmaster notices.
+.IP \fBdelay_notice_recipient\fR
+The recipient of "delayed mail" postmaster notices.
 .IP \fBbounce_size_limit\fR
 Limit the amount of original message context that is sent in
 a non-delivery notification.
index 38093ac2bca3541878a8fa84e0eb1b7a7d24e7e8..6dbd17a8b2a9eecbcfb821588fca13e9d7d98dd3 100644 (file)
@@ -71,6 +71,10 @@ a configuration change.
 .SH Miscellaneous
 .ad
 .fi
+.IP \fBbest_mx_transport\fR
+Name of the delivery transport to use when the local machine
+is the most-preferred mail exchanger (by default, a mailer
+loop is reported, and the message is bounced).
 .IP \fBdebug_peer_level\fR
 Verbose logging level increment for hosts that match a
 pattern in the \fBdebug_peer_list\fR parameter.
@@ -78,6 +82,8 @@ 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 \fBerror_notice_recipient\fR
+Recipient of protocol/policy/resource/software error notices.
 .IP \fBfallback_relay\fR
 Hosts to hand off mail to if a message destination is not found
 or if a destination is unreachable.
index c838208b34148fe509e205c8bd9bc02399155d6e..9ff7a6df7da05c703591cb24cbb6501e72d36a0b 100644 (file)
@@ -83,6 +83,8 @@ 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 \fBerror_notice_recipient\fR
+Recipient of protocol/policy/resource/software error notices.
 .IP \fBhopcount_limit\fR
 Limit the number of \fBReceived:\fR message headers.
 .IP \fBnotify_classes\fR
index 4c7043bffe9fe3b996d3da1bf13c5736b67801ac..4d18315f64394cb5cb419e9de7b301d9db221562 100644 (file)
@@ -12,6 +12,7 @@ TESTPROG=
 MAKES  = bool_table.h bool_vars.h int_table.h int_vars.h str_table.h \
        str_vars.h
 PROG   = postconf
+SAMPLES        = ../conf/main.cf.default
 INC_DIR        = ../include
 LIBS   = ../lib/libglobal.a ../lib/libutil.a
 
@@ -20,12 +21,15 @@ LIBS        = ../lib/libglobal.a ../lib/libutil.a
 $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
 
+../conf/main.cf.default: $(PROG) Makefile
+       ./$(PROG) -d |egrep -v '^(myhostname|mydomain|mynetworks) ' >$@
+
 Makefile: Makefile.in
        (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@
 
 test:  $(TESTPROG)
 
-update: ../bin/$(PROG)
+update: ../bin/$(PROG) $(SAMPLES)
 
 ../bin/$(PROG): $(PROG)
        cp $(PROG) ../bin
index 91e217546bcdea4dad0b1a545f3e0749bc4763cb..6d528e8802d6200a2b695a6b21d9fdd5bbdab307 100644 (file)
@@ -82,6 +82,8 @@ smtp.o: ../include/mail_params.h
 smtp.o: ../include/config.h
 smtp.o: ../include/debug_peer.h
 smtp.o: ../include/mail_error.h
+smtp.o: ../include/mail_proto.h
+smtp.o: ../include/iostuff.h
 smtp.o: ../include/mail_server.h
 smtp.o: smtp.h
 smtp.o: ../include/argv.h
index 48274ac305027ee5a7c11d71c9ced38cb45e9a13..60c840b35f7c7a58c62bbb982ba6b66bea81089d 100644 (file)
 /* .SH Miscellaneous
 /* .ad
 /* .fi
+/* .IP \fBbest_mx_transport\fR
+/*     Name of the delivery transport to use when the local machine
+/*     is the most-preferred mail exchanger (by default, a mailer
+/*     loop is reported, and the message is bounced).
 /* .IP \fBdebug_peer_level\fR
 /*     Verbose logging level increment for hosts that match a
 /*     pattern in the \fBdebug_peer_list\fR parameter.
@@ -62,6 +66,8 @@
 /*     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 \fBerror_notice_recipient\fR
+/*     Recipient of protocol/policy/resource/software error notices.
 /* .IP \fBfallback_relay\fR
 /*     Hosts to hand off mail to if a message destination is not found
 /*     or if a destination is unreachable.
 #include <config.h>
 #include <debug_peer.h>
 #include <mail_error.h>
+#include <deliver_pass.h>
 
 /* Single server skeleton. */
 
@@ -192,6 +199,8 @@ int     var_smtp_skip_4xx_greeting;
 int     var_ign_mx_lookup_err;
 int     var_skip_quit_resp;
 char   *var_fallback_relay;
+char   *var_bestmx_transp;
+char   *var_error_rcpt;
 
  /*
   * Global variables. smtp_errno is set by the address lookup routines and by
@@ -245,16 +254,21 @@ static int deliver_message(DELIVER_REQUEST *request)
        msg_info("%s: file %s", myname, VSTREAM_PATH(state->src));
 
     /*
-     * Establish an SMTP session and deliver this message to (limited batches
-     * of) recipients. XXX By doing the recipient batching in the SMTP agent
-     * instead of in the queue manager, we're stuck with one connection per
-     * message per domain. But, the queue manager should not have hard-wired
-     * logic that is specific to SMTP processing. At the end, notify the
-     * postmaster of any protocol errors.
+     * Establish an SMTP session and deliver this message to all requested
+     * recipients. At the end, notify the postmaster of any protocol errors.
+     * Optionally deliver mail locally when this machine is the best mail
+     * exchanger.
      */
     if ((state->session = smtp_connect(request->nexthop, why)) == 0) {
-       smtp_site_fail(state, smtp_errno == SMTP_RETRY ? 450 : 550,
-                      "%s", vstring_str(why));
+       if (smtp_errno == SMTP_OK) {
+           if (*var_bestmx_transp == 0)
+               msg_panic("smtp_errno botch");
+           state->status = deliver_pass_all(MAIL_CLASS_PRIVATE,
+                                            var_bestmx_transp,
+                                            request);
+       } else
+           smtp_site_fail(state, smtp_errno == SMTP_RETRY ? 450 : 550,
+                          "%s", vstring_str(why));
     } else {
        debug_peer_check(state->session->host, state->session->addr);
        if (smtp_helo(state) == 0)
@@ -314,6 +328,8 @@ int     main(int argc, char **argv)
        VAR_DEBUG_PEER_LIST, DEF_DEBUG_PEER_LIST, &var_debug_peer_list, 0, 0,
        VAR_NOTIFY_CLASSES, DEF_NOTIFY_CLASSES, &var_notify_classes, 0, 0,
        VAR_FALLBACK_RELAY, DEF_FALLBACK_RELAY, &var_fallback_relay, 0, 0,
+       VAR_BESTMX_TRANSP, DEF_BESTMX_TRANSP, &var_bestmx_transp, 0, 0,
+       VAR_ERROR_RCPT, DEF_ERROR_RCPT, &var_error_rcpt, 1, 0,
        0,
     };
     static CONFIG_INT_TABLE int_table[] = {
index f1d2bea13edab8151decb2731e044890dff0cf8f..380d37cbdcd0e3298d5a8602bdfd2863f821e256 100644 (file)
 /*     exchanger hosts listed for the named domain. Addresses are
 /*     returned in most-preferred first order. The result is truncated
 /*     so that it contains only hosts that are more preferred than the
-/*     local mail server itself.
+/*     local mail server itself. When the "best MX is local" feature
+/*     is enabled, the local system is allowed to be the best mail
+/*     exchanger, and the result is a null list pointer. Otherwise,
+/*     mailer loops are treated as an error.
 /*
 /*     When no mail exchanger is listed in the DNS for \fIname\fR, the
 /*     request is passed to smtp_host_addr().
@@ -286,8 +289,11 @@ static DNS_RR *smtp_truncate_self(DNS_RR *addr_list, unsigned pref,
                smtp_print_addr("truncated", addr);
            dns_rr_free(addr);
            if (last == 0) {
-               vstring_sprintf(why, "mail for %s loops back to myself", name);
-               smtp_errno = SMTP_FAIL;
+               if (*var_bestmx_transp == 0) {
+                   vstring_sprintf(why, "mail for %s loops back to myself",
+                                   name);
+                   smtp_errno = SMTP_FAIL;
+               }
                addr_list = 0;
            } else {
                last->next = 0;
index 143e7d256b3e29e27548d5feb0fd1626343abed3..7d3547461456e51848b47c0d074e26fe62aa10d7 100644 (file)
@@ -246,7 +246,7 @@ void    smtp_chat_notify(SMTP_STATE *state)
 #define INDENT 4
 
     notice = post_mail_fopen_nowait(mail_addr_double_bounce(),
-                                   mail_addr_postmaster(),
+                                   var_error_rcpt,
                                    NULL_CLEANUP_FLAGS, "NOTICE");
     if (notice == 0) {
        msg_warn("postmaster notify: %m");
@@ -254,7 +254,7 @@ void    smtp_chat_notify(SMTP_STATE *state)
     }
     post_mail_fprintf(notice, "From: %s (Mail Delivery System)",
                      mail_addr_mail_daemon());
-    post_mail_fprintf(notice, "To: %s (Postmaster)", mail_addr_postmaster());
+    post_mail_fprintf(notice, "To: %s (Postmaster)", var_error_rcpt);
     post_mail_fprintf(notice, "Subject: %s SMTP client: errors from %s",
                      var_mail_name, session->host);
     post_mail_fputs(notice, "");
index 0f2ff5435322bed4e0f58dcecbf60339c97e8d24..80f4b7e543927ce7461a1b890d937c56c28c2116 100644 (file)
@@ -67,6 +67,8 @@
 /*     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 \fBerror_notice_recipient\fR
+/*     Recipient of protocol/policy/resource/software error notices.
 /* .IP \fBhopcount_limit\fR
 /*     Limit the number of \fBReceived:\fR message headers.
 /* .IP \fBnotify_classes\fR
@@ -273,6 +275,7 @@ int     var_reject_code;
 int     var_smtpd_err_sleep;
 int     var_non_fqdn_code;
 char   *var_always_bcc;
+char   *var_error_rcpt;
 
  /*
   * Global state, for stand-alone mode queue file cleanup. When this is
@@ -1153,6 +1156,7 @@ int     main(int argc, char **argv)
        VAR_ETRN_CHECKS, DEF_ETRN_CHECKS, &var_etrn_checks, 0, 0,
        VAR_MAPS_RBL_DOMAINS, DEF_MAPS_RBL_DOMAINS, &var_maps_rbl_domains, 0, 0,
        VAR_ALWAYS_BCC, DEF_ALWAYS_BCC, &var_always_bcc, 0, 0,
+       VAR_ERROR_RCPT, DEF_ERROR_RCPT, &var_error_rcpt, 1, 0,
        0,
     };
 
index 6e97b4c94f420f12e17213df7bfb07242c655746..95d9d9b11670609f16be270e907d682d7504eb32 100644 (file)
@@ -193,7 +193,7 @@ void    smtpd_chat_notify(SMTPD_STATE *state)
 #define INDENT 4
 
     notice = post_mail_fopen_nowait(mail_addr_double_bounce(),
-                                   mail_addr_postmaster(),
+                                   var_error_rcpt,
                                    NULL_CLEANUP_FLAGS, "NOTICE");
     if (notice == 0) {
        msg_warn("postmaster notify: %m");
@@ -201,7 +201,7 @@ void    smtpd_chat_notify(SMTPD_STATE *state)
     }
     post_mail_fprintf(notice, "From: %s (Mail Delivery System)",
                      mail_addr_mail_daemon());
-    post_mail_fprintf(notice, "To: %s (Postmaster)", mail_addr_postmaster());
+    post_mail_fprintf(notice, "To: %s (Postmaster)", var_error_rcpt);
     post_mail_fprintf(notice, "Subject: %s SMTP server: errors from %s[%s]",
                      var_mail_name, state->name, state->addr);
     post_mail_fputs(notice, "");