Prereq: "2.4.1" diff -cr /var/tmp/postfix-2.4.1/src/global/mail_version.h ./src/global/mail_version.h *** /var/tmp/postfix-2.4.1/src/global/mail_version.h Mon Apr 23 19:22:51 2007 --- ./src/global/mail_version.h Wed May 30 20:19:10 2007 *************** *** 20,27 **** * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ ! #define MAIL_RELEASE_DATE "20070423" ! #define MAIL_VERSION_NUMBER "2.4.1" #ifdef SNAPSHOT # define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE --- 20,27 ---- * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ ! #define MAIL_RELEASE_DATE "20070530" ! #define MAIL_VERSION_NUMBER "2.4.2" #ifdef SNAPSHOT # define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE diff -cr /var/tmp/postfix-2.4.1/HISTORY ./HISTORY *** /var/tmp/postfix-2.4.1/HISTORY Mon Apr 23 19:21:53 2007 --- ./HISTORY Wed May 30 20:17:59 2007 *************** *** 13422,13424 **** --- 13422,13477 ---- with deadlock, "postfix stop" now forcefully stops all the processes in the master's process group, not just the master process alone. File: conf/postfix-script. + + 20070425 + + Bugfix: don't falsely report "lost connection from + localhost[127.0.0.1]" when Postfix is being portscanned. + Files: smtpd/smtpd_peer.c, qmqpd/qmqpd_peer.c. + + 20070430 + + Robustness: recommend a "0" process limit for policy servers + to avoid "connection refused" problems when the smtpd process + limit exceeds the default process limit. File: + proto/SMTPD_POLICY_README.html. + + 20070501 + + Safety: when IPv6 (or IPv4) is turned off, don't treat an + IPv6 (or IPv4) connection from e.g. inetd as if it comes + from localhost[127.0.0.1]. Files: smtpd/smtpd_peer.c, + qmqpd/qmqpd_peer.c. + + 20070508 + + Bugfix: Content-Transfer-Encoding: attribute values are + case insensitive. File: src/cleanup/cleanup_message.c. + + 20070514 + + Bugfix: mailbox_transport(_maps) and fallback_transport(_maps) + were broken when used with the error(8) or discard(8) + transports. Cause: insufficient documentation. Files: + error/error.c, discard/discard.c. + + 20070520 + + Bugfix (problem introduced Postfix 2.3): when DSN support + was introduced it broke "agressive" recipient duplicate + elimination with "enable_original_recipient = no". File: + cleanup/cleanup_out_recipient.c. + + 20070529 + + Bugfix (introduced Postfix 2.3): the sendmail/postdrop + commands would hang when trying to submit a message larger + than the per-message size limit. File: postdrop/postdrop.c. + + 20070530 + + Sabotage the saboteur who insists on breaking Postfix by + adding gethostbyname() calls that cause maildir delivery + to fail when the machine name is not found in /etc/hosts, + or that cause Postfix processes to hang when the network + is down. diff -cr /var/tmp/postfix-2.4.1/README_FILES/SMTPD_POLICY_README ./README_FILES/SMTPD_POLICY_README *** /var/tmp/postfix-2.4.1/README_FILES/SMTPD_POLICY_README Sun Mar 25 14:52:06 2007 --- ./README_FILES/SMTPD_POLICY_README Tue May 1 14:19:34 2007 *************** *** 43,48 **** --- 43,49 ---- Here is an example of all the attributes that the Postfix SMTP server sends in a delegated SMTPD access policy request: + PPoossttffiixx vveerrssiioonn 22..11 aanndd llaatteerr:: request=smtpd_access_policy protocol_state=RCPT protocol_name=SMTP *************** *** 170,176 **** use something like this: 1 /etc/postfix/master.cf: ! 2 policy unix - n n - - spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: --- 171,177 ---- use something like this: 1 /etc/postfix/master.cf: ! 2 policy unix - n n - 0 spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: *************** *** 190,202 **** "policy_time_limit" setting. The name of the parameter is the name of the master.cf entry ("policy") concatenated with the "_time_limit" suffix. * Lines 8, 9: always specify "check_policy_service" AFTER "reject_unauth_destination" or else your system could become an open relay. * Solaris UNIX-domain sockets do not work reliably. Use TCP sockets instead: 1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - - spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: --- 191,207 ---- "policy_time_limit" setting. The name of the parameter is the name of the master.cf entry ("policy") concatenated with the "_time_limit" suffix. + * Line 2: specify a "0" process limit instead of the default "-", to avoid + "connection refused" and other problems when the smtpd process limit + exceeds the default_process_limit setting. + * Lines 8, 9: always specify "check_policy_service" AFTER "reject_unauth_destination" or else your system could become an open relay. * Solaris UNIX-domain sockets do not work reliably. Use TCP sockets instead: 1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - 0 spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: *************** *** 264,270 **** socket that is accessible by Postfix processes only: 1 /etc/postfix/master.cf: ! 2 policy unix - n n - - spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: --- 269,275 ---- socket that is accessible by Postfix processes only: 1 /etc/postfix/master.cf: ! 2 policy unix - n n - 0 spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: *************** *** 282,292 **** "policy_time_limit" setting. The name of the parameter is the name of the master.cf entry ("policy") concatenated with the "_time_limit" suffix. On Solaris you must use inet: style sockets instead of unix: style, as detailed in the "Policy client/server configuration" section above. 1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - - spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: --- 287,301 ---- "policy_time_limit" setting. The name of the parameter is the name of the master.cf entry ("policy") concatenated with the "_time_limit" suffix. + * Line 2: specify a "0" process limit instead of the default "-", to avoid + "connection refused" and other problems when the smtpd process limit + exceeds the default_process_limit setting. + On Solaris you must use inet: style sockets instead of unix: style, as detailed in the "Policy client/server configuration" section above. 1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - 0 spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: diff -cr /var/tmp/postfix-2.4.1/html/SMTPD_POLICY_README.html ./html/SMTPD_POLICY_README.html *** /var/tmp/postfix-2.4.1/html/SMTPD_POLICY_README.html Sun Mar 25 14:52:06 2007 --- ./html/SMTPD_POLICY_README.html Tue May 1 14:19:34 2007 *************** *** 74,79 **** --- 74,80 ----
+ Postfix version 2.1 and later: request=smtpd_access_policy protocol_state=RCPT protocol_name=SMTP *************** *** 240,246 ****1 /etc/postfix/master.cf: ! 2 policy unix - n n - - spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: --- 241,247 ----1 /etc/postfix/master.cf: ! 2 policy unix - n n - 0 spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: *************** *** 265,270 **** --- 266,275 ---- the parameter is the name of the master.cf entry ("policy") concatenated with the "_time_limit" suffix. +Line 2: specify a "0" process limit instead of the default + "-", to avoid "connection refused" and other problems when the smtpd + process limit exceeds the default_process_limit setting.
+Lines 8, 9: always specify "check_policy_service" AFTER "reject_unauth_destination" or else your system could become an open relay.
*************** *** 277,283 ****1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - - spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: --- 282,288 ----1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - 0 spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: *************** *** 369,375 ****1 /etc/postfix/master.cf: ! 2 policy unix - n n - - spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: --- 374,380 ----1 /etc/postfix/master.cf: ! 2 policy unix - n n - 0 spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: *************** *** 392,397 **** --- 397,406 ---- the parameter is the name of the master.cf entry ("policy") concatenated with the "_time_limit" suffix. +Line 2: specify a "0" process limit instead of the default + "-", to avoid "connection refused" and other problems when the smtpd + process limit exceeds the default_process_limit setting.
+On Solaris you must use inet: style sockets instead of unix: *************** *** 401,407 ****
1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - - spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: --- 410,416 ----1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - 0 spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: diff -cr /var/tmp/postfix-2.4.1/html/error.8.html ./html/error.8.html *** /var/tmp/postfix-2.4.1/html/error.8.html Sat Mar 17 13:59:51 2007 --- ./html/error.8.html Tue May 15 17:08:34 2007 *************** *** 17,24 **** requests from the queue manager. Each request specifies a queue file, a sender address, the reason for non-delivery (specified as the next-hop destination), and recipient ! information. The reason may be prefixed with an RFC ! 3463-compatible detail code. This program expects to be run from the master(8) process manager. Depending on the service name in master.cf, error or --- 17,24 ---- requests from the queue manager. Each request specifies a queue file, a sender address, the reason for non-delivery (specified as the next-hop destination), and recipient ! information. The reason may be prefixed with an RFC ! 3463-compatible detail code. This program expects to be run from the master(8) process manager. Depending on the service name in master.cf, error or diff -cr /var/tmp/postfix-2.4.1/html/postconf.1.html ./html/postconf.1.html *** /var/tmp/postfix-2.4.1/html/postconf.1.html Sat Mar 17 13:59:54 2007 --- ./html/postconf.1.html Thu Apr 26 15:35:32 2007 *************** *** 177,184 **** tcp (read-only) Perform lookups using a simple request-reply protocol that is described in tcp_table(5). ! This feature is not included with Postfix ! 2.2. unix (read-only) A limited way to query the UNIX authentica- --- 177,184 ---- tcp (read-only) Perform lookups using a simple request-reply protocol that is described in tcp_table(5). ! This feature is not included with the stable ! Postfix release. unix (read-only) A limited way to query the UNIX authentica- diff -cr /var/tmp/postfix-2.4.1/man/man1/postconf.1 ./man/man1/postconf.1 *** /var/tmp/postfix-2.4.1/man/man1/postconf.1 Sat Mar 17 13:59:50 2007 --- ./man/man1/postconf.1 Thu Apr 26 15:35:31 2007 *************** *** 152,158 **** .IP "\fBtcp\fR (read-only)" Perform lookups using a simple request-reply protocol that is described in \fBtcp_table\fR(5). ! This feature is not included with Postfix 2.2. .IP "\fBunix\fR (read-only)" A limited way to query the UNIX authentication database. The following tables are implemented: --- 152,158 ---- .IP "\fBtcp\fR (read-only)" Perform lookups using a simple request-reply protocol that is described in \fBtcp_table\fR(5). ! This feature is not included with the stable Postfix release. .IP "\fBunix\fR (read-only)" A limited way to query the UNIX authentication database. The following tables are implemented: diff -cr /var/tmp/postfix-2.4.1/proto/SMTPD_POLICY_README.html ./proto/SMTPD_POLICY_README.html *** /var/tmp/postfix-2.4.1/proto/SMTPD_POLICY_README.html Sun Mar 25 14:52:04 2007 --- ./proto/SMTPD_POLICY_README.html Tue May 1 13:34:30 2007 *************** *** 74,79 **** --- 74,80 ----+ Postfix version 2.1 and later: request=smtpd_access_policy protocol_state=RCPT protocol_name=SMTP *************** *** 240,246 ****1 /etc/postfix/master.cf: ! 2 policy unix - n n - - spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: --- 241,247 ----1 /etc/postfix/master.cf: ! 2 policy unix - n n - 0 spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: *************** *** 265,270 **** --- 266,275 ---- the parameter is the name of the master.cf entry ("policy") concatenated with the "_time_limit" suffix. +Line 2: specify a "0" process limit instead of the default + "-", to avoid "connection refused" and other problems when the smtpd + process limit exceeds the default_process_limit setting.
+Lines 8, 9: always specify "check_policy_service" AFTER "reject_unauth_destination" or else your system could become an open relay.
*************** *** 277,283 ****1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - - spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: --- 282,288 ----1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - 0 spawn 3 user=nobody argv=/some/where/policy-server 4 5 /etc/postfix/main.cf: *************** *** 369,375 ****1 /etc/postfix/master.cf: ! 2 policy unix - n n - - spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: --- 374,380 ----1 /etc/postfix/master.cf: ! 2 policy unix - n n - 0 spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: *************** *** 392,397 **** --- 397,406 ---- the parameter is the name of the master.cf entry ("policy") concatenated with the "_time_limit" suffix. +Line 2: specify a "0" process limit instead of the default + "-", to avoid "connection refused" and other problems when the smtpd + process limit exceeds the default_process_limit setting.
+On Solaris you must use inet: style sockets instead of unix: *************** *** 401,407 ****
1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - - spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: --- 410,416 ----1 /etc/postfix/master.cf: ! 2 127.0.0.1:9998 inet n n n - 0 spawn 3 user=nobody argv=/usr/bin/perl /usr/libexec/postfix/greylist.pl 4 5 /etc/postfix/main.cf: diff -cr /var/tmp/postfix-2.4.1/src/cleanup/cleanup_message.c ./src/cleanup/cleanup_message.c *** /var/tmp/postfix-2.4.1/src/cleanup/cleanup_message.c Sat Mar 10 18:20:29 2007 --- ./src/cleanup/cleanup_message.c Tue May 8 12:41:42 2007 *************** *** 515,521 **** if (hdr_opts->type == HDR_CONTENT_TRANSFER_ENCODING) { for (cmp = code_map; cmp->name != 0; cmp++) { if (strcasecmp(hdrval, cmp->name) == 0) { ! if (strcmp(cmp->encoding, MAIL_ATTR_ENC_8BIT) == 0) nvtable_update(state->attr, MAIL_ATTR_ENCODING, cmp->encoding); break; --- 515,521 ---- if (hdr_opts->type == HDR_CONTENT_TRANSFER_ENCODING) { for (cmp = code_map; cmp->name != 0; cmp++) { if (strcasecmp(hdrval, cmp->name) == 0) { ! if (strcasecmp(cmp->encoding, MAIL_ATTR_ENC_8BIT) == 0) nvtable_update(state->attr, MAIL_ATTR_ENCODING, cmp->encoding); break; diff -cr /var/tmp/postfix-2.4.1/src/cleanup/cleanup_out_recipient.c ./src/cleanup/cleanup_out_recipient.c *** /var/tmp/postfix-2.4.1/src/cleanup/cleanup_out_recipient.c Thu Jan 5 19:22:04 2006 --- ./src/cleanup/cleanup_out_recipient.c Sun May 20 12:29:53 2007 *************** *** 127,139 **** * Distinguish between different original recipient addresses that map * onto the same mailbox. The recipient will use our original recipient * message header to figure things out. */ #define STREQ(x, y) (strcmp((x), (y)) == 0) if ((state->flags & CLEANUP_FLAG_MAP_OK) == 0 || cleanup_virt_alias_maps == 0) { ! if (been_here(state->dups, "%s\n%d\n%s\n%s", ! dsn_orcpt, dsn_notify, orcpt, recip) == 0) { if (dsn_notify) cleanup_out_format(state, REC_TYPE_ATTR, "%s=%d", MAIL_ATTR_DSN_NOTIFY, dsn_notify); --- 127,146 ---- * Distinguish between different original recipient addresses that map * onto the same mailbox. The recipient will use our original recipient * message header to figure things out. + * + * Postfix 2.2 compatibility: when ignoring differences in Postfix original + * recipient information, also ignore differences in DSN attributes. We + * do, however, keep the DSN attributes of the recipient that survives + * duplicate elimination. */ #define STREQ(x, y) (strcmp((x), (y)) == 0) if ((state->flags & CLEANUP_FLAG_MAP_OK) == 0 || cleanup_virt_alias_maps == 0) { ! if ((var_enable_orcpt ? ! been_here(state->dups, "%s\n%d\n%s\n%s", ! dsn_orcpt, dsn_notify, orcpt, recip) : ! been_here_fixed(state->dups, recip)) == 0) { if (dsn_notify) cleanup_out_format(state, REC_TYPE_ATTR, "%s=%d", MAIL_ATTR_DSN_NOTIFY, dsn_notify); *************** *** 181,186 **** --- 188,198 ---- * notifications. The queue manager will flush the trace (and bounce) * logfile, possibly after it has generated its own success or failure * notification records. + * + * Postfix 2.2 compatibility: when ignoring differences in Postfix original + * recipient information, also ignore differences in DSN attributes. We + * do, however, keep the DSN attributes of the recipient that survives + * duplicate elimination. */ else { RECIPIENT rcpt; *************** *** 198,205 **** dsn_notify & ~DSN_NOTIFY_SUCCESS); } for (cpp = argv->argv; *cpp; cpp++) { ! if (been_here(state->dups, "%s\n%d\n%s\n%s", ! dsn_orcpt, dsn_notify, orcpt, *cpp) == 0) { if (dsn_notify) cleanup_out_format(state, REC_TYPE_ATTR, "%s=%d", MAIL_ATTR_DSN_NOTIFY, dsn_notify); --- 210,219 ---- dsn_notify & ~DSN_NOTIFY_SUCCESS); } for (cpp = argv->argv; *cpp; cpp++) { ! if ((var_enable_orcpt ? ! been_here(state->dups, "%s\n%d\n%s\n%s", ! dsn_orcpt, dsn_notify, orcpt, *cpp) : ! been_here_fixed(state->dups, *cpp)) == 0) { if (dsn_notify) cleanup_out_format(state, REC_TYPE_ATTR, "%s=%d", MAIL_ATTR_DSN_NOTIFY, dsn_notify); diff -cr /var/tmp/postfix-2.4.1/src/discard/discard.c ./src/discard/discard.c *** /var/tmp/postfix-2.4.1/src/discard/discard.c Sat Mar 17 13:59:38 2007 --- ./src/discard/discard.c Tue May 15 11:15:04 2007 *************** *** 174,186 **** (void) DSN_SIMPLE(&dsn, DSN_STATUS(dp.dsn), dp.text); for (nrcpt = 0; nrcpt < request->rcpt_list.len; nrcpt++) { rcpt = request->rcpt_list.info + nrcpt; ! if (rcpt->offset >= 0) { ! status = sent(BOUNCE_FLAGS(request), request->queue_id, ! &request->msg_stats, rcpt, "none", &dsn); ! if (status == 0 && (request->flags & DEL_REQ_FLAG_SUCCESS)) ! deliver_completed(src, rcpt->offset); ! result |= status; ! } } /* --- 174,184 ---- (void) DSN_SIMPLE(&dsn, DSN_STATUS(dp.dsn), dp.text); for (nrcpt = 0; nrcpt < request->rcpt_list.len; nrcpt++) { rcpt = request->rcpt_list.info + nrcpt; ! status = sent(BOUNCE_FLAGS(request), request->queue_id, ! &request->msg_stats, rcpt, "none", &dsn); ! if (status == 0 && (request->flags & DEL_REQ_FLAG_SUCCESS)) ! deliver_completed(src, rcpt->offset); ! result |= status; } /* diff -cr /var/tmp/postfix-2.4.1/src/error/error.c ./src/error/error.c *** /var/tmp/postfix-2.4.1/src/error/error.c Sat Mar 17 13:59:38 2007 --- ./src/error/error.c Tue May 15 11:14:04 2007 *************** *** 181,193 **** (void) DSN_SIMPLE(&dsn, DSN_STATUS(dp.dsn), dp.text); for (nrcpt = 0; nrcpt < request->rcpt_list.len; nrcpt++) { rcpt = request->rcpt_list.info + nrcpt; ! if (rcpt->offset >= 0) { ! status = append(BOUNCE_FLAGS(request), request->queue_id, ! &request->msg_stats, rcpt, "none", &dsn); ! if (status == 0) ! deliver_completed(src, rcpt->offset); ! result |= status; ! } } /* --- 181,191 ---- (void) DSN_SIMPLE(&dsn, DSN_STATUS(dp.dsn), dp.text); for (nrcpt = 0; nrcpt < request->rcpt_list.len; nrcpt++) { rcpt = request->rcpt_list.info + nrcpt; ! status = append(BOUNCE_FLAGS(request), request->queue_id, ! &request->msg_stats, rcpt, "none", &dsn); ! if (status == 0) ! deliver_completed(src, rcpt->offset); ! result |= status; } /* diff -cr /var/tmp/postfix-2.4.1/src/local/mailbox.c ./src/local/mailbox.c *** /var/tmp/postfix-2.4.1/src/local/mailbox.c Mon Jun 26 08:59:19 2006 --- ./src/local/mailbox.c Tue May 15 16:14:21 2007 *************** *** 271,276 **** --- 271,277 ---- if (*var_mbox_transp_maps && transp_maps == 0) transp_maps = maps_create(VAR_MBOX_TRANSP_MAPS, var_mbox_transp_maps, DICT_FLAG_LOCK | DICT_FLAG_NO_REGSUB); + /* The -1 is a hint for the down-stream deliver_completed() function. */ if (*var_mbox_transp_maps && (map_transport = maps_find(transp_maps, state.msg_attr.user, DICT_FLAG_NONE)) != 0) { diff -cr /var/tmp/postfix-2.4.1/src/local/unknown.c ./src/local/unknown.c *** /var/tmp/postfix-2.4.1/src/local/unknown.c Mon Jun 26 08:59:19 2006 --- ./src/local/unknown.c Tue May 15 16:14:28 2007 *************** *** 109,117 **** --- 109,119 ---- if (*var_fbck_transp_maps && transp_maps == 0) transp_maps = maps_create(VAR_FBCK_TRANSP_MAPS, var_fbck_transp_maps, DICT_FLAG_LOCK | DICT_FLAG_NO_REGSUB); + /* The -1 is a hint for the down-stream deliver_completed() function. */ if (*var_fbck_transp_maps && (map_transport = maps_find(transp_maps, state.msg_attr.user, DICT_FLAG_NONE)) != 0) { + state.msg_attr.rcpt.offset = -1L; return (deliver_pass(MAIL_CLASS_PRIVATE, map_transport, state.request, &state.msg_attr.rcpt)); } diff -cr /var/tmp/postfix-2.4.1/src/postconf/postconf.c ./src/postconf/postconf.c *** /var/tmp/postfix-2.4.1/src/postconf/postconf.c Sat Mar 17 13:59:38 2007 --- ./src/postconf/postconf.c Thu Apr 26 15:34:57 2007 *************** *** 146,152 **** /* .IP "\fBtcp\fR (read-only)" /* Perform lookups using a simple request-reply protocol that is /* described in \fBtcp_table\fR(5). ! /* This feature is not included with Postfix 2.2. /* .IP "\fBunix\fR (read-only)" /* A limited way to query the UNIX authentication database. The /* following tables are implemented: --- 146,152 ---- /* .IP "\fBtcp\fR (read-only)" /* Perform lookups using a simple request-reply protocol that is /* described in \fBtcp_table\fR(5). ! /* This feature is not included with the stable Postfix release. /* .IP "\fBunix\fR (read-only)" /* A limited way to query the UNIX authentication database. The /* following tables are implemented: diff -cr /var/tmp/postfix-2.4.1/src/postdrop/postdrop.c ./src/postdrop/postdrop.c *** /var/tmp/postfix-2.4.1/src/postdrop/postdrop.c Sat Mar 17 13:59:38 2007 --- ./src/postdrop/postdrop.c Tue May 29 20:22:55 2007 *************** *** 438,446 **** if (REC_PUT_BUF(dst->stream, rec_type, buf) < 0) { /* rec_get() errors must not clobber errno. */ saved_errno = errno; ! while (rec_get_raw(VSTREAM_IN, buf, var_line_limit, ! REC_FLAG_NONE) > 0) ! /* void */ ; errno = saved_errno; break; } --- 438,448 ---- if (REC_PUT_BUF(dst->stream, rec_type, buf) < 0) { /* rec_get() errors must not clobber errno. */ saved_errno = errno; ! while ((rec_type = rec_get_raw(VSTREAM_IN, buf, var_line_limit, ! REC_FLAG_NONE)) != REC_TYPE_END ! && rec_type != REC_TYPE_EOF) ! if (rec_type == REC_TYPE_ERROR) ! msg_fatal("uid=%ld: malformed input", (long) uid); errno = saved_errno; break; } diff -cr /var/tmp/postfix-2.4.1/src/qmqpd/qmqpd_peer.c ./src/qmqpd/qmqpd_peer.c *** /var/tmp/postfix-2.4.1/src/qmqpd/qmqpd_peer.c Mon Jun 26 08:59:19 2006 --- ./src/qmqpd/qmqpd_peer.c Tue May 1 17:10:51 2007 *************** *** 91,97 **** /* * If peer went away, give up. */ ! if (errno == ECONNRESET || errno == ECONNABORTED) { state->name = mystrdup(CLIENT_NAME_UNKNOWN); state->addr = mystrdup(CLIENT_ADDR_UNKNOWN); state->rfc_addr = mystrdup(CLIENT_ADDR_UNKNOWN); --- 91,97 ---- /* * If peer went away, give up. */ ! if (errno != 0 && errno != ENOTSOCK) { state->name = mystrdup(CLIENT_NAME_UNKNOWN); state->addr = mystrdup(CLIENT_ADDR_UNKNOWN); state->rfc_addr = mystrdup(CLIENT_ADDR_UNKNOWN); *************** *** 100,112 **** /* * Convert the client address to printable address and hostname. */ else if (errno == 0 ! && strchr((char *) proto_info->sa_family_list, sa->sa_family)) { MAI_HOSTNAME_STR client_name; MAI_HOSTADDR_STR client_addr; int aierr; char *colonp; /* * Sorry, but there are some things that we just cannot do while --- 100,130 ---- /* * Convert the client address to printable address and hostname. + * + * XXX If we're given an IPv6 (or IPv4) connection from, e.g., inetd, while + * Postfix IPv6 (or IPv4) support is turned off, don't (skip to the final + * else clause, pretend the origin is localhost[127.0.0.1], and become an + * open relay). */ else if (errno == 0 ! && (sa->sa_family == AF_INET ! #ifdef AF_INET6 ! || sa->sa_family == AF_INET6 ! #endif ! )) { MAI_HOSTNAME_STR client_name; MAI_HOSTADDR_STR client_addr; int aierr; char *colonp; + + /* + * Sanity check: we can't use sockets that we're not configured for. + */ + if (strchr((char *) proto_info->sa_family_list, sa->sa_family) == 0) + msg_fatal("cannot handle socket type %s with \"%s = %s\"", + sa->sa_family == AF_INET6 ? "AF_INET6" : + sa->sa_family == AF_INET ? "AF_INET" : + "other", VAR_INET_PROTOCOLS, var_inet_protocols); /* * Sorry, but there are some things that we just cannot do while diff -cr /var/tmp/postfix-2.4.1/src/smtpd/smtpd_peer.c ./src/smtpd/smtpd_peer.c *** /var/tmp/postfix-2.4.1/src/smtpd/smtpd_peer.c Sat Sep 30 10:13:57 2006 --- ./src/smtpd/smtpd_peer.c Tue May 1 17:10:54 2007 *************** *** 162,168 **** /* * If peer went away, give up. */ ! if (errno == ECONNRESET || errno == ECONNABORTED) { state->name = mystrdup(CLIENT_NAME_UNKNOWN); state->reverse_name = mystrdup(CLIENT_NAME_UNKNOWN); state->addr = mystrdup(CLIENT_ADDR_UNKNOWN); --- 162,168 ---- /* * If peer went away, give up. */ ! if (errno != 0 && errno != ENOTSOCK) { state->name = mystrdup(CLIENT_NAME_UNKNOWN); state->reverse_name = mystrdup(CLIENT_NAME_UNKNOWN); state->addr = mystrdup(CLIENT_ADDR_UNKNOWN); *************** *** 174,186 **** /* * Convert the client address to printable address and hostname. */ else if (errno == 0 ! && strchr((char *) proto_info->sa_family_list, sa->sa_family)) { MAI_HOSTNAME_STR client_name; MAI_HOSTADDR_STR client_addr; int aierr; char *colonp; /* * Sorry, but there are some things that we just cannot do while --- 174,204 ---- /* * Convert the client address to printable address and hostname. + * + * XXX If we're given an IPv6 (or IPv4) connection from, e.g., inetd, while + * Postfix IPv6 (or IPv4) support is turned off, don't (skip to the final + * else clause, pretend the origin is localhost[127.0.0.1], and become an + * open relay). */ else if (errno == 0 ! && (sa->sa_family == AF_INET ! #ifdef AF_INET6 ! || sa->sa_family == AF_INET6 ! #endif ! )) { MAI_HOSTNAME_STR client_name; MAI_HOSTADDR_STR client_addr; int aierr; char *colonp; + + /* + * Sanity check: we can't use sockets that we're not configured for. + */ + if (strchr((char *) proto_info->sa_family_list, sa->sa_family) == 0) + msg_fatal("cannot handle socket type %s with \"%s = %s\"", + sa->sa_family == AF_INET6 ? "AF_INET6" : + sa->sa_family == AF_INET ? "AF_INET" : + "other", VAR_INET_PROTOCOLS, var_inet_protocols); /* * Sorry, but there are some things that we just cannot do while diff -cr /var/tmp/postfix-2.4.1/src/util/get_hostname.c ./src/util/get_hostname.c *** /var/tmp/postfix-2.4.1/src/util/get_hostname.c Sun Jan 28 09:00:12 2001 --- ./src/util/get_hostname.c Wed May 30 20:08:21 2007 *************** *** 61,73 **** --- 61,83 ---- * part of the socket interface library. We avoid the more politically- * correct uname() routine because that has no portable way of dealing * with long (FQDN) hostnames. + * + * DO NOT CALL GETHOSTBYNAME FROM THIS FUNCTION. IT BREAKS MAILDIR DELIVERY + * AND OTHER THINGS WHEN THE MACHINE NAME IS NOT FOUND IN /ETC/HOSTS OR + * CAUSES PROCESSES TO HANG WHEN THE NETWORK IS DISCONNECTED. + * + * POSTFIX NO LONGER NEEDS A FULLY QUALIFIED HOSTNAME. INSTEAD POSTFIX WILL + * USE A DEFAULT DOMAIN NAME "LOCALDOMAIN". */ if (my_host_name == 0) { + /* DO NOT CALL GETHOSTBYNAME FROM THIS FUNCTION */ if (gethostname(namebuf, sizeof(namebuf)) < 0) msg_fatal("gethostname: %m"); namebuf[MAXHOSTNAMELEN] = 0; + /* DO NOT CALL GETHOSTBYNAME FROM THIS FUNCTION */ if (valid_hostname(namebuf, DO_GRIPE) == 0) msg_fatal("unable to use my own hostname"); + /* DO NOT CALL GETHOSTBYNAME FROM THIS FUNCTION */ my_host_name = mystrdup(namebuf); } return (my_host_name);