Feature: selective suppression of SMTP extensions (pipelining,
starttls, auth, etc.); this is useful to work around broken
clients or servers. Specify a list of EHLO keywords with
- the smtp(d)_disable_ehlo_keywords parameters, or specify
+ the smtp(d)_discard_ehlo_keywords parameters, or specify
one or more lookup tables, indexed by remote network address,
- with the smtp(d)_disable_ehlo_keyword_address_maps parameters.
+ with the smtp(d)_discard_ehlo_keyword_address_maps parameters.
EHLO keyword lists are case insensitive. Files:
util/name_mask.[hc], global/ehlo_mask.[hc], smtpd/smtpd.c,
smtp/smtp.c, smtp/smtp_proto.c.
commands like this, and when you never have to send mail to a user on such a
host.
-An alternative would be to remove the hostname with address masquerading, as
-described in the ADDRESS_REWRITING_README document.
+An alternative would be to remove the hostname from "hostname.porcupine.org"
+with address masquerading, as described in the ADDRESS_REWRITING_README
+document.
B\bBl\blo\boc\bck\bki\bin\bng\bg b\bba\bac\bck\bks\bsc\bca\bat\btt\bte\ber\br m\bma\bai\bil\bl w\bwi\bit\bth\bh f\bfo\bor\brg\bge\bed\bd s\bse\ben\bnd\bde\ber\br i\bin\bnf\bfo\bor\brm\bma\bat\bti\bio\bon\bn
A plea to virus or spam scanner operators: please do not make the problem worse
by sending return mail to forged sender addresses. You're only harassing
-innocent people.
+innocent people. If you must return mail to the purported sender, please return
+the full message headers, so that the sender can defend against forgeries.
Major changes with snapshot Postfix-2.2-20041218
================================================
-Fine control for SMTP inter-operability problems. You can now
-selectively turn off SMTP extensions (pipelining, starttls, auth,
-etc.), to work around specific broken clients or servers. Specify
-a list of EHLO keywords with the smtp(d)_disable_ehlo_keywords
-parameters, or specify one or more lookup tables, indexed by remote
-network address, with the smtp(d)_disable_ehlo_keyword_address_maps
-parameters. The EHLO keywords lists are case insensitive.
+Fine control for SMTP inter-operability problems, by discarding
+keywords sent or received with the EHLO handshake. Typically one
+would discard "pipelining", "starttls", or "auth". Specify a list
+of EHLO keywords with the smtp(d)_discard_ehlo_keywords parameters,
+or specify one or more lookup tables, indexed by remote network
+address, with the smtp(d)_discard_ehlo_keyword_address_maps
+parameters. Note: this only discards words from the EHLO conversation;
+it does not turn off the actual features in the SMTP server.
More client attributes for delivery to command with the local(8)
and pipe(8) delivery agents: client_hostname, client_address,
that send HELO commands like this, and when you never have to send
mail to a user on such a host. </p>
-<p> An alternative would be to remove the hostname with address
+<p> An alternative would be to remove the hostname from
+"hostname.porcupine.org" with address
masquerading, as described in the <a href="ADDRESS_REWRITING_README.html">ADDRESS_REWRITING_README</a> document.
</p>
<p> A plea to virus or spam scanner operators: please do not make
the problem worse by sending return mail to forged sender addresses.
-You're only harassing innocent people. </p>
+You're only harassing innocent people. If you must return mail to
+the purported sender, please return the full message headers, so
+that the sender can defend against forgeries. </p>
</body>
<b>SENDER</b> The entire sender address.
Additional remote client information is made available via
- the following pseudo variables:
+ the following environment variables:
<b>CLIENT_ADDRESS</b>
Remote client network address. Available as of
</DD>
-<DT><b><a name="smtp_disable_ehlo_keyword_address_maps">smtp_disable_ehlo_keyword_address_maps</a>
+<DT><b><a name="smtp_discard_ehlo_keyword_address_maps">smtp_discard_ehlo_keyword_address_maps</a>
(default: empty)</b></DT><DD>
<p> Lookup tables, indexed by the remote SMTP server address, with
</DD>
-<DT><b><a name="smtp_disable_ehlo_keywords">smtp_disable_ehlo_keywords</a>
+<DT><b><a name="smtp_discard_ehlo_keywords">smtp_discard_ehlo_keywords</a>
(default: empty)</b></DT><DD>
<p> A case insensitive list of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP client will ignore in the EHLO response
-from a remote SMTP server. Use the <a href="postconf.5.html#smtp_disable_ehlo_keyword_address_maps">smtp_disable_ehlo_keyword_address_maps</a>
-feature to disable EHLO keywords selectively. </p>
+from a remote SMTP server. Use the <a href="postconf.5.html#smtp_discard_ehlo_keyword_address_maps">smtp_discard_ehlo_keyword_address_maps</a>
+feature to discard EHLO keywords selectively. </p>
</DD>
<pre>
/etc/postfix/master.cf:
- mysmtp ... smtp -o <a href="postconf.5.html#<a href="postconf.5.html#smtp_helo_name">smtp_helo_name</a>"><a href="postconf.5.html#smtp_helo_name">smtp_helo_name</a></a>=foo.bar.com
+ mysmtp ... smtp -o <a href="postconf.5.html#smtp_helo_name">smtp_helo_name</a>=foo.bar.com
</pre>
<p>
</DD>
-<DT><b><a name="smtpd_disable_ehlo_keyword_address_maps">smtpd_disable_ehlo_keyword_address_maps</a>
+<DT><b><a name="smtpd_discard_ehlo_keyword_address_maps">smtpd_discard_ehlo_keyword_address_maps</a>
(default: empty)</b></DT><DD>
<p> Lookup tables, indexed by the remote SMTP client address, with
</DD>
-<DT><b><a name="smtpd_disable_ehlo_keywords">smtpd_disable_ehlo_keywords</a>
+<DT><b><a name="smtpd_discard_ehlo_keywords">smtpd_discard_ehlo_keywords</a>
(default: empty)</b></DT><DD>
<p> A case insensitive list of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP server will not send in the EHLO response
-to a remote SMTP client. Use the <a href="postconf.5.html#smtpd_disable_ehlo_keyword_address_maps">smtpd_disable_ehlo_keyword_address_maps</a>
-feature to disable EHLO keywords selectively. </p>
+to a remote SMTP client. Use the <a href="postconf.5.html#smtpd_discard_ehlo_keyword_address_maps">smtpd_discard_ehlo_keyword_address_maps</a>
+feature to discard EHLO keywords selectively. </p>
</DD>
Available in Postfix version 2.2 and later:
- <b><a href="postconf.5.html#smtp_disable_ehlo_keyword_address_maps">smtp_disable_ehlo_keyword_address_maps</a> (empty)</b>
+ <b><a href="postconf.5.html#smtp_discard_ehlo_keyword_address_maps">smtp_discard_ehlo_keyword_address_maps</a> (empty)</b>
Lookup tables, indexed by the remote SMTP server
address, with case insensitive lists of EHLO key-
words (pipelining, starttls, auth, etc.) that the
SMTP client will ignore in the EHLO response from a
remote SMTP server.
- <b><a href="postconf.5.html#smtp_disable_ehlo_keywords">smtp_disable_ehlo_keywords</a> (empty)</b>
+ <b><a href="postconf.5.html#smtp_discard_ehlo_keywords">smtp_discard_ehlo_keywords</a> (empty)</b>
A case insensitive list of EHLO keywords (pipelin-
ing, starttls, auth, etc.) that the SMTP client
will ignore in the EHLO response from a remote SMTP
Available in Postfix version 2.2 and later:
- <b><a href="postconf.5.html#smtpd_disable_ehlo_keyword_address_maps">smtpd_disable_ehlo_keyword_address_maps</a> (empty)</b>
+ <b><a href="postconf.5.html#smtpd_discard_ehlo_keyword_address_maps">smtpd_discard_ehlo_keyword_address_maps</a> (empty)</b>
Lookup tables, indexed by the remote SMTP client
address, with case insensitive lists of EHLO key-
words (pipelining, starttls, auth, etc.) that the
SMTP server will not send in the EHLO response to a
remote SMTP client.
- <b><a href="postconf.5.html#smtpd_disable_ehlo_keywords">smtpd_disable_ehlo_keywords</a> (empty)</b>
+ <b><a href="postconf.5.html#smtpd_discard_ehlo_keywords">smtpd_discard_ehlo_keywords</a> (empty)</b>
A case insensitive list of EHLO keywords (pipelin-
ing, starttls, auth, etc.) that the SMTP server
will not send in the EHLO response to a remote SMTP
Setting this parameter to a value of 1 changes the meaning of
smtp_destination_concurrency_limit from concurrency per domain
into concurrency per recipient.
-.SH smtp_disable_ehlo_keyword_address_maps (default: empty)
+.SH smtp_discard_ehlo_keyword_address_maps (default: empty)
Lookup tables, indexed by the remote SMTP server address, with
case insensitive lists of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP client will ignore in the EHLO response
from a remote SMTP server.
-.SH smtp_disable_ehlo_keywords (default: empty)
+.SH smtp_discard_ehlo_keywords (default: empty)
A case insensitive list of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP client will ignore in the EHLO response
-from a remote SMTP server. Use the smtp_disable_ehlo_keyword_address_maps
-feature to disable EHLO keywords selectively.
+from a remote SMTP server. Use the smtp_discard_ehlo_keyword_address_maps
+feature to discard EHLO keywords selectively.
.SH smtp_helo_name (default: $myhostname)
The hostname to send in the SMTP EHLO or HELO command.
.PP
recipient address information when rejecting a client name/address
or sender address, so that it is possible to find out whose mail
is being rejected.
-.SH smtpd_disable_ehlo_keyword_address_maps (default: empty)
+.SH smtpd_discard_ehlo_keyword_address_maps (default: empty)
Lookup tables, indexed by the remote SMTP client address, with
case insensitive lists of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP server will not send in the EHLO response
to a remote SMTP client.
-.SH smtpd_disable_ehlo_keywords (default: empty)
+.SH smtpd_discard_ehlo_keywords (default: empty)
A case insensitive list of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP server will not send in the EHLO response
-to a remote SMTP client. Use the smtpd_disable_ehlo_keyword_address_maps
-feature to disable EHLO keywords selectively.
+to a remote SMTP client. Use the smtpd_discard_ehlo_keyword_address_maps
+feature 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.
The entire sender address.
.PP
Additional remote client information is made available via
-the following pseudo variables:
+the following environment variables:
.IP \fBCLIENT_ADDRESS\fR
Remote client network address. Available as of Postfix 2.2.
.IP \fBCLIENT_HELO\fR
again later).
.PP
Available in Postfix version 2.2 and later:
-.IP "\fBsmtp_disable_ehlo_keyword_address_maps (empty)\fR"
+.IP "\fBsmtp_discard_ehlo_keyword_address_maps (empty)\fR"
Lookup tables, indexed by the remote SMTP server address, with
case insensitive lists of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP client will ignore in the EHLO response
from a remote SMTP server.
-.IP "\fBsmtp_disable_ehlo_keywords (empty)\fR"
+.IP "\fBsmtp_discard_ehlo_keywords (empty)\fR"
A case insensitive list of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP client will ignore in the EHLO response
from a remote SMTP server.
What SMTP clients Postfix will not offer AUTH support to.
.PP
Available in Postfix version 2.2 and later:
-.IP "\fBsmtpd_disable_ehlo_keyword_address_maps (empty)\fR"
+.IP "\fBsmtpd_discard_ehlo_keyword_address_maps (empty)\fR"
Lookup tables, indexed by the remote SMTP client address, with
case insensitive lists of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP server will not send in the EHLO response
to a remote SMTP client.
-.IP "\fBsmtpd_disable_ehlo_keywords (empty)\fR"
+.IP "\fBsmtpd_discard_ehlo_keywords (empty)\fR"
A case insensitive list of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP server will not send in the EHLO response
to a remote SMTP client.
s;\bsmtp_destination_recip[-</bB>]*\n* *[<bB>]*ient_limit\b;<a href="postconf.5.html#smtp_destination_recipient_limit">$&</a>;g;
s;\bvir[-</bB>]*\n*[ <bB>]*tual_destination_concurrency_limit\b;<a href="postconf.5.html#virtual_destination_concurrency_limit">$&</a>;g;
s;\bvir[-</bB>]*\n*[ <bB>]*tual_destination_recip[-</bB>]*\n* *[<bB>]*ient_limit\b;<a href="postconf.5.html#virtual_destination_recipient_limit">$&</a>;g;
- s;\bsmtp_disable_ehlo_keyword_address_maps\b;<a href="postconf.5.html#smtp_disable_ehlo_keyword_address_maps">$&</a>;g;
- s;\bsmtp_disable_ehlo_keywords\b;<a href="postconf.5.html#smtp_disable_ehlo_keywords">$&</a>;g;
- s;\bsmtp_helo_name\b;<a href="postconf.5.html#smtp_helo_name">$&</a>;g;
+ s;\bsmtp_discard_ehlo_keyword_address_maps\b;<a href="postconf.5.html#smtp_discard_ehlo_keyword_address_maps">$&</a>;g;
+ s;\bsmtp_discard_ehlo_keywords\b;<a href="postconf.5.html#smtp_discard_ehlo_keywords">$&</a>;g;
s;\bsmtp_helo_name\b;<a href="postconf.5.html#smtp_helo_name">$&</a>;g;
s;\bsmtp_helo_timeout\b;<a href="postconf.5.html#smtp_helo_timeout">$&</a>;g;
s;\bsmtp_host_lookup\b;<a href="postconf.5.html#smtp_host_lookup">$&</a>;g;
s;\bsmtpd_client_restrictions\b;<a href="postconf.5.html#smtpd_client_restrictions">$&</a>;g;
s;\bsmtpd_data_restrictions\b;<a href="postconf.5.html#smtpd_data_restrictions">$&</a>;g;
s;\bsmtpd_delay_reject\b;<a href="postconf.5.html#smtpd_delay_reject">$&</a>;g;
- s;\bsmtpd_disable_ehlo_keyword_address_maps\b;<a href="postconf.5.html#smtpd_disable_ehlo_keyword_address_maps">$&</a>;g;
- s;\bsmtpd_disable_ehlo_keywords\b;<a href="postconf.5.html#smtpd_disable_ehlo_keywords">$&</a>;g;
+ s;\bsmtpd_discard_ehlo_keyword_address_maps\b;<a href="postconf.5.html#smtpd_discard_ehlo_keyword_address_maps">$&</a>;g;
+ s;\bsmtpd_discard_ehlo_keywords\b;<a href="postconf.5.html#smtpd_discard_ehlo_keywords">$&</a>;g;
s;\bsmtpd_end_of_data_restrictions\b;<a href="postconf.5.html#smtpd_end_of_data_restrictions">$&</a>;g;
s;\bsmtpd_error_sleep_time\b;<a href="postconf.5.html#smtpd_error_sleep_time">$&</a>;g;
s;\bsmtpd_etrn_restrictions\b;<a href="postconf.5.html#smtpd_etrn_restrictions">$&</a>;g;
that send HELO commands like this, and when you never have to send
mail to a user on such a host. </p>
-<p> An alternative would be to remove the hostname with address
+<p> An alternative would be to remove the hostname from
+"hostname.porcupine.org" with address
masquerading, as described in the ADDRESS_REWRITING_README document.
</p>
<p> A plea to virus or spam scanner operators: please do not make
the problem worse by sending return mail to forged sender addresses.
-You're only harassing innocent people. </p>
+You're only harassing innocent people. If you must return mail to
+the purported sender, please return the full message headers, so
+that the sender can defend against forgeries. </p>
</body>
and later, this is replaced by separate controls: virtual_alias_domains
and virtual_alias_maps. </p>
-%PARAM smtp_disable_ehlo_keywords
+%PARAM smtp_discard_ehlo_keywords
<p> A case insensitive list of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP client will ignore in the EHLO response
-from a remote SMTP server. Use the smtp_disable_ehlo_keyword_address_maps
-feature to disable EHLO keywords selectively. </p>
+from a remote SMTP server. Use the smtp_discard_ehlo_keyword_address_maps
+feature to discard EHLO keywords selectively. </p>
-%PARAM smtpd_disable_ehlo_keywords
+%PARAM smtpd_discard_ehlo_keywords
<p> A case insensitive list of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP server will not send in the EHLO response
-to a remote SMTP client. Use the smtpd_disable_ehlo_keyword_address_maps
-feature to disable EHLO keywords selectively. </p>
+to a remote SMTP client. Use the smtpd_discard_ehlo_keyword_address_maps
+feature to discard EHLO keywords selectively. </p>
-%PARAM smtp_disable_ehlo_keyword_address_maps
+%PARAM smtp_discard_ehlo_keyword_address_maps
<p> Lookup tables, indexed by the remote SMTP server address, with
case insensitive lists of EHLO keywords (pipelining, starttls,
auth, etc.) that the SMTP client will ignore in the EHLO response
from a remote SMTP server. </p>
-%PARAM smtpd_disable_ehlo_keyword_address_maps
+%PARAM smtpd_discard_ehlo_keyword_address_maps
<p> Lookup tables, indexed by the remote SMTP client address, with
case insensitive lists of EHLO keywords (pipelining, starttls,
* We don't allow non-existent bits. Doing so makes no sense at this
* time.
*/
- return (str_name_mask_opt("ehlo bitmask", ehlo_mask_table,
- mask_bits, NAME_MASK_NONE));
+ return (str_name_mask("ehlo bitmask", ehlo_mask_table, mask_bits));
}
#ifdef TEST
/*
* EHLO keyword filter.
*/
-#define VAR_SMTPD_EHLO_DIS_WORDS "smtpd_disable_ehlo_keywords"
+#define VAR_SMTPD_EHLO_DIS_WORDS "smtpd_discard_ehlo_keywords"
#define DEF_SMTPD_EHLO_DIS_WORDS ""
extern char *var_smtpd_ehlo_dis_words;
-#define VAR_SMTPD_EHLO_DIS_MAPS "smtpd_disable_ehlo_keyword_address_maps"
+#define VAR_SMTPD_EHLO_DIS_MAPS "smtpd_discard_ehlo_keyword_address_maps"
#define DEF_SMTPD_EHLO_DIS_MAPS ""
extern char *var_smtpd_ehlo_dis_maps;
-#define VAR_SMTP_EHLO_DIS_WORDS "smtp_disable_ehlo_keywords"
+#define VAR_SMTP_EHLO_DIS_WORDS "smtp_discard_ehlo_keywords"
#define DEF_SMTP_EHLO_DIS_WORDS ""
extern char *var_smtp_ehlo_dis_words;
-#define VAR_SMTP_EHLO_DIS_MAPS "smtp_disable_ehlo_keyword_address_maps"
+#define VAR_SMTP_EHLO_DIS_MAPS "smtp_discard_ehlo_keyword_address_maps"
#define DEF_SMTP_EHLO_DIS_MAPS ""
extern char *var_smtp_ehlo_dis_maps;
* Patches change the patchlevel and the release date. Snapshots change the
* release date only.
*/
-#define MAIL_RELEASE_DATE "20041218"
+#define MAIL_RELEASE_DATE "20041219"
#define MAIL_VERSION_NUMBER "2.2"
#define VAR_MAIL_VERSION "mail_version"
/* The entire sender address.
/* .PP
/* Additional remote client information is made available via
-/* the following pseudo variables:
+/* the following environment variables:
/* .IP \fBCLIENT_ADDRESS\fR
/* Remote client network address. Available as of Postfix 2.2.
/* .IP \fBCLIENT_HELO\fR
master_config();
master_sigsetup();
master_flow_init();
- msg_info("daemon started -- version %s", var_mail_version);
+ msg_info("daemon started -- version %s, configuration %s",
+ var_mail_version, var_config_dir);
/*
* Process events. The event handler will execute the read/write/timer
/* again later).
/* .PP
/* Available in Postfix version 2.2 and later:
-/* .IP "\fBsmtp_disable_ehlo_keyword_address_maps (empty)\fR"
+/* .IP "\fBsmtp_discard_ehlo_keyword_address_maps (empty)\fR"
/* Lookup tables, indexed by the remote SMTP server address, with
/* case insensitive lists of EHLO keywords (pipelining, starttls,
/* auth, etc.) that the SMTP client will ignore in the EHLO response
/* from a remote SMTP server.
-/* .IP "\fBsmtp_disable_ehlo_keywords (empty)\fR"
+/* .IP "\fBsmtp_discard_ehlo_keywords (empty)\fR"
/* A case insensitive list of EHLO keywords (pipelining, starttls,
/* auth, etc.) that the SMTP client will ignore in the EHLO response
/* from a remote SMTP server.
int smtp_host_lookup_mask;
STRING_LIST *smtp_cache_dest;
SCACHE *smtp_scache;
-MAPS *smtp_ehlo_disable_maps;
+MAPS *smtp_ehlo_dis_maps;
/* deliver_message - deliver message with extreme prejudice */
* EHLO keyword filter.
*/
if (*var_smtp_ehlo_dis_maps)
- smtp_ehlo_disable_maps = maps_create(VAR_SMTPD_EHLO_DIS_MAPS,
- var_smtp_ehlo_dis_maps,
- DICT_FLAG_LOCK);
+ smtp_ehlo_dis_maps = maps_create(VAR_SMTPD_EHLO_DIS_MAPS,
+ var_smtp_ehlo_dis_maps,
+ DICT_FLAG_LOCK);
}
/* pre_accept - see if tables have changed */
extern SCACHE *smtp_scache; /* connection cache instance */
extern STRING_LIST *smtp_cache_dest; /* cached destinations */
-extern MAPS *smtp_ehlo_disable_maps; /* ehlo keyword filter */
+extern MAPS *smtp_ehlo_dis_maps; /* ehlo keyword filter */
/*
* smtp_session.c
};
SOCKOPT_SIZE optlen;
const char *ehlo_words;
- int disable_mask;
+ int discard_mask;
/*
* Prepare for disaster.
* Determine what server EHLO keywords to ignore, typically to avoid
* inter-operability problems.
*/
- if (smtp_ehlo_disable_maps == 0
- || (ehlo_words = maps_find(smtp_ehlo_disable_maps, state->session->addr, 0)) == 0)
+ if (smtp_ehlo_dis_maps == 0
+ || (ehlo_words = maps_find(smtp_ehlo_dis_maps, state->session->addr, 0)) == 0)
ehlo_words = var_smtp_ehlo_dis_words;
- disable_mask = ehlo_mask(ehlo_words);
- if (disable_mask)
- msg_info("disabled EHLO keywords: %s", str_ehlo_mask(disable_mask));
+ discard_mask = ehlo_mask(ehlo_words);
+ if (discard_mask)
+ msg_info("discarding EHLO keywords: %s", str_ehlo_mask(discard_mask));
/*
* Pick up some useful features offered by the SMTP server. XXX Until we
while ((words = mystrtok(&lines, "\n")) != 0) {
if (mystrtok(&words, "- ") && (word = mystrtok(&words, " \t=")) != 0) {
if (strcasecmp(word, "8BITMIME") == 0) {
- if ((disable_mask & EHLO_MASK_8BITMIME) == 0)
+ if ((discard_mask & EHLO_MASK_8BITMIME) == 0)
session->features |= SMTP_FEATURE_8BITMIME;
} else if (strcasecmp(word, "PIPELINING") == 0) {
- if ((disable_mask & EHLO_MASK_PIPELINING) == 0)
+ if ((discard_mask & EHLO_MASK_PIPELINING) == 0)
session->features |= SMTP_FEATURE_PIPELINING;
} else if (strcasecmp(word, "XFORWARD") == 0) {
- if ((disable_mask & EHLO_MASK_XFORWARD) == 0)
+ if ((discard_mask & EHLO_MASK_XFORWARD) == 0)
while ((word = mystrtok(&words, " \t")) != 0)
session->features |= name_code(xforward_features,
NAME_CODE_FLAG_NONE, word);
} else if (strcasecmp(word, "SIZE") == 0) {
- if ((disable_mask & EHLO_MASK_SIZE) == 0) {
+ if ((discard_mask & EHLO_MASK_SIZE) == 0) {
session->features |= SMTP_FEATURE_SIZE;
if ((word = mystrtok(&words, " \t")) != 0) {
if (!alldig(word))
}
#ifdef USE_SASL_AUTH
} else if (var_smtp_sasl_enable && strcasecmp(word, "AUTH") == 0) {
- if ((disable_mask & EHLO_MASK_AUTH) == 0)
+ if ((discard_mask & EHLO_MASK_AUTH) == 0)
smtp_sasl_helo_auth(session, words);
#endif
} else if (strcasecmp(word, var_myhostname) == 0) {
/* What SMTP clients Postfix will not offer AUTH support to.
/* .PP
/* Available in Postfix version 2.2 and later:
-/* .IP "\fBsmtpd_disable_ehlo_keyword_address_maps (empty)\fR"
+/* .IP "\fBsmtpd_discard_ehlo_keyword_address_maps (empty)\fR"
/* Lookup tables, indexed by the remote SMTP client address, with
/* case insensitive lists of EHLO keywords (pipelining, starttls,
/* auth, etc.) that the SMTP server will not send in the EHLO response
/* to a remote SMTP client.
-/* .IP "\fBsmtpd_disable_ehlo_keywords (empty)\fR"
+/* .IP "\fBsmtpd_discard_ehlo_keywords (empty)\fR"
/* A case insensitive list of EHLO keywords (pipelining, starttls,
/* auth, etc.) that the SMTP server will not send in the EHLO response
/* to a remote SMTP client.
/*
* EHLO keyword filter
*/
-static MAPS *ehlo_disable_maps;
+static MAPS *ehlo_discard_maps;
/*
* VERP command name.
static int ehlo_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
{
char *err;
- int todo_mask;
+ int discard_mask;
const char *ehlo_words;
- VSTRING *ehlo_buf;
+ VSTRING *reply_buf;
/*
* XXX 2821 new feature: Section 4.1.4 specifies that a server must clear
* Determine what server EHLO keywords to suppress, typically to avoid
* inter-operability problems.
*/
- if (ehlo_disable_maps == 0
- || (ehlo_words = maps_find(ehlo_disable_maps, state->addr, 0)) == 0)
+ if (ehlo_discard_maps == 0
+ || (ehlo_words = maps_find(ehlo_discard_maps, state->addr, 0)) == 0)
ehlo_words = var_smtpd_ehlo_dis_words;
- todo_mask = ~ehlo_mask(ehlo_words);
- if (~todo_mask)
- msg_info("disabled EHLO keywords: %s", str_ehlo_mask(~todo_mask));
+ discard_mask = ehlo_mask(ehlo_words);
+ if (discard_mask)
+ msg_info("discarding EHLO keywords: %s", str_ehlo_mask(discard_mask));
/*
* Build the EHLO response, suppressing features as requested. We store
- * each output line in one-element output queue, where it sits until we
+ * each output line in a one-element output queue, where it sits until we
* know if we need to prepend "250-" or "250 " to it. Each time we
* enqueue a reply line we flush the one that sits in the queue. We use a
* couple ugly macros to avoid making mistakes in code that repeats a
* lot.
*/
-#define ENQUEUE_FIX_REPLY(state, ehlo_buf, cmd) \
+#define ENQUEUE_FIX_REPLY(state, reply_buf, cmd) \
do { \
- smtpd_chat_reply((state), "250-%s", STR(ehlo_buf)); \
- vstring_strcpy((ehlo_buf), (cmd)); \
+ smtpd_chat_reply((state), "250-%s", STR(reply_buf)); \
+ vstring_strcpy((reply_buf), (cmd)); \
} while (0)
-#define ENQUEUE_FMT_REPLY(state, ehlo_buf, fmt, arg) \
+#define ENQUEUE_FMT_REPLY(state, reply_buf, fmt, arg) \
do { \
- smtpd_chat_reply((state), "250-%s", STR(ehlo_buf)); \
- vstring_sprintf((ehlo_buf), (fmt), (arg)); \
+ smtpd_chat_reply((state), "250-%s", STR(reply_buf)); \
+ vstring_sprintf((reply_buf), (fmt), (arg)); \
} while (0)
- ehlo_buf = vstring_alloc(10);
- vstring_strcpy(ehlo_buf, var_myhostname);
- if (todo_mask & EHLO_MASK_PIPELINING)
- ENQUEUE_FIX_REPLY(state, ehlo_buf, "PIPELINING");
- if (todo_mask & EHLO_MASK_SIZE) {
+ reply_buf = vstring_alloc(10);
+ vstring_strcpy(reply_buf, var_myhostname);
+ if ((discard_mask & EHLO_MASK_PIPELINING) == 0)
+ ENQUEUE_FIX_REPLY(state, reply_buf, "PIPELINING");
+ if ((discard_mask & EHLO_MASK_SIZE) == 0) {
if (var_message_limit)
- ENQUEUE_FMT_REPLY(state, ehlo_buf, "SIZE %lu",
+ ENQUEUE_FMT_REPLY(state, reply_buf, "SIZE %lu",
(unsigned long) var_message_limit); /* XXX */
else
- ENQUEUE_FIX_REPLY(state, ehlo_buf, "SIZE");
+ ENQUEUE_FIX_REPLY(state, reply_buf, "SIZE");
}
- if (todo_mask & EHLO_MASK_VRFY)
+ if ((discard_mask & EHLO_MASK_VRFY) == 0)
if (var_disable_vrfy_cmd == 0)
- ENQUEUE_FIX_REPLY(state, ehlo_buf, "VRFY");
- if (todo_mask & EHLO_MASK_ETRN)
- ENQUEUE_FIX_REPLY(state, ehlo_buf, "ETRN");
+ ENQUEUE_FIX_REPLY(state, reply_buf, "VRFY");
+ if ((discard_mask & EHLO_MASK_ETRN) == 0)
+ ENQUEUE_FIX_REPLY(state, reply_buf, "ETRN");
#ifdef USE_SASL_AUTH
- if (todo_mask & EHLO_MASK_AUTH) {
+ if ((discard_mask & EHLO_MASK_AUTH) == 0) {
if (var_smtpd_sasl_enable && !sasl_client_exception(state)) {
- ENQUEUE_FMT_REPLY(state, ehlo_buf, "AUTH %s",
+ ENQUEUE_FMT_REPLY(state, reply_buf, "AUTH %s",
state->sasl_mechanism_list);
if (var_broken_auth_clients)
- ENQUEUE_FMT_REPLY(state, ehlo_buf, "AUTH=%s",
+ ENQUEUE_FMT_REPLY(state, reply_buf, "AUTH=%s",
state->sasl_mechanism_list);
}
}
#endif
- if (todo_mask & EHLO_MASK_VERP)
+ if ((discard_mask & EHLO_MASK_VERP) == 0)
if (namadr_list_match(verp_clients, state->name, state->addr))
- ENQUEUE_FIX_REPLY(state, ehlo_buf, VERP_CMD);
+ ENQUEUE_FIX_REPLY(state, reply_buf, VERP_CMD);
/* XCLIENT must not override its own access control. */
- if (todo_mask & EHLO_MASK_XCLIENT)
+ if ((discard_mask & EHLO_MASK_XCLIENT) == 0)
if (xclient_allowed)
- ENQUEUE_FIX_REPLY(state, ehlo_buf, XCLIENT_CMD
+ ENQUEUE_FIX_REPLY(state, reply_buf, XCLIENT_CMD
" " XCLIENT_NAME " " XCLIENT_ADDR
" " XCLIENT_PROTO " " XCLIENT_HELO);
- if (todo_mask & EHLO_MASK_XFORWARD)
+ if ((discard_mask & EHLO_MASK_XFORWARD) == 0)
if (xforward_allowed)
- ENQUEUE_FIX_REPLY(state, ehlo_buf, XFORWARD_CMD
+ ENQUEUE_FIX_REPLY(state, reply_buf, XFORWARD_CMD
" " XFORWARD_NAME " " XFORWARD_ADDR
" " XFORWARD_PROTO " " XFORWARD_HELO
" " XFORWARD_DOMAIN);
- if (todo_mask & EHLO_MASK_8BITMIME)
- ENQUEUE_FIX_REPLY(state, ehlo_buf, "8BITMIME");
- smtpd_chat_reply(state, "250 %s", STR(ehlo_buf));
+ if ((discard_mask & EHLO_MASK_8BITMIME) == 0)
+ ENQUEUE_FIX_REPLY(state, reply_buf, "8BITMIME");
+ smtpd_chat_reply(state, "250 %s", STR(reply_buf));
/*
* Clean up.
*/
- vstring_free(ehlo_buf);
+ vstring_free(reply_buf);
return (0);
}
* EHLO keyword filter.
*/
if (*var_smtpd_ehlo_dis_maps)
- ehlo_disable_maps = maps_create(VAR_SMTPD_EHLO_DIS_MAPS,
+ ehlo_discard_maps = maps_create(VAR_SMTPD_EHLO_DIS_MAPS,
var_smtpd_ehlo_dis_maps,
DICT_FLAG_LOCK);
}