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:
/* 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.
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.
};
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,
};
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)");
}
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.
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) {
* 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)
* 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)
--- /dev/null
+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 =
# 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.
# 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.
# 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.
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 \
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
/* 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
/* Global library. */
-#include <mail_proto.h>
-#include <deliver_request.h>
+#include <deliver_pass.h>
/* deliver_pass_initial_reply - retrieve initial delivery process response */
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);
+}
--- /dev/null
+#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
#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.
*/
* 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;
* 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
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.
+
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>
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>
-
-
-
-
-
-
-
-
-
-
<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>
<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:
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
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.
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>
<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>
-
-
2
tiple <b>-v</b> options make the software increasingly
verbose.
- Arguments:
-
+ B-w Do not warn about duplicate entries; silently
+ ignore them.
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>
<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>
-
-
2
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.
<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>
-
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,
<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.
-
-
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
-
-
-
-
-
-
-
-
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.
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>
<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>
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
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>
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
- 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
</pre> </body> </html>
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
#include <mypwd.h>
#include <been_here.h>
#include <mail_params.h>
-#include <mail_proto.h>
+#include <deliver_pass.h>
/* Application-specific. */
.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
.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
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.
.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.
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.
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
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
$(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
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
/* .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.
/* 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. */
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
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)
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[] = {
/* 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().
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;
#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");
}
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, "");
/* 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
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
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,
};
#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");
}
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, "");