diff --git a/postfix/HISTORY b/postfix/HISTORY index ff08a78fb..f70477f9f 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -7083,6 +7083,20 @@ Apologies for any names omitted. Feature: X-Original-To: message headers with the raw original envelope recipient. + Logging: status=sent/deferred/bounced/ logging now includes + the original recipient address if it differs from the final + address. + +20020126 + + Logging: SMTP UCE reject/warn/hold/discard logging now + includes the protocol name and, if available, the hostname + given in the SMTP HELO or EHLO command. + + Logging: header/body_checks reject/warn/hold/discard logging + now includes the protocol name and, if available, the + hostname given in the SMTP HELO or EHLO command. + Open problems: Low: smtpd should log queue ID with reject/warn/hold/discard diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 5899fdc9c..1972e4cdc 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -12,6 +12,33 @@ snapshot release). Patches change the patchlevel and the release date. Snapshots change only the release date, unless they include the same bugfixes as a patch release. +Incompatible changes with Postfix snapshot 1.1.11-20021026 +========================================================== + +Logging formats have changed. This may affect logfile processing +software. + +- The Postfix SMTP UCE reject etc. logging now includes the queue +ID, the mail protocol (SMTP or ESMTP), and the hostname that was +received with the HELO or EHLO command, if available. + +- The Postfix header/body_checks logging now includes the the mail +protocol (SMTP, ESMTP, QMQP) and the hostname that was received +with the SMTP HELO or EHLO command, if available. + +The Postfix status=sent/bounced/deferred logging now shows the +original recipient address (as received before any address rewriting +or aliasing). The original recipient address is logged only when +it differs from the final recipient address. + +Major changes with Postfix snapshot 1.1.11-20021026 +=================================================== + +The Postfix status=sent/bounced/deferred logging now shows the +original recipient address (as received before any address rewriting +or aliasing). The original recipient address is logged only when +it differs from the final recipient address. + Major changes with Postfix snapshot 1.1.11-20021024 =================================================== diff --git a/postfix/src/cleanup/cleanup_envelope.c b/postfix/src/cleanup/cleanup_envelope.c index 64b56e6ff..932aacb8e 100644 --- a/postfix/src/cleanup/cleanup_envelope.c +++ b/postfix/src/cleanup/cleanup_envelope.c @@ -143,6 +143,14 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type, char *buf, if (msg_verbose) msg_info("envelope %c %.*s", type, len, buf); + if (type != REC_TYPE_RCPT) { + if (state->orig_rcpt != 0) { + msg_warn("%s: out-of-order original recipient record <%.200s>", + state->queue_id, state->orig_rcpt); + myfree(state->orig_rcpt); + state->orig_rcpt = 0; + } + } if (type == REC_TYPE_TIME) { state->time = atol(buf); cleanup_out(state, type, buf, len); @@ -230,15 +238,9 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type, char *buf, return; } nvtable_update(state->attr, attr_name, attr_value); + } else if (type == REC_TYPE_ORCP) { + state->orig_rcpt = mystrdup(buf); } else { - if (state->orig_rcpt != 0) { - msg_warn("%s: out-of-order original recipient <%.200s>", - state->queue_id, buf); - myfree(state->orig_rcpt); - state->orig_rcpt = 0; - } - if (type == REC_TYPE_ORCP) - state->orig_rcpt = mystrdup(buf); cleanup_out(state, type, buf, len); } } diff --git a/postfix/src/cleanup/cleanup_extracted.c b/postfix/src/cleanup/cleanup_extracted.c index f964380f7..df19c49c1 100644 --- a/postfix/src/cleanup/cleanup_extracted.c +++ b/postfix/src/cleanup/cleanup_extracted.c @@ -127,6 +127,17 @@ static void cleanup_extracted_process(CLEANUP_STATE *state, int type, char *buf, ARGV *rcpt; char **cpp; + /* + * Weird condition for consistency with cleanup_envelope.c + */ + if (type != REC_TYPE_RCPT) { + if (state->orig_rcpt != 0) { + msg_warn("%s: out-of-order original recipient record <%.200s>", + state->queue_id, buf); + myfree(state->orig_rcpt); + state->orig_rcpt = 0; + } + } if (type == REC_TYPE_RCPT) { clean_addr = vstring_alloc(100); if (state->orig_rcpt == 0) @@ -148,15 +159,8 @@ static void cleanup_extracted_process(CLEANUP_STATE *state, int type, char *buf, myfree(state->orig_rcpt); state->orig_rcpt = 0; return; - } else { - if (state->orig_rcpt != 0) { - msg_warn("%s: out-of-order original recipient <%.200s>", - state->queue_id, buf); - myfree(state->orig_rcpt); - state->orig_rcpt = 0; - } - if (type == REC_TYPE_ORCP) - state->orig_rcpt = mystrdup(buf); + } else if (type == REC_TYPE_ORCP) { + state->orig_rcpt = mystrdup(buf); } if (type != REC_TYPE_END) { cleanup_out(state, type, buf, len); diff --git a/postfix/src/cleanup/cleanup_message.c b/postfix/src/cleanup/cleanup_message.c index a683b5e57..34ceea2c3 100644 --- a/postfix/src/cleanup/cleanup_message.c +++ b/postfix/src/cleanup/cleanup_message.c @@ -260,6 +260,31 @@ static void cleanup_rewrite_recip(CLEANUP_STATE *state, HEADER_OPTS *hdr_opts, cleanup_fold_header(state, header_buf); } +/* cleanup_act_log - log action with context */ + +static void cleanup_act_log(CLEANUP_STATE *state, + const char *action, const char *class, + const char *content, const char *text) +{ + const char *attr; + + if ((attr = nvtable_find(state->attr, MAIL_ATTR_ORIGIN)) == 0) + attr="unknown"; + vstring_sprintf(state->temp1, "%s: %s: %s %.200s from %s;", + state->queue_id, action, class, content, attr); + if (state->sender) + vstring_sprintf_append(state->temp1, " from=<%s>", state->sender); + if (state->recip) + vstring_sprintf_append(state->temp1, " to=<%s>", state->recip); + if ((attr = nvtable_find(state->attr, MAIL_ATTR_PROTO_NAME)) != 0) + vstring_sprintf_append(state->temp1, " proto=%s", attr); + if ((attr = nvtable_find(state->attr, MAIL_ATTR_HELO_NAME)) != 0) + vstring_sprintf_append(state->temp1, " helo=<%s>", attr); + if (text && *text) + vstring_sprintf_append(state->temp1, ": %s", text); + msg_info("%s", vstring_str(state->temp1)); +} + /* cleanup_act - act upon a header/body match */ static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf, @@ -267,7 +292,6 @@ static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf, { const char *optional_text = value + strcspn(value, " \t"); int command_len = optional_text - value; - const char *origin; while (*optional_text && ISSPACE(*optional_text)) optional_text++; @@ -275,6 +299,7 @@ static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf, #define STREQUAL(x,y,l) (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0) #define CLEANUP_ACT_KEEP 1 #define CLEANUP_ACT_DROP 0 +#define STR(x) vstring_str(x) if (STREQUAL(value, "REJECT", command_len)) { if (state->reason == 0) @@ -282,20 +307,11 @@ static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf, cleanup_strerror(CLEANUP_STAT_CONT)); state->errs |= CLEANUP_STAT_CONT; state->flags &= ~CLEANUP_FLAG_FILTER; - if ((origin = nvtable_find(state->attr, MAIL_ATTR_ORIGIN)) == 0) - origin = MAIL_ATTR_ORG_NONE; - msg_info("%s: reject: %s %.200s from %s; from=<%s> to=<%s>: %s", - state->queue_id, context, buf, origin, state->sender, - state->recip ? state->recip : "unknown", - state->reason); + cleanup_act_log(state, "reject", context, buf, state->reason); return (CLEANUP_ACT_KEEP); } if (STREQUAL(value, "WARN", command_len)) { - msg_info("%s: warning: %s %.200s; from=<%s> to=<%s>%s%s", - state->queue_id, context, buf, state->sender, - state->recip ? state->recip : "unknown", - *optional_text ? ": " : "", - *optional_text ? optional_text : ""); + cleanup_act_log(state, "warning", context, buf, optional_text); return (CLEANUP_ACT_KEEP); } if (STREQUAL(value, "FILTER", command_len)) { @@ -304,26 +320,19 @@ static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf, } else { if (state->filter) myfree(state->filter); + /* XXX should log something? */ state->filter = mystrdup(optional_text); } return (CLEANUP_ACT_KEEP); } if (STREQUAL(value, "DISCARD", command_len)) { - msg_info("%s: discard: %s %.200s; from=<%s> to=<%s>%s%s", - state->queue_id, context, buf, state->sender, - state->recip ? state->recip : "unknown", - *optional_text ? ": " : "", - *optional_text ? optional_text : ""); + cleanup_act_log(state, "discard", context, buf, optional_text); state->flags |= CLEANUP_FLAG_DISCARD; state->flags &= ~CLEANUP_FLAG_FILTER; return (CLEANUP_ACT_KEEP); } if (STREQUAL(value, "HOLD", command_len)) { - msg_info("%s: hold: %s %.200s; from=<%s> to=<%s>%s%s", - state->queue_id, context, buf, state->sender, - state->recip ? state->recip : "unknown", - *optional_text ? ": " : "", - *optional_text ? optional_text : ""); + cleanup_act_log(state, "hold", context, buf, optional_text); state->flags |= CLEANUP_FLAG_HOLD; return (CLEANUP_ACT_KEEP); } diff --git a/postfix/src/cleanup/cleanup_out_recipient.c b/postfix/src/cleanup/cleanup_out_recipient.c index a45bba88b..4491532df 100644 --- a/postfix/src/cleanup/cleanup_out_recipient.c +++ b/postfix/src/cleanup/cleanup_out_recipient.c @@ -68,22 +68,27 @@ void cleanup_out_recipient(CLEANUP_STATE *state, const char *orcpt, ARGV *argv; char **cpp; + /* + * Apply the duplicate recipient filter before virtual expansion, so that + * we can distinguish between different addresses that map onto the same + * mailbox. The recipient will use our original recipient message header + * to figure things out. + */ + if (been_here_fixed(state->dups, recip) != 0) + return; + if (cleanup_virtual_maps == 0) { - if (been_here_fixed(state->dups, orcpt) == 0) { - if (strcasecmp(orcpt, recip) != 0) - cleanup_out_string(state, REC_TYPE_ORCP, orcpt); - cleanup_out_string(state, REC_TYPE_RCPT, recip); - state->rcpt_count++; - } + if (strcasecmp(orcpt, recip) != 0) + cleanup_out_string(state, REC_TYPE_ORCP, orcpt); + cleanup_out_string(state, REC_TYPE_RCPT, recip); + state->rcpt_count++; } else { argv = cleanup_map1n_internal(state, recip, cleanup_virtual_maps, cleanup_ext_prop_mask & EXT_PROP_VIRTUAL); - if (been_here_fixed(state->dups, orcpt) == 0) { - for (cpp = argv->argv; *cpp; cpp++) { - cleanup_out_string(state, REC_TYPE_ORCP, orcpt); - cleanup_out_string(state, REC_TYPE_RCPT, *cpp); - state->rcpt_count++; - } + for (cpp = argv->argv; *cpp; cpp++) { + cleanup_out_string(state, REC_TYPE_ORCP, orcpt); + cleanup_out_string(state, REC_TYPE_RCPT, *cpp); + state->rcpt_count++; } argv_free(argv); } diff --git a/postfix/src/global/bounce.c b/postfix/src/global/bounce.c index 13d5fc20f..11e68d280 100644 --- a/postfix/src/global/bounce.c +++ b/postfix/src/global/bounce.c @@ -106,7 +106,8 @@ /* .IP entry /* Message arrival time. /* .IP orig_rcpt -/* The original envelope recipient address. +/* The original envelope recipient address. If unavailable, +/* specify a null string or null pointer. /* .IP recipient /* Recipient address that the message could not be delivered to. /* This information is used for syslogging only. @@ -139,6 +140,11 @@ #include /* 44BSD stdarg.h uses abort() */ #include #include +#include + +#ifdef STRCASECMP_IN_STRINGS_H +#include +#endif /* Utility library. */ @@ -189,6 +195,8 @@ int vbounce_append(int flags, const char *id, const char *orig_rcpt, why = vstring_alloc(100); delay = time((time_t *) 0) - entry; vstring_vsprintf(why, fmt, ap); + if (orig_rcpt == 0) + orig_rcpt = ""; if (mail_command_client(MAIL_CLASS_PRIVATE, var_soft_bounce ? var_defer_service : var_bounce_service, ATTR_TYPE_NUM, MAIL_ATTR_NREQ, BOUNCE_CMD_APPEND, @@ -198,11 +206,18 @@ int vbounce_append(int flags, const char *id, const char *orig_rcpt, ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient, ATTR_TYPE_STR, MAIL_ATTR_WHY, vstring_str(why), ATTR_TYPE_END) == 0) { - msg_info("%s: orig_to=<%s>, to=<%s>, relay=%s, delay=%d, status=%s (%s%s)", - id, orig_rcpt, recipient, relay, delay, - var_soft_bounce ? "deferred" : "bounced", - var_soft_bounce ? "SOFT BOUNCE - " : "", - vstring_str(why)); + if (*orig_rcpt && strcasecmp(recipient, orig_rcpt) != 0) + msg_info("%s: to=<%s>, orig_to=<%s>, relay=%s, delay=%d, status=%s (%s%s)", + id, recipient, orig_rcpt, relay, delay, + var_soft_bounce ? "deferred" : "bounced", + var_soft_bounce ? "SOFT BOUNCE - " : "", + vstring_str(why)); + else + msg_info("%s: to=<%s>, relay=%s, delay=%d, status=%s (%s%s)", + id, recipient, relay, delay, + var_soft_bounce ? "deferred" : "bounced", + var_soft_bounce ? "SOFT BOUNCE - " : "", + vstring_str(why)); status = (var_soft_bounce ? -1 : 0); } else if ((flags & BOUNCE_FLAG_CLEAN) == 0) { status = defer_append(flags, id, orig_rcpt, recipient, "bounce", entry, @@ -284,6 +299,8 @@ int vbounce_one(int flags, const char *queue, const char *id, why = vstring_alloc(100); delay = time((time_t *) 0) - entry; vstring_vsprintf(why, fmt, ap); + if (orig_rcpt == 0) + orig_rcpt = ""; if (mail_command_client(MAIL_CLASS_PRIVATE, var_bounce_service, ATTR_TYPE_NUM, MAIL_ATTR_NREQ, BOUNCE_CMD_ONE, ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, @@ -295,8 +312,12 @@ int vbounce_one(int flags, const char *queue, const char *id, ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient, ATTR_TYPE_STR, MAIL_ATTR_WHY, vstring_str(why), ATTR_TYPE_END) == 0) { - msg_info("%s: to=<%s>, relay=%s, delay=%d, status=bounced (%s)", - id, recipient, relay, delay, vstring_str(why)); + if (*orig_rcpt && strcasecmp(recipient, orig_rcpt) != 0) + msg_info("%s: to=<%s>, orig_to=<%s>, relay=%s, delay=%d, status=bounced (%s)", + id, recipient, orig_rcpt, relay, delay, vstring_str(why)); + else + msg_info("%s: to=<%s>, relay=%s, delay=%d, status=bounced (%s)", + id, recipient, relay, delay, vstring_str(why)); status = 0; } else if ((flags & BOUNCE_FLAG_CLEAN) == 0) { status = defer_append(flags, id, orig_rcpt, recipient, "bounce", entry, diff --git a/postfix/src/global/defer.c b/postfix/src/global/defer.c index beb8b04a5..324d9fc13 100644 --- a/postfix/src/global/defer.c +++ b/postfix/src/global/defer.c @@ -73,7 +73,8 @@ /* .IP id /* The queue id of the original message file. /* .IP orig_rcpt -/* The original envelope recipient address. +/* The original envelope recipient address. If unavailable, +/* specify a null string or null pointer. /* .IP recipient /* A recipient address that is being deferred. The domain part /* of the address is marked dead (for a limited amount of time). @@ -115,6 +116,10 @@ #include #include +#ifdef STRCASECMP_IN_STRINGS_H +#include +#endif + /* Utility library. */ #include @@ -158,17 +163,23 @@ int vdefer_append(int flags, const char *id, const char *orig_rcpt, const char *rcpt_domain; vstring_vsprintf(why, fmt, ap); + if (orig_rcpt == 0) + orig_rcpt = ""; if (mail_command_client(MAIL_CLASS_PRIVATE, var_defer_service, - ATTR_TYPE_NUM, MAIL_ATTR_NREQ, BOUNCE_CMD_APPEND, - ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, - ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, id, - ATTR_TYPE_STR, MAIL_ATTR_ORCPT, orig_rcpt, - ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient, - ATTR_TYPE_STR, MAIL_ATTR_WHY, vstring_str(why), - ATTR_TYPE_END) != 0) - msg_warn("%s: defer service failure", id); - msg_info("%s: orig_to=<%s>, to=<%s>, relay=%s, delay=%d, status=deferred (%s)", - id, orig_rcpt, recipient, relay, delay, vstring_str(why)); + ATTR_TYPE_NUM, MAIL_ATTR_NREQ, BOUNCE_CMD_APPEND, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, + ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, id, + ATTR_TYPE_STR, MAIL_ATTR_ORCPT, orig_rcpt, + ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient, + ATTR_TYPE_STR, MAIL_ATTR_WHY, vstring_str(why), + ATTR_TYPE_END) != 0) + msg_warn("%s: defer service failure", id); + if (*orig_rcpt && strcasecmp(recipient, orig_rcpt) != 0) + msg_info("%s: to=<%s>, orig_to=<%s>, relay=%s, delay=%d, status=deferred (%s)", + id, recipient, orig_rcpt, relay, delay, vstring_str(why)); + else + msg_info("%s: to=<%s>, relay=%s, delay=%d, status=deferred (%s)", + id, recipient, relay, delay, vstring_str(why)); vstring_free(why); /* diff --git a/postfix/src/global/mail_copy.c b/postfix/src/global/mail_copy.c index 596bd8c4b..dc51da9ea 100644 --- a/postfix/src/global/mail_copy.c +++ b/postfix/src/global/mail_copy.c @@ -6,9 +6,9 @@ /* SYNOPSIS /* #include /* -/* int mail_copy(sender, envrcpt, delivered, src, dst, flags, eol, why) +/* int mail_copy(sender, orig_to, delivered, src, dst, flags, eol, why) /* const char *sender; -/* const char *envrcpt; +/* const char *orig_to; /* const char *delivered; /* VSTREAM *src; /* VSTREAM *dst; @@ -166,15 +166,13 @@ int mail_copy(const char *sender, if (orig_rcpt == 0) msg_panic("%s: null orig_rcpt", myname); quote_822_local(buf, orig_rcpt); - vstream_fprintf(dst, "X-Original-To: %s%s", - lowercase(vstring_str(buf)), eol); + vstream_fprintf(dst, "X-Original-To: %s%s", vstring_str(buf), eol); } if (flags & MAIL_COPY_DELIVERED) { if (delivered == 0) msg_panic("%s: null delivered", myname); quote_822_local(buf, delivered); - vstream_fprintf(dst, "Delivered-To: %s%s", - lowercase(vstring_str(buf)), eol); + vstream_fprintf(dst, "Delivered-To: %s%s", vstring_str(buf), eol); } /* diff --git a/postfix/src/global/mail_copy.h b/postfix/src/global/mail_copy.h index e7d650ff8..bd7f1d58f 100644 --- a/postfix/src/global/mail_copy.h +++ b/postfix/src/global/mail_copy.h @@ -31,7 +31,7 @@ extern int mail_copy(const char *, const char *, const char *, #define MAIL_COPY_RETURN_PATH (1<<4) /* prepend Return-Path: */ #define MAIL_COPY_DOT (1<<5) /* escape dots - needed for bsmtp */ #define MAIL_COPY_BLANK (1<<6) /* append blank line */ -#define MAIL_COPY_ORIG_RCPT (1<<7) /* prepend Delivered-To: */ +#define MAIL_COPY_ORIG_RCPT (1<<7) /* prepend X-Original-To: */ #define MAIL_COPY_MBOX (MAIL_COPY_FROM | MAIL_COPY_QUOTE | \ MAIL_COPY_TOFILE | MAIL_COPY_DELIVERED | \ MAIL_COPY_RETURN_PATH | MAIL_COPY_BLANK | \ diff --git a/postfix/src/global/mail_proto.h b/postfix/src/global/mail_proto.h index 4168d7ead..0cd707aa3 100644 --- a/postfix/src/global/mail_proto.h +++ b/postfix/src/global/mail_proto.h @@ -127,6 +127,7 @@ extern char *mail_pathname(const char *, const char *); #define MAIL_ATTR_CLIENT_NAME "client_name" /* client hostname */ #define MAIL_ATTR_CLIENT_ADDR "client_address" /* client address */ #define MAIL_ATTR_HELO_NAME "helo_name" /* SMTP helo name */ +#define MAIL_ATTR_PROTO_NAME "protocol_name" /* SMTP/ESMTP/QMQP/... */ #define MAIL_ATTR_ORIGIN "message_origin" /* hostname[address] */ #define MAIL_ATTR_ORG_NONE "unknown" /* origin unknown */ #define MAIL_ATTR_ORG_LOCAL "local" /* local submission */ diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index e4b133be5..9969d2ad4 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only, unless they include the same bugfix as a patch release. */ -#define MAIL_RELEASE_DATE "20021025" +#define MAIL_RELEASE_DATE "20021026" #define VAR_MAIL_VERSION "mail_version" #define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE diff --git a/postfix/src/global/sent.c b/postfix/src/global/sent.c index 25e60059d..37c1f2078 100644 --- a/postfix/src/global/sent.c +++ b/postfix/src/global/sent.c @@ -31,7 +31,8 @@ /* .IP queue_id /* The message queue id. /* .IP orig_rcpt -/* The original envelope recipient address +/* The original envelope recipient address. If unavailable, +/* specify a null string or a null pointer. /* .IP recipient /* The recipient address. /* .IP relay @@ -64,6 +65,11 @@ #include #include /* 44BSD stdarg.h uses abort() */ #include +#include + +#ifdef STRCASECMP_IN_STRINGS_H +#include +#endif /* Utility library. */ @@ -99,9 +105,14 @@ int vsent(const char *queue_id, const char *orig_rcpt, int delay = time((time_t *) 0) - entry; vstring_vsprintf(text, fmt, ap); - msg_info("%s: orig_to=<%s>, to=<%s>, relay=%s, delay=%d, status=sent%s%s%s", - queue_id, orig_rcpt, recipient, relay, delay, - *TEXT ? " (" : "", TEXT, *TEXT ? ")" : ""); + if (orig_rcpt && *orig_rcpt && strcasecmp(recipient, orig_rcpt) != 0) + msg_info("%s: to=<%s>, orig_to=<%s>, relay=%s, delay=%d, status=sent%s%s%s", + queue_id, recipient, orig_rcpt, relay, delay, + *TEXT ? " (" : "", TEXT, *TEXT ? ")" : ""); + else + msg_info("%s: to=<%s>, relay=%s, delay=%d, status=sent%s%s%s", + queue_id, recipient, relay, delay, + *TEXT ? " (" : "", TEXT, *TEXT ? ")" : ""); vstring_free(text); return (0); } diff --git a/postfix/src/local/forward.c b/postfix/src/local/forward.c index a15cc5592..77ebc9282 100644 --- a/postfix/src/local/forward.c +++ b/postfix/src/local/forward.c @@ -187,6 +187,7 @@ int forward_append(DELIVER_ATTR attr) /* * Append the recipient to the message envelope. */ + rec_fputs(info->cleanup, REC_TYPE_ORCP, attr.orig_rcpt); rec_fputs(info->cleanup, REC_TYPE_RCPT, attr.recipient); return (vstream_ferror(info->cleanup)); diff --git a/postfix/src/nqmgr/qmgr_message.c b/postfix/src/nqmgr/qmgr_message.c index f1f5fdbf2..fae69c51c 100644 --- a/postfix/src/nqmgr/qmgr_message.c +++ b/postfix/src/nqmgr/qmgr_message.c @@ -403,6 +403,10 @@ static int qmgr_message_read(QMGR_MESSAGE *message) message->rcpt_unread--; qmgr_rcpt_list_add(&message->rcpt_list, curr_offset, orig_rcpt, start); + if (orig_rcpt) { + myfree(orig_rcpt); + orig_rcpt = 0; + } if (message->rcpt_list.len >= recipient_limit) { if ((message->rcpt_offset = vstream_ftell(message->fp)) < 0) msg_fatal("vstream_ftell %s: %m", @@ -458,7 +462,7 @@ static int qmgr_message_read(QMGR_MESSAGE *message) } } if (orig_rcpt != 0) { - msg_warn("%s: out-of-order original recipient <%.200s>", + msg_warn("%s: out-of-order original recipient record <%.200s>", message->queue_id, start); myfree(orig_rcpt); orig_rcpt = 0; diff --git a/postfix/src/qmgr/qmgr_message.c b/postfix/src/qmgr/qmgr_message.c index fd92d7d52..91f70482f 100644 --- a/postfix/src/qmgr/qmgr_message.c +++ b/postfix/src/qmgr/qmgr_message.c @@ -342,7 +342,7 @@ static int qmgr_message_read(QMGR_MESSAGE *message) } } if (orig_rcpt != 0) { - msg_warn("%s: out-of-order original recipient <%.200s>", + msg_warn("%s: out-of-order original recipient record <%.200s>", message->queue_id, start); myfree(orig_rcpt); orig_rcpt = 0; diff --git a/postfix/src/qmqpd/qmqpd.c b/postfix/src/qmqpd/qmqpd.c index c11e4f6b6..60f42c08a 100644 --- a/postfix/src/qmqpd/qmqpd.c +++ b/postfix/src/qmqpd/qmqpd.c @@ -191,7 +191,8 @@ static void qmqpd_open_file(QMQPD_STATE *state) MAIL_CLASS_PUBLIC, var_cleanup_service); state->cleanup = state->dest->stream; state->queue_id = mystrdup(state->dest->id); - msg_info("%s: client=%s", state->queue_id, state->namaddr); + msg_info("%s: client=%s proto=%s", state->queue_id, + state->namaddr, state->protocol); /* * Record the time of arrival. Optionally, enable content filtering (not @@ -266,6 +267,8 @@ static void qmqpd_write_attributes(QMQPD_STATE *state) MAIL_ATTR_CLIENT_ADDR, state->addr); rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s", MAIL_ATTR_ORIGIN, state->namaddr); + rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s", + MAIL_ATTR_PROTO_NAME, state->protocol); } /* qmqpd_copy_recipients - copy message recipients */ diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index 7e9a1152c..ebdbd93e1 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -818,6 +818,8 @@ static int mail_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv) if (state->helo_name != 0) rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s", MAIL_ATTR_HELO_NAME, state->helo_name); + rec_fprintf(state->cleanup, REC_TYPE_ATTR, "%s=%s", + MAIL_ATTR_PROTO_NAME, state->protocol); } if (verp_delims) rec_fputs(state->cleanup, REC_TYPE_VERP, verp_delims); diff --git a/postfix/src/smtpd/smtpd_acl.ref b/postfix/src/smtpd/smtpd_acl.ref index 08ca55916..0613b949b 100644 --- a/postfix/src/smtpd/smtpd_acl.ref +++ b/postfix/src/smtpd/smtpd_acl.ref @@ -16,7 +16,7 @@ OK OK >>> # Expect: REJECT >>> helo foo.dunno.com -./smtpd_check: reject: HELO from localhost[127.0.0.1]: 554 : Helo command rejected: Access denied +./smtpd_check: : reject: HELO from localhost[127.0.0.1]: 554 : Helo command rejected: Access denied; proto=SMTP helo= 554 : Helo command rejected: Access denied >>> # Expect: OK >>> helo bar.dunno.com @@ -31,7 +31,7 @@ OK OK >>> # Expect: REJECT >>> client foo.dunno.com 131.155.210.17 -./smtpd_check: reject: CONNECT from foo.dunno.com[131.155.210.17]: 554 : Client host rejected: Access denied +./smtpd_check: : reject: CONNECT from foo.dunno.com[131.155.210.17]: 554 : Client host rejected: Access denied; proto=SMTP helo= 554 : Client host rejected: Access denied >>> # Expect: OK >>> client bar.dunno.com 131.155.210.17 @@ -47,18 +47,18 @@ OK OK >>> # Expect: REJECT >>> client bar.duno.com 131.155.210.19 -./smtpd_check: reject: CONNECT from bar.duno.com[131.155.210.19]: 554 : Client host rejected: Access denied +./smtpd_check: : reject: CONNECT from bar.duno.com[131.155.210.19]: 554 : Client host rejected: Access denied; proto=SMTP helo= 554 : Client host rejected: Access denied >>> # Expect: REJECT >>> client bar.duno.com 44.33.22.11 -./smtpd_check: reject: CONNECT from bar.duno.com[44.33.22.11]: 554 : Client host rejected: Access denied +./smtpd_check: : reject: CONNECT from bar.duno.com[44.33.22.11]: 554 : Client host rejected: Access denied; proto=SMTP helo= 554 : Client host rejected: Access denied >>> # Expect: OK >>> client bar.duno.com 44.33.22.55 OK >>> # Expect: REJECT >>> client bar.duno.com 44.33.44.33 -./smtpd_check: reject: CONNECT from bar.duno.com[44.33.44.33]: 554 : Client host rejected: Access denied +./smtpd_check: : reject: CONNECT from bar.duno.com[44.33.44.33]: 554 : Client host rejected: Access denied; proto=SMTP helo= 554 : Client host rejected: Access denied >>> # >>> # Test check_mail_access() @@ -67,7 +67,7 @@ OK OK >>> # Expect: REJECT >>> mail reject@dunno.domain -./smtpd_check: reject: MAIL from bar.duno.com[44.33.44.33]: 554 : Sender address rejected: Access denied; from= +./smtpd_check: : reject: MAIL from bar.duno.com[44.33.44.33]: 554 : Sender address rejected: Access denied; from= proto=SMTP helo= 554 : Sender address rejected: Access denied >>> # Expect: OK >>> mail ok@dunno.domain @@ -83,25 +83,25 @@ OK >>> # >>> # Expect: REJECT >>> mail reject@reject.domain -./smtpd_check: reject: MAIL from bar.duno.com[44.33.44.33]: 554 : Sender address rejected: Access denied; from= +./smtpd_check: : reject: MAIL from bar.duno.com[44.33.44.33]: 554 : Sender address rejected: Access denied; from= proto=SMTP helo= 554 : Sender address rejected: Access denied >>> # Expect: OK >>> mail ok@reject.domain OK >>> # Expect: REJECT >>> mail anyone@reject.domain -./smtpd_check: reject: MAIL from bar.duno.com[44.33.44.33]: 554 : Sender address rejected: Access denied; from= +./smtpd_check: : reject: MAIL from bar.duno.com[44.33.44.33]: 554 : Sender address rejected: Access denied; from= proto=SMTP helo= 554 : Sender address rejected: Access denied >>> # Expect: REJECT >>> mail good-sender@reject.domain -./smtpd_check: reject: MAIL from bar.duno.com[44.33.44.33]: 554 : Sender address rejected: Access denied; from= +./smtpd_check: : reject: MAIL from bar.duno.com[44.33.44.33]: 554 : Sender address rejected: Access denied; from= proto=SMTP helo= 554 : Sender address rejected: Access denied >>> # >>> # Again, with a domain that accepts by default >>> # >>> # Expect: REJECT >>> mail reject@ok.domain -./smtpd_check: reject: MAIL from bar.duno.com[44.33.44.33]: 554 : Sender address rejected: Access denied; from= +./smtpd_check: : reject: MAIL from bar.duno.com[44.33.44.33]: 554 : Sender address rejected: Access denied; from= proto=SMTP helo= 554 : Sender address rejected: Access denied >>> # Expect: OK >>> mail ok@ok.domain @@ -119,13 +119,13 @@ OK OK >>> # Expect: REJECT >>> rcpt reject@dunno.domain -./smtpd_check: reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= +./smtpd_check: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 : Recipient address rejected: Access denied >>> # Expect: REJECT >>> recipient_delimiter + OK >>> rcpt reject+ext@dunno.domain -./smtpd_check: reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= +./smtpd_check: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 : Recipient address rejected: Access denied >>> recipient_delimiter | OK @@ -150,25 +150,25 @@ OK >>> # >>> # Expect: REJECT >>> rcpt reject@reject.domain -./smtpd_check: reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= +./smtpd_check: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 : Recipient address rejected: Access denied >>> # Expect: OK >>> rcpt ok@reject.domain OK >>> # Expect: REJECT >>> rcpt anyone@reject.domain -./smtpd_check: reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= +./smtpd_check: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 : Recipient address rejected: Access denied >>> # Expect: REJECT >>> rcpt good-sender@reject.domain -./smtpd_check: reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= +./smtpd_check: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 : Recipient address rejected: Access denied >>> # >>> # Again, with a domain that accepts by default >>> # >>> # Expect: REJECT >>> rcpt reject@ok.domain -./smtpd_check: reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= +./smtpd_check: : reject: RCPT from bar.duno.com[44.33.44.33]: 554 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 : Recipient address rejected: Access denied >>> # Expect: OK >>> rcpt ok@ok.domain @@ -183,5 +183,5 @@ OK >>> # check_sender_access specific >>> # >>> mail <> -./smtpd_check: reject: MAIL from bar.duno.com[44.33.44.33]: 550 <>: Sender address rejected: Go away postmaster; from=<> +./smtpd_check: : reject: MAIL from bar.duno.com[44.33.44.33]: 550 <>: Sender address rejected: Go away postmaster; from=<> proto=SMTP helo= 550 <>: Sender address rejected: Go away postmaster diff --git a/postfix/src/smtpd/smtpd_check.c b/postfix/src/smtpd/smtpd_check.c index a3fb09752..3b41403fc 100644 --- a/postfix/src/smtpd/smtpd_check.c +++ b/postfix/src/smtpd/smtpd_check.c @@ -720,27 +720,21 @@ void smtpd_check_init(void) static void log_whatsup(SMTPD_STATE *state, const char *whatsup, const char *text) { + VSTRING *buf = vstring_alloc(100); - /* - * XXX should include queue ID but that will break all existing logfile - * parsers. - */ - if (state->recipient && state->sender) { - msg_info("%s: %s from %s: %s; from=<%s> to=<%s>", - whatsup, state->where, state->namaddr, text, - state->sender, state->recipient); - } else if (state->recipient) { - msg_info("%s: %s from %s: %s; to=<%s>", - whatsup, state->where, state->namaddr, text, - state->recipient); - } else if (state->sender) { - msg_info("%s: %s from %s: %s; from=<%s>", - whatsup, state->where, state->namaddr, text, - state->sender); - } else { - msg_info("%s: %s from %s: %s", - whatsup, state->where, state->namaddr, text); - } + vstring_sprintf(buf, "%s: %s: %s from %s: %s;", + state->queue_id, whatsup, state->where, + state->namaddr, text); + if (state->sender) + vstring_sprintf_append(buf, " from=<%s>", state->sender); + if (state->recipient) + vstring_sprintf_append(buf, " to=<%s>", state->recipient); + if (state->protocol) + vstring_sprintf_append(buf, " proto=%s", state->protocol); + if (state->helo_name) + vstring_sprintf_append(buf, " helo=<%s>", state->helo_name); + msg_info("%s", STR(buf)); + vstring_free(buf); } /* smtpd_check_reject - do the boring things that must be done */ diff --git a/postfix/src/smtpd/smtpd_check.ref b/postfix/src/smtpd/smtpd_check.ref index f6c0f1d84..d3ebec823 100644 --- a/postfix/src/smtpd/smtpd_check.ref +++ b/postfix/src/smtpd/smtpd_check.ref @@ -17,22 +17,22 @@ OK >>> client_restrictions permit_mynetworks,reject_unknown_client,hash:./smtpd_check_access OK >>> client unknown 131.155.210.17 -./smtpd_check: reject: CONNECT from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17] +./smtpd_check: : reject: CONNECT from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; proto=SMTP 450 Client host rejected: cannot find your hostname, [131.155.210.17] >>> client unknown 168.100.189.13 OK >>> client random.bad.domain 123.123.123.123 -./smtpd_check: reject: CONNECT from random.bad.domain[123.123.123.123]: 554 : Client host rejected: match bad.domain +./smtpd_check: : reject: CONNECT from random.bad.domain[123.123.123.123]: 554 : Client host rejected: match bad.domain; proto=SMTP 554 : Client host rejected: match bad.domain >>> client friend.bad.domain 123.123.123.123 OK >>> client bad.domain 123.123.123.123 -./smtpd_check: reject: CONNECT from bad.domain[123.123.123.123]: 554 : Client host rejected: match bad.domain +./smtpd_check: : reject: CONNECT from bad.domain[123.123.123.123]: 554 : Client host rejected: match bad.domain; proto=SMTP 554 : Client host rejected: match bad.domain >>> client wzv.win.tue.nl 131.155.210.17 OK >>> client aa.win.tue.nl 131.155.210.18 -./smtpd_check: reject: CONNECT from aa.win.tue.nl[131.155.210.18]: 554 : Client host rejected: match 131.155.210 +./smtpd_check: : reject: CONNECT from aa.win.tue.nl[131.155.210.18]: 554 : Client host rejected: match 131.155.210; proto=SMTP 554 : Client host rejected: match 131.155.210 >>> client_restrictions permit_mynetworks OK @@ -44,29 +44,29 @@ OK >>> client unknown 131.155.210.17 OK >>> helo foo. -./smtpd_check: reject: HELO from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17] +./smtpd_check: : reject: HELO from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; proto=SMTP helo= 450 Client host rejected: cannot find your hostname, [131.155.210.17] >>> client foo 123.123.123.123 OK >>> helo foo. -./smtpd_check: reject: HELO from foo[123.123.123.123]: 450 : Helo command rejected: Host not found +./smtpd_check: : reject: HELO from foo[123.123.123.123]: 450 : Helo command rejected: Host not found; proto=SMTP helo= 450 : Helo command rejected: Host not found >>> helo foo -./smtpd_check: reject: HELO from foo[123.123.123.123]: 450 : Helo command rejected: Host not found +./smtpd_check: : reject: HELO from foo[123.123.123.123]: 450 : Helo command rejected: Host not found; proto=SMTP helo= 450 : Helo command rejected: Host not found >>> helo spike.porcupine.org OK >>> helo_restrictions permit_mynetworks,reject_unknown_client,reject_invalid_hostname,hash:./smtpd_check_access OK >>> helo random.bad.domain -./smtpd_check: reject: HELO from foo[123.123.123.123]: 554 : Helo command rejected: match bad.domain +./smtpd_check: : reject: HELO from foo[123.123.123.123]: 554 : Helo command rejected: match bad.domain; proto=SMTP helo= 554 : Helo command rejected: match bad.domain >>> helo friend.bad.domain OK >>> helo_restrictions reject_invalid_hostname,reject_unknown_hostname OK >>> helo 123.123.123.123 -./smtpd_check: reject: HELO from foo[123.123.123.123]: 450 <123.123.123.123>: Helo command rejected: Host not found +./smtpd_check: : reject: HELO from foo[123.123.123.123]: 450 <123.123.123.123>: Helo command rejected: Host not found; proto=SMTP helo=<123.123.123.123> 450 <123.123.123.123>: Helo command rejected: Host not found >>> helo_restrictions permit_naked_ip_address,reject_invalid_hostname,reject_unknown_hostname OK @@ -81,7 +81,7 @@ OK >>> client unknown 131.155.210.17 OK >>> mail foo@watson.ibm.com -./smtpd_check: reject: MAIL from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; from= +./smtpd_check: : reject: MAIL from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; from= proto=SMTP helo=<123.123.123.123> 450 Client host rejected: cannot find your hostname, [131.155.210.17] >>> client unknown 168.100.189.13 OK @@ -96,29 +96,29 @@ OK >>> mail foo@watson.ibm.com OK >>> mail foo@bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 450 : Sender address rejected: Domain not found; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 450 : Sender address rejected: Domain not found; from= proto=SMTP helo=<123.123.123.123> 450 : Sender address rejected: Domain not found >>> sender_restrictions hash:./smtpd_check_access OK >>> mail bad-sender@any.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad-sender@; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad-sender@; from= proto=SMTP helo=<123.123.123.123> 554 : Sender address rejected: match bad-sender@ >>> mail bad-sender@good.domain OK >>> mail reject@this.address -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= proto=SMTP helo=<123.123.123.123> 554 : Sender address rejected: match reject@this.address >>> mail Reject@this.address -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= proto=SMTP helo=<123.123.123.123> 554 : Sender address rejected: match reject@this.address >>> mail foo@bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= proto=SMTP helo=<123.123.123.123> 554 : Sender address rejected: match bad.domain >>> mail foo@Bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= proto=SMTP helo=<123.123.123.123> 554 : Sender address rejected: match bad.domain >>> mail foo@random.bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= proto=SMTP helo=<123.123.123.123> 554 : Sender address rejected: match bad.domain >>> mail foo@friend.bad.domain OK @@ -130,7 +130,7 @@ OK >>> client unknown 131.155.210.17 OK >>> rcpt foo@watson.ibm.com -./smtpd_check: reject: RCPT from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; from= to= +./smtpd_check: : reject: RCPT from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; from= to= proto=SMTP helo=<123.123.123.123> 450 Client host rejected: cannot find your hostname, [131.155.210.17] >>> client unknown 168.100.189.13 OK @@ -139,7 +139,7 @@ OK >>> client foo 123.123.123.123 OK >>> rcpt foo@watson.ibm.com -./smtpd_check: reject: RCPT from foo[123.123.123.123]: 554 : Recipient address rejected: Relay access denied; from= to= +./smtpd_check: : reject: RCPT from foo[123.123.123.123]: 554 : Recipient address rejected: Relay access denied; from= to= proto=SMTP helo=<123.123.123.123> 554 : Recipient address rejected: Relay access denied >>> rcpt foo@porcupine.org OK @@ -154,25 +154,25 @@ OK >>> client foo 123.123.123.123 OK >>> rcpt foo@watson.ibm.com -./smtpd_check: reject: RCPT from foo[123.123.123.123]: 554 : Recipient address rejected: Relay access denied; from= to= +./smtpd_check: : reject: RCPT from foo[123.123.123.123]: 554 : Recipient address rejected: Relay access denied; from= to= proto=SMTP helo=<123.123.123.123> 554 : Recipient address rejected: Relay access denied >>> rcpt foo@porcupine.org OK >>> recipient_restrictions hash:./smtpd_check_access OK >>> mail bad-sender@any.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad-sender@; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad-sender@; from= proto=SMTP helo=<123.123.123.123> 554 : Sender address rejected: match bad-sender@ >>> mail bad-sender@good.domain OK >>> mail reject@this.address -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= proto=SMTP helo=<123.123.123.123> 554 : Sender address rejected: match reject@this.address >>> mail foo@bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= proto=SMTP helo=<123.123.123.123> 554 : Sender address rejected: match bad.domain >>> mail foo@random.bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= proto=SMTP helo=<123.123.123.123> 554 : Sender address rejected: match bad.domain >>> mail foo@friend.bad.domain OK @@ -184,7 +184,7 @@ OK >>> client spike.porcupine.org 168.100.189.2 OK >>> client foo 127.0.0.2 -./smtpd_check: reject: CONNECT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using blackholes.mail-abuse.org; Blackholed - see ; from= +./smtpd_check: : reject: CONNECT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using blackholes.mail-abuse.org; Blackholed - see ; from= proto=SMTP helo=<123.123.123.123> 554 Service unavailable; Client host [127.0.0.2] blocked using blackholes.mail-abuse.org; Blackholed - see >>> # >>> # Hybrids @@ -194,7 +194,7 @@ OK >>> client foo 131.155.210.17 OK >>> rcpt foo@watson.ibm.com -./smtpd_check: reject: RCPT from foo[131.155.210.17]: 554 : Recipient address rejected: Relay access denied; from= to= +./smtpd_check: : reject: RCPT from foo[131.155.210.17]: 554 : Recipient address rejected: Relay access denied; from= to= proto=SMTP helo=<123.123.123.123> 554 : Recipient address rejected: Relay access denied >>> recipient_restrictions check_client_access,hash:./smtpd_check_access,check_relay_domains OK @@ -207,10 +207,10 @@ OK >>> recipient_restrictions check_helo_access,hash:./smtpd_check_access,check_relay_domains OK >>> helo bad.domain -./smtpd_check: reject: HELO from foo[131.155.210.17]: 554 : Helo command rejected: match bad.domain; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 554 : Helo command rejected: match bad.domain; from= proto=SMTP helo= 554 : Helo command rejected: match bad.domain >>> rcpt foo@porcupine.org -./smtpd_check: reject: RCPT from foo[131.155.210.17]: 554 : Helo command rejected: match bad.domain; from= to= +./smtpd_check: : reject: RCPT from foo[131.155.210.17]: 554 : Helo command rejected: match bad.domain; from= to= proto=SMTP helo= 554 : Helo command rejected: match bad.domain >>> helo 131.155.210.17 OK @@ -219,10 +219,10 @@ OK >>> recipient_restrictions check_sender_access,hash:./smtpd_check_access,check_relay_domains OK >>> mail foo@bad.domain -./smtpd_check: reject: MAIL from foo[131.155.210.17]: 554 : Sender address rejected: match bad.domain; from= +./smtpd_check: : reject: MAIL from foo[131.155.210.17]: 554 : Sender address rejected: match bad.domain; from= proto=SMTP helo=<131.155.210.17> 554 : Sender address rejected: match bad.domain >>> rcpt foo@porcupine.org -./smtpd_check: reject: RCPT from foo[131.155.210.17]: 554 : Sender address rejected: match bad.domain; from= to= +./smtpd_check: : reject: RCPT from foo[131.155.210.17]: 554 : Sender address rejected: match bad.domain; from= to= proto=SMTP helo=<131.155.210.17> 554 : Sender address rejected: match bad.domain >>> mail foo@friend.bad.domain OK @@ -253,14 +253,14 @@ OK >>> mail foo@good.domain OK >>> rcpt foo@porcupine.org -./smtpd_check: reject: RCPT from foo[131.155.210.17]: 554 : Helo command rejected: match bad.domain; from= to= +./smtpd_check: : reject: RCPT from foo[131.155.210.17]: 554 : Helo command rejected: match bad.domain; from= to= proto=SMTP helo= 554 : Helo command rejected: match bad.domain >>> helo good.domain OK >>> mail foo@bad.domain OK >>> rcpt foo@porcupine.org -./smtpd_check: reject: RCPT from foo[131.155.210.17]: 554 : Sender address rejected: match bad.domain; from= to= +./smtpd_check: : reject: RCPT from foo[131.155.210.17]: 554 : Sender address rejected: match bad.domain; from= to= proto=SMTP helo= 554 : Sender address rejected: match bad.domain >>> # >>> # FQDN restrictions @@ -276,27 +276,27 @@ OK >>> helo foo.bar OK >>> helo foo -./smtpd_check: reject: HELO from foo[131.155.210.17]: 504 : Helo command rejected: need fully-qualified hostname; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 504 : Helo command rejected: need fully-qualified hostname; from= proto=SMTP helo= 504 : Helo command rejected: need fully-qualified hostname >>> mail foo@foo.bar. OK >>> mail foo@foo.bar OK >>> mail foo@foo -./smtpd_check: reject: MAIL from foo[131.155.210.17]: 504 : Sender address rejected: need fully-qualified address; from= +./smtpd_check: : reject: MAIL from foo[131.155.210.17]: 504 : Sender address rejected: need fully-qualified address; from= proto=SMTP helo= 504 : Sender address rejected: need fully-qualified address >>> mail foo -./smtpd_check: reject: MAIL from foo[131.155.210.17]: 504 : Sender address rejected: need fully-qualified address; from= +./smtpd_check: : reject: MAIL from foo[131.155.210.17]: 504 : Sender address rejected: need fully-qualified address; from= proto=SMTP helo= 504 : Sender address rejected: need fully-qualified address >>> rcpt foo@foo.bar. OK >>> rcpt foo@foo.bar OK >>> rcpt foo@foo -./smtpd_check: reject: RCPT from foo[131.155.210.17]: 504 : Recipient address rejected: need fully-qualified address; from= to= +./smtpd_check: : reject: RCPT from foo[131.155.210.17]: 504 : Recipient address rejected: need fully-qualified address; from= to= proto=SMTP helo= 504 : Recipient address rejected: need fully-qualified address >>> rcpt foo -./smtpd_check: reject: RCPT from foo[131.155.210.17]: 504 : Recipient address rejected: need fully-qualified address; from= to= +./smtpd_check: : reject: RCPT from foo[131.155.210.17]: 504 : Recipient address rejected: need fully-qualified address; from= to= proto=SMTP helo= 504 : Recipient address rejected: need fully-qualified address >>> # >>> # Numerical HELO checks @@ -308,70 +308,70 @@ OK OK >>> helo [321.255.255.255] ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <[321.255.255.255]>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <[321.255.255.255]>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<[321.255.255.255]> 501 <[321.255.255.255]>: Helo command rejected: invalid ip address >>> helo [0.255.255.255] ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <[0.255.255.255]>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <[0.255.255.255]>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<[0.255.255.255]> 501 <[0.255.255.255]>: Helo command rejected: invalid ip address >>> helo [1.2.3.321] ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <[1.2.3.321]>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <[1.2.3.321]>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<[1.2.3.321]> 501 <[1.2.3.321]>: Helo command rejected: invalid ip address >>> helo [1.2.3] ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <[1.2.3]>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <[1.2.3]>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<[1.2.3]> 501 <[1.2.3]>: Helo command rejected: invalid ip address >>> helo [1.2.3.4.5] ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <[1.2.3.4.5]>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <[1.2.3.4.5]>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<[1.2.3.4.5]> 501 <[1.2.3.4.5]>: Helo command rejected: invalid ip address >>> helo [1..2.3.4] ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <[1..2.3.4]>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <[1..2.3.4]>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<[1..2.3.4]> 501 <[1..2.3.4]>: Helo command rejected: invalid ip address >>> helo [.1.2.3.4] ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <[.1.2.3.4]>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <[.1.2.3.4]>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<[.1.2.3.4]> 501 <[.1.2.3.4]>: Helo command rejected: invalid ip address >>> helo [1.2.3.4.5.] ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <[1.2.3.4.5.]>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <[1.2.3.4.5.]>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<[1.2.3.4.5.]> 501 <[1.2.3.4.5.]>: Helo command rejected: invalid ip address >>> helo 1.2.3.4 ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead OK >>> helo 321.255.255.255 ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <321.255.255.255>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <321.255.255.255>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<321.255.255.255> 501 <321.255.255.255>: Helo command rejected: invalid ip address >>> helo 0.255.255.255 ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <0.255.255.255>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <0.255.255.255>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<0.255.255.255> 501 <0.255.255.255>: Helo command rejected: invalid ip address >>> helo 1.2.3.321 ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <1.2.3.321>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <1.2.3.321>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<1.2.3.321> 501 <1.2.3.321>: Helo command rejected: invalid ip address >>> helo 1.2.3 ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <1.2.3>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <1.2.3>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<1.2.3> 501 <1.2.3>: Helo command rejected: invalid ip address >>> helo 1.2.3.4.5 ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <1.2.3.4.5>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <1.2.3.4.5>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<1.2.3.4.5> 501 <1.2.3.4.5>: Helo command rejected: invalid ip address >>> helo 1..2.3.4 ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <1..2.3.4>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <1..2.3.4>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<1..2.3.4> 501 <1..2.3.4>: Helo command rejected: invalid ip address >>> helo .1.2.3.4 ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <.1.2.3.4>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <.1.2.3.4>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<.1.2.3.4> 501 <.1.2.3.4>: Helo command rejected: invalid ip address >>> helo 1.2.3.4.5. ./smtpd_check: warning: restriction permit_naked_ip_address is deprecated. Use permit_mynetworks instead -./smtpd_check: reject: HELO from foo[131.155.210.17]: 501 <1.2.3.4.5.>: Helo command rejected: invalid ip address; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 501 <1.2.3.4.5.>: Helo command rejected: invalid ip address; from= proto=SMTP helo=<1.2.3.4.5.> 501 <1.2.3.4.5.>: Helo command rejected: invalid ip address >>> # >>> # The defer restriction @@ -381,5 +381,5 @@ OK >>> helo_restrictions defer OK >>> helo foobar -./smtpd_check: reject: HELO from foo[131.155.210.17]: 444 : Helo command rejected: Try again later; from= +./smtpd_check: : reject: HELO from foo[131.155.210.17]: 444 : Helo command rejected: Try again later; from= proto=SMTP helo= 444 : Helo command rejected: Try again later diff --git a/postfix/src/smtpd/smtpd_check.ref2 b/postfix/src/smtpd/smtpd_check.ref2 index 6007991d6..64cffa686 100644 --- a/postfix/src/smtpd/smtpd_check.ref2 +++ b/postfix/src/smtpd/smtpd_check.ref2 @@ -17,22 +17,22 @@ OK >>> client_restrictions permit_mynetworks,reject_unknown_client,check_client_access,hash:./smtpd_check_access OK >>> client unknown 131.155.210.17 -./smtpd_check: reject: CONNECT from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17] +./smtpd_check: : reject: CONNECT from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; proto=SMTP 450 Client host rejected: cannot find your hostname, [131.155.210.17] >>> client unknown 168.100.189.13 OK >>> client random.bad.domain 123.123.123.123 -./smtpd_check: reject: CONNECT from random.bad.domain[123.123.123.123]: 554 : Client host rejected: match bad.domain +./smtpd_check: : reject: CONNECT from random.bad.domain[123.123.123.123]: 554 : Client host rejected: match bad.domain; proto=SMTP 554 : Client host rejected: match bad.domain >>> client friend.bad.domain 123.123.123.123 OK >>> client bad.domain 123.123.123.123 -./smtpd_check: reject: CONNECT from bad.domain[123.123.123.123]: 554 : Client host rejected: match bad.domain +./smtpd_check: : reject: CONNECT from bad.domain[123.123.123.123]: 554 : Client host rejected: match bad.domain; proto=SMTP 554 : Client host rejected: match bad.domain >>> client wzv.win.tue.nl 131.155.210.17 OK >>> client aa.win.tue.nl 131.155.210.18 -./smtpd_check: reject: CONNECT from aa.win.tue.nl[131.155.210.18]: 554 : Client host rejected: match 131.155.210 +./smtpd_check: : reject: CONNECT from aa.win.tue.nl[131.155.210.18]: 554 : Client host rejected: match 131.155.210; proto=SMTP 554 : Client host rejected: match 131.155.210 >>> client_restrictions permit_mynetworks OK @@ -44,22 +44,22 @@ OK >>> client unknown 131.155.210.17 OK >>> helo foo. -./smtpd_check: reject: HELO from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17] +./smtpd_check: : reject: HELO from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; proto=SMTP helo= 450 Client host rejected: cannot find your hostname, [131.155.210.17] >>> client foo 123.123.123.123 OK >>> helo foo. -./smtpd_check: reject: HELO from foo[123.123.123.123]: 450 : Helo command rejected: Host not found +./smtpd_check: : reject: HELO from foo[123.123.123.123]: 450 : Helo command rejected: Host not found; proto=SMTP helo= 450 : Helo command rejected: Host not found >>> helo foo -./smtpd_check: reject: HELO from foo[123.123.123.123]: 450 : Helo command rejected: Host not found +./smtpd_check: : reject: HELO from foo[123.123.123.123]: 450 : Helo command rejected: Host not found; proto=SMTP helo= 450 : Helo command rejected: Host not found >>> helo spike.porcupine.org OK >>> helo_restrictions permit_mynetworks,reject_unknown_client,reject_invalid_hostname,check_helo_access,hash:./smtpd_check_access OK >>> helo random.bad.domain -./smtpd_check: reject: HELO from foo[123.123.123.123]: 554 : Helo command rejected: match bad.domain +./smtpd_check: : reject: HELO from foo[123.123.123.123]: 554 : Helo command rejected: match bad.domain; proto=SMTP helo= 554 : Helo command rejected: match bad.domain >>> helo friend.bad.domain OK @@ -71,7 +71,7 @@ OK >>> client unknown 131.155.210.17 OK >>> mail foo@watson.ibm.com -./smtpd_check: reject: MAIL from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; from= +./smtpd_check: : reject: MAIL from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; from= proto=SMTP helo= 450 Client host rejected: cannot find your hostname, [131.155.210.17] >>> client unknown 168.100.189.13 OK @@ -86,29 +86,29 @@ OK >>> mail foo@watson.ibm.com OK >>> mail foo@bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 450 : Sender address rejected: Domain not found; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 450 : Sender address rejected: Domain not found; from= proto=SMTP helo= 450 : Sender address rejected: Domain not found >>> sender_restrictions check_sender_access,hash:./smtpd_check_access OK >>> mail bad-sender@any.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad-sender@; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad-sender@; from= proto=SMTP helo= 554 : Sender address rejected: match bad-sender@ >>> mail bad-sender@good.domain OK >>> mail reject@this.address -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= proto=SMTP helo= 554 : Sender address rejected: match reject@this.address >>> mail Reject@this.address -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= proto=SMTP helo= 554 : Sender address rejected: match reject@this.address >>> mail foo@bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= proto=SMTP helo= 554 : Sender address rejected: match bad.domain >>> mail foo@Bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= proto=SMTP helo= 554 : Sender address rejected: match bad.domain >>> mail foo@random.bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= proto=SMTP helo= 554 : Sender address rejected: match bad.domain >>> mail foo@friend.bad.domain OK @@ -120,7 +120,7 @@ OK >>> client unknown 131.155.210.17 OK >>> rcpt foo@watson.ibm.com -./smtpd_check: reject: RCPT from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; from= to= +./smtpd_check: : reject: RCPT from unknown[131.155.210.17]: 450 Client host rejected: cannot find your hostname, [131.155.210.17]; from= to= proto=SMTP helo= 450 Client host rejected: cannot find your hostname, [131.155.210.17] >>> client unknown 168.100.189.13 OK @@ -129,7 +129,7 @@ OK >>> client foo 123.123.123.123 OK >>> rcpt foo@watson.ibm.com -./smtpd_check: reject: RCPT from foo[123.123.123.123]: 554 : Recipient address rejected: Relay access denied; from= to= +./smtpd_check: : reject: RCPT from foo[123.123.123.123]: 554 : Recipient address rejected: Relay access denied; from= to= proto=SMTP helo= 554 : Recipient address rejected: Relay access denied >>> rcpt foo@porcupine.org OK @@ -144,25 +144,25 @@ OK >>> client foo 123.123.123.123 OK >>> rcpt foo@watson.ibm.com -./smtpd_check: reject: RCPT from foo[123.123.123.123]: 554 : Recipient address rejected: Relay access denied; from= to= +./smtpd_check: : reject: RCPT from foo[123.123.123.123]: 554 : Recipient address rejected: Relay access denied; from= to= proto=SMTP helo= 554 : Recipient address rejected: Relay access denied >>> rcpt foo@porcupine.org OK >>> recipient_restrictions check_recipient_access,hash:./smtpd_check_access OK >>> mail bad-sender@any.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad-sender@; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad-sender@; from= proto=SMTP helo= 554 : Sender address rejected: match bad-sender@ >>> mail bad-sender@good.domain OK >>> mail reject@this.address -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match reject@this.address; from= proto=SMTP helo= 554 : Sender address rejected: match reject@this.address >>> mail foo@bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= proto=SMTP helo= 554 : Sender address rejected: match bad.domain >>> mail foo@random.bad.domain -./smtpd_check: reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= +./smtpd_check: : reject: MAIL from foo[123.123.123.123]: 554 : Sender address rejected: match bad.domain; from= proto=SMTP helo= 554 : Sender address rejected: match bad.domain >>> mail foo@friend.bad.domain OK @@ -174,7 +174,7 @@ OK >>> client spike.porcupine.org 168.100.189.2 OK >>> client foo 127.0.0.2 -./smtpd_check: reject: CONNECT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using blackholes.mail-abuse.org; Blackholed - see ; from= +./smtpd_check: : reject: CONNECT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using blackholes.mail-abuse.org; Blackholed - see ; from= proto=SMTP helo= 554 Service unavailable; Client host [127.0.0.2] blocked using blackholes.mail-abuse.org; Blackholed - see >>> # >>> # unknown sender/recipient domain @@ -188,12 +188,12 @@ OK >>> rcpt wietse@porcupine.org OK >>> rcpt wietse@no.recipient.domain -./smtpd_check: reject: RCPT from foo[127.0.0.2]: 554 : Recipient address rejected: Domain not found; from= to= +./smtpd_check: : reject: RCPT from foo[127.0.0.2]: 554 : Recipient address rejected: Domain not found; from= to= proto=SMTP helo= 554 : Recipient address rejected: Domain not found >>> mail wietse@no.sender.domain OK >>> rcpt wietse@porcupine.org -./smtpd_check: reject: RCPT from foo[127.0.0.2]: 554 : Sender address rejected: Domain not found; from= to= +./smtpd_check: : reject: RCPT from foo[127.0.0.2]: 554 : Sender address rejected: Domain not found; from= to= proto=SMTP helo= 554 : Sender address rejected: Domain not found >>> # >>> # {permit_auth,reject_unauth}_destination @@ -205,14 +205,14 @@ OK >>> recipient_restrictions permit_auth_destination,reject OK >>> rcpt user@foo.org -./smtpd_check: reject: RCPT from foo[127.0.0.2]: 554 : Recipient address rejected: Access denied; from= to= +./smtpd_check: : reject: RCPT from foo[127.0.0.2]: 554 : Recipient address rejected: Access denied; from= to= proto=SMTP helo= 554 : Recipient address rejected: Access denied >>> rcpt user@foo.com OK >>> recipient_restrictions reject_unauth_destination,permit OK >>> rcpt user@foo.org -./smtpd_check: reject: RCPT from foo[127.0.0.2]: 554 : Relay access denied; from= to= +./smtpd_check: : reject: RCPT from foo[127.0.0.2]: 554 : Relay access denied; from= to= proto=SMTP helo= 554 : Relay access denied >>> rcpt user@foo.com OK @@ -226,8 +226,8 @@ OK >>> client spike.porcupine.org 160.100.189.2 2 OK >>> client unknown 1.1.1.1 4 -./smtpd_check: reject: CONNECT from unknown[1.1.1.1]: 450 Client host rejected: cannot find your hostname, [1.1.1.1]; from= +./smtpd_check: : reject: CONNECT from unknown[1.1.1.1]: 450 Client host rejected: cannot find your hostname, [1.1.1.1]; from= proto=SMTP helo= 450 Client host rejected: cannot find your hostname, [1.1.1.1] >>> client unknown 1.1.1.1 5 -./smtpd_check: reject: CONNECT from unknown[1.1.1.1]: 550 Client host rejected: cannot find your hostname, [1.1.1.1]; from= +./smtpd_check: : reject: CONNECT from unknown[1.1.1.1]: 550 Client host rejected: cannot find your hostname, [1.1.1.1]; from= proto=SMTP helo= 550 Client host rejected: cannot find your hostname, [1.1.1.1] diff --git a/postfix/src/smtpd/smtpd_exp.ref b/postfix/src/smtpd/smtpd_exp.ref index 882dc2181..8ed2c20d3 100644 --- a/postfix/src/smtpd/smtpd_exp.ref +++ b/postfix/src/smtpd/smtpd_exp.ref @@ -29,7 +29,7 @@ OK >>> client foo 127.0.0.2 OK >>> rcpt rname@rdomain -./smtpd_check: reject: RCPT from foo[127.0.0.2]: 554 client=foo[127.0.0.2] client_address=127.0.0.2 client_name=foo helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=blackholes.mail-abuse.org rbl_txt=Blackholed - see rbl_what=127.0.0.2 rbl_class=Client host; from= to= +./smtpd_check: : reject: RCPT from foo[127.0.0.2]: 554 client=foo[127.0.0.2] client_address=127.0.0.2 client_name=foo helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=blackholes.mail-abuse.org rbl_txt=Blackholed - see rbl_what=127.0.0.2 rbl_class=Client host; from= to= proto=SMTP helo= 554 client=foo[127.0.0.2] client_address=127.0.0.2 client_name=foo helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=blackholes.mail-abuse.org rbl_txt=Blackholed - see rbl_what=127.0.0.2 rbl_class=Client host >>> # >>> recipient_restrictions reject_rbl_client,blackholes.mail-abuse.org @@ -41,7 +41,7 @@ OK >>> client foo 127.0.0.2 OK >>> rcpt rname@rdomain -./smtpd_check: reject: RCPT from foo[127.0.0.2]: 554 client=foo[127.0.0.2] client_address=127.0.0.2 client_name=foo helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=blackholes.mail-abuse.org rbl_txt=Blackholed - see rbl_what=127.0.0.2 rbl_class=Client host; from= to= +./smtpd_check: : reject: RCPT from foo[127.0.0.2]: 554 client=foo[127.0.0.2] client_address=127.0.0.2 client_name=foo helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=blackholes.mail-abuse.org rbl_txt=Blackholed - see rbl_what=127.0.0.2 rbl_class=Client host; from= to= proto=SMTP helo= 554 client=foo[127.0.0.2] client_address=127.0.0.2 client_name=foo helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=blackholes.mail-abuse.org rbl_txt=Blackholed - see rbl_what=127.0.0.2 rbl_class=Client host >>> # >>> # RHSBL sender domain name @@ -53,7 +53,7 @@ OK >>> mail sname@example.tld OK >>> rcpt rname@rdomain -./smtpd_check: reject: RCPT from spike.porcupine.org[168.100.189.2]: 554 client=spike.porcupine.org[168.100.189.2] client_address=168.100.189.2 client_name=spike.porcupine.org helo_name=foobar sender=sname@example.tld sender_name=sname sender_domain=example.tld recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=dsn.rfc-ignorant.org rbl_txt=Not supporting null originator (DSN) rbl_what=sname@example.tld rbl_class=Sender address; from= to= +./smtpd_check: : reject: RCPT from spike.porcupine.org[168.100.189.2]: 554 client=spike.porcupine.org[168.100.189.2] client_address=168.100.189.2 client_name=spike.porcupine.org helo_name=foobar sender=sname@example.tld sender_name=sname sender_domain=example.tld recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=dsn.rfc-ignorant.org rbl_txt=Not supporting null originator (DSN) rbl_what=sname@example.tld rbl_class=Sender address; from= to= proto=SMTP helo= 554 client=spike.porcupine.org[168.100.189.2] client_address=168.100.189.2 client_name=spike.porcupine.org helo_name=foobar sender=sname@example.tld sender_name=sname sender_domain=example.tld recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=dsn.rfc-ignorant.org rbl_txt=Not supporting null originator (DSN) rbl_what=sname@example.tld rbl_class=Sender address >>> mail sname@sdomain OK @@ -69,7 +69,7 @@ OK >>> mail sname@sdomain OK >>> rcpt rname@rdomain -./smtpd_check: reject: RCPT from example.tld[1.2.3.4]: 554 client=example.tld[1.2.3.4] client_address=1.2.3.4 client_name=example.tld helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=dsn.rfc-ignorant.org rbl_txt=Not supporting null originator (DSN) rbl_what=example.tld rbl_class=Client host; from= to= +./smtpd_check: : reject: RCPT from example.tld[1.2.3.4]: 554 client=example.tld[1.2.3.4] client_address=1.2.3.4 client_name=example.tld helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=dsn.rfc-ignorant.org rbl_txt=Not supporting null originator (DSN) rbl_what=example.tld rbl_class=Client host; from= to= proto=SMTP helo= 554 client=example.tld[1.2.3.4] client_address=1.2.3.4 client_name=example.tld helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@rdomain recipient_name=rname recipient_domain=rdomain rbl_code=554 rbl_domain=dsn.rfc-ignorant.org rbl_txt=Not supporting null originator (DSN) rbl_what=example.tld rbl_class=Client host >>> # >>> # RHSBL recipient domain name @@ -83,5 +83,5 @@ OK >>> rcpt rname@rdomain OK >>> rcpt rname@example.tld -./smtpd_check: reject: RCPT from spike.porcupine.org[168.100.189.2]: 554 client=spike.porcupine.org[168.100.189.2] client_address=168.100.189.2 client_name=spike.porcupine.org helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@example.tld recipient_name=rname recipient_domain=example.tld rbl_code=554 rbl_domain=dsn.rfc-ignorant.org rbl_txt=Not supporting null originator (DSN) rbl_what=rname@example.tld rbl_class=Recipient address; from= to= +./smtpd_check: : reject: RCPT from spike.porcupine.org[168.100.189.2]: 554 client=spike.porcupine.org[168.100.189.2] client_address=168.100.189.2 client_name=spike.porcupine.org helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@example.tld recipient_name=rname recipient_domain=example.tld rbl_code=554 rbl_domain=dsn.rfc-ignorant.org rbl_txt=Not supporting null originator (DSN) rbl_what=rname@example.tld rbl_class=Recipient address; from= to= proto=SMTP helo= 554 client=spike.porcupine.org[168.100.189.2] client_address=168.100.189.2 client_name=spike.porcupine.org helo_name=foobar sender=sname@sdomain sender_name=sname sender_domain=sdomain recipient=rname@example.tld recipient_name=rname recipient_domain=example.tld rbl_code=554 rbl_domain=dsn.rfc-ignorant.org rbl_txt=Not supporting null originator (DSN) rbl_what=rname@example.tld rbl_class=Recipient address