From: Wietse Venema Date: Sat, 30 Sep 2006 05:00:00 +0000 (-0500) Subject: postfix-2.4-20060930 X-Git-Tag: v2.4.0-RC1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=911ee6f58251a816f6fa49a83ce4727d7eb4684d;p=thirdparty%2Fpostfix.git postfix-2.4-20060930 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 5a4e44d96..2ff259e00 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -12741,14 +12741,33 @@ Apologies for any names omitted. Cleanup: record loop detection. File: global/record.c. +20060929 + + Workaround: AIX 5.[1-3] getaddrinfo() creates socket address + structures with a non-zero port value. This breaks the + smtp_bind_address etc. features, and breaks inet_interfaces + settings with only one IP address. Problem reported by + Hamish Marson. Files: util/sock_addr.[hc], util/myaddrinfo.c. + + Bugfix (introduced with the Postfix TLS patch): memory leak + in verify_extract_peer(). The OpenSSL documentation provides + no information on how subjectAltNames are managed. Sam + Rushing, ironport. File: tls/tls_client.c. + + Bugfix (introduced with Postfix 2.2): smtp_generic_maps + turned on MIME conversion. File: smtp/smtp_proto.c. + Wish list: + Update FILTER_README with mailing list suggestions to tag + with a badness indicator and then filter down-stream. + Either document or remove the internal_mail_filter_classes feature (it's disabled by default). Build a command-line test driver for the cleanup engine. - This allows us to generate arbitrary record sequences without - having to hijack mail from the queue. + This allows us to test it with arbitrary record sequences + without having to use a live mail queue. Make null local-part handling configurable: either expand into mailer-daemon (current bahavior) or disallow (strict diff --git a/postfix/README_FILES/MYSQL_README b/postfix/README_FILES/MYSQL_README index 6ebbc234e..403fc736c 100644 --- a/postfix/README_FILES/MYSQL_README +++ b/postfix/README_FILES/MYSQL_README @@ -35,6 +35,13 @@ mysqlclient library (and libm) to AUXLIBS, for example: 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include' \ 'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm' +On Solaris, use this instead: + + make -f Makefile.init makefiles \ + 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include' \ + 'AUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib \ + -lmysqlclient -lz -lm' + Then, just run 'make'. This requires libz, the compression library. Older mysql implementations build without libz. diff --git a/postfix/auxiliary/qshape/qshape.pl b/postfix/auxiliary/qshape/qshape.pl index 511126569..67d378984 100644 --- a/postfix/auxiliary/qshape/qshape.pl +++ b/postfix/auxiliary/qshape/qshape.pl @@ -19,7 +19,7 @@ # Postfix queue message distribution in time and by sender domain # or recipient domain. The program needs read access to the queue # directories and queue files, so it must run as the superuser or -# the \fBmail_owner\fR specified in \fImain.cf\fR (typically +# the \fBmail_owner\fR specified in \fBmain.cf\fR (typically # \fBpostfix\fR). # # Options: @@ -73,8 +73,8 @@ # the incoming and active queues. To display a different set of # queues, just list their directory names on the command line. # Absolute paths are used as is, other paths are taken relative -# to the \fImain.cf\fR \fBqueue_directory\fR parameter setting. -# While \fImain.cf\fR supports the use of \fI$variable\fR expansion +# to the \fBmain.cf\fR \fBqueue_directory\fR parameter setting. +# While \fBmain.cf\fR supports the use of \fI$variable\fR expansion # in the definition of the \fBqueue_directory\fR parameter, the # \fBqshape\fR program does not. If you must use variable expansions # in the \fBqueue_directory\fR setting, you must specify an explicit diff --git a/postfix/html/MYSQL_README.html b/postfix/html/MYSQL_README.html index f243075c2..933059e5f 100644 --- a/postfix/html/MYSQL_README.html +++ b/postfix/html/MYSQL_README.html @@ -57,13 +57,24 @@ make -f Makefile.init makefiles \ +

On Solaris, use this instead:

+ +
+
+make -f Makefile.init makefiles \
+    'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include' \
+    'AUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib \
+        -lmysqlclient -lz -lm'
+
+
+

Then, just run 'make'. This requires libz, the compression library. Older mysql implementations build without libz.

Using MySQL tables

Once Postfix is built with mysql support, you can specify a -map type in main.cf like this:

+map type in main.cf like this:

@@ -126,7 +137,7 @@ will be deferred until at least one of those hosts is reachable.
 Marcus, IC Group, Inc.
 
 
  • Liviu Daia revised the configuration interface and added the -main.cf configuration feature.
  • +main.cf configuration feature.
  • Liviu Daia with further refinements from Jose Luis Tallon and Victor Duchovni developed the common query, result_format, domain and diff --git a/postfix/html/postalias.1.html b/postfix/html/postalias.1.html index dab7e015a..045b5eb3d 100644 --- a/postfix/html/postalias.1.html +++ b/postfix/html/postalias.1.html @@ -21,13 +21,13 @@ POSTALIAS(1) POSTALIAS(1) able for the use as NIS alias maps. If the result files do not exist they will be created with - the same group and other read permissions as the source + the same group and other read permissions as their source file. While a database update is in progress, signal delivery is postponed, and an exclusive, advisory, lock is placed on the entire database, in order to avoid surprises in spec- - tator programs. + tator processes. The format of Postfix alias input files is described in aliases(5). diff --git a/postfix/html/postmap.1.html b/postfix/html/postmap.1.html index 53d86f0b3..99a4ec3e4 100644 --- a/postfix/html/postmap.1.html +++ b/postfix/html/postmap.1.html @@ -22,13 +22,13 @@ POSTMAP(1) POSTMAP(1) makemap file_type file_name < file_name If the result files do not exist they will be created with - the same group and other read permissions as the source + the same group and other read permissions as their source file. While the table update is in progress, signal delivery is postponed, and an exclusive, advisory, lock is placed on the entire table, in order to avoid surprises in spectator - programs. + processes. INPUT FILE FORMAT The format of a lookup table input file is as follows: diff --git a/postfix/html/postsuper.1.html b/postfix/html/postsuper.1.html index 16184d224..8f43bb49d 100644 --- a/postfix/html/postsuper.1.html +++ b/postfix/html/postsuper.1.html @@ -52,10 +52,10 @@ POSTSUPER(1) POSTSUPER(1) print $1 } ' | tr -d '*!' | postsuper -d - - Specify -d ALL to remove all messages; for example, - specify -d ALL deferred to delete mail in the - deferred queue. As a safety measure, the word ALL - must be specified in upper case. + Specify "-d ALL" to remove all messages; for exam- + ple, specify "-d ALL deferred" to delete all mail + in the deferred queue. As a safety measure, the + word ALL must be specified in upper case. Warning: Postfix queue IDs are reused. There is a very small possibility that postsuper deletes the @@ -91,8 +91,8 @@ POSTSUPER(1) POSTSUPER(1) If a queue_id of - is specified, the program reads queue IDs from standard input. - Specify -h ALL to hold all messages; for example, - specify -h ALL deferred to hold mail in the + Specify "-h ALL" to hold all messages; for example, + specify "-h ALL deferred" to hold all mail in the deferred queue. As a safety measure, the word ALL must be specified in upper case. @@ -110,12 +110,12 @@ POSTSUPER(1) POSTSUPER(1) If a queue_id of - is specified, the program reads queue IDs from standard input. - Note: use "postsuper -r" to release mail that was - kept on hold for a significant fraction of $maxi- - mal_queue_lifetime or $bounce_queue_lifetime, or - longer. + Note: specify "postsuper -r" to release mail that + was kept on hold for a significant fraction of + $maximal_queue_lifetime or $bounce_queue_lifetime, + or longer. - Specify -H ALL to release all mail that is "on + Specify "-H ALL" to release all mail that is "on hold". As a safety measure, the word ALL must be specified in upper case. @@ -131,9 +131,9 @@ POSTSUPER(1) POSTSUPER(1) Alternatively, if a queue_id of - is specified, the program reads queue IDs from standard input. - Specify -r ALL to requeue all messages. As a safety - measure, the word ALL must be specified in upper - case. + Specify "-r ALL" to requeue all messages. As a + safety measure, the word ALL must be specified in + upper case. A requeued message is moved to the maildrop queue, from where it is copied by the pickup(8) and diff --git a/postfix/html/qshape.1.html b/postfix/html/qshape.1.html index a60f09dce..490cb713b 100644 --- a/postfix/html/qshape.1.html +++ b/postfix/html/qshape.1.html @@ -20,7 +20,7 @@ QSHAPE(1) QSHAPE(1) Postfix queue message distribution in time and by sender domain or recipient domain. The program needs read access to the queue directories and queue files, so it must run - as the superuser or the mail_owner specified in >main.cfi> + as the superuser or the mail_owner specified in main.cf (typically postfix). Options: @@ -90,8 +90,8 @@ QSHAPE(1) QSHAPE(1) a different set of queues, just list their direc- tory names on the command line. Absolute paths are used as is, other paths are taken relative to the - >main.cfi> queue_directory parameter setting. While - >main.cfi> supports the use of $variable expansion in + main.cf queue_directory parameter setting. While + main.cf supports the use of $variable expansion in the definition of the queue_directory parameter, the qshape program does not. If you must use vari- able expansions in the queue_directory setting, you diff --git a/postfix/html/sendmail.1.html b/postfix/html/sendmail.1.html index 96428e610..c79578d8e 100644 --- a/postfix/html/sendmail.1.html +++ b/postfix/html/sendmail.1.html @@ -439,11 +439,6 @@ SENDMAIL(1) SENDMAIL(1) process name in syslog records, so that "smtpd" becomes, for example, "postfix/smtpd". - trigger_timeout (10s) - The time limit for sending a trigger to a Postfix - daemon (for example, the pickup(8) or qmgr(8) dae- - mon). - FILES /var/spool/postfix, mail queue /etc/postfix, configuration files diff --git a/postfix/man/man1/postalias.1 b/postfix/man/man1/postalias.1 index c8bd57491..358b97e56 100644 --- a/postfix/man/man1/postalias.1 +++ b/postfix/man/man1/postalias.1 @@ -21,12 +21,12 @@ file formats are expected to be compatible with Sendmail version 8, and are expected to be suitable for the use as NIS alias maps. If the result files do not exist they will be created with the -same group and other read permissions as the source file. +same group and other read permissions as their source file. While a database update is in progress, signal delivery is postponed, and an exclusive, advisory, lock is placed on the entire database, in order to avoid surprises in spectator -programs. +processes. The format of Postfix alias input files is described in \fBaliases\fR(5). diff --git a/postfix/man/man1/postmap.1 b/postfix/man/man1/postmap.1 index dc3e9bce7..bedee7d6d 100644 --- a/postfix/man/man1/postmap.1 +++ b/postfix/man/man1/postmap.1 @@ -23,12 +23,12 @@ file formats are expected to be compatible with: \fBmakemap \fIfile_type\fR \fIfile_name\fR < \fIfile_name\fR If the result files do not exist they will be created with the -same group and other read permissions as the source file. +same group and other read permissions as their source file. While the table update is in progress, signal delivery is postponed, and an exclusive, advisory, lock is placed on the entire table, in order to avoid surprises in spectator -programs. +processes. .SH "INPUT FILE FORMAT" .na .nf diff --git a/postfix/man/man1/postsuper.1 b/postfix/man/man1/postsuper.1 index 2b803854b..a6800a474 100644 --- a/postfix/man/man1/postsuper.1 +++ b/postfix/man/man1/postsuper.1 @@ -52,8 +52,8 @@ print $1 } .br \' | tr -d '*!' | postsuper -d - .sp -Specify \fB-d ALL\fR to remove all messages; for example, specify -\fB-d ALL deferred\fR to delete mail in the \fBdeferred\fR queue. +Specify "\fB-d ALL\fR" to remove all messages; for example, specify +"\fB-d ALL deferred\fR" to delete all mail in the \fBdeferred\fR queue. As a safety measure, the word \fBALL\fR must be specified in upper case. .sp @@ -87,8 +87,8 @@ mail queue(s) (default: \fBincoming\fR, \fBactive\fR and If a \fIqueue_id\fR of \fB-\fR is specified, the program reads queue IDs from standard input. .sp -Specify \fB-h ALL\fR to hold all messages; for example, specify -\fB-h ALL deferred\fR to hold mail in the \fBdeferred\fR queue. +Specify "\fB-h ALL\fR" to hold all messages; for example, specify +"\fB-h ALL deferred\fR" to hold all mail in the \fBdeferred\fR queue. As a safety measure, the word \fBALL\fR must be specified in upper case. .sp @@ -104,11 +104,11 @@ mail queue(s) (default: \fBhold\fR) to the \fBdeferred\fR queue. If a \fIqueue_id\fR of \fB-\fR is specified, the program reads queue IDs from standard input. .sp -Note: use "\fBpostsuper -r\fR" to release mail that was kept on +Note: specify "\fBpostsuper -r\fR" to release mail that was kept on hold for a significant fraction of \fB$maximal_queue_lifetime\fR or \fB$bounce_queue_lifetime\fR, or longer. .sp -Specify \fB-H ALL\fR to release all mail that is "on hold". +Specify "\fB-H ALL\fR" to release all mail that is "on hold". As a safety measure, the word \fBALL\fR must be specified in upper case. .IP \fB-p\fR @@ -124,7 +124,7 @@ command-line options. Alternatively, if a \fIqueue_id\fR of \fB-\fR is specified, the program reads queue IDs from standard input. .sp -Specify \fB-r ALL\fR to requeue all messages. As a safety +Specify "\fB-r ALL\fR" to requeue all messages. As a safety measure, the word \fBALL\fR must be specified in upper case. .sp A requeued message is moved to the \fBmaildrop\fR queue, diff --git a/postfix/man/man1/qshape.1 b/postfix/man/man1/qshape.1 index 6c2c9908a..4badd4c02 100644 --- a/postfix/man/man1/qshape.1 +++ b/postfix/man/man1/qshape.1 @@ -20,7 +20,7 @@ The \fBqshape\fR program helps the administrator understand the Postfix queue message distribution in time and by sender domain or recipient domain. The program needs read access to the queue directories and queue files, so it must run as the superuser or -the \fBmail_owner\fR specified in \fImain.cf\fR (typically +the \fBmail_owner\fR specified in \fBmain.cf\fR (typically \fBpostfix\fR). Options: @@ -74,8 +74,8 @@ By default \fBqshape\fR displays the combined distribution of the incoming and active queues. To display a different set of queues, just list their directory names on the command line. Absolute paths are used as is, other paths are taken relative -to the \fImain.cf\fR \fBqueue_directory\fR parameter setting. -While \fImain.cf\fR supports the use of \fI$variable\fR expansion +to the \fBmain.cf\fR \fBqueue_directory\fR parameter setting. +While \fBmain.cf\fR supports the use of \fI$variable\fR expansion in the definition of the \fBqueue_directory\fR parameter, the \fBqshape\fR program does not. If you must use variable expansions in the \fBqueue_directory\fR setting, you must specify an explicit diff --git a/postfix/man/man1/sendmail.1 b/postfix/man/man1/sendmail.1 index 827d48380..a4e99359d 100644 --- a/postfix/man/man1/sendmail.1 +++ b/postfix/man/man1/sendmail.1 @@ -369,9 +369,6 @@ The syslog facility of Postfix logging. .IP "\fBsyslog_name (postfix)\fR" The mail system name that is prepended to the process name in syslog records, so that "smtpd" becomes, for example, "postfix/smtpd". -.IP "\fBtrigger_timeout (10s)\fR" -The time limit for sending a trigger to a Postfix daemon (for -example, the \fBpickup\fR(8) or \fBqmgr\fR(8) daemon). .SH "FILES" .na .nf diff --git a/postfix/proto/MYSQL_README.html b/postfix/proto/MYSQL_README.html index 9672f5a9d..7f56cf04f 100644 --- a/postfix/proto/MYSQL_README.html +++ b/postfix/proto/MYSQL_README.html @@ -57,6 +57,17 @@ make -f Makefile.init makefiles \
  • +

    On Solaris, use this instead:

    + +
    +
    +make -f Makefile.init makefiles \
    +    'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include' \
    +    'AUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib \
    +        -lmysqlclient -lz -lm'
    +
    +
    +

    Then, just run 'make'. This requires libz, the compression library. Older mysql implementations build without libz.

    diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 501d61b7e..f8a1d565a 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20060903" +#define MAIL_RELEASE_DATE "20060930" #define MAIL_VERSION_NUMBER "2.4" #ifdef SNAPSHOT diff --git a/postfix/src/postalias/postalias.c b/postfix/src/postalias/postalias.c index a62d065f0..b31a719e8 100644 --- a/postfix/src/postalias/postalias.c +++ b/postfix/src/postalias/postalias.c @@ -15,12 +15,12 @@ /* and are expected to be suitable for the use as NIS alias maps. /* /* If the result files do not exist they will be created with the -/* same group and other read permissions as the source file. +/* same group and other read permissions as their source file. /* /* While a database update is in progress, signal delivery is /* postponed, and an exclusive, advisory, lock is placed on the /* entire database, in order to avoid surprises in spectator -/* programs. +/* processes. /* /* The format of Postfix alias input files is described in /* \fBaliases\fR(5). diff --git a/postfix/src/postmap/postmap.c b/postfix/src/postmap/postmap.c index bc9e2bd8f..c02e394a3 100644 --- a/postfix/src/postmap/postmap.c +++ b/postfix/src/postmap/postmap.c @@ -17,12 +17,12 @@ /* \fBmakemap \fIfile_type\fR \fIfile_name\fR < \fIfile_name\fR /* /* If the result files do not exist they will be created with the -/* same group and other read permissions as the source file. +/* same group and other read permissions as their source file. /* /* While the table update is in progress, signal delivery is /* postponed, and an exclusive, advisory, lock is placed on the /* entire table, in order to avoid surprises in spectator -/* programs. +/* processes. /* INPUT FILE FORMAT /* .ad /* .fi diff --git a/postfix/src/postsuper/postsuper.c b/postfix/src/postsuper/postsuper.c index e3636cdf7..2f9622d90 100644 --- a/postfix/src/postsuper/postsuper.c +++ b/postfix/src/postsuper/postsuper.c @@ -46,8 +46,8 @@ /* .br /* \' | tr -d '*!' | postsuper -d - /* .sp -/* Specify \fB-d ALL\fR to remove all messages; for example, specify -/* \fB-d ALL deferred\fR to delete mail in the \fBdeferred\fR queue. +/* Specify "\fB-d ALL\fR" to remove all messages; for example, specify +/* "\fB-d ALL deferred\fR" to delete all mail in the \fBdeferred\fR queue. /* As a safety measure, the word \fBALL\fR must be specified in upper /* case. /* .sp @@ -81,8 +81,8 @@ /* If a \fIqueue_id\fR of \fB-\fR is specified, the program reads /* queue IDs from standard input. /* .sp -/* Specify \fB-h ALL\fR to hold all messages; for example, specify -/* \fB-h ALL deferred\fR to hold mail in the \fBdeferred\fR queue. +/* Specify "\fB-h ALL\fR" to hold all messages; for example, specify +/* "\fB-h ALL deferred\fR" to hold all mail in the \fBdeferred\fR queue. /* As a safety measure, the word \fBALL\fR must be specified in upper /* case. /* .sp @@ -98,11 +98,11 @@ /* If a \fIqueue_id\fR of \fB-\fR is specified, the program reads /* queue IDs from standard input. /* .sp -/* Note: use "\fBpostsuper -r\fR" to release mail that was kept on +/* Note: specify "\fBpostsuper -r\fR" to release mail that was kept on /* hold for a significant fraction of \fB$maximal_queue_lifetime\fR /* or \fB$bounce_queue_lifetime\fR, or longer. /* .sp -/* Specify \fB-H ALL\fR to release all mail that is "on hold". +/* Specify "\fB-H ALL\fR" to release all mail that is "on hold". /* As a safety measure, the word \fBALL\fR must be specified in upper /* case. /* .IP \fB-p\fR @@ -118,7 +118,7 @@ /* Alternatively, if a \fIqueue_id\fR of \fB-\fR is specified, /* the program reads queue IDs from standard input. /* .sp -/* Specify \fB-r ALL\fR to requeue all messages. As a safety +/* Specify "\fB-r ALL\fR" to requeue all messages. As a safety /* measure, the word \fBALL\fR must be specified in upper case. /* .sp /* A requeued message is moved to the \fBmaildrop\fR queue, diff --git a/postfix/src/sendmail/sendmail.c b/postfix/src/sendmail/sendmail.c index 4f33a0c04..da88542b1 100644 --- a/postfix/src/sendmail/sendmail.c +++ b/postfix/src/sendmail/sendmail.c @@ -343,9 +343,6 @@ /* .IP "\fBsyslog_name (postfix)\fR" /* The mail system name that is prepended to the process name in syslog /* records, so that "smtpd" becomes, for example, "postfix/smtpd". -/* .IP "\fBtrigger_timeout (10s)\fR" -/* The time limit for sending a trigger to a Postfix daemon (for -/* example, the \fBpickup\fR(8) or \fBqmgr\fR(8) daemon). /* FILES /* /var/spool/postfix, mail queue /* /etc/postfix, configuration files diff --git a/postfix/src/smtp/smtp_proto.c b/postfix/src/smtp/smtp_proto.c index a7c865845..276db41ce 100644 --- a/postfix/src/smtp/smtp_proto.c +++ b/postfix/src/smtp/smtp_proto.c @@ -230,6 +230,11 @@ char *xfer_request[SMTP_STATE_LAST] = { "QUIT command", }; +#define SMTP_MIME_DOWNGRADE(session, request) \ + (var_disable_mime_oconv == 0 \ + && (session->features & SMTP_FEATURE_8BITMIME) == 0 \ + && strcmp(request->encoding, MAIL_ATTR_ENC_7BIT) != 0) + static int smtp_start_tls(SMTP_STATE *); /* smtp_helo - perform initial handshake with SMTP server */ @@ -1172,7 +1177,9 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state, QUOTE_ADDRESS(session->scratch, vstring_str(session->scratch2)); vstring_sprintf(next_command, "MAIL FROM:<%s>", vstring_str(session->scratch)); - if (session->features & SMTP_FEATURE_SIZE) /* RFC 1870 */ + /* XXX Don't announce SIZE if we're going to MIME downgrade. */ + if (session->features & SMTP_FEATURE_SIZE /* RFC 1870 */ + && !SMTP_MIME_DOWNGRADE(session, request)) vstring_sprintf_append(next_command, " SIZE=%lu", request->data_size); if (session->features & SMTP_FEATURE_8BITMIME) { /* RFC 1652 */ @@ -1619,13 +1626,13 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state, * transaction in progress. */ if (send_state == SMTP_STATE_DOT && nrcpt > 0) { - downgrading = - (var_disable_mime_oconv == 0 - && (session->features & SMTP_FEATURE_8BITMIME) == 0 - && strcmp(request->encoding, MAIL_ATTR_ENC_7BIT) != 0); + downgrading = SMTP_MIME_DOWNGRADE(session, request); + /* XXX Don't downgrade just because generic_maps is turned on. */ if (downgrading || smtp_generic_maps) - session->mime_state = mime_state_alloc(MIME_OPT_DOWNGRADE - | MIME_OPT_REPORT_NESTING, + session->mime_state = mime_state_alloc(downgrading ? + MIME_OPT_DOWNGRADE + | MIME_OPT_REPORT_NESTING : + MIME_OPT_REPORT_NESTING, smtp_generic_maps ? smtp_header_rewrite : smtp_header_out, diff --git a/postfix/src/smtpd/smtpd_peer.c b/postfix/src/smtpd/smtpd_peer.c index 8dacecffb..d2e7c14d2 100644 --- a/postfix/src/smtpd/smtpd_peer.c +++ b/postfix/src/smtpd/smtpd_peer.c @@ -143,6 +143,13 @@ void smtpd_peer_init(SMTPD_STATE *state) * Milter applications as {if_name} and {if_addr}, then we also must be * able to provide this via the XCLIENT command for Milter testing. * + * XXX If we make local or remote port information available to policy + * servers or Milter applications, then we must also make this testable + * with the XCLIENT command, otherwise there will be confusion. + * + * XXX If we make local or remote port information available via logging, + * then we must also support these attributes with the XFORWARD command. + * * XXX If support were to be added for Milter applications in down-stream * MTAs, then consistency demands that we propagate a lot of Sendmail * macro information via the XFORWARD command. Otherwise we could end up diff --git a/postfix/src/tls/tls_client.c b/postfix/src/tls/tls_client.c index e5c19c76b..0680ee0cd 100644 --- a/postfix/src/tls/tls_client.c +++ b/postfix/src/tls/tls_client.c @@ -565,7 +565,7 @@ static void verify_extract_peer(const char *nexthop, const char *hname, break; } } - sk_GENERAL_NAME_free(gens); + sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); } } if (dNSName_found) { diff --git a/postfix/src/util/myaddrinfo.c b/postfix/src/util/myaddrinfo.c index 941d58b94..171528c22 100644 --- a/postfix/src/util/myaddrinfo.c +++ b/postfix/src/util/myaddrinfo.c @@ -400,8 +400,12 @@ int hostname_to_sockaddr(const char *hostname, const char *service, * might blow up. Instead we turn off IPV6_V6ONLY in inet_listen(), and * supply a protocol-dependent hard-coded string value to getaddrinfo() * below, so that it will convert into the appropriate wild-card address. + * + * XXX AIX 5.[1-3] getaddrinfo() may return a non-null port when a null + * service argument is specified. */ struct addrinfo hints; + int err; memset((char *) &hints, 0, sizeof(hints)); hints.ai_family = inet_proto_info()->ai_family; @@ -423,7 +427,18 @@ int hostname_to_sockaddr(const char *hostname, const char *service, } #endif } - return (getaddrinfo(hostname, service, &hints, res)); + err = getaddrinfo(hostname, service, &hints, res); +#if defined(BROKEN_AI_NULL_SERVICE) + if (service == 0 && err == 0) { + struct addrinfo *r; + unsigned short *portp; + + for (r = *res; r != 0; r = r->ai_next) + if (*(portp = SOCK_ADDR_PORTP(r->ai_addr)) != 0) + *portp = 0; + } +#endif + return (err); #endif } @@ -500,8 +515,12 @@ int hostaddr_to_sockaddr(const char *hostaddr, const char *service, * ai_family=PF_UNSPEC, ai_flags=AI_NUMERICHOST, ai_socktype=SOCK_STREAM, * ai_protocol=0 or IPPROTO_TCP, and service=0. The workaround is to * ignore all but the first result. + * + * XXX AIX 5.[1-3] getaddrinfo() may return a non-null port when a null + * service argument is specified. */ struct addrinfo hints; + int err; memset(&hints, 0, sizeof(hints)); hints.ai_family = inet_proto_info()->ai_family; @@ -524,7 +543,18 @@ int hostaddr_to_sockaddr(const char *hostaddr, const char *service, } #endif } - return (getaddrinfo(hostaddr, service, &hints, res)); + err = getaddrinfo(hostaddr, service, &hints, res); +#if defined(BROKEN_AI_NULL_SERVICE) + if (service == 0 && err == 0) { + struct addrinfo *r; + unsigned short *portp; + + for (r = *res; r != 0; r = r->ai_next) + if (*(portp = SOCK_ADDR_PORTP(r->ai_addr)) != 0) + *portp = 0; + } +#endif + return (err); #endif } diff --git a/postfix/src/util/sock_addr.c b/postfix/src/util/sock_addr.c index 6ccd041d4..f80d08207 100644 --- a/postfix/src/util/sock_addr.c +++ b/postfix/src/util/sock_addr.c @@ -28,6 +28,8 @@ /* struct sockaddr *SOCK_ADDR_PTR(ptr) /* unsigned char SOCK_ADDR_FAMILY(ptr) /* unsigned char SOCK_ADDR_LEN(ptr) +/* unsigned short SOCK_ADDR_PORT(ptr) +/* unsigned short *SOCK_ADDR_PORTP(ptr) /* /* struct sockaddr_in *SOCK_ADDR_IN_PTR(ptr) /* unsigned char SOCK_ADDR_IN_FAMILY(ptr) @@ -66,7 +68,9 @@ /* address family and length of the real structure that hides /* inside a generic sockaddr structure. On systems where struct /* sockaddr has no sa_len member, SOCK_ADDR_LEN() cannot be -/* used as lvalue. +/* used as lvalue. SOCK_ADDR_PORT() returns the IPv4 or IPv6 +/* port number, in network byte order; it must not be used as +/* lvalue. SOCK_ADDR_PORTP() returns a pointer to the same. /* /* The macros SOCK_ADDR_IN{,6}_{PTR,FAMILY,PORT,ADDR}() cast /* a generic pointer to a specific socket address structure diff --git a/postfix/src/util/sock_addr.h b/postfix/src/util/sock_addr.h index 1fb54a8a0..1f5407a4b 100644 --- a/postfix/src/util/sock_addr.h +++ b/postfix/src/util/sock_addr.h @@ -45,6 +45,13 @@ extern int sock_addr_in_loopback(const struct sockaddr *); sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in)) #endif +#define SOCK_ADDR_PORT(sa) \ + (SOCK_ADDR_PTR(sa)->sa_family == AF_INET6 ? \ + SOCK_ADDR_IN6_PORT(sa) : SOCK_ADDR_IN_PORT(sa)) +#define SOCK_ADDR_PORTP(sa) \ + (SOCK_ADDR_PTR(sa)->sa_family == AF_INET6 ? \ + &SOCK_ADDR_IN6_PORT(sa) : &SOCK_ADDR_IN_PORT(sa)) + #define SOCK_ADDR_IN6_PTR(sa) ((struct sockaddr_in6 *)(sa)) #define SOCK_ADDR_IN6_FAMILY(sa) SOCK_ADDR_IN6_PTR(sa)->sin6_family #define SOCK_ADDR_IN6_PORT(sa) SOCK_ADDR_IN6_PTR(sa)->sin6_port @@ -71,6 +78,9 @@ extern int sock_addr_in_loopback(const struct sockaddr *); #define SOCK_ADDR_LEN(sa) sizeof(struct sockaddr_in) #endif +#define SOCK_ADDR_PORT(sa) SOCK_ADDR_IN_PORT(sa)) +#define SOCK_ADDR_PORTP(sa) &SOCK_ADDR_IN_PORT(sa)) + #define SOCK_ADDR_EQ_ADDR(sa, sb) \ (SOCK_ADDR_FAMILY(sa) == AF_INET && SOCK_ADDR_FAMILY(sb) == AF_INET \ && SOCK_ADDR_IN_ADDR(sa).s_addr == SOCK_ADDR_IN_ADDR(sb).s_addr) diff --git a/postfix/src/util/sys_defs.h b/postfix/src/util/sys_defs.h index 11499916b..513d25223 100644 --- a/postfix/src/util/sys_defs.h +++ b/postfix/src/util/sys_defs.h @@ -513,6 +513,7 @@ extern int opterr; # define HAS_IPV6 #endif #define BROKEN_AI_PASSIVE_NULL_HOST +#define BROKEN_AI_NULL_SERVICE #endif #ifdef AIX4