209
209
#define SMFIP_NOUNKNOWN (1L<<8) /* filter does not want unknown cmd */
210
210
#define SMFIP_NODATA (1L<<9) /* filter does not want DATA */
211
211
/* Introduced with Sendmail 8.14. */
212
#define SMFIP_SKIP (1L<<10)/* MTA supports SMFIS_SKIP */
212
#define SMFIP_SKIP (1L<<10)/* MTA supports SMFIR_SKIP */
213
213
#define SMFIP_RCPT_REJ (1L<<11)/* filter wants rejected RCPTs */
214
214
#define SMFIP_NR_CONN (1L<<12)/* filter won't reply for connect */
215
215
#define SMFIP_NR_HELO (1L<<13)/* filter won't reply for HELO */
445
445
* XXX Is this still needed? Sendmail 8.14 provides a proper way to negotiate
446
446
* what replies the mail filter will send.
448
* XXX Keep this table in reverse numerical order. This is needed by the code
449
* that implements compatibility with older Milter protocol versions.
448
451
static const NAME_CODE milter8_event_masks[] = {
452
"6", MILTER8_V6_PROTO_MASK,
453
"4", MILTER8_V4_PROTO_MASK,
454
"3", MILTER8_V3_PROTO_MASK,
449
455
"2", MILTER8_V2_PROTO_MASK,
450
"3", MILTER8_V3_PROTO_MASK,
451
"4", MILTER8_V4_PROTO_MASK,
452
"6", MILTER8_V6_PROTO_MASK,
453
456
"no_header_reply", SMFIP_NOHREPL,
1776
1779
milter->m.flags |= MILTER_FLAG_WANT_RCPT_REJ;
1782
* Allow the remote application to run an older protocol version, but
1783
* don't them send events that their protocol version doesn't support.
1784
* Based on a suggestion by Kouhei Sutou.
1786
* XXX When the Milter sends a protocol version that we don't have
1787
* information for, use the information for the next-lower protocol
1788
* version instead. This code assumes that the milter8_event_masks table
1789
* is organized in reverse numerical order.
1791
if (milter->version < my_version) {
1792
const NAME_CODE *np;
1795
for (np = milter8_event_masks; /* see below */ ; np++) {
1796
if (np->name == 0) {
1797
msg_warn("milter %s: unexpected protocol version %d",
1798
milter->m.name, milter->version);
1801
if ((version = atoi(np->name)) > 0 && version <= milter->version) {
1802
milter->np_mask |= (SMFIP_NOSEND_MASK & ~np->code);
1804
msg_info("%s: non-protocol events for milter %s"
1805
" protocol version %d: %s",
1806
myname, milter->m.name, milter->version,
1807
str_name_mask_opt(milter->buf,
1808
"non-protocol event mask",
1809
smfip_table, milter->np_mask,
1779
1817
* Initial negotiations completed.
1781
1819
if (msg_verbose) {