after connection timeout. Problem reported by Alain Thivillon.
did not take his patch because I have no means to verify
the code. File: util/dict_ldap.c.
+
+20001214
+
+ Feature: local_transport and default_transport now also
+ understand the transport[:destination] notation, so that
+ transport parameters are similar again. File:
+ trivial-rewrite/resolve.c, trivial-rewrite/transport.c.
set to shadow or sasldb), Solaris 2.7 (pwcheck_method set to shadow
or sasldb), and FreeBSD 3.4 (pwcheck_method set to sasldb). On
RedHat 6.1, SASL 1.5.5 insisted on write access to /etc/sasldb.
+Note that this seems to be related to the auto_transition switch in
+SASL. Note also that the Cyrus SASL documentation says that it is
+pointless to enable that if you use "sasldb" for "pwcheck_method".
SASL is a lot of complex code. In a future version the Postfix SASL
code is likely to be put outside the SMTP server.
have to play games with group access permissions. On RedHat 6.1,
SASL 1.5.5 insists on write access to /etc/sasldb.
+IMPORTANT: To get sasldb running, make sure that you set the SASL domain
+(realm) to a fully qualified domain name.
+
+EXAMPLE: saslpasswd -c -u `postconf -h myhostname` exampleuser
+
Instead of the SASL-specific password file you can configure the
Postfix SMTP server to validate client passwords against the UNIX
shadow password file:
However this requires that Postfix has read access to the UNIX shadow
password file, which is normally readable only by root. Shadow
password support has been found to work for Solaris 2.7 and RedHat
-6. 1 but not with freeBSD 3.4.
+6.1 but not with FreeBSD 3.4.
To run software chrooted with SASL support is an interesting exercise.
This is one of the many problems with the present SASL support.
form of username\0username\0password (the \0 is a null byte). The
example above is for a user named `test' with password `testpass'.
+You can use e. g.: printf 'username\0username\0password' | mmencode
+or perl -MMIME::Base64 -e 'print
+ encode_base64("username\0username\0password");'
+to get this output (MIME::Base64 is available from CPAN in case you
+don't have it).
+
Enabling SASL authentication in the Postfix SMTP client
=======================================================
# has precedence over the mailbox_command, fallback_transport and
# luser_relay parameters.
#
+# Specify a string of the form transport:nexthop, where transport is
+# the name of a mail delivery transport defined in master.cf. The
+# :nexthop part is optional. For more details see the sample transport
+# configuration file.
+#
+#mailbox_transport = lmtp:unix:/file/name
#mailbox_transport = cyrus
# The fallback_transport specifies the optional transport in master.cf
# to use for recipients that are not found in the UNIX passwd database.
# This parameter has precedence over the luser_relay parameter.
#
+# Specify a string of the form transport:nexthop, where transport is
+# the name of a mail delivery transport defined in master.cf. The
+# :nexthop part is optional. For more details see the sample transport
+# configuration file.
+#
+#fallback_transport = lmtp:unix:/file/name
+#fallback_transport = cyrus
#fallback_transport =
# The luser_relay parameter specifies an optional destination address
# By default, local mail is delivered to the transport called "local",
# which is just the name of a service that is defined the master.cf file.
#
+# Specify a string of the form transport:nexthop, where transport is
+# the name of a mail delivery transport defined in master.cf. The
+# :nexthop part is optional. For more details see the sample transports
+# file.
+#
+local_transport = lmtp:unix:/file/name
local_transport = local
#
# luser_relay parameters.
#
# Specify a string of the form transport:nexthop, where transport is
-# the name of a mail delivery transport defined in master.cf. Either
-# transport or nexthop are optional. For more details see the sample
-# transports file.
+# the name of a mail delivery transport defined in master.cf. The
+# :nexthop part is optional. For more details see the sample transport
+# configuration file.
#
# mailbox_transport = lmtp:unix:/file/name
# mailbox_transport = cyrus
# This parameter has precedence over the luser_relay parameter.
#
# Specify a string of the form transport:nexthop, where transport is
-# the name of a mail delivery transport defined in master.cf. Either
-# transport or nexthop are optional. For more details see the sample
-# transports file.
+# the name of a mail delivery transport defined in master.cf. The
+# :nexthop part is optional. For more details see the sample transport
+# configuration file.
#
# fallback_transport = lmtp:unix:/file/name
# fallback_transport = cyrus
# delivery transport to use when no transport is explicitly given in
# the optional transport(5) table.
#
-# default_transport = uucp
+# Specify a string of the form transport:nexthop, where transport is
+# the name of a mail delivery transport defined in master.cf. Either
+# transport or nexthop are optional. For more details see the sample
+# transports file.
+#
+# default_transport = uucp:relayhostname
default_transport = smtp
# The double_bounce_sender parameter specifies the sender address
<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>
+ The default time unit is seconds; an explicit time unit
+ can be specified by appending a one-letter suffix: s (sec-
+ onds), m (minutes), h (hours), d (days) or w (weeks).
+
<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,
- the SMTP client tries the next address on the mail
- exchanger list.
+ Timeout (default: seconds) for completing a TCP
+ connection. When no connection can be made within
+ the deadline, the SMTP client tries the next
+ address on the mail exchanger list.
<b>smtp</b><i>_</i><b>helo</b><i>_</i><b>timeout</b>
- Timeout in seconds for receiving the SMTP greeting
- banner. When the server drops the connection with-
- out sending a greeting banner, or when it sends no
- greeting banner within the deadline, the SMTP
- client tries the next address on the mail exchanger
- list.
+ Timeout (default: seconds) for receiving the SMTP
+ greeting banner. When the server drops the connec-
+ tion without sending a greeting banner, or when it
+ sends no greeting banner within the deadline, the
+ SMTP client tries the next address on the mail
+ exchanger list.
<b>smtp</b><i>_</i><b>helo</b><i>_</i><b>timeout</b>
- Timeout in seconds for sending the <b>HELO</b> command,
- and for receiving the server response.
+ Timeout (default: seconds) for sending the <b>HELO</b>
+ command, and for receiving the server response.
<b>smtp</b><i>_</i><b>mail</b><i>_</i><b>timeout</b>
- Timeout in seconds for sending the <b>MAIL</b> <b>FROM</b> com-
- mand, and for receiving the server response.
+ Timeout (default: seconds) for sending the <b>MAIL</b>
+ <b>FROM</b> command, and for receiving the server
+ response.
<b>smtp</b><i>_</i><b>rcpt</b><i>_</i><b>timeout</b>
- Timeout in seconds for sending the <b>RCPT</b> <b>TO</b> command,
- and for receiving the server response.
+ Timeout (default: seconds) for sending the <b>RCPT</b> <b>TO</b>
+ command, and for receiving the server response.
<b>smtp</b><i>_</i><b>data</b><i>_</i><b>init</b><i>_</i><b>timeout</b>
- Timeout in seconds for sending the <b>DATA</b> command,
- and for receiving the server response.
+ Timeout (default: seconds) for sending the <b>DATA</b>
+ command, and for receiving the server response.
<b>smtp</b><i>_</i><b>data</b><i>_</i><b>xfer</b><i>_</i><b>timeout</b>
- Timeout in seconds for sending the message content.
+ Timeout (default: seconds) for sending the message
+ content.
<b>smtp</b><i>_</i><b>data</b><i>_</i><b>done</b><i>_</i><b>timeout</b>
- Timeout in seconds for sending the "<b>.</b>" command, and
- for receiving the server response. When no response
- is received, a warning is logged that the mail may
- be delivered multiple times.
+ Timeout (default: seconds) for sending the "<b>.</b>" com-
+ mand, and for receiving the server response. When
+ no response is received, a warning is logged that
+ the mail may be delivered multiple times.
<b>smtp</b><i>_</i><b>quit</b><i>_</i><b>timeout</b>
- Timeout in seconds for sending the <b>QUIT</b> command,
- and for receiving the server response.
-
-<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
+ Timeout (default: seconds) for sending the <b>QUIT</b>
+ command, and for receiving the server response.
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
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
-
-
-
-
-
-
Rewrite <i>site</i>!<i>user</i> to <i>user</i>@<i>site</i>.
<b>Routing</b>
- <b>default</b><i>_</i><b>transport</b>
- The default transport to use when no transport is
- explicitly given in the <a href="transport.5.html"><b>transport</b>(5)</a> table.
-
- <b>relayhost</b>
- The default host to send mail to when no entry is
- matched in the <a href="transport.5.html"><b>transport</b>(5)</a> table.
+ <b>local</b><i>_</i><b>transport</b>
+ Where to deliver mail for destinations that match
+ $<b>mydestination</b> or $<b>inet</b><i>_</i><b>interfaces</b>. The default
+ transport is <b>local</b>.
- When no <b>relayhost</b> is specified, mail is routed
- directly to the destination's mail exchanger.
+ Syntax is <i>transport</i>:<i>nexthop</i>; see <a href="transport.5.html"><b>transport</b>(5)</a> for
+ details. The :<i>nexthop</i> part is optional.
- <b>transport</b><i>_</i><b>maps</b>
- List of tables with <i>domain</i> to (<i>transport,</i> <i>nexthop</i>)
- mappings.
+ <b>default</b><i>_</i><b>transport</b>
+ Where to deliver non-local mail when no information
+ is explicitly given in the <a href="transport.5.html"><b>transport</b>(5)</a> table. The
+ default transport is <b>smtp</b>.
+ Syntax is <i>transport</i>:<i>nexthop</i>; see <a href="transport.5.html"><b>transport</b>(5)</a> for
+ details. The :<i>nexthop</i> part is optional.
TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8)
+ <b>relayhost</b>
+ The default host to send non-local mail to when no
+ entry is matched in the <a href="transport.5.html"><b>transport</b>(5)</a> table.
+
+ When no <b>relayhost</b> is specified, mail is routed
+ directly to the destination's mail exchanger.
+
+ <b>transport</b><i>_</i><b>maps</b>
+ List of tables with <i>domain</i> to (<i>transport,</i> <i>nexthop</i>)
+ mappings.
+
<b>SEE</b> <b>ALSO</b>
<a href="master.8.html">master(8)</a> process manager
syslogd(8) system logging
<a href="transport.5.html">transport(5)</a> transport table format
<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>
-
-
-
-
-
-
-
-
-
-
-
.SH "Timeout controls"
.ad
.fi
+.PP
+The default time unit is seconds; an explicit time unit can
+be specified by appending a one-letter suffix: s (seconds),
+m (minutes), h (hours), d (days) or w (weeks).
.IP \fBsmtp_connect_timeout\fR
-Timeout in seconds for completing a TCP connection. When no
+Timeout (default: seconds) for completing a TCP connection. When no
connection can be made within the deadline, the SMTP client
tries the next address on the mail exchanger list.
.IP \fBsmtp_helo_timeout\fR
-Timeout in seconds for receiving the SMTP greeting banner.
+Timeout (default: seconds) for receiving the SMTP greeting banner.
When the server drops the connection without sending a
greeting banner, or when it sends no greeting banner within the
deadline, the SMTP client tries the next address on the mail
exchanger list.
.IP \fBsmtp_helo_timeout\fR
-Timeout in seconds for sending the \fBHELO\fR command, and for
+Timeout (default: seconds) for sending the \fBHELO\fR command, and for
receiving the server response.
.IP \fBsmtp_mail_timeout\fR
-Timeout in seconds for sending the \fBMAIL FROM\fR command, and for
+Timeout (default: seconds) for sending the \fBMAIL FROM\fR command, and for
receiving the server response.
.IP \fBsmtp_rcpt_timeout\fR
-Timeout in seconds for sending the \fBRCPT TO\fR command, and for
+Timeout (default: seconds) for sending the \fBRCPT TO\fR command, and for
receiving the server response.
.IP \fBsmtp_data_init_timeout\fR
-Timeout in seconds for sending the \fBDATA\fR command, and for
+Timeout (default: seconds) for sending the \fBDATA\fR command, and for
receiving the server response.
.IP \fBsmtp_data_xfer_timeout\fR
-Timeout in seconds for sending the message content.
+Timeout (default: seconds) for sending the message content.
.IP \fBsmtp_data_done_timeout\fR
-Timeout in seconds for sending the "\fB.\fR" command, and for
+Timeout (default: seconds) for sending the "\fB.\fR" command, and for
receiving the server response. When no response is received, a
warning is logged that the mail may be delivered multiple times.
.IP \fBsmtp_quit_timeout\fR
-Timeout in seconds for sending the \fBQUIT\fR command, and for
+Timeout (default: seconds) for sending the \fBQUIT\fR command, and for
receiving the server response.
.SH SEE ALSO
.na
.SH Routing
.ad
.fi
+.IP \fBlocal_transport\fR
+Where to deliver mail for destinations that match $\fBmydestination\fR
+or $\fBinet_interfaces\fR.
+The default transport is \fBlocal\fR.
+.sp
+Syntax is \fItransport\fR:\fInexthop\fR; see \fBtransport\fR(5)
+for details. The :\fInexthop\fR part is optional.
.IP \fBdefault_transport\fR
-The default transport to use when no transport is explicitly
+Where to deliver non-local mail when no information is explicitly
given in the \fBtransport\fR(5) table.
+The default transport is \fBsmtp\fR.
+.sp
+Syntax is \fItransport\fR:\fInexthop\fR; see \fBtransport\fR(5)
+for details. The :\fInexthop\fR part is optional.
.IP \fBrelayhost\fR
-The default host to send mail to when no entry is matched
+The default host to send non-local mail to when no entry is matched
in the \fBtransport\fR(5) table.
.sp
When no \fBrelayhost\fR is specified, mail is routed directly
if ((nexthop = split_at(saved_service, ':')) == 0 || *nexthop == 0)
nexthop = request->nexthop;
if (*transport == 0)
- transport = var_def_transport;
+ msg_fatal("missing transport name in \"%s\"", service);
/*
* Initialize.
* Version of this program.
*/
#define VAR_MAIL_VERSION "mail_version"
-#define DEF_MAIL_VERSION "Snapshot-20001213"
+#define DEF_MAIL_VERSION "Snapshot-20001214"
extern char *var_mail_version;
/* LICENSE
VAR_QUEUE_RUN_DELAY, DEF_QUEUE_RUN_DELAY, &var_queue_run_delay, 's', 1, 0,
VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 's', 1, 0,
VAR_MAX_BACKOFF_TIME, DEF_MAX_BACKOFF_TIME, &var_max_backoff_time, 's', 1, 0,
- VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 'd', 1, 1000,
+ VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 'd', 1, 8640000,
VAR_XPORT_RETRY_TIME, DEF_XPORT_RETRY_TIME, &var_transport_retry_time, 's', 1, 0,
0,
};
VAR_QUEUE_RUN_DELAY, DEF_QUEUE_RUN_DELAY, &var_queue_run_delay, 's', 1, 0,
VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 's', 1, 0,
VAR_MAX_BACKOFF_TIME, DEF_MAX_BACKOFF_TIME, &var_max_backoff_time, 's', 1, 0,
- VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 'd', 1, 1000,
+ VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 'd', 1, 8640000,
VAR_XPORT_RETRY_TIME, DEF_XPORT_RETRY_TIME, &var_transport_retry_time, 's', 1, 0,
0,
};
void resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop,
VSTRING *nextrcpt, int *flags)
{
+ char *myname = "resolve_addr";
VSTRING *addr_buf = vstring_alloc(100);
TOK822 *tree;
TOK822 *saved_domain = 0;
TOK822 *domain = 0;
+ char *destination;
*flags = 0;
if (tree->tail->type == '.' || tree->tail->type == '@') {
tok822_free_tree(tok822_sub_keep_before(tree, tree->tail));
continue;
- }
+ }
/*
* A lone empty string becomes the postmaster.
*/
else if (domain != 0) {
vstring_strcpy(channel, var_def_transport);
- if (*var_relayhost)
+ if ((destination = split_at(STR(channel), ':')) != 0 && *destination)
+ vstring_strcpy(nexthop, destination);
+ else if (*var_relayhost)
vstring_strcpy(nexthop, var_relayhost);
else
tok822_internalize(nexthop, domain->next, TOK822_STR_DEFL);
+ if (*STR(channel) == 0)
+ msg_fatal("null transport is not allowed: %s = %s",
+ VAR_DEF_TRANSPORT, var_def_transport);
}
/*
*/
else {
vstring_strcpy(channel, var_local_transport);
- vstring_strcpy(nexthop, var_myhostname);
+ if ((destination = split_at(STR(channel), ':')) == 0
+ || *destination == 0)
+ destination = var_myhostname;
+ vstring_strcpy(nexthop, destination);
+ if (*STR(channel) == 0)
+ msg_fatal("null transport is not allowed: %s = %s",
+ VAR_LOCAL_TRANSPORT, var_local_transport);
}
+ if (*STR(nexthop) == 0)
+ msg_panic("%s: null nexthop", myname);
/*
* Clean up.
/* transport_lookup - map a transport domain */
-int transport_lookup(const char *domain, VSTRING *channel, VSTRING *nexthop)
+int transport_lookup(const char *domain, VSTRING * channel, VSTRING * nexthop)
{
char *low_domain = lowercase(mystrdup(domain));
const char *name;
if (*(transport = saved_value) == 0)
transport = var_def_transport;
vstring_strcpy(channel, transport);
+ (void) split_at(vstring_str(channel), ':');
vstring_strcpy(nexthop, host);
myfree(saved_value);
found = 1;
/* .SH Routing
/* .ad
/* .fi
+/* .IP \fBlocal_transport\fR
+/* Where to deliver mail for destinations that match $\fBmydestination\fR
+/* or $\fBinet_interfaces\fR.
+/* The default transport is \fBlocal\fR.
+/* .sp
+/* Syntax is \fItransport\fR:\fInexthop\fR; see \fBtransport\fR(5)
+/* for details. The :\fInexthop\fR part is optional.
/* .IP \fBdefault_transport\fR
-/* The default transport to use when no transport is explicitly
+/* Where to deliver non-local mail when no information is explicitly
/* given in the \fBtransport\fR(5) table.
+/* The default transport is \fBsmtp\fR.
+/* .sp
+/* Syntax is \fItransport\fR:\fInexthop\fR; see \fBtransport\fR(5)
+/* for details. The :\fInexthop\fR part is optional.
/* .IP \fBrelayhost\fR
-/* The default host to send mail to when no entry is matched
+/* The default host to send non-local mail to when no entry is matched
/* in the \fBtransport\fR(5) table.
/* .sp
/* When no \fBrelayhost\fR is specified, mail is routed directly