From: Wietse Venema Date: Thu, 14 Dec 2000 05:00:00 +0000 (-0500) Subject: snapshot-20001214 X-Git-Tag: v20010228~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f4f370bedcd580c5be42c099f502c02b5731454;p=thirdparty%2Fpostfix.git snapshot-20001214 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index a60c73372..9993b0e0e 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -4632,3 +4632,10 @@ Apologies for any names omitted. 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. diff --git a/postfix/SASL_README b/postfix/SASL_README index 537337715..243c98bd4 100644 --- a/postfix/SASL_README +++ b/postfix/SASL_README @@ -10,6 +10,9 @@ Postfix+SASL 1.5.5 appears to work on RedHat 6.1 (pwcheck_method 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. @@ -102,6 +105,11 @@ Postfix SMTP server needs read access to the sasldb file - you may 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: @@ -112,7 +120,7 @@ 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. @@ -135,6 +143,12 @@ Instead of dGVzdAB0ZXN0AHRlc3RwYXNz, specify the base64 encoded 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 ======================================================= diff --git a/postfix/conf/main.cf b/postfix/conf/main.cf index a2a81298b..38ae9fcd8 100644 --- a/postfix/conf/main.cf +++ b/postfix/conf/main.cf @@ -270,12 +270,25 @@ mail_owner = postfix # 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 diff --git a/postfix/conf/sample-local.cf b/postfix/conf/sample-local.cf index 183e524ff..d7b7e0268 100644 --- a/postfix/conf/sample-local.cf +++ b/postfix/conf/sample-local.cf @@ -37,6 +37,12 @@ require_home_directory = no # 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 # @@ -159,9 +165,9 @@ mailbox_command = # 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 @@ -172,9 +178,9 @@ mailbox_transport = # 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 diff --git a/postfix/conf/sample-misc.cf b/postfix/conf/sample-misc.cf index 436767b3c..0b55f1ce3 100644 --- a/postfix/conf/sample-misc.cf +++ b/postfix/conf/sample-misc.cf @@ -28,7 +28,12 @@ daemon_timeout = 18000 # 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 diff --git a/postfix/html/smtp.8.html b/postfix/html/smtp.8.html index 99b5aa3ae..874def288 100644 --- a/postfix/html/smtp.8.html +++ b/postfix/html/smtp.8.html @@ -209,54 +209,54 @@ SMTP(8) SMTP(8) default_destination_recipient_limit parameter. Timeout controls + 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). + smtp_connect_timeout - 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. smtp_helo_timeout - 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. smtp_helo_timeout - Timeout in seconds for sending the HELO command, - and for receiving the server response. + Timeout (default: seconds) for sending the HELO + command, and for receiving the server response. smtp_mail_timeout - Timeout in seconds for sending the MAIL FROM com- - mand, and for receiving the server response. + Timeout (default: seconds) for sending the MAIL + FROM command, and for receiving the server + response. smtp_rcpt_timeout - Timeout in seconds for sending the RCPT TO command, - and for receiving the server response. + Timeout (default: seconds) for sending the RCPT TO + command, and for receiving the server response. smtp_data_init_timeout - Timeout in seconds for sending the DATA command, - and for receiving the server response. + Timeout (default: seconds) for sending the DATA + command, and for receiving the server response. smtp_data_xfer_timeout - Timeout in seconds for sending the message content. + Timeout (default: seconds) for sending the message + content. smtp_data_done_timeout - Timeout in seconds for sending the "." 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 "." 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. smtp_quit_timeout - Timeout in seconds for sending the QUIT command, - and for receiving the server response. - -SEE ALSO - bounce(8) non-delivery status reports - master(8) process manager - qmgr(8) queue manager - syslogd(8) system logging + Timeout (default: seconds) for sending the QUIT + command, and for receiving the server response. @@ -269,8 +269,14 @@ SMTP(8) SMTP(8) SMTP(8) SMTP(8) +SEE ALSO + bounce(8) non-delivery status reports + master(8) process manager + qmgr(8) queue manager + syslogd(8) system logging + LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) @@ -313,12 +319,6 @@ SMTP(8) SMTP(8) - - - - - - diff --git a/postfix/html/trivial-rewrite.8.html b/postfix/html/trivial-rewrite.8.html index 08ff75d86..ce97479f8 100644 --- a/postfix/html/trivial-rewrite.8.html +++ b/postfix/html/trivial-rewrite.8.html @@ -109,21 +109,21 @@ TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8) Rewrite site!user to user@site. Routing - default_transport - The default transport to use when no transport is - explicitly given in the transport(5) table. - - relayhost - The default host to send mail to when no entry is - matched in the transport(5) table. + local_transport + Where to deliver mail for destinations that match + $mydestination or $inet_interfaces. The default + transport is local. - When no relayhost is specified, mail is routed - directly to the destination's mail exchanger. + Syntax is transport:nexthop; see transport(5) for + details. The :nexthop part is optional. - transport_maps - List of tables with domain to (transport, nexthop) - mappings. + default_transport + Where to deliver non-local mail when no information + is explicitly given in the transport(5) table. The + default transport is smtp. + Syntax is transport:nexthop; see transport(5) for + details. The :nexthop part is optional. @@ -137,13 +137,24 @@ TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8) + relayhost + The default host to send non-local mail to when no + entry is matched in the transport(5) table. + + When no relayhost is specified, mail is routed + directly to the destination's mail exchanger. + + transport_maps + List of tables with domain to (transport, nexthop) + mappings. + SEE ALSO master(8) process manager syslogd(8) system logging transport(5) transport table format LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) @@ -171,17 +182,6 @@ TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8) - - - - - - - - - - - diff --git a/postfix/man/man8/smtp.8 b/postfix/man/man8/smtp.8 index 976874a97..46a79e3f7 100644 --- a/postfix/man/man8/smtp.8 +++ b/postfix/man/man8/smtp.8 @@ -153,36 +153,40 @@ The default limit is taken from the .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 diff --git a/postfix/man/man8/trivial-rewrite.8 b/postfix/man/man8/trivial-rewrite.8 index 2af0a0bcf..bf110a702 100644 --- a/postfix/man/man8/trivial-rewrite.8 +++ b/postfix/man/man8/trivial-rewrite.8 @@ -94,11 +94,22 @@ Rewrite \fIsite\fR!\fIuser\fR to \fIuser\fR@\fIsite\fR. .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 diff --git a/postfix/src/global/deliver_pass.c b/postfix/src/global/deliver_pass.c index f9ceda49f..2deec8c3c 100644 --- a/postfix/src/global/deliver_pass.c +++ b/postfix/src/global/deliver_pass.c @@ -142,7 +142,7 @@ int deliver_pass(const char *class, const char *service, 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. diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 8ae399bca..bf0df24ef 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -15,7 +15,7 @@ * 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 diff --git a/postfix/src/nqmgr/qmgr.c b/postfix/src/nqmgr/qmgr.c index 94c26a6ef..a5fbfa918 100644 --- a/postfix/src/nqmgr/qmgr.c +++ b/postfix/src/nqmgr/qmgr.c @@ -513,7 +513,7 @@ int main(int argc, char **argv) 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, }; diff --git a/postfix/src/qmgr/qmgr.c b/postfix/src/qmgr/qmgr.c index 30fd919f4..af6759542 100644 --- a/postfix/src/qmgr/qmgr.c +++ b/postfix/src/qmgr/qmgr.c @@ -476,7 +476,7 @@ int main(int argc, char **argv) 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, }; diff --git a/postfix/src/trivial-rewrite/resolve.c b/postfix/src/trivial-rewrite/resolve.c index bc1fa58fb..bd99fa61a 100644 --- a/postfix/src/trivial-rewrite/resolve.c +++ b/postfix/src/trivial-rewrite/resolve.c @@ -85,10 +85,12 @@ 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; @@ -115,7 +117,7 @@ void resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop, 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. @@ -205,10 +207,15 @@ void resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop, */ 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); } /* @@ -217,8 +224,16 @@ void resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop, */ 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. diff --git a/postfix/src/trivial-rewrite/transport.c b/postfix/src/trivial-rewrite/transport.c index e8ceee266..62e677728 100644 --- a/postfix/src/trivial-rewrite/transport.c +++ b/postfix/src/trivial-rewrite/transport.c @@ -81,7 +81,7 @@ void transport_init(void) /* 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; @@ -121,6 +121,7 @@ int transport_lookup(const char *domain, VSTRING *channel, VSTRING *nexthop) 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; diff --git a/postfix/src/trivial-rewrite/trivial-rewrite.c b/postfix/src/trivial-rewrite/trivial-rewrite.c index c533a9aeb..61624ada5 100644 --- a/postfix/src/trivial-rewrite/trivial-rewrite.c +++ b/postfix/src/trivial-rewrite/trivial-rewrite.c @@ -78,11 +78,22 @@ /* .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