diff --git a/postfix/HISTORY b/postfix/HISTORY index ae18da967..acd675779 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -12691,3 +12691,51 @@ Apologies for any names omitted. Robustness: mail delivery agents now detect loops in queue files. Files with too many backward jumps are saved to the "corrupt" directory. File: global/record.c. + +20060831 + + Bugfix (introduced with initial implementation): missing + "dict_errno = 0" caused mis-leading error messages after + non-error lookup failure. Victor Duchovni. File: + util/dict_cidr.c. + + Robustness: the default TLS cipher lists were changed from + !foo:ALL into ALL:!foo. Victor Duchovni. Files: + global/mail_params.h and documentation. + +20060902 + + Bugfix (introduced Postfix 2.3): the LMTP client stripped + "inet": from the next-hop destination, but still used the + complete next-hop from the delivery request. File: + smtp/smtp_connect.c. + +20060903 + + 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. + + Workaround: don't send SIZE information in the MAIL FROM + command when message content will be subject to 8bit -> + quoted-printable conversion. File: smtp/smtp_proto.c. + +20061002 + + Compatibility: Sendmail now invokes the Milter connect + action with the verified hostname instead of the name + obtained with PTR lookup. File: smtpd/smtpd.c. 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/postconf.5.html b/postfix/html/postconf.5.html index 3b2d15490..83636dd82 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -11604,7 +11604,7 @@ strongly encouraged to not change this setting.

tls_high_cipherlist -(default: !EXPORT:!LOW:!MEDIUM:ALL:+RC4:@STRENGTH)
+(default: ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH)

The OpenSSL cipherlist for "HIGH" grade ciphers. This defines the meaning of the "high" setting in smtpd_tls_mandatory_ciphers, @@ -11617,7 +11617,7 @@ strongly encouraged to not change this setting.

tls_low_cipherlist -(default: !EXPORT:ALL:+RC4:@STRENGTH)
+(default: ALL:!EXPORT:+RC4:@STRENGTH)

The OpenSSL cipherlist for "LOW" or higher grade ciphers. This defines the meaning of the "low" setting in smtpd_tls_mandatory_ciphers, @@ -11630,7 +11630,7 @@ strongly encouraged to not change this setting.

tls_medium_cipherlist -(default: !EXPORT:!LOW:ALL:+RC4:@STRENGTH)
+(default: ALL:!EXPORT:!LOW:+RC4:@STRENGTH)

