20020126
+ Logging: SMTP UCE reject/warn/hold/discard logging now
+ includes queue ID. This will break some logfile analyzers.
+
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.
now includes the protocol name and, if available, the
hostname given in the SMTP HELO or EHLO command.
-Open problems:
+20021028
- Low: smtpd should log queue ID with reject/warn/hold/discard
- actions.
+ Bugfix: don't reset state after rejected EHLO. Reset state
+ after HELO. Reported by Karthikeyan Bhargavan, upenn.edu.
+ Files: smtpd/smtpd.c.
+
+Open problems:
Low: revise other local delivery agent duplicate filters.
% perl -MMIME::Base64 -e \
'print encode_base64("username\0username\0password");'
+mmencode is part of the metamail software.
MIME::Base64 is available from www.cpan.org.
Enabling SASL authentication in the Postfix SMTP client
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
+Incompatible changes with Postfix snapshot 1.1.11-20021028
==========================================================
-Logging formats have changed. This may affect logfile processing
-software.
+Logfile formats have changed. This may affect logfile processing
+software. The queue file format is still compatible with Postfix
+version 1.1 (stable release).
-- 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 SMTP server 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
+- The Postfix header/body_checks logging now includes the mail
protocol (SMTP, ESMTP, QMQP) and the hostname that was received
with the SMTP HELO or EHLO command, if available.
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
+Major changes with Postfix snapshot 1.1.11-20021028
===================================================
-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.
+Postfix logs more information, as described in the "incompatibilities"
+section above.
+
+The local(8) and virtual(8) delivery agents now record the original
+recipient address in the X-Original-To: message header. This header
+can also be emitted by the pipe(8) delivery agent.
Major changes with Postfix snapshot 1.1.11-20021024
===================================================
#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)
return;
if (cleanup_virtual_maps == 0) {
- if (strcasecmp(orcpt, recip) != 0)
- cleanup_out_string(state, REC_TYPE_ORCP, orcpt);
+ cleanup_out_string(state, REC_TYPE_ORCP, orcpt);
cleanup_out_string(state, REC_TYPE_RCPT, recip);
state->rcpt_count++;
} else {
/* const char *encoding;
/* const char *sender;
/*
-/* int bounce_one(flags, queue, id, encoding, sender,
+/* int bounce_one(flags, queue, id, encoding, sender, orig_rcpt,
/* recipient, relay, entry, format, ...)
/* int flags;
/* const char *queue;
ATTR_TYPE_STR, MAIL_ATTR_RRCPT, request->return_receipt,
ATTR_TYPE_LONG, MAIL_ATTR_TIME, request->arrival_time,
ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, offs,
- ATTR_TYPE_STR, MAIL_ATTR_ORCPT, orcpt ? orcpt : "",
+ ATTR_TYPE_STR, MAIL_ATTR_ORCPT, orcpt,
ATTR_TYPE_STR, MAIL_ATTR_RECIP, addr,
ATTR_TYPE_NUM, MAIL_ATTR_OFFSET, 0,
ATTR_TYPE_END);
return (-1);
}
recipient_list_add(&request->rcpt_list, offset,
- *vstring_str(orig_addr) ? vstring_str(orig_addr) : 0,
+ vstring_str(orig_addr),
vstring_str(address));
}
#include <iostuff.h>
#include <attr.h>
+ /*
+ * External protocols.
+ */
+#define MAIL_PROTO_SMTP "SMTP"
+#define MAIL_PROTO_ESMTP "ESMTP"
+#define MAIL_PROTO_QMQP "QMQP"
+
/*
* Names of services: these are the names if INET ports, UNIX-domain sockets
* or FIFOs that a service listens on.
* 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 "20021026"
+#define MAIL_RELEASE_DATE "20021028"
#define VAR_MAIL_VERSION "mail_version"
#define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE
list->info = (RECIPIENT *)
myrealloc((char *) list->info, list->avail * sizeof(RECIPIENT));
}
- list->info[list->len].orig_addr = orig_rcpt ? mystrdup(orig_rcpt) : 0;
+ list->info[list->len].orig_addr = mystrdup(orig_rcpt);
list->info[list->len].address = mystrdup(rcpt);
list->info[list->len].offset = offset;
list->len++;
RECIPIENT *rcpt;
for (rcpt = list->info; rcpt < list->info + list->len; rcpt++) {
- if (rcpt->orig_addr)
- myfree(rcpt->orig_addr);
+ myfree(rcpt->orig_addr);
myfree(rcpt->address);
}
myfree((char *) list->info);
for (recipient = list.info; recipient < list.info + list.len; recipient++)
attr_print(stream, ATTR_FLAG_MORE,
ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, recipient->offset,
- ATTR_TYPE_STR, MAIL_ATTR_ORCPT,
- recipient->orig_rcpt ? recipient->orig_rcpt : "",
+ ATTR_TYPE_STR, MAIL_ATTR_ORCPT, recipient->orig_rcpt,
ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient->address,
ATTR_TYPE_END);
attr_print(stream, ATTR_FLAG_NONE,
if (message->rcpt_list.len < recipient_limit) {
message->rcpt_unread--;
qmgr_rcpt_list_add(&message->rcpt_list, curr_offset,
- orig_rcpt, start);
+ orig_rcpt ? orig_rcpt : "unknown", start);
if (orig_rcpt) {
myfree(orig_rcpt);
orig_rcpt = 0;
list->info = (QMGR_RCPT *)
myrealloc((char *) list->info, list->avail * sizeof(QMGR_RCPT));
}
- list->info[list->len].orig_rcpt = (orcpt ? mystrdup(orcpt) : 0);
+ list->info[list->len].orig_rcpt = mystrdup(orcpt);
list->info[list->len].address = mystrdup(rcpt);
list->info[list->len].offset = offset;
list->info[list->len].queue = 0;
QMGR_RCPT *rcpt;
for (rcpt = list->info; rcpt < list->info + list->len; rcpt++) {
- if (rcpt->orig_rcpt)
- myfree(rcpt->orig_rcpt);
+ myfree(rcpt->orig_rcpt);
myfree(rcpt->address);
}
myfree((char *) list->info);
for (recipient = list.info; recipient < list.info + list.len; recipient++)
attr_print(stream, ATTR_FLAG_MORE,
ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, recipient->offset,
- ATTR_TYPE_STR, MAIL_ATTR_ORCPT,
- recipient->orig_rcpt ? recipient->orig_rcpt : "",
+ ATTR_TYPE_STR, MAIL_ATTR_ORCPT, recipient->orig_rcpt,
ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient->address,
ATTR_TYPE_END);
attr_print(stream, ATTR_FLAG_NONE,
#define FUDGE(x) ((x) * (var_qmgr_fudge / 100.0))
if (message->rcpt_list.len < FUDGE(var_qmgr_rcpt_limit)) {
qmgr_rcpt_list_add(&message->rcpt_list, curr_offset,
- orig_rcpt, start);
+ orig_rcpt ? orig_rcpt : "unknown", start);
if (orig_rcpt) {
myfree(orig_rcpt);
orig_rcpt = 0;
list->info = (QMGR_RCPT *)
myrealloc((char *) list->info, list->avail * sizeof(QMGR_RCPT));
}
- list->info[list->len].orig_rcpt = (orcpt ? mystrdup(orcpt) : 0);
+ list->info[list->len].orig_rcpt = mystrdup(orcpt);
list->info[list->len].address = mystrdup(rcpt);
list->info[list->len].offset = offset;
list->info[list->len].queue = 0;
QMGR_RCPT *rcpt;
for (rcpt = list->info; rcpt < list->info + list->len; rcpt++) {
- if (rcpt->orig_rcpt)
- myfree(rcpt->orig_rcpt);
+ myfree(rcpt->orig_rcpt);
myfree(rcpt->address);
}
myfree((char *) list->info);
qmqpd_state.o: ../../include/vstring.h
qmqpd_state.o: ../../include/mail_stream.h
qmqpd_state.o: ../../include/cleanup_user.h
+qmqpd_state.o: ../../include/mail_proto.h
+qmqpd_state.o: ../../include/iostuff.h
+qmqpd_state.o: ../../include/attr.h
qmqpd_state.o: qmqpd.h
MAIL_CLASS_PUBLIC, var_cleanup_service);
state->cleanup = state->dest->stream;
state->queue_id = mystrdup(state->dest->id);
- msg_info("%s: client=%s proto=%s", state->queue_id,
- state->namaddr, state->protocol);
+ msg_info("%s: client=%s", state->queue_id, state->namaddr);
/*
* Record the time of arrival. Optionally, enable content filtering (not
#include <mail_stream.h>
#include <cleanup_user.h>
+#include <mail_proto.h>
/* Application-specific. */
state->reason = 0;
state->sender = 0;
state->recipient = 0;
- state->protocol = "QMQP";
+ state->protocol = MAIL_PROTO_QMQP;
state->where = "initializing client connection";
state->why_rejected = vstring_alloc(10);
return (state);
smtpd_state.o: ../../include/cleanup_user.h
smtpd_state.o: ../../include/mail_params.h
smtpd_state.o: ../../include/mail_error.h
+smtpd_state.o: ../../include/mail_proto.h
+smtpd_state.o: ../../include/iostuff.h
+smtpd_state.o: ../../include/attr.h
smtpd_state.o: smtpd.h
smtpd_state.o: ../../include/vstring.h
smtpd_state.o: ../../include/argv.h
smtpd_chat_reply(state, "501 Syntax: HELO hostname");
return (-1);
}
- if (state->helo_name != 0)
- helo_reset(state);
if (argc > 2)
collapse_args(argc - 1, argv + 1);
if (SMTPD_STAND_ALONE(state) == 0
smtpd_chat_reply(state, "%s", err);
return (-1);
}
+ if (state->helo_name != 0)
+ helo_reset(state);
+ chat_reset(state, var_smtpd_hist_thrsh);
+ mail_reset(state);
+ rcpt_reset(state);
state->helo_name = mystrdup(printable(argv[1].strval, '?'));
- state->protocol = "SMTP";
+ if (strcmp(state->protocol, MAIL_PROTO_ESMTP) != 0)
+ state->protocol = MAIL_PROTO_SMTP;
smtpd_chat_reply(state, "250 %s", var_myhostname);
return (0);
}
smtpd_chat_reply(state, "501 Syntax: EHLO hostname");
return (-1);
}
- if (state->helo_name != 0)
- helo_reset(state);
-#ifndef RFC821_SYNTAX
- chat_reset(state, var_smtpd_hist_thrsh);
- mail_reset(state);
- rcpt_reset(state);
-#endif
if (argc > 2)
collapse_args(argc - 1, argv + 1);
if (SMTPD_STAND_ALONE(state) == 0
smtpd_chat_reply(state, "%s", err);
return (-1);
}
+ if (state->helo_name != 0)
+ helo_reset(state);
+ chat_reset(state, var_smtpd_hist_thrsh);
+ mail_reset(state);
+ rcpt_reset(state);
state->helo_name = mystrdup(printable(argv[1].strval, '?'));
- state->protocol = "ESMTP";
+ state->protocol = MAIL_PROTO_ESMTP;
smtpd_chat_reply(state, "250-%s", var_myhostname);
smtpd_chat_reply(state, "250-PIPELINING");
if (var_message_limit)
#include <cleanup_user.h>
#include <mail_params.h>
#include <mail_error.h>
+#include <mail_proto.h>
/* Application-specific. */
state->sender = 0;
state->recipient = 0;
state->etrn_name = 0;
- state->protocol = "SMTP";
+ state->protocol = MAIL_PROTO_SMTP;
state->where = SMTPD_AFTER_CONNECT;
state->recursion = 0;
state->msg_size = 0;