From eabaabc2f13209d934b904214e95b2e17eab6451 Mon Sep 17 00:00:00 2001
From: Wietse Venema Postfix version 2.3 introduces support for the Sendmail version
-8 Milter (mail filter) protocol. This protocol is used by applications
-that run outside the MTA to inspect SMTP events (CONNECT, DISCONNECT),
-SMTP commands (HELO, MAIL FROM, etc.) as well as mail content (headers
-and body). All this happens before mail is queued. Postfix implements support for the Sendmail version 8 Milter
+(mail filter) protocol. This protocol is used by applications that
+run outside the MTA to inspect SMTP events (CONNECT, DISCONNECT),
+SMTP commands (HELO, MAIL FROM, etc.) as well as mail content
+(headers and body). All this happens before mail is queued. The reason for adding Milter support to Postfix is that there
exists a large collection of applications, not only to block unwanted
@@ -39,13 +39,12 @@ href="http://sourceforge.net/projects/dk-milter/">DomainKeys).
Having yet another Postfix-specific version of all that software
is a poor use of human and system resources. Postfix version 2.4 implements all the requests of Sendmail
-version 8 Milter protocols up to version 4, including message body
-replacement (body replacement is not available with Postfix version
-2.3).
-See, however, the workarounds and The Milter protocol has evolved over time, and different Postfix
+versions implement different feature sets. See the workarounds and limitations sections at the end of this
-document. Introduction
-
This document provides information on the following topics:
@@ -68,8 +67,8 @@ document.The Postfix Milter implementation uses two different lists of -mail filters: one list of filters that are used for SMTP mail only, -and one list of filters that are used for non-SMTP mail. The two +mail filters: one list of filters for SMTP mail only, +and one list of filters for non-SMTP mail. The two lists have different capabilities, which is unfortunate. Avoiding this would require major restructuring of Postfix.
@@ -98,7 +97,8 @@ figure below shows how Milter applications plug into Postfix. Names followed by a number are Postfix commands or server programs, while unnumbered names inside shaded areas represent Postfix queues. To avoid clutter, the path for local submission is simplified (the -OVERVIEW document has a more complete description). +OVERVIEW document has a more complete description of the Postfix +architecture).@@ -204,10 +204,16 @@ an object library that implements the Sendmail 8 Milter protocol. Postfix currently does not provide such a library, but Sendmail does. -On some Linux and *BSD distributions, the Sendmail libmilter -library is installed by default. With this, applications such as -dkim-milter -and sid-milter +
+ +
The first option is to use a pre-compiled library. Some +systems install the Sendmail libmilter library by default. With +other systems, libmilter may be provided by a package (called +"sendmail-devel" on some Linux systems).
+ +Once libmilter is installed, applications such as dkim-milter and +sid-milter build out of the box without requiring any tinkering:
@@ -219,17 +225,8 @@ $ make-On other platforms you have two options:
- -- -
Install the Sendmail libmilter object library and include -files. On Linux systems, libmilter may be provided by the -sendmail-devel package. After installing libmilter, build the -Milter applications as described in the preceding paragraph.
- -Don't install the Sendmail libmilter library, but build the -library from Sendmail source code instead:
+The other option is to build the libmilter library from +Sendmail source code:
@@ -476,8 +473,9 @@ following:@@ -487,15 +485,16 @@ number.-postfix/smtpd[21045]: warning: milter inet:host:port: can't read packet header: Unknown error : 0 -postfix/cleanup[15190]: warning: milter inet:host:port: can't read packet header: Success +warning: milter inet:host:port: can't read packet header: Unknown error : 0 +warning: milter inet:host:port: can't read packet header: Success +warning: milter inet:host:port: can't read SMFIC_DATA reply packet header: No such file or directoryMilter protocol timeouts
Postfix uses different time limits at different Milter protocol -stages. The table shows wich timeouts are used and when +stages. The table shows the timeout settings and the corresponding +protocol stages (EOH = end of headers; EOM = end of message).
-
+ Parameter Time limit Protocol -stage Postfix parameter Time limit Milter +protocol stage @@ -510,17 +509,18 @@ EOH, BODY, EOM - milter_connect_timeout 30s CONNECT Beware: 30s may be too short for applications doing lots of DNS -lookups. However, if you increase the above timeouts too much, -remote SMTP clients may hang up and mail may be delivered multiple -times. This is an inherent problem with before-queue filtering.
+Beware: 30s may be too short for Milter applications that do +lots of DNS lookups. However, if you increase the above timeouts +too much, remote SMTP clients may hang up and mail may be delivered +multiple times. This is an inherent problem with before-queue +filtering.
Sendmail macro emulation
Postfix emulates a limited number of Sendmail macros, as shown in the table. Some macro values depend on whether a recipient is rejected (rejected recipients are available on request by the Milter -application). Different macros are available at different SMTP +application). Different macros are available at different Milter protocol stages (EOH = end-of-header, EOM = end-of-message); their availability is not always the same as in Sendmail. See the workarounds section below for solutions.
-
+ Name Availability Description -- Sendmail macro Milter protocol stage +Description + i DATA, EOH, EOM Queue ID - i DATA, EOH, EOM Queue ID, also +Postfix queue file name j Always value of myhostname +j Always Value of myhostname _ Always The validated client name @@ -586,22 +587,22 @@ cipher - {mail_addr} Sender address + {mail_host} MAIL (Postfix ≥ 2.6) -Sender next-hop destination - {mail_host} MAIL (Postfix ≥ 2.6, only with +smtpd_milters) Sender next-hop destination + {mail_mailer} MAIL (Postfix ≥ 2.6) -Sender mail delivery transport {mail_mailer} MAIL (Postfix ≥ 2.6, only with +smtpd_milters) Sender mail delivery transport - {rcpt_addr} RCPT Recipient address
With rejected recipient: descriptive text+ {rcpt_host} RCPT (Postfix ≥ 2.6) -Recipient next-hop destination
With rejected recpient: enhanced -status code- {rcpt_host} RCPT (Postfix ≥ 2.6, only with +smtpd_milters) Recipient next-hop destination
With +rejected recipient: enhanced status code+ {rcpt_mailer} RCPT (Postfix ≥ 2.6) -Recipient mail delivery transport
With rejected recipient: -"error"{rcpt_mailer} RCPT (Postfix ≥ 2.6, only with +smtpd_milters) Recipient mail delivery transport
+With rejected recipient: "error"@@ -613,18 +614,23 @@ status code - {tls_version} HELO, MAIL, DATA, EOH, EOM TLS protocol version Postfix sends specific sets of macros at different SMTP protocol +
Postfix sends specific sets of macros at different Milter protocol stages. The sets are configured with the parameters as described in the table (EOH = end of headers; EOM = end of message). The protocol version is a number that Postfix sends at the beginning of the Milter protocol handshake.
+As of Sendmail 8.14.0, Milter applications can specify what +macros they want to receive at different Milter protocol stages. +An application-specified list takes precedence over a Postfix-specified +list.
+-
+ Parameter name Protocol version -Protocol stage Postfix parameter Milter protocol version +Milter protocol stage @@ -656,19 +662,26 @@ TO milter_connect_macros 2 or higher CONNECT Workarounds
-Content filters may break DKIM etc. signatures. If you -use an SMTP-based content filter, then you should add a line to -master.cf with "-o disable_mime_output_conversion=yes" (note: no -spaces around the "="), as described in the + +
-To avoid breaking DKIM etc. signatures with an SMTP-based +content filter, update the before-filter SMTP client in master.cf, +and add a line with "-o disable_mime_output_conversion=yes" (note: +no spaces around the "="). For details, see the advanced content filter example.
-Sendmail Milter applications were originally developed for the -Sendmail version 8 MTA, which has a different architecture than -Postfix. The result is that some Milter applications make assumptions -that aren't true in a Postfix environment.
- -+
+/etc/postfix/master.cf: + # ============================================================= + # service type private unpriv chroot wakeup maxproc command + # (yes) (yes) (yes) (never) (100) + # ============================================================= + scan unix - - n - 10 smtp + -o smtp_send_xforward_command=yes + -o disable_mime_output_conversion=yes + -o smtp_generic_maps= +Some Milter applications use the "{if_addr}" macro to recognize local mail; this macro does not exist in Postfix. @@ -691,62 +704,22 @@ X-SenderID: Sendmail Sender-ID Filter vx.y.z host.example.com <unknown-msgid& -
This happens because those Milter applications expect that the -queue ID is known before the MTA accepts the MAIL FROM -(sender) command. Postfix, on the other hand, does not choose a -queue file name until after it accepts the first valid RCPT -TO (recipient) command (Postfix queue file names must be unique -across multiple directories, so the name can't be chosen before the -file is created; if multiple messages were to use the same queue -ID simultaneously, mail would be lost).
- - +The problem is that Milter applications expect that the queue +ID is known before the MTA accepts the MAIL FROM (sender) +command. Postfix does not choose a queue ID, which is used as the +queue file name, until after it accepts the first valid RCPT +TO (recipient) command.
If you experience the ugly header problem, see if a recent version of the Milter application fixes it. For example, current versions of dkim-filter and dk-filter already have code that looks -up the Postfix queue ID at a later protocol stage.
- -To fix the ugly message header with sid-filter applications, -we change the source code, so that it does the queue ID lookup after -Postfix receives the end of the message.
- -- -
- -Edit the filter source file (named -sid-filter/sid-filter.c).
- -Look up the smfilter table and replace -mlfi_eoh by NULL. +up the Postfix queue ID at a later protocol stage, and sid-filter +version 1.0.0 no longer includes the queue ID in the message header.
-Look up the mlfi_eom() function and add code near -the top that calls mlfi_eoh() as shown by the bold -text below:
- --- -- assert(ctx != NULL); -#endif /* !DEBUG */ - - ret = mlfi_eoh(ctx); - if (ret != SMFIS_CONTINUE) - return ret; --NOTES:
- -- -
- -This was tested with sid-milter-0.2.10 and sid-milter-0.2.14.
- -To fix the ugly message header with other Milter applications, -you will need to do something like this:
+To fix the ugly message header, you will need to add code that +looks up the Postfix queue ID at some later point im time. The +example below adds the lookup after the end-of-message.
@@ -769,8 +742,6 @@ if (dfc->mctx_jobid == 0 || strcmp(dfc->mctx_jobid, JOBIDUNKNOWN) == 0) { if (jobid != 0) dfc->mctx_jobid = jobid; } - -/* get hostname; used in the X header and in new MIME boundaries */ @@ -779,11 +750,15 @@ if (dfc->mctx_jobid == 0 || strcmp(dfc->mctx_jobid, JOBIDUNKNOWN) == 0) {
Different mail filters use slightly different names for -variables. If the above code does not compile, look for the code -at the start of the mlfi_eoh() routine.
+variables. If the above code does not compile, look elsewhere in +the mail filter source file for code that looks up the "i" macro +value, and copy that code.This fixes only the ugly message header, but not the WARNING -message. Fortunately, many Milters log that message only once.
+This change fixes only the ugly message header, but not +the WARNING message. Fortunately, many Milters log that message +only once.
+ + @@ -797,28 +772,47 @@ a discussion.+
The Milter protocol has evolved over time. Therefore, +different Postfix versions implement different feature sets.
+ ++ +
++ + Postfix Supported Milter requests ++ + 2.6 All Milter requests of +Sendmail 8.14.0 (see notes below). + + 2.5 All Milter requests of +Sendmail 8.14.0, except:
SMFIP_RCPT_REJ (report rejected +recipients to the mail filter),
SMFIR_CHGFROM (replace sender, +with optional ESMTP parameters),
SMFIR_ADDRCPT_PAR (add +recipient, with optional ESMTP parameters).+ + 2.4 All Milter requests of +Sendmail 8.13.0. 2.3 All Milter requests of +Sendmail 8.13.0, except:
SMFIR_REPLBODY (replace message body). + +For Milter applications that are written in C, you need to use the Sendmail libmilter library.
-There are TWO sets of mail filters: filters that are used +
Postfix has TWO sets of mail filters: filters that are used for SMTP mail only (specified with the smtpd_milters parameter), and filters for non-SMTP mail (specified with the non_smtpd_milters parameter). The non-SMTP filters are primarily for local submissions.
-- -
-When mail is filtered by non-SMTP filters, the Postfix -cleanup(8) server has to simulate the SMTP client CONNECT and -DISCONNECT events, and the SMTP client EHLO, MAIL FROM, RCPT TO and -DATA commands. This works as expected, with only one exception: -non-SMTP filters must not REJECT or TEMPFAIL simulated RCPT TO -commands. When a non-SMTP filter REJECTs or TEMPFAILs a recipient, +
When mail is filtered by non_smtpd_milters, the Postfix cleanup(8) +server has to simulate SMTP client requests. This works as expected, +with only one exception: non_smtpd_milters must not REJECT or +TEMPFAIL simulated RCPT TO commands. When this rule is violated, Postfix will report a configuration error, and mail will stay in the queue.
-Postfix currently does not apply content filters to mail that is forwarded or aliased internally, or to mail that is generated internally such as bounces or Postmaster notifications. This may @@ -831,49 +825,26 @@ only to the SMTP command information; they have no access to the message header or body, and cannot make modifications to the message or to the envelope.
-Postfix version 2.6 implements all Sendmail 8.14 Milter -features, except it ignores the optional ESMTP command parameters -with requests to replace the sender (SMFIR_CHGFROM), or to append -a recipient (SMFIR_ADDRCPT_PAR). When a Milter application supplies -ESMTP command parameters, these are logged as follows:
+Postfix 2.6 ignores the optional ESMTP parameters in +requests to replace the sender (SMFIR_CHGFROM) or to append a +recipient (SMFIR_ADDRCPT_PAR). Postfix logs a warning message when +a Milter application supplies such ESMTP parameters:
-postfix/cleanup[40629]: warning: 100B22B3293: cleanup_chg_from: ignoring ESMTP arguments "whatever" +warning: queue-id: cleanup_chg_from: ignoring ESMTP arguments "whatever" +warning: queue-id: cleanup_add_rcpt: ignoring ESMTP arguments "whatever"-Specify "milter_protocol = 6" to enable all available Sendmail -8.14 and earlier Milter features.
+Postfix 2.3 does not implement requests to replace the +message body. Milter applications log a warning message when they +need this unsupported operation:
-Postfix version 2.5 implements all Sendmail 8.14 Milter -features except: SMFIP_RCPT_REJ (report rejected recipients to the -mail filter), SMFIR_CHGFROM (replace sender, with optional ESMTP -command parameters), and SMFIR_ADDRCPT_PAR (add recipient, with -optional ESMTP command parameters).
- -Specify "milter_protocol = 6" to enable all available Sendmail -8.14 and earlier Milter features.
- -Postfix 2.4 implements all Sendmail 8.13 Milter features. -
- -Specify "milter_protocol = 4" to enable all available Sendmail -8.13 and earlier Milter features.
- -Postfix 2.3 implements all Sendmail 8.13 Milter features -except requests to replace the message body. Milter applications -that request this unsupported operation will log a warning like - -
-application name: st_optionneg[134563840]: 0x3d does not fulfill action requirements 0x1e +st_optionneg[134563840]: 0x3d does not fulfill action requirements 0x1e-The solution is to use Postfix version 2.4 or later.
-Specify "milter_protocol = 4" to enable all available Sendmail -8.13 and earlier Milter features.
-Most Milter configuration options are global. Future Postfix versions may support per-Milter timeouts, per-Milter error handling, etc.
diff --git a/postfix/html/SMTPD_POLICY_README.html b/postfix/html/SMTPD_POLICY_README.html index 42c3e2f4e..85f4b77cd 100644 --- a/postfix/html/SMTPD_POLICY_README.html +++ b/postfix/html/SMTPD_POLICY_README.html @@ -271,11 +271,12 @@ daemon, you would use something like this:Lines 2, 11: the Postfix spawn(8) daemon by default kills its child process after 1000 seconds. This is too short for a -policy daemon that may run for as long as an SMTP client is connected -to an SMTP server process. The default time limit is overruled in +policy daemon that may need to run for as long as the SMTP server +process that talks to it. The default time limit is overruled in main.cf with an explicit "policy_time_limit" setting. The name of the parameter is the name of the master.cf entry ("policy") -concatenated with the "_time_limit" suffix.
+concatenated with the "_time_limit" suffix. See spawn(8) for +more information about the time limit parameter.Line 2: specify a "0" process limit instead of the default "-", to avoid "connection refused" and other problems when the smtpd diff --git a/postfix/html/STRESS_README.html b/postfix/html/STRESS_README.html index 49a99408f..328893639 100644 --- a/postfix/html/STRESS_README.html +++ b/postfix/html/STRESS_README.html @@ -512,7 +512,7 @@ services that accept remote connections.
-Other measures to off-load zombies
+Other measures to off-load zombies
OpenBSD spamd implements a daemon that handles all connections from "new" clients. diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index 4098156e7..49287c76f 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -10453,6 +10453,8 @@ Example:
Optional SMTP server access restrictions in the context of a client SMTP connection request. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
@@ -10724,6 +10726,8 @@ Example:
Optional access restrictions that the Postfix SMTP server applies in the context of the SMTP DATA command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
@@ -10851,7 +10855,10 @@ to discard EHLO keywords selectively.
(default: empty)Optional access restrictions that the Postfix SMTP server -applies in the context of the SMTP END-OF-DATA command.
+applies in the context of the SMTP END-OF-DATA command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time. +This feature is available in Postfix 2.2 and later.
@@ -10903,6 +10910,8 @@ mail.Optional SMTP server access restrictions in the context of a client ETRN request. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
@@ -11034,6 +11043,8 @@ Example:
Optional restrictions that the Postfix SMTP server applies in the context of the SMTP HELO command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
@@ -11353,6 +11364,8 @@ for each excess recipient.
The access restrictions that the Postfix SMTP server applies in the context of the RCPT TO command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
@@ -11951,6 +11964,8 @@ or a list of SASL login names separated by comma and/or whitespace.
Optional restrictions that the Postfix SMTP server applies in the context of the MAIL FROM command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
diff --git a/postfix/html/postfix-logo.jpg b/postfix/html/postfix-logo.jpg index 9133bcdb52e44299f89d389e5b930745460d8919..f1bc4e067da77bc35ae0e60c0c330399b456dc42 100644 GIT binary patch delta 2871 zcmb8x_aoE~1Hkb+v&={oGVZd+m$O%gI$NA|W}WdR&YnqpWR&f6R^<5NtnAs5D0`Q^ zXPhG{%Go{Rr{~w_hu8aWc#rUY;jLYv0!~E>BN;?1xI)NOvaVFPU`DQo2(5vN`W;gQ zB}IZgY`{MH4&Fd%>0$LstTv}6VO*f-?7+Y82ibJXqdbRX8^^@lw
-9S zPXj||7r*g%{qS!Tc3oyg+So2?nM{y1^!?bmY1xoq-*cv%L$1;s2A}AY-#JwSJ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C3%C6d0)ti0Ty$~maxxopEZ zO{&*o>CI00k`y*kiiP0cGdNU$MGlw~%r2;A^xobJGCUc-vqG$AYYqIWF~H)ODNFoI zGdJXVGYGn82oM2`2hL<1Tr~=6`sHPoltA%#+t;lqhh^YDjP6A@f4%pqgTOH*fg{>5 z|4dpA_j;2uBgTVZ8!tZtxOMWR^Bh6_b7e@1!9HH%RL ). Having yet another Postfix-specific version of all that software is a poor use of human and system resources.({C>3_0Ar22qsU-si{vSdiC;iFft`pbOY=RjhezM3`m5H z ;{uO0kWwJuyK3&Db1Q54bM{>q;?m1q(8|yTo5_o#OZJtZ zLzDg58y8-qndi4ohu_&6);|cVw)&(}Vt5;>hyvH%zbiCzN5&QBP)Hg!Od{lRGU5vN zONd!fhh8*2oRw!F$Wfthg#z}sb}MEt oG Hv&sJeF+PHg diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index 32d879201..298ae5921 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -6355,6 +6355,8 @@ smtpd_client_recipient_rate_limit = 1000 .SH smtpd_client_restrictions (default: empty) Optional SMTP server access restrictions in the context of a client SMTP connection request. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time. .PP The default is to allow all connection requests. .PP @@ -6571,6 +6573,8 @@ smtpd_client_restrictions = permit_mynetworks, reject_unknown_client_hostname .SH smtpd_data_restrictions (default: empty) Optional access restrictions that the Postfix SMTP server applies in the context of the SMTP DATA command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time. .PP This feature is available in Postfix 2.0 and later. .PP @@ -6649,6 +6653,8 @@ to discard EHLO keywords selectively. .SH smtpd_end_of_data_restrictions (default: empty) Optional access restrictions that the Postfix SMTP server applies in the context of the SMTP END-OF-DATA command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time. .PP This feature is available in Postfix 2.2 and later. .PP @@ -6680,6 +6686,8 @@ mail. .SH smtpd_etrn_restrictions (default: empty) Optional SMTP server access restrictions in the context of a client ETRN request. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time. .PP The Postfix ETRN implementation accepts only destinations that are eligible for the Postfix "fast flush" service. See the ETRN_README @@ -6750,6 +6758,8 @@ smtpd_helo_required = yes .SH smtpd_helo_restrictions (default: empty) Optional restrictions that the Postfix SMTP server applies in the context of the SMTP HELO command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time. .PP The default is to permit everything. .PP @@ -6922,6 +6932,8 @@ for each excess recipient. .SH smtpd_recipient_restrictions (default: permit_mynetworks, reject_unauth_destination) The access restrictions that the Postfix SMTP server applies in the context of the RCPT TO command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time. .PP By default, the Postfix SMTP server accepts: .IP \(bu @@ -7334,6 +7346,8 @@ or a list of SASL login names separated by comma and/or whitespace. .SH smtpd_sender_restrictions (default: empty) Optional restrictions that the Postfix SMTP server applies in the context of the MAIL FROM command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time. .PP The default is to permit everything. .PP diff --git a/postfix/proto/MILTER_README.html b/postfix/proto/MILTER_README.html index ca544dd69..41f6938c3 100644 --- a/postfix/proto/MILTER_README.html +++ b/postfix/proto/MILTER_README.html @@ -19,11 +19,11 @@ Introduction
-Postfix version 2.3 introduces support for the Sendmail version -8 Milter (mail filter) protocol. This protocol is used by applications -that run outside the MTA to inspect SMTP events (CONNECT, DISCONNECT), -SMTP commands (HELO, MAIL FROM, etc.) as well as mail content (headers -and body). All this happens before mail is queued.
+Postfix implements support for the Sendmail version 8 Milter +(mail filter) protocol. This protocol is used by applications that +run outside the MTA to inspect SMTP events (CONNECT, DISCONNECT), +SMTP commands (HELO, MAIL FROM, etc.) as well as mail content +(headers and body). All this happens before mail is queued.
The reason for adding Milter support to Postfix is that there exists a large collection of applications, not only to block unwanted @@ -39,13 +39,12 @@ href="http://sourceforge.net/projects/dk-milter/">DomainKeys
Postfix version 2.4 implements all the requests of Sendmail -version 8 Milter protocols up to version 4, including message body -replacement (body replacement is not available with Postfix version -2.3). -See, however, the workarounds and The Milter protocol has evolved over time, and different Postfix +versions implement different feature sets. See the workarounds and limitations sections at the end of this -document.
+document for differences between Postfix and Sendmail implementations. +This document provides information on the following topics:
@@ -68,8 +67,8 @@ document.How Milter applications plug into Postfix
The Postfix Milter implementation uses two different lists of -mail filters: one list of filters that are used for SMTP mail only, -and one list of filters that are used for non-SMTP mail. The two +mail filters: one list of filters for SMTP mail only, +and one list of filters for non-SMTP mail. The two lists have different capabilities, which is unfortunate. Avoiding this would require major restructuring of Postfix.
@@ -98,7 +97,8 @@ figure below shows how Milter applications plug into Postfix. Names followed by a number are Postfix commands or server programs, while unnumbered names inside shaded areas represent Postfix queues. To avoid clutter, the path for local submission is simplified (the -OVERVIEW document has a more complete description). +OVERVIEW document has a more complete description of the Postfix +architecture).@@ -204,10 +204,16 @@ an object library that implements the Sendmail 8 Milter protocol. Postfix currently does not provide such a library, but Sendmail does. -On some Linux and *BSD distributions, the Sendmail libmilter -library is installed by default. With this, applications such as -dkim-milter -and sid-milter +
+ +
The first option is to use a pre-compiled library. Some +systems install the Sendmail libmilter library by default. With +other systems, libmilter may be provided by a package (called +"sendmail-devel" on some Linux systems).
+ +Once libmilter is installed, applications such as dkim-milter and +sid-milter build out of the box without requiring any tinkering:
@@ -219,17 +225,8 @@ $ make-On other platforms you have two options:
- -- -
Install the Sendmail libmilter object library and include -files. On Linux systems, libmilter may be provided by the -sendmail-devel package. After installing libmilter, build the -Milter applications as described in the preceding paragraph.
- -Don't install the Sendmail libmilter library, but build the -library from Sendmail source code instead:
+The other option is to build the libmilter library from +Sendmail source code:
@@ -476,8 +473,9 @@ following:@@ -487,15 +485,16 @@ number.-postfix/smtpd[21045]: warning: milter inet:host:port: can't read packet header: Unknown error : 0 -postfix/cleanup[15190]: warning: milter inet:host:port: can't read packet header: Success +warning: milter inet:host:port: can't read packet header: Unknown error : 0 +warning: milter inet:host:port: can't read packet header: Success +warning: milter inet:host:port: can't read SMFIC_DATA reply packet header: No such file or directoryMilter protocol timeouts
Postfix uses different time limits at different Milter protocol -stages. The table shows wich timeouts are used and when +stages. The table shows the timeout settings and the corresponding +protocol stages (EOH = end of headers; EOM = end of message).
-
+ Parameter Time limit Protocol -stage Postfix parameter Time limit Milter +protocol stage @@ -510,17 +509,18 @@ EOH, BODY, EOM - milter_connect_timeout 30s CONNECT Beware: 30s may be too short for applications doing lots of DNS -lookups. However, if you increase the above timeouts too much, -remote SMTP clients may hang up and mail may be delivered multiple -times. This is an inherent problem with before-queue filtering.
+Beware: 30s may be too short for Milter applications that do +lots of DNS lookups. However, if you increase the above timeouts +too much, remote SMTP clients may hang up and mail may be delivered +multiple times. This is an inherent problem with before-queue +filtering.
Sendmail macro emulation
Postfix emulates a limited number of Sendmail macros, as shown in the table. Some macro values depend on whether a recipient is rejected (rejected recipients are available on request by the Milter -application). Different macros are available at different SMTP +application). Different macros are available at different Milter protocol stages (EOH = end-of-header, EOM = end-of-message); their availability is not always the same as in Sendmail. See the workarounds section below for solutions.
-
+ Name Availability Description -- Sendmail macro Milter protocol stage +Description + i DATA, EOH, EOM Queue ID - i DATA, EOH, EOM Queue ID, also +Postfix queue file name j Always value of myhostname +j Always Value of myhostname _ Always The validated client name @@ -586,22 +587,22 @@ milter_macro_daemon_name - {mail_addr} Sender address + {mail_host} MAIL (Postfix ≥ 2.6) -Sender next-hop destination - {mail_host} MAIL (Postfix ≥ 2.6, only with +smtpd_milters) Sender next-hop destination + {mail_mailer} MAIL (Postfix ≥ 2.6) -Sender mail delivery transport {mail_mailer} MAIL (Postfix ≥ 2.6, only with +smtpd_milters) Sender mail delivery transport - {rcpt_addr} RCPT Recipient address
With rejected recipient: descriptive text+ {rcpt_host} RCPT (Postfix ≥ 2.6) -Recipient next-hop destination
With rejected recpient: enhanced -status code- {rcpt_host} RCPT (Postfix ≥ 2.6, only with +smtpd_milters) Recipient next-hop destination
With +rejected recipient: enhanced status code+ {rcpt_mailer} RCPT (Postfix ≥ 2.6) -Recipient mail delivery transport
With rejected recipient: -"error"{rcpt_mailer} RCPT (Postfix ≥ 2.6, only with +smtpd_milters) Recipient mail delivery transport
+With rejected recipient: "error"@@ -613,18 +614,23 @@ status code - {tls_version} HELO, MAIL, DATA, EOH, EOM TLS protocol version Postfix sends specific sets of macros at different SMTP protocol +
Postfix sends specific sets of macros at different Milter protocol stages. The sets are configured with the parameters as described in the table (EOH = end of headers; EOM = end of message). The protocol version is a number that Postfix sends at the beginning of the Milter protocol handshake.
+As of Sendmail 8.14.0, Milter applications can specify what +macros they want to receive at different Milter protocol stages. +An application-specified list takes precedence over a Postfix-specified +list.
+-
+ Parameter name Protocol version -Protocol stage Postfix parameter Milter protocol version +Milter protocol stage @@ -656,19 +662,26 @@ TO milter_connect_macros 2 or higher CONNECT Workarounds
-Content filters may break DKIM etc. signatures. If you -use an SMTP-based content filter, then you should add a line to -master.cf with "-o disable_mime_output_conversion=yes" (note: no -spaces around the "="), as described in the + +
-To avoid breaking DKIM etc. signatures with an SMTP-based +content filter, update the before-filter SMTP client in master.cf, +and add a line with "-o disable_mime_output_conversion=yes" (note: +no spaces around the "="). For details, see the advanced content filter example.
-Sendmail Milter applications were originally developed for the -Sendmail version 8 MTA, which has a different architecture than -Postfix. The result is that some Milter applications make assumptions -that aren't true in a Postfix environment.
- -+
+/etc/postfix/master.cf: + # ============================================================= + # service type private unpriv chroot wakeup maxproc command + # (yes) (yes) (yes) (never) (100) + # ============================================================= + scan unix - - n - 10 smtp + -o smtp_send_xforward_command=yes + -o disable_mime_output_conversion=yes + -o smtp_generic_maps= +Some Milter applications use the "{if_addr}" macro to recognize local mail; this macro does not exist in Postfix. @@ -691,62 +704,22 @@ X-SenderID: Sendmail Sender-ID Filter vx.y.z host.example.com <unknown-msgid& -
This happens because those Milter applications expect that the -queue ID is known before the MTA accepts the MAIL FROM -(sender) command. Postfix, on the other hand, does not choose a -queue file name until after it accepts the first valid RCPT -TO (recipient) command (Postfix queue file names must be unique -across multiple directories, so the name can't be chosen before the -file is created; if multiple messages were to use the same queue -ID simultaneously, mail would be lost).
- - +The problem is that Milter applications expect that the queue +ID is known before the MTA accepts the MAIL FROM (sender) +command. Postfix does not choose a queue ID, which is used as the +queue file name, until after it accepts the first valid RCPT +TO (recipient) command.
If you experience the ugly header problem, see if a recent version of the Milter application fixes it. For example, current versions of dkim-filter and dk-filter already have code that looks -up the Postfix queue ID at a later protocol stage.
- -To fix the ugly message header with sid-filter applications, -we change the source code, so that it does the queue ID lookup after -Postfix receives the end of the message.
- -- -
- -Edit the filter source file (named -sid-filter/sid-filter.c).
- -Look up the smfilter table and replace -mlfi_eoh by NULL. +up the Postfix queue ID at a later protocol stage, and sid-filter +version 1.0.0 no longer includes the queue ID in the message header.
-Look up the mlfi_eom() function and add code near -the top that calls mlfi_eoh() as shown by the bold -text below:
- --- -- assert(ctx != NULL); -#endif /* !DEBUG */ - - ret = mlfi_eoh(ctx); - if (ret != SMFIS_CONTINUE) - return ret; --NOTES:
- -- -
- -This was tested with sid-milter-0.2.10 and sid-milter-0.2.14.
- -To fix the ugly message header with other Milter applications, -you will need to do something like this:
+To fix the ugly message header, you will need to add code that +looks up the Postfix queue ID at some later point im time. The +example below adds the lookup after the end-of-message.
@@ -769,8 +742,6 @@ if (dfc->mctx_jobid == 0 || strcmp(dfc->mctx_jobid, JOBIDUNKNOWN) == 0) { if (jobid != 0) dfc->mctx_jobid = jobid; } - -/* get hostname; used in the X header and in new MIME boundaries */ @@ -779,11 +750,15 @@ if (dfc->mctx_jobid == 0 || strcmp(dfc->mctx_jobid, JOBIDUNKNOWN) == 0) {
Different mail filters use slightly different names for -variables. If the above code does not compile, look for the code -at the start of the mlfi_eoh() routine.
+variables. If the above code does not compile, look elsewhere in +the mail filter source file for code that looks up the "i" macro +value, and copy that code.This fixes only the ugly message header, but not the WARNING -message. Fortunately, many Milters log that message only once.
+This change fixes only the ugly message header, but not +the WARNING message. Fortunately, many Milters log that message +only once.
+ + @@ -797,28 +772,47 @@ a discussion.+
The Milter protocol has evolved over time. Therefore, +different Postfix versions implement different feature sets.
+ ++ +
++ + Postfix Supported Milter requests ++ + 2.6 All Milter requests of +Sendmail 8.14.0 (see notes below). + + 2.5 All Milter requests of +Sendmail 8.14.0, except:
SMFIP_RCPT_REJ (report rejected +recipients to the mail filter),
SMFIR_CHGFROM (replace sender, +with optional ESMTP parameters),
SMFIR_ADDRCPT_PAR (add +recipient, with optional ESMTP parameters).+ + 2.4 All Milter requests of +Sendmail 8.13.0. 2.3 All Milter requests of +Sendmail 8.13.0, except:
SMFIR_REPLBODY (replace message body). + +For Milter applications that are written in C, you need to use the Sendmail libmilter library.
-There are TWO sets of mail filters: filters that are used +
Postfix has TWO sets of mail filters: filters that are used for SMTP mail only (specified with the smtpd_milters parameter), and filters for non-SMTP mail (specified with the non_smtpd_milters parameter). The non-SMTP filters are primarily for local submissions.
-- -
-When mail is filtered by non-SMTP filters, the Postfix -cleanup(8) server has to simulate the SMTP client CONNECT and -DISCONNECT events, and the SMTP client EHLO, MAIL FROM, RCPT TO and -DATA commands. This works as expected, with only one exception: -non-SMTP filters must not REJECT or TEMPFAIL simulated RCPT TO -commands. When a non-SMTP filter REJECTs or TEMPFAILs a recipient, +
When mail is filtered by non_smtpd_milters, the Postfix cleanup(8) +server has to simulate SMTP client requests. This works as expected, +with only one exception: non_smtpd_milters must not REJECT or +TEMPFAIL simulated RCPT TO commands. When this rule is violated, Postfix will report a configuration error, and mail will stay in the queue.
-Postfix currently does not apply content filters to mail that is forwarded or aliased internally, or to mail that is generated internally such as bounces or Postmaster notifications. This may @@ -831,49 +825,26 @@ only to the SMTP command information; they have no access to the message header or body, and cannot make modifications to the message or to the envelope.
-Postfix version 2.6 implements all Sendmail 8.14 Milter -features, except it ignores the optional ESMTP command parameters -with requests to replace the sender (SMFIR_CHGFROM), or to append -a recipient (SMFIR_ADDRCPT_PAR). When a Milter application supplies -ESMTP command parameters, these are logged as follows:
+Postfix 2.6 ignores the optional ESMTP parameters in +requests to replace the sender (SMFIR_CHGFROM) or to append a +recipient (SMFIR_ADDRCPT_PAR). Postfix logs a warning message when +a Milter application supplies such ESMTP parameters:
-postfix/cleanup[40629]: warning: 100B22B3293: cleanup_chg_from: ignoring ESMTP arguments "whatever" +warning: queue-id: cleanup_chg_from: ignoring ESMTP arguments "whatever" +warning: queue-id: cleanup_add_rcpt: ignoring ESMTP arguments "whatever"-Specify "milter_protocol = 6" to enable all available Sendmail -8.14 and earlier Milter features.
+Postfix 2.3 does not implement requests to replace the +message body. Milter applications log a warning message when they +need this unsupported operation:
-Postfix version 2.5 implements all Sendmail 8.14 Milter -features except: SMFIP_RCPT_REJ (report rejected recipients to the -mail filter), SMFIR_CHGFROM (replace sender, with optional ESMTP -command parameters), and SMFIR_ADDRCPT_PAR (add recipient, with -optional ESMTP command parameters).
- -Specify "milter_protocol = 6" to enable all available Sendmail -8.14 and earlier Milter features.
- -Postfix 2.4 implements all Sendmail 8.13 Milter features. -
- -Specify "milter_protocol = 4" to enable all available Sendmail -8.13 and earlier Milter features.
- -Postfix 2.3 implements all Sendmail 8.13 Milter features -except requests to replace the message body. Milter applications -that request this unsupported operation will log a warning like - -
-application name: st_optionneg[134563840]: 0x3d does not fulfill action requirements 0x1e +st_optionneg[134563840]: 0x3d does not fulfill action requirements 0x1e-The solution is to use Postfix version 2.4 or later.
-Specify "milter_protocol = 4" to enable all available Sendmail -8.13 and earlier Milter features.
-Most Milter configuration options are global. Future Postfix versions may support per-Milter timeouts, per-Milter error handling, etc.
diff --git a/postfix/proto/SMTPD_POLICY_README.html b/postfix/proto/SMTPD_POLICY_README.html index 4ceb78cc3..e27d06541 100644 --- a/postfix/proto/SMTPD_POLICY_README.html +++ b/postfix/proto/SMTPD_POLICY_README.html @@ -271,11 +271,12 @@ daemon, you would use something like this:Lines 2, 11: the Postfix spawn(8) daemon by default kills its child process after 1000 seconds. This is too short for a -policy daemon that may run for as long as an SMTP client is connected -to an SMTP server process. The default time limit is overruled in +policy daemon that may need to run for as long as the SMTP server +process that talks to it. The default time limit is overruled in main.cf with an explicit "policy_time_limit" setting. The name of the parameter is the name of the master.cf entry ("policy") -concatenated with the "_time_limit" suffix.
+concatenated with the "_time_limit" suffix. See spawn(8) for +more information about the time limit parameter.Line 2: specify a "0" process limit instead of the default "-", to avoid "connection refused" and other problems when the smtpd diff --git a/postfix/proto/STRESS_README.html b/postfix/proto/STRESS_README.html index 31488359f..6d6acf52c 100644 --- a/postfix/proto/STRESS_README.html +++ b/postfix/proto/STRESS_README.html @@ -512,7 +512,7 @@ services that accept remote connections.
-Other measures to off-load zombies
+Other measures to off-load zombies
OpenBSD spamd implements a daemon that handles all connections from "new" clients. diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index b1d88550c..e1139ec33 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -4721,6 +4721,8 @@ smtpd_client_new_tls_session_rate_limit = 100
Optional SMTP server access restrictions in the context of a client SMTP connection request. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
@@ -5084,6 +5086,8 @@ for each excess recipient.
Optional SMTP server access restrictions in the context of a client ETRN request. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
@@ -5186,6 +5190,8 @@ smtpd_helo_required = yes
Optional restrictions that the Postfix SMTP server applies in the context of the SMTP HELO command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
@@ -5383,6 +5389,8 @@ accepts per message delivery request.
The access restrictions that the Postfix SMTP server applies in the context of the RCPT TO command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
@@ -5818,6 +5826,8 @@ or a list of SASL login names separated by comma and/or whitespace.
Optional restrictions that the Postfix SMTP server applies in the context of the MAIL FROM command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
@@ -7613,6 +7623,8 @@ cached session is still usable.
Optional access restrictions that the Postfix SMTP server applies in the context of the SMTP DATA command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time.
@@ -7653,7 +7665,10 @@ smtpd_data_restrictions = reject_multi_recipient_bounce %PARAM smtpd_end_of_data_restrictions
Optional access restrictions that the Postfix SMTP server -applies in the context of the SMTP END-OF-DATA command.
+applies in the context of the SMTP END-OF-DATA command. +See SMTPD_ACCESS_README, section "Delayed evaluation of SMTP access +restriction lists" for a discussion of evaluation context and time. +This feature is available in Postfix 2.2 and later.
diff --git a/postfix/src/cleanup/cleanup_addr.c b/postfix/src/cleanup/cleanup_addr.c index 49123a90f..99c7e1073 100644 --- a/postfix/src/cleanup/cleanup_addr.c +++ b/postfix/src/cleanup/cleanup_addr.c @@ -124,8 +124,9 @@ void cleanup_addr_sender(CLEANUP_STATE *state, const char *buf) cleanup_masquerade_internal(clean_addr, cleanup_masq_domains); } CLEANUP_OUT_BUF(state, REC_TYPE_FROM, clean_addr); - if (state->sender == 0) - state->sender = mystrdup(STR(clean_addr)); + if (state->sender) /* XXX Can't happen */ + myfree(state->sender); + state->sender = mystrdup(STR(clean_addr)); /* Used by Milter client */ if ((state->flags & CLEANUP_FLAG_BCC_OK) && *STR(clean_addr) && cleanup_send_bcc_maps @@ -166,8 +167,9 @@ void cleanup_addr_recipient(CLEANUP_STATE *state, const char *buf) } cleanup_out_recipient(state, state->dsn_orcpt, state->dsn_notify, state->orig_rcpt, STR(clean_addr)); - if (state->recip == 0) - state->recip = mystrdup(STR(clean_addr)); + if (state->recip) /* This can happen */ + myfree(state->recip); + state->recip = mystrdup(STR(clean_addr)); /* Used by Milter client */ if ((state->flags & CLEANUP_FLAG_BCC_OK) && *STR(clean_addr) && cleanup_rcpt_bcc_maps diff --git a/postfix/src/cleanup/cleanup_envelope.c b/postfix/src/cleanup/cleanup_envelope.c index a7a964692..9ba1830dd 100644 --- a/postfix/src/cleanup/cleanup_envelope.c +++ b/postfix/src/cleanup/cleanup_envelope.c @@ -267,7 +267,7 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type, if (cleanup_milters != 0 && state->milters == 0 && CLEANUP_MILTER_OK(state)) - cleanup_milter_emul_rcpt(state, cleanup_milters, buf); + cleanup_milter_emul_rcpt(state, cleanup_milters, state->recip); myfree(state->orig_rcpt); state->orig_rcpt = 0; if (state->dsn_orcpt != 0) { @@ -394,7 +394,7 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type, if (cleanup_milters != 0 && state->milters == 0 && CLEANUP_MILTER_OK(state)) - cleanup_milter_emul_mail(state, cleanup_milters, buf); + cleanup_milter_emul_mail(state, cleanup_milters, state->sender); return; } if (mapped_type == REC_TYPE_DSN_ENVID) { diff --git a/postfix/src/cleanup/cleanup_extracted.c b/postfix/src/cleanup/cleanup_extracted.c index d47c0fe6a..cf66c5dde 100644 --- a/postfix/src/cleanup/cleanup_extracted.c +++ b/postfix/src/cleanup/cleanup_extracted.c @@ -206,7 +206,7 @@ void cleanup_extracted_process(CLEANUP_STATE *state, int type, if (cleanup_milters != 0 && state->milters == 0 && CLEANUP_MILTER_OK(state)) - cleanup_milter_emul_rcpt(state, cleanup_milters, buf); + cleanup_milter_emul_rcpt(state, cleanup_milters, state->recip); myfree(state->orig_rcpt); state->orig_rcpt = 0; if (state->dsn_orcpt != 0) { diff --git a/postfix/src/global/dsn_buf.c b/postfix/src/global/dsn_buf.c index c3c3a7e30..cd842989d 100644 --- a/postfix/src/global/dsn_buf.c +++ b/postfix/src/global/dsn_buf.c @@ -206,7 +206,8 @@ void dsb_free(DSN_BUF *dsb) * * For safety we keep the test for null pointers in input. It's cheap. */ -#define DSB_TRUNCATE(s) (STR(s)[0] = 0) +#define DSB_TRUNCATE(s) \ + do { VSTRING_RESET(s); VSTRING_TERMINATE(s); } while (0) #define NULL_OR_EMPTY(s) ((s) == 0 || *(s) == 0) diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index e2498fef3..04c3f5747 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -620,8 +620,8 @@ extern int var_dup_filter_limit; extern char *var_tls_rand_exch_name; #define VAR_TLS_RAND_SOURCE "tls_random_source" -#ifdef HAS_DEV_URANDOM -#define DEF_TLS_RAND_SOURCE "dev:/dev/urandom" +#ifdef PREFERRED_RAND_SOURCE +#define DEF_TLS_RAND_SOURCE PREFERRED_RAND_SOURCE #else #define DEF_TLS_RAND_SOURCE "" #endif diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index dca6e868d..7c41198c1 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 "20090428" -#define MAIL_VERSION_NUMBER "2.6.0-RC3" +#define MAIL_RELEASE_DATE "20090511" +#define MAIL_VERSION_NUMBER "2.6.0" #ifdef SNAPSHOT # define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE diff --git a/postfix/src/master/multi_server.c b/postfix/src/master/multi_server.c index 8835ef2a7..2641dd325 100644 --- a/postfix/src/master/multi_server.c +++ b/postfix/src/master/multi_server.c @@ -511,6 +511,7 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...) int alone = 0; int zerolimit = 0; WATCHDOG *watchdog; + char *oname; char *oval; char *generation; int msg_vstream_needed = 0; @@ -591,10 +592,11 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...) break; case 'o': /* XXX Use split_nameval() */ - if ((oval = split_at(optarg, '=')) == 0) + oname = mystrdup(optarg); + if ((oval = split_at(oname, '=')) == 0) oval = ""; - mail_conf_update(optarg, oval); - if (strcmp(optarg, VAR_SYSLOG_NAME) == 0) + mail_conf_update(oname, oval); + if (strcmp(oname, VAR_SYSLOG_NAME) == 0) redo_syslog_init = 1; break; case 's': diff --git a/postfix/src/master/single_server.c b/postfix/src/master/single_server.c index 49ea1dc4d..99dfa218a 100644 --- a/postfix/src/master/single_server.c +++ b/postfix/src/master/single_server.c @@ -402,6 +402,7 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...) int alone = 0; int zerolimit = 0; WATCHDOG *watchdog; + char *oname; char *oval; char *generation; int msg_vstream_needed = 0; @@ -482,10 +483,11 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...) break; case 'o': /* XXX Use split_nameval() */ - if ((oval = split_at(optarg, '=')) == 0) + oname = mystrdup(optarg); + if ((oval = split_at(oname, '=')) == 0) oval = ""; - mail_conf_update(optarg, oval); - if (strcmp(optarg, VAR_SYSLOG_NAME) == 0) + mail_conf_update(oname, oval); + if (strcmp(oname, VAR_SYSLOG_NAME) == 0) redo_syslog_init = 1; break; case 's': diff --git a/postfix/src/master/trigger_server.c b/postfix/src/master/trigger_server.c index 7f054d068..279ce2ed9 100644 --- a/postfix/src/master/trigger_server.c +++ b/postfix/src/master/trigger_server.c @@ -413,6 +413,7 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,.. int alone = 0; int zerolimit = 0; WATCHDOG *watchdog; + char *oname; char *oval; char *generation; int msg_vstream_needed = 0; @@ -493,10 +494,11 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,.. break; case 'o': /* XXX Use split_nameval() */ - if ((oval = split_at(optarg, '=')) == 0) + oname = mystrdup(optarg); + if ((oval = split_at(oname, '=')) == 0) oval = ""; - mail_conf_update(optarg, oval); - if (strcmp(optarg, VAR_SYSLOG_NAME) == 0) + mail_conf_update(oname, oval); + if (strcmp(oname, VAR_SYSLOG_NAME) == 0) redo_syslog_init = 1; break; case 's': diff --git a/postfix/src/milter/milter8.c b/postfix/src/milter/milter8.c index 1c437e8c7..d49f656dd 100644 --- a/postfix/src/milter/milter8.c +++ b/postfix/src/milter/milter8.c @@ -1426,8 +1426,10 @@ static const char *milter8_event(MILTER8 *milter, int event, MILTER8_DATA_STRING, milter->body, MILTER8_DATA_END) != 0) MILTER8_EVENT_BREAK(milter->def_reply); - } else - STR(milter->body)[0] = 0; + } else { + VSTRING_RESET(milter->body); + VSTRING_TERMINATE(milter->body); + } /* Skip to the next request after previous edit error. */ if (edit_resp) continue; @@ -1465,8 +1467,10 @@ static const char *milter8_event(MILTER8 *milter, int event, MILTER8_DATA_STRING, milter->body, MILTER8_DATA_END) != 0) MILTER8_EVENT_BREAK(milter->def_reply); - } else - STR(milter->body)[0] = 0; + } else { + VSTRING_RESET(milter->body); + VSTRING_TERMINATE(milter->body); + } /* Skip to the next request after previous edit error. */ if (edit_resp) continue; diff --git a/postfix/src/util/sys_defs.h b/postfix/src/util/sys_defs.h index d51c9521d..0119d5274 100644 --- a/postfix/src/util/sys_defs.h +++ b/postfix/src/util/sys_defs.h @@ -93,7 +93,7 @@ /* __FreeBSD_version version is major+minor */ #if __FreeBSD_version >= 220000 -#define HAS_DEV_URANDOM /* introduced in 2.1.5 */ +#define PREFERRED_RAND_SOURCE "dev:/dev/urandom" /* introduced 2.1.5 */ #endif #if __FreeBSD_version >= 300000 @@ -116,9 +116,12 @@ #define HAS_FUTIMES /* XXX maybe earlier */ #endif +#if (defined(OpenBSD) && OpenBSD >= 199608) +#define PREFERRED_RAND_SOURCE "dev:/dev/arandom" /* XXX earlier */ +#endif + #if OpenBSD >= 200000 /* XXX */ #define HAS_ISSETUGID -#define HAS_DEV_URANDOM /* XXX probably earlier */ #endif #if OpenBSD >= 200200 /* XXX */ @@ -135,7 +138,7 @@ #if __NetBSD_Version__ >= 103000000 /* XXX maybe earlier */ #undef DEF_MAILBOX_LOCK #define DEF_MAILBOX_LOCK "flock, dotlock" -#define HAS_DEV_URANDOM /* XXX probably earlier */ +#define PREFERRED_RAND_SOURCE "dev:/dev/urandom" /* XXX maybe earlier */ #endif #if __NetBSD_Version__ >= 105000000 @@ -422,7 +425,7 @@ extern int opterr; # define HAS_CLOSEFROM #endif #ifndef NO_DEV_URANDOM -# define HAS_DEV_URANDOM +# define PREFERRED_RAND_SOURCE "dev:/dev/urandom" #endif #ifndef NO_FUTIMESAT # define HAS_FUTIMESAT @@ -754,7 +757,7 @@ extern int initgroups(const char *, int); #else # define CANT_WRITE_BEFORE_SENDING_FD #endif -#define HAS_DEV_URANDOM /* introduced in 1.1 */ +#define PREFERRED_RAND_SOURCE "dev:/dev/urandom" /* introduced in 1.1 */ #ifndef NO_EPOLL # define EVENTS_STYLE EVENTS_STYLE_EPOLL /* introduced in 2.5 */ #endif @@ -852,7 +855,7 @@ extern int initgroups(const char *, int); #endif #define CANT_USE_SEND_RECV_MSG #define DEF_SMTP_CACHE_DEMAND 0 -#define HAS_DEV_URANDOM +#define PREFERRED_RAND_SOURCE "dev:/dev/urandom" #endif /*