The OpenSSL cipherlist for "MEDIUM" or higher grade ciphers. This defines the meaning of the "medium" setting in smtpd_tls_mandatory_ciphers, 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 c2e465ded..c79578d8e 100644 --- a/postfix/html/sendmail.1.html +++ b/postfix/html/sendmail.1.html @@ -120,48 +120,49 @@ SENDMAIL(1) SENDMAIL(1) files. -F full_name - Set the sender full name. This is used only with - messages that have no From: message header. + Set the sender full name. This overrides the NAME + environment variable, and is used only with mes- + sages that have no From: message header. -f sender Set the envelope sender address. This is the - address where delivery problems are sent to. With + address where delivery problems are sent to. With Postfix versions before 2.1, the Errors-To: message header overrides the error return address. - -G Gateway (relay) submission, as opposed to initial - user submission. Either do not rewrite addresses - at all, or update incomplete addresses with the + -G Gateway (relay) submission, as opposed to initial + user submission. Either do not rewrite addresses + at all, or update incomplete addresses with the domain information specified with remote_header_re- write_domain. - This option is ignored before Postfix version 2.3. + This option is ignored before Postfix version 2.3. -h hop_count (ignored) - Hop count limit. Use the hopcount_limit configura- + Hop count limit. Use the hopcount_limit configura- tion parameter instead. - -I Initialize alias database. See the newaliases com- + -I Initialize alias database. See the newaliases com- mand above. - -i When reading a message from standard input, don't - treat a line with only a . character as the end of + -i When reading a message from standard input, don't + treat a line with only a . character as the end of input. -L label (ignored) - The logging label. Use the syslog_name configura- + The logging label. Use the syslog_name configura- tion parameter instead. -m (ignored) Backwards compatibility. -N dsn (default: 'delay, failure') - Delivery status notification control. Specify - either a comma-separated list with one or more of - failure (send notification when delivery fails), + Delivery status notification control. Specify + either a comma-separated list with one or more of + failure (send notification when delivery fails), delay (send notification when delivery is delayed), - or success (send notification when the message is - delivered); or specify never (don't send any noti- + or success (send notification when the message is + delivered); or specify never (don't send any noti- fications at all). This feature is available in Postfix 2.3 and later. @@ -170,7 +171,7 @@ SENDMAIL(1) SENDMAIL(1) Backwards compatibility. -oAalias_database - Non-default alias database. Specify pathname or + Non-default alias database. Specify pathname or type:pathname. See postalias(1) for details. -O option=value (ignored) @@ -180,60 +181,60 @@ SENDMAIL(1) SENDMAIL(1) -o8 (ignored) To send 8-bit or binary content, use an appropriate - MIME encapsulation and specify the appropriate -B + MIME encapsulation and specify the appropriate -B command-line option. - -oi When reading a message from standard input, don't - treat a line with only a . character as the end of + -oi When reading a message from standard input, don't + treat a line with only a . character as the end of input. -om (ignored) - The sender is never eliminated from alias etc. + The sender is never eliminated from alias etc. expansions. -o x value (ignored) - Set option x to value. Use the equivalent configu- + Set option x to value. Use the equivalent configu- ration parameter in main.cf instead. -r sender Set the envelope sender address. This is the - address where delivery problems are sent to. With + address where delivery problems are sent to. With Postfix versions before 2.1, the Errors-To: message header overrides the error return address. -R return_limit (ignored) - Limit the size of bounced mail. Use the - bounce_size_limit configuration parameter instead. + Limit the size of bounced mail. Use the + bounce_size_limit configuration parameter instead. - -q Attempt to deliver all queued mail. This is imple- + -q Attempt to deliver all queued mail. This is imple- mented by executing the postqueue(1) command. Warning: flushing undeliverable mail frequently - will result in poor delivery performance of all + will result in poor delivery performance of all other mail. -qinterval (ignored) - The interval between queue runs. Use the + The interval between queue runs. Use the queue_run_delay configuration parameter instead. -qRsite - Schedule immediate delivery of all mail that is + Schedule immediate delivery of all mail that is queued for the named site. This option accepts only - site names that are eligible for the "fast flush" - service, and is implemented by executing the + site names that are eligible for the "fast flush" + service, and is implemented by executing the postqueue(1) command. See flush(8) for more infor- mation about the "fast flush" service. -qSsite - This command is not implemented. Use the slower + This command is not implemented. Use the slower "sendmail -q" command instead. - -t Extract recipients from message headers. These are - added to any recipients specified on the command + -t Extract recipients from message headers. These are + added to any recipients specified on the command line. - With Postfix versions prior to 2.1, this option - requires that no recipient addresses are specified + With Postfix versions prior to 2.1, this option + requires that no recipient addresses are specified on the command line. -U (ignored) @@ -246,63 +247,67 @@ SENDMAIL(1) SENDMAIL(1) This feature is available in Postfix 2.3 and later. -XV (Postfix 2.2 and earlier: -V) - Variable Envelope Return Path. Given an envelope - sender address of the form owner-listname@origin, - each recipient user@domain receives mail with a + Variable Envelope Return Path. Given an envelope + sender address of the form owner-listname@origin, + each recipient user@domain receives mail with a personalized envelope sender address. - By default, the personalized envelope sender - address is owner-listname+user=domain@origin. The - default + and = characters are configurable with - the default_verp_delimiters configuration parame- + By default, the personalized envelope sender + address is owner-listname+user=domain@origin. The + default + and = characters are configurable with + the default_verp_delimiters configuration parame- ter. -XVxy (Postfix 2.2 and earlier: -Vxy) - As -XV, but uses x and y as the VERP delimiter - characters, instead of the characters specified - with the default_verp_delimiters configuration + As -XV, but uses x and y as the VERP delimiter + characters, instead of the characters specified + with the default_verp_delimiters configuration parameter. - -v Send an email report of the first delivery attempt - (Postfix versions 2.1 and later). Mail delivery - always happens in the background. When multiple -v + -v Send an email report of the first delivery attempt + (Postfix versions 2.1 and later). Mail delivery + always happens in the background. When multiple -v options are given, enable verbose logging for debugging purposes. -X log_file (ignored) - Log mailer traffic. Use the debug_peer_list and - debug_peer_level configuration parameters instead. + Log mailer traffic. Use the debug_peer_list and + debug_peer_level configuration parameters instead. SECURITY - By design, this program is not set-user (or group) id. - However, it must handle data from untrusted users or - untrusted machines. Thus, the usual precautions need to + By design, this program is not set-user (or group) id. + However, it must handle data from untrusted users or + untrusted machines. Thus, the usual precautions need to be taken against malicious inputs. DIAGNOSTICS - Problems are logged to syslogd(8) and to the standard + Problems are logged to syslogd(8) and to the standard error stream. ENVIRONMENT MAIL_CONFIG Directory with Postfix configuration files. - MAIL_VERBOSE + MAIL_VERBOSE (value does not matter) Enable verbose logging for debugging purposes. - MAIL_DEBUG + MAIL_DEBUG (value does not matter) Enable debugging with an external command, as spec- - ified with the debugger_command configuration + ified with the debugger_command configuration parameter. + NAME The sender full name. This is used only with mes- + sages that have no From: message header. See also + the -F option above. + CONFIGURATION PARAMETERS - The following main.cf parameters are especially relevant + The following main.cf parameters are especially relevant to this program. The text below provides only a parameter - summary. See postconf(5) for more details including exam- + summary. See postconf(5) for more details including exam- ples. TROUBLE SHOOTING CONTROLS - The DEBUG_README file gives examples of how to trouble + The DEBUG_README file gives examples of how to trouble shoot a Postfix system. debugger_command (empty) @@ -310,29 +315,29 @@ SENDMAIL(1) SENDMAIL(1) mon program is invoked with the -D option. debug_peer_level (2) - The increment in verbose logging level when a - remote client or server matches a pattern in the + The increment in verbose logging level when a + remote client or server matches a pattern in the debug_peer_list parameter. debug_peer_list (empty) - Optional list of remote client or server hostname - or network address patterns that cause the verbose - logging level to increase by the amount specified + Optional list of remote client or server hostname + or network address patterns that cause the verbose + logging level to increase by the amount specified in $debug_peer_level. ACCESS CONTROLS Available in Postfix version 2.2 and later: authorized_flush_users (static:anyone) - List of users who are authorized to flush the + List of users who are authorized to flush the queue. authorized_mailq_users (static:anyone) List of users who are authorized to view the queue. authorized_submit_users (static:anyone) - List of users who are authorized to submit mail - with the sendmail(1) command (and with the privi- + List of users who are authorized to submit mail + with the sendmail(1) command (and with the privi- leged postdrop(1) helper command). RESOURCE AND RATE CONTROLS @@ -341,7 +346,7 @@ SENDMAIL(1) SENDMAIL(1) sent in a non-delivery notification. fork_attempts (5) - The maximal number of attempts to fork() a child + The maximal number of attempts to fork() a child process. fork_delay (1s) @@ -349,11 +354,11 @@ SENDMAIL(1) SENDMAIL(1) process. hopcount_limit (50) - The maximal number of Received: message headers + The maximal number of Received: message headers that is allowed in the primary message headers. queue_run_delay (1000s) - The time between deferred queue scans by the queue + The time between deferred queue scans by the queue manager. FAST FLUSH CONTROLS @@ -362,37 +367,37 @@ SENDMAIL(1) SENDMAIL(1) fast_flush_domains ($relay_domains) Optional list of destinations that are eligible for - per-destination logfiles with mail that is queued + per-destination logfiles with mail that is queued to those destinations. VERP CONTROLS The VERP_README file describes configuration and operation - details of Postfix support for variable envelope return + details of Postfix support for variable envelope return path addresses. default_verp_delimiters (+=) The two default VERP delimiter characters. verp_delimiter_filter (-=+) - The characters Postfix accepts as VERP delimiter - characters on the Postfix sendmail(1) command line + The characters Postfix accepts as VERP delimiter + characters on the Postfix sendmail(1) command line and in SMTP commands. MISCELLANEOUS CONTROLS alias_database (see 'postconf -d' output) - The alias databases for local(8) delivery that are + The alias databases for local(8) delivery that are updated with "newaliases" or with "sendmail -bi". command_directory (see 'postconf -d' output) - The location of all postfix administrative com- + The location of all postfix administrative com- mands. config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and + The default location of the Postfix main.cf and master.cf configuration files. daemon_directory (see 'postconf -d' output) - The directory with Postfix support programs and + The directory with Postfix support programs and daemon programs. default_database_type (see 'postconf -d' output) @@ -400,16 +405,16 @@ SENDMAIL(1) SENDMAIL(1) postalias(1) and postmap(1) commands. delay_warning_time (0h) - The time after which the sender receives the mes- + The time after which the sender receives the mes- sage headers of mail that is still queued. enable_errors_to (no) - Report mail delivery errors to the address speci- - fied with the non-standard Errors-To: message - header, instead of the envelope sender address - (this feature is removed with Postfix version 2.2, - is turned off by default with Postfix version 2.1, - and is always turned on with older Postfix ver- + Report mail delivery errors to the address speci- + fied with the non-standard Errors-To: message + header, instead of the envelope sender address + (this feature is removed with Postfix version 2.2, + is turned off by default with Postfix version 2.1, + and is always turned on with older Postfix ver- sions). mail_owner (postfix) @@ -417,28 +422,23 @@ SENDMAIL(1) SENDMAIL(1) and most Postfix daemon processes. queue_directory (see 'postconf -d' output) - The location of the Postfix top-level queue direc- + The location of the Postfix top-level queue direc- tory. remote_header_rewrite_domain (empty) - Don't rewrite message headers from remote clients + Don't rewrite message headers from remote clients at all when this parameter is empty; otherwise, re- - write message headers and append the specified + write message headers and append the specified domain name to incomplete addresses. syslog_facility (mail) The syslog facility of Postfix logging. syslog_name (postfix) - The mail system name that is prepended to the - process name in syslog records, so that "smtpd" + The mail system name that is prepended to the + 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 @@ -461,7 +461,7 @@ SENDMAIL(1) SENDMAIL(1) VERP_README, Postfix VERP howto LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) diff --git a/postfix/html/smtp.8.html b/postfix/html/smtp.8.html index 9ea0a828c..fb57a3a86 100644 --- a/postfix/html/smtp.8.html +++ b/postfix/html/smtp.8.html @@ -417,14 +417,14 @@ SMTP(8) SMTP(8) number generator (PRNG). tls_high_cipherlist - (!EXPORT:!LOW:!MEDIUM:ALL:+RC4:@STRENGTH) + (ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH) The OpenSSL cipherlist for "HIGH" grade ciphers. - tls_medium_cipherlist (!EXPORT:!LOW:ALL:+RC4:@STRENGTH) + tls_medium_cipherlist (ALL:!EXPORT:!LOW:+RC4:@STRENGTH) The OpenSSL cipherlist for "MEDIUM" or higher grade ciphers. - tls_low_cipherlist (!EXPORT:ALL:+RC4:@STRENGTH) + tls_low_cipherlist (ALL:!EXPORT:+RC4:@STRENGTH) The OpenSSL cipherlist for "LOW" or higher grade ciphers. diff --git a/postfix/html/smtpd.8.html b/postfix/html/smtpd.8.html index 7092c7ba1..b4b0a63ed 100644 --- a/postfix/html/smtpd.8.html +++ b/postfix/html/smtpd.8.html @@ -456,14 +456,14 @@ SMTPD(8) SMTPD(8) number generator (PRNG). tls_high_cipherlist - (!EXPORT:!LOW:!MEDIUM:ALL:+RC4:@STRENGTH) + (ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH) The OpenSSL cipherlist for "HIGH" grade ciphers. - tls_medium_cipherlist (!EXPORT:!LOW:ALL:+RC4:@STRENGTH) + tls_medium_cipherlist (ALL:!EXPORT:!LOW:+RC4:@STRENGTH) The OpenSSL cipherlist for "MEDIUM" or higher grade ciphers. - tls_low_cipherlist (!EXPORT:ALL:+RC4:@STRENGTH) + tls_low_cipherlist (ALL:!EXPORT:+RC4:@STRENGTH) The OpenSSL cipherlist for "LOW" or higher grade ciphers. diff --git a/postfix/makedefs b/postfix/makedefs index db9852b84..a691112e3 100644 --- a/postfix/makedefs +++ b/postfix/makedefs @@ -132,6 +132,8 @@ case "$SYSTEM.$RELEASE" in ;; NetBSD.3*) SYSTYPE=NETBSD3 ;; + NetBSD.4*) SYSTYPE=NETBSD4 + ;; BSD/OS.2*) SYSTYPE=BSDI2 ;; BSD/OS.3*) SYSTYPE=BSDI3 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 eba9b7f54..a4e99359d 100644 --- a/postfix/man/man1/sendmail.1 +++ b/postfix/man/man1/sendmail.1 @@ -101,7 +101,8 @@ With all Postfix versions, you can specify a directory pathname with the MAIL_CONFIG environment variable to override the location of configuration files. .IP "\fB-F \fIfull_name\fR -Set the sender full name. This is used only with messages that +Set the sender full name. This overrides the NAME environment +variable, and is used only with messages that have no \fBFrom:\fR message header. .IP "\fB-f \fIsender\fR" Set the envelope sender address. This is the address where @@ -239,11 +240,15 @@ stream. .fi .IP \fBMAIL_CONFIG\fR Directory with Postfix configuration files. -.IP \fBMAIL_VERBOSE\fR +.IP "\fBMAIL_VERBOSE\fR (value does not matter)" Enable verbose logging for debugging purposes. -.IP \fBMAIL_DEBUG\fR +.IP "\fBMAIL_DEBUG\fR (value does not matter)" Enable debugging with an external command, as specified with the \fBdebugger_command\fR configuration parameter. +.IP \fBNAME\fR +The sender full name. This is used only with messages that +have no \fBFrom:\fR message header. See also the \fB-F\fR +option above. .SH "CONFIGURATION PARAMETERS" .na .nf @@ -364,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/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index c37d800ba..3c387c2bf 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -7044,21 +7044,21 @@ level and is the default cipherlist for the SMTP server. You are strongly encouraged to not change this setting. .PP This feature is available in Postfix 2.3 and later. -.SH tls_high_cipherlist (default: !EXPORT:!LOW:!MEDIUM:ALL:+RC4:@STRENGTH) +.SH tls_high_cipherlist (default: ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH) The OpenSSL cipherlist for "HIGH" grade ciphers. This defines the meaning of the "high" setting in smtpd_tls_mandatory_ciphers, smtp_tls_mandatory_ciphers and lmtp_tls_mandatory_ciphers. You are strongly encouraged to not change this setting. .PP This feature is available in Postfix 2.3 and later. -.SH tls_low_cipherlist (default: !EXPORT:ALL:+RC4:@STRENGTH) +.SH tls_low_cipherlist (default: ALL:!EXPORT:+RC4:@STRENGTH) The OpenSSL cipherlist for "LOW" or higher grade ciphers. This defines the meaning of the "low" setting in smtpd_tls_mandatory_ciphers, smtp_tls_mandatory_ciphers and lmtp_tls_mandatory_ciphers. You are strongly encouraged to not change this setting. .PP This feature is available in Postfix 2.3 and later. -.SH tls_medium_cipherlist (default: !EXPORT:!LOW:ALL:+RC4:@STRENGTH) +.SH tls_medium_cipherlist (default: ALL:!EXPORT:!LOW:+RC4:@STRENGTH) The OpenSSL cipherlist for "MEDIUM" or higher grade ciphers. This defines the meaning of the "medium" setting in smtpd_tls_mandatory_ciphers, smtp_tls_mandatory_ciphers and lmtp_tls_mandatory_ciphers. This is diff --git a/postfix/man/man8/smtp.8 b/postfix/man/man8/smtp.8 index 40d18484b..1dd18024c 100644 --- a/postfix/man/man8/smtp.8 +++ b/postfix/man/man8/smtp.8 @@ -347,11 +347,11 @@ The server certificate peername verification method for the The number of pseudo-random bytes that an \fBsmtp\fR(8) or \fBsmtpd\fR(8) process requests from the \fBtlsmgr\fR(8) server in order to seed its internal pseudo random number generator (PRNG). -.IP "\fBtls_high_cipherlist (!EXPORT:!LOW:!MEDIUM:ALL:+RC4:@STRENGTH)\fR" +.IP "\fBtls_high_cipherlist (ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH)\fR" The OpenSSL cipherlist for "HIGH" grade ciphers. -.IP "\fBtls_medium_cipherlist (!EXPORT:!LOW:ALL:+RC4:@STRENGTH)\fR" +.IP "\fBtls_medium_cipherlist (ALL:!EXPORT:!LOW:+RC4:@STRENGTH)\fR" The OpenSSL cipherlist for "MEDIUM" or higher grade ciphers. -.IP "\fBtls_low_cipherlist (!EXPORT:ALL:+RC4:@STRENGTH)\fR" +.IP "\fBtls_low_cipherlist (ALL:!EXPORT:+RC4:@STRENGTH)\fR" The OpenSSL cipherlist for "LOW" or higher grade ciphers. .IP "\fBtls_export_cipherlist (ALL:+RC4:@STRENGTH)\fR" The OpenSSL cipherlist for "EXPORT" or higher grade ciphers. diff --git a/postfix/man/man8/smtpd.8 b/postfix/man/man8/smtpd.8 index b0865010b..2794c906b 100644 --- a/postfix/man/man8/smtpd.8 +++ b/postfix/man/man8/smtpd.8 @@ -378,11 +378,11 @@ instead of using the STARTTLS command. The number of pseudo-random bytes that an \fBsmtp\fR(8) or \fBsmtpd\fR(8) process requests from the \fBtlsmgr\fR(8) server in order to seed its internal pseudo random number generator (PRNG). -.IP "\fBtls_high_cipherlist (!EXPORT:!LOW:!MEDIUM:ALL:+RC4:@STRENGTH)\fR" +.IP "\fBtls_high_cipherlist (ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH)\fR" The OpenSSL cipherlist for "HIGH" grade ciphers. -.IP "\fBtls_medium_cipherlist (!EXPORT:!LOW:ALL:+RC4:@STRENGTH)\fR" +.IP "\fBtls_medium_cipherlist (ALL:!EXPORT:!LOW:+RC4:@STRENGTH)\fR" The OpenSSL cipherlist for "MEDIUM" or higher grade ciphers. -.IP "\fBtls_low_cipherlist (!EXPORT:ALL:+RC4:@STRENGTH)\fR" +.IP "\fBtls_low_cipherlist (ALL:!EXPORT:+RC4:@STRENGTH)\fR" The OpenSSL cipherlist for "LOW" or higher grade ciphers. .IP "\fBtls_export_cipherlist (ALL:+RC4:@STRENGTH)\fR" The OpenSSL cipherlist for "EXPORT" or higher grade ciphers. diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index f031b6f57..30d07f1bd 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -10301,7 +10301,7 @@ works in addition to the exclusions listed with smtp_tls_exclude_ciphers

This feature is available in Postfix 2.3 and later.

-%PARAM tls_high_cipherlist !EXPORT:!LOW:!MEDIUM:ALL:+RC4:@STRENGTH +%PARAM tls_high_cipherlist ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH

The OpenSSL cipherlist for "HIGH" grade ciphers. This defines the meaning of the "high" setting in smtpd_tls_mandatory_ciphers, @@ -10310,7 +10310,7 @@ strongly encouraged to not change this setting.

This feature is available in Postfix 2.3 and later.

-%PARAM tls_medium_cipherlist !EXPORT:!LOW:ALL:+RC4:@STRENGTH +%PARAM tls_medium_cipherlist ALL:!EXPORT:!LOW:+RC4:@STRENGTH

The OpenSSL cipherlist for "MEDIUM" or higher grade ciphers. This defines the meaning of the "medium" setting in smtpd_tls_mandatory_ciphers, @@ -10322,7 +10322,7 @@ setting.

This feature is available in Postfix 2.3 and later.

-%PARAM tls_low_cipherlist !EXPORT:ALL:+RC4:@STRENGTH +%PARAM tls_low_cipherlist ALL:!EXPORT:+RC4:@STRENGTH

The OpenSSL cipherlist for "LOW" or higher grade ciphers. This defines the meaning of the "low" setting in smtpd_tls_mandatory_ciphers, diff --git a/postfix/src/cleanup/Makefile.in b/postfix/src/cleanup/Makefile.in index 958057df7..69dfd981e 100644 --- a/postfix/src/cleanup/Makefile.in +++ b/postfix/src/cleanup/Makefile.in @@ -60,7 +60,7 @@ cleanup_masquerade: cleanup_masquerade.o CLEANUP_MILTER_OBJS = cleanup_state.o cleanup_out.o cleanup_addr.o \ cleanup_out_recipient.o -cleanup_milter: cleanup_milter.o $(CLEANUP_MILTER_OBJS) +cleanup_milter: cleanup_milter.o $(CLEANUP_MILTER_OBJS) $(LIBS) mv cleanup_milter.o junk $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(CLEANUP_MILTER_OBJS) $(LIBS) $(SYSLIBS) mv junk cleanup_milter.o diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 3e63728cc..a940e1ec7 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -2648,15 +2648,15 @@ extern bool var_smtp_cname_overr; * TLS cipherlists */ #define VAR_TLS_HIGH_CLIST "tls_high_cipherlist" -#define DEF_TLS_HIGH_CLIST "!EXPORT:!LOW:!MEDIUM:ALL:+RC4:@STRENGTH" +#define DEF_TLS_HIGH_CLIST "ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH" extern char *var_tls_high_clist; #define VAR_TLS_MEDIUM_CLIST "tls_medium_cipherlist" -#define DEF_TLS_MEDIUM_CLIST "!EXPORT:!LOW:ALL:+RC4:@STRENGTH" +#define DEF_TLS_MEDIUM_CLIST "ALL:!EXPORT:!LOW:+RC4:@STRENGTH" extern char *var_tls_medium_clist; #define VAR_TLS_LOW_CLIST "tls_low_cipherlist" -#define DEF_TLS_LOW_CLIST "!EXPORT:ALL:+RC4:@STRENGTH" +#define DEF_TLS_LOW_CLIST "ALL:!EXPORT:+RC4:@STRENGTH" extern char *var_tls_low_clist; #define VAR_TLS_EXPORT_CLIST "tls_export_cipherlist" diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index b337dc6be..61d8b75c4 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,8 +20,8 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "200600825" -#define MAIL_VERSION_NUMBER "2.3.3" +#define MAIL_RELEASE_DATE "20061002" +#define MAIL_VERSION_NUMBER "2.3.4-RC1" #ifdef SNAPSHOT # define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE diff --git a/postfix/src/global/record.c b/postfix/src/global/record.c index a52003e75..3ef7ca7b5 100644 --- a/postfix/src/global/record.c +++ b/postfix/src/global/record.c @@ -320,10 +320,13 @@ int rec_goto(VSTREAM *stream, const char *buf) msg_warn("%s: malformed pointer record value: %s", VSTREAM_PATH(stream), buf); return (REC_TYPE_ERROR); - } else if (offset < saved_offset && ++reverse_count > REVERSE_JUMP_LIMIT) { + } else if (offset == 0) { + /* Dummy record. */ + return (0); + } else if (offset <= saved_offset && ++reverse_count > REVERSE_JUMP_LIMIT) { msg_warn("%s: too many reverse jump records", VSTREAM_PATH(stream)); return (REC_TYPE_ERROR); - } else if (offset > 0 && vstream_fseek(stream, offset, SEEK_SET) < 0) { + } else if (vstream_fseek(stream, offset, SEEK_SET) < 0) { msg_warn("%s: seek error after pointer record: %m", VSTREAM_PATH(stream)); return (REC_TYPE_ERROR); diff --git a/postfix/src/sendmail/sendmail.c b/postfix/src/sendmail/sendmail.c index f7cc4b7ae..da88542b1 100644 --- a/postfix/src/sendmail/sendmail.c +++ b/postfix/src/sendmail/sendmail.c @@ -95,7 +95,8 @@ /* with the MAIL_CONFIG environment variable to override the /* location of configuration files. /* .IP "\fB-F \fIfull_name\fR -/* Set the sender full name. This is used only with messages that +/* Set the sender full name. This overrides the NAME environment +/* variable, and is used only with messages that /* have no \fBFrom:\fR message header. /* .IP "\fB-f \fIsender\fR" /* Set the envelope sender address. This is the address where @@ -227,11 +228,15 @@ /* .fi /* .IP \fBMAIL_CONFIG\fR /* Directory with Postfix configuration files. -/* .IP \fBMAIL_VERBOSE\fR +/* .IP "\fBMAIL_VERBOSE\fR (value does not matter)" /* Enable verbose logging for debugging purposes. -/* .IP \fBMAIL_DEBUG\fR +/* .IP "\fBMAIL_DEBUG\fR (value does not matter)" /* Enable debugging with an external command, as specified with the /* \fBdebugger_command\fR configuration parameter. +/* .IP \fBNAME\fR +/* The sender full name. This is used only with messages that +/* have no \fBFrom:\fR message header. See also the \fB-F\fR +/* option above. /* CONFIGURATION PARAMETERS /* .ad /* .fi @@ -338,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.c b/postfix/src/smtp/smtp.c index b6fdad8b0..21a7aab6b 100644 --- a/postfix/src/smtp/smtp.c +++ b/postfix/src/smtp/smtp.c @@ -317,11 +317,11 @@ /* The number of pseudo-random bytes that an \fBsmtp\fR(8) or \fBsmtpd\fR(8) /* process requests from the \fBtlsmgr\fR(8) server in order to seed its /* internal pseudo random number generator (PRNG). -/* .IP "\fBtls_high_cipherlist (!EXPORT:!LOW:!MEDIUM:ALL:+RC4:@STRENGTH)\fR" +/* .IP "\fBtls_high_cipherlist (ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH)\fR" /* The OpenSSL cipherlist for "HIGH" grade ciphers. -/* .IP "\fBtls_medium_cipherlist (!EXPORT:!LOW:ALL:+RC4:@STRENGTH)\fR" +/* .IP "\fBtls_medium_cipherlist (ALL:!EXPORT:!LOW:+RC4:@STRENGTH)\fR" /* The OpenSSL cipherlist for "MEDIUM" or higher grade ciphers. -/* .IP "\fBtls_low_cipherlist (!EXPORT:ALL:+RC4:@STRENGTH)\fR" +/* .IP "\fBtls_low_cipherlist (ALL:!EXPORT:+RC4:@STRENGTH)\fR" /* The OpenSSL cipherlist for "LOW" or higher grade ciphers. /* .IP "\fBtls_export_cipherlist (ALL:+RC4:@STRENGTH)\fR" /* The OpenSSL cipherlist for "EXPORT" or higher grade ciphers. diff --git a/postfix/src/smtp/smtp_connect.c b/postfix/src/smtp/smtp_connect.c index b8fbde19f..3f87e7dc3 100644 --- a/postfix/src/smtp/smtp_connect.c +++ b/postfix/src/smtp/smtp_connect.c @@ -663,9 +663,9 @@ static void smtp_connect_remote(SMTP_STATE *state, const char *nexthop, * primary destination to be a list (it could be just separators). */ sites = argv_alloc(1); - argv_add(sites, request->nexthop, (char *) 0); + argv_add(sites, nexthop, (char *) 0); if (sites->argc == 0) - msg_panic("null destination: \"%s\"", request->nexthop); + msg_panic("null destination: \"%s\"", nexthop); non_fallback_sites = sites->argc; if ((state->misc_flags & SMTP_MISC_FLAG_USE_LMTP) == 0) argv_split_append(sites, var_fallback_relay, ", \t\r\n"); 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.c b/postfix/src/smtpd/smtpd.c index 42d336337..16f71294b 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -346,11 +346,11 @@ /* The number of pseudo-random bytes that an \fBsmtp\fR(8) or \fBsmtpd\fR(8) /* process requests from the \fBtlsmgr\fR(8) server in order to seed its /* internal pseudo random number generator (PRNG). -/* .IP "\fBtls_high_cipherlist (!EXPORT:!LOW:!MEDIUM:ALL:+RC4:@STRENGTH)\fR" +/* .IP "\fBtls_high_cipherlist (ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH)\fR" /* The OpenSSL cipherlist for "HIGH" grade ciphers. -/* .IP "\fBtls_medium_cipherlist (!EXPORT:!LOW:ALL:+RC4:@STRENGTH)\fR" +/* .IP "\fBtls_medium_cipherlist (ALL:!EXPORT:!LOW:+RC4:@STRENGTH)\fR" /* The OpenSSL cipherlist for "MEDIUM" or higher grade ciphers. -/* .IP "\fBtls_low_cipherlist (!EXPORT:ALL:+RC4:@STRENGTH)\fR" +/* .IP "\fBtls_low_cipherlist (ALL:!EXPORT:+RC4:@STRENGTH)\fR" /* The OpenSSL cipherlist for "LOW" or higher grade ciphers. /* .IP "\fBtls_export_cipherlist (ALL:+RC4:@STRENGTH)\fR" /* The OpenSSL cipherlist for "EXPORT" or higher grade ciphers. @@ -2250,7 +2250,7 @@ static int rcpt_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv) } vstring_strcpy(state->dsn_orcpt_buf, arg + 6); if (dsn_orcpt_addr - || (coded_addr = split_at(STR(state->dsn_orcpt_buf), ';')) == 0 + || (coded_addr = split_at(STR(state->dsn_orcpt_buf), ';')) == 0 || xtext_unquote(state->dsn_buf, coded_addr) == 0 || *(dsn_orcpt_type = STR(state->dsn_orcpt_buf)) == 0) { state->error_mask |= MAIL_ERROR_PROTOCOL; @@ -3901,7 +3901,7 @@ static void smtpd_proto(SMTPD_STATE *state) if (smtpd_milters != 0 && SMTPD_STAND_ALONE(state) == 0) { milter_macro_callback(smtpd_milters, smtpd_milter_eval, (void *) state); - if ((err = milter_conn_event(smtpd_milters, state->reverse_name, + if ((err = milter_conn_event(smtpd_milters, state->name, state->addr, XXX_NO_PORT, state->addr_family)) != 0) err = check_milter_reply(state, err); diff --git a/postfix/src/smtpstone/smtp-sink.c b/postfix/src/smtpstone/smtp-sink.c index 289c2f1a3..a7324da17 100644 --- a/postfix/src/smtpstone/smtp-sink.c +++ b/postfix/src/smtpstone/smtp-sink.c @@ -282,6 +282,7 @@ static void rcpt_response(SINK_STATE *state) static void data_response(SINK_STATE *state) { + /* Not: ST_ANY. */ state->data_state = ST_CR_LF; smtp_printf(state->stream, "354 End data with ."); smtp_flush(state->stream); 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/dict_cidr.c b/postfix/src/util/dict_cidr.c index 28f075e78..6f12f9f87 100644 --- a/postfix/src/util/dict_cidr.c +++ b/postfix/src/util/dict_cidr.c @@ -78,6 +78,8 @@ static const char *dict_cidr_lookup(DICT *dict, const char *key) if (msg_verbose) msg_info("dict_cidr_lookup: %s: %s", dict->name, key); + dict_errno = 0; + if ((entry = (DICT_CIDR_ENTRY *) cidr_match_execute(&(dict_cidr->head->cidr_info), key)) != 0) return (entry->value); 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 296806d3e..513d25223 100644 --- a/postfix/src/util/sys_defs.h +++ b/postfix/src/util/sys_defs.h @@ -28,6 +28,7 @@ || defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \ || defined(OPENBSD2) || defined(OPENBSD3) || defined(OPENBSD4) \ || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) \ + || defined(NETBSD4) \ || defined(EKKOBSD1) #define SUPPORTED #include @@ -512,6 +513,7 @@ extern int opterr; # define HAS_IPV6 #endif #define BROKEN_AI_PASSIVE_NULL_HOST +#define BROKEN_AI_NULL_SERVICE #endif #ifdef AIX4