2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-31 14:17:41 +00:00

postfix-1.1.11-20021028

This commit is contained in:
Wietse Venema
2002-10-28 00:00:00 -05:00
committed by Viktor Dukhovni
parent 1eee692a04
commit bae04c10f3
23 changed files with 71 additions and 52 deletions

View File

@@ -7089,6 +7089,9 @@ Apologies for any names omitted.
20020126 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 Logging: SMTP UCE reject/warn/hold/discard logging now
includes the protocol name and, if available, the hostname includes the protocol name and, if available, the hostname
given in the SMTP HELO or EHLO command. given in the SMTP HELO or EHLO command.
@@ -7097,10 +7100,13 @@ Apologies for any names omitted.
now includes the protocol name and, if available, the now includes the protocol name and, if available, the
hostname given in the SMTP HELO or EHLO command. hostname given in the SMTP HELO or EHLO command.
Open problems: 20021028
Low: smtpd should log queue ID with reject/warn/hold/discard Bugfix: don't reset state after rejected EHLO. Reset state
actions. after HELO. Reported by Karthikeyan Bhargavan, upenn.edu.
Files: smtpd/smtpd.c.
Open problems:
Low: revise other local delivery agent duplicate filters. Low: revise other local delivery agent duplicate filters.

View File

@@ -216,6 +216,7 @@ can use one of the following commands:
% perl -MMIME::Base64 -e \ % perl -MMIME::Base64 -e \
'print encode_base64("username\0username\0password");' 'print encode_base64("username\0username\0password");'
mmencode is part of the metamail software.
MIME::Base64 is available from www.cpan.org. MIME::Base64 is available from www.cpan.org.
Enabling SASL authentication in the Postfix SMTP client Enabling SASL authentication in the Postfix SMTP client

View File

@@ -12,17 +12,18 @@ snapshot release). Patches change the patchlevel and the release
date. Snapshots change only the release date, unless they include date. Snapshots change only the release date, unless they include
the same bugfixes as a patch release. 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 Logfile formats have changed. This may affect logfile processing
software. 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 - The Postfix SMTP server UCE reject etc. logging now includes the
ID, the mail protocol (SMTP or ESMTP), and the hostname that was queue ID, the mail protocol (SMTP or ESMTP), and the hostname that
received with the HELO or EHLO command, if available. 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 protocol (SMTP, ESMTP, QMQP) and the hostname that was received
with the SMTP HELO or EHLO command, if available. with the SMTP HELO or EHLO command, if available.
@@ -31,13 +32,15 @@ original recipient address (as received before any address rewriting
or aliasing). The original recipient address is logged only when or aliasing). The original recipient address is logged only when
it differs from the final recipient address. 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 Postfix logs more information, as described in the "incompatibilities"
original recipient address (as received before any address rewriting section above.
or aliasing). The original recipient address is logged only when
it differs from the final recipient address. 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 Major changes with Postfix snapshot 1.1.11-20021024
=================================================== ===================================================

View File

@@ -299,7 +299,6 @@ 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 STREQUAL(x,y,l) (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0)
#define CLEANUP_ACT_KEEP 1 #define CLEANUP_ACT_KEEP 1
#define CLEANUP_ACT_DROP 0 #define CLEANUP_ACT_DROP 0
#define STR(x) vstring_str(x)
if (STREQUAL(value, "REJECT", command_len)) { if (STREQUAL(value, "REJECT", command_len)) {
if (state->reason == 0) if (state->reason == 0)

View File

@@ -78,8 +78,7 @@ void cleanup_out_recipient(CLEANUP_STATE *state, const char *orcpt,
return; return;
if (cleanup_virtual_maps == 0) { 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); cleanup_out_string(state, REC_TYPE_RCPT, recip);
state->rcpt_count++; state->rcpt_count++;
} else { } else {

View File

@@ -34,7 +34,7 @@
/* const char *encoding; /* const char *encoding;
/* const char *sender; /* 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, ...) /* recipient, relay, entry, format, ...)
/* int flags; /* int flags;
/* const char *queue; /* const char *queue;

View File

@@ -108,7 +108,7 @@ static int deliver_pass_send_request(VSTREAM *stream, DELIVER_REQUEST *request,
ATTR_TYPE_STR, MAIL_ATTR_RRCPT, request->return_receipt, ATTR_TYPE_STR, MAIL_ATTR_RRCPT, request->return_receipt,
ATTR_TYPE_LONG, MAIL_ATTR_TIME, request->arrival_time, ATTR_TYPE_LONG, MAIL_ATTR_TIME, request->arrival_time,
ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, offs, 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_STR, MAIL_ATTR_RECIP, addr,
ATTR_TYPE_NUM, MAIL_ATTR_OFFSET, 0, ATTR_TYPE_NUM, MAIL_ATTR_OFFSET, 0,
ATTR_TYPE_END); ATTR_TYPE_END);

View File

@@ -246,7 +246,7 @@ static int deliver_request_get(VSTREAM *stream, DELIVER_REQUEST *request)
return (-1); return (-1);
} }
recipient_list_add(&request->rcpt_list, offset, recipient_list_add(&request->rcpt_list, offset,
*vstring_str(orig_addr) ? vstring_str(orig_addr) : 0, vstring_str(orig_addr),
vstring_str(address)); vstring_str(address));
} }

View File

@@ -23,6 +23,13 @@
#include <iostuff.h> #include <iostuff.h>
#include <attr.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 * Names of services: these are the names if INET ports, UNIX-domain sockets
* or FIFOs that a service listens on. * or FIFOs that a service listens on.

View File

@@ -20,7 +20,7 @@
* Patches change the patchlevel and the release date. Snapshots change the * Patches change the patchlevel and the release date. Snapshots change the
* release date only, unless they include the same bugfix as a patch release. * 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 VAR_MAIL_VERSION "mail_version"
#define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE #define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE

View File

@@ -100,7 +100,7 @@ void recipient_list_add(RECIPIENT_LIST *list, long offset,
list->info = (RECIPIENT *) list->info = (RECIPIENT *)
myrealloc((char *) list->info, list->avail * sizeof(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].address = mystrdup(rcpt);
list->info[list->len].offset = offset; list->info[list->len].offset = offset;
list->len++; list->len++;
@@ -113,8 +113,7 @@ void recipient_list_free(RECIPIENT_LIST *list)
RECIPIENT *rcpt; RECIPIENT *rcpt;
for (rcpt = list->info; rcpt < list->info + list->len; 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(rcpt->address);
} }
myfree((char *) list->info); myfree((char *) list->info);

View File

@@ -177,8 +177,7 @@ static int qmgr_deliver_send_request(QMGR_ENTRY *entry, VSTREAM *stream)
for (recipient = list.info; recipient < list.info + list.len; recipient++) for (recipient = list.info; recipient < list.info + list.len; recipient++)
attr_print(stream, ATTR_FLAG_MORE, attr_print(stream, ATTR_FLAG_MORE,
ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, recipient->offset, ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, recipient->offset,
ATTR_TYPE_STR, MAIL_ATTR_ORCPT, ATTR_TYPE_STR, MAIL_ATTR_ORCPT, recipient->orig_rcpt,
recipient->orig_rcpt ? recipient->orig_rcpt : "",
ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient->address, ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient->address,
ATTR_TYPE_END); ATTR_TYPE_END);
attr_print(stream, ATTR_FLAG_NONE, attr_print(stream, ATTR_FLAG_NONE,

View File

@@ -402,7 +402,7 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
if (message->rcpt_list.len < recipient_limit) { if (message->rcpt_list.len < recipient_limit) {
message->rcpt_unread--; message->rcpt_unread--;
qmgr_rcpt_list_add(&message->rcpt_list, curr_offset, qmgr_rcpt_list_add(&message->rcpt_list, curr_offset,
orig_rcpt, start); orig_rcpt ? orig_rcpt : "unknown", start);
if (orig_rcpt) { if (orig_rcpt) {
myfree(orig_rcpt); myfree(orig_rcpt);
orig_rcpt = 0; orig_rcpt = 0;

View File

@@ -80,7 +80,7 @@ void qmgr_rcpt_list_add(QMGR_RCPT_LIST *list, long offset,
list->info = (QMGR_RCPT *) list->info = (QMGR_RCPT *)
myrealloc((char *) list->info, list->avail * sizeof(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].address = mystrdup(rcpt);
list->info[list->len].offset = offset; list->info[list->len].offset = offset;
list->info[list->len].queue = 0; list->info[list->len].queue = 0;
@@ -94,8 +94,7 @@ void qmgr_rcpt_list_free(QMGR_RCPT_LIST *list)
QMGR_RCPT *rcpt; QMGR_RCPT *rcpt;
for (rcpt = list->info; rcpt < list->info + list->len; 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(rcpt->address);
} }
myfree((char *) list->info); myfree((char *) list->info);

View File

@@ -172,8 +172,7 @@ static int qmgr_deliver_send_request(QMGR_ENTRY *entry, VSTREAM *stream)
for (recipient = list.info; recipient < list.info + list.len; recipient++) for (recipient = list.info; recipient < list.info + list.len; recipient++)
attr_print(stream, ATTR_FLAG_MORE, attr_print(stream, ATTR_FLAG_MORE,
ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, recipient->offset, ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, recipient->offset,
ATTR_TYPE_STR, MAIL_ATTR_ORCPT, ATTR_TYPE_STR, MAIL_ATTR_ORCPT, recipient->orig_rcpt,
recipient->orig_rcpt ? recipient->orig_rcpt : "",
ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient->address, ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient->address,
ATTR_TYPE_END); ATTR_TYPE_END);
attr_print(stream, ATTR_FLAG_NONE, attr_print(stream, ATTR_FLAG_NONE,

View File

@@ -278,7 +278,7 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
#define FUDGE(x) ((x) * (var_qmgr_fudge / 100.0)) #define FUDGE(x) ((x) * (var_qmgr_fudge / 100.0))
if (message->rcpt_list.len < FUDGE(var_qmgr_rcpt_limit)) { if (message->rcpt_list.len < FUDGE(var_qmgr_rcpt_limit)) {
qmgr_rcpt_list_add(&message->rcpt_list, curr_offset, qmgr_rcpt_list_add(&message->rcpt_list, curr_offset,
orig_rcpt, start); orig_rcpt ? orig_rcpt : "unknown", start);
if (orig_rcpt) { if (orig_rcpt) {
myfree(orig_rcpt); myfree(orig_rcpt);
orig_rcpt = 0; orig_rcpt = 0;

View File

@@ -80,7 +80,7 @@ void qmgr_rcpt_list_add(QMGR_RCPT_LIST *list, long offset,
list->info = (QMGR_RCPT *) list->info = (QMGR_RCPT *)
myrealloc((char *) list->info, list->avail * sizeof(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].address = mystrdup(rcpt);
list->info[list->len].offset = offset; list->info[list->len].offset = offset;
list->info[list->len].queue = 0; list->info[list->len].queue = 0;
@@ -94,8 +94,7 @@ void qmgr_rcpt_list_free(QMGR_RCPT_LIST *list)
QMGR_RCPT *rcpt; QMGR_RCPT *rcpt;
for (rcpt = list->info; rcpt < list->info + list->len; 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(rcpt->address);
} }
myfree((char *) list->info); myfree((char *) list->info);

View File

@@ -117,4 +117,7 @@ qmqpd_state.o: ../../include/vbuf.h
qmqpd_state.o: ../../include/vstring.h qmqpd_state.o: ../../include/vstring.h
qmqpd_state.o: ../../include/mail_stream.h qmqpd_state.o: ../../include/mail_stream.h
qmqpd_state.o: ../../include/cleanup_user.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 qmqpd_state.o: qmqpd.h

View File

@@ -191,8 +191,7 @@ static void qmqpd_open_file(QMQPD_STATE *state)
MAIL_CLASS_PUBLIC, var_cleanup_service); MAIL_CLASS_PUBLIC, var_cleanup_service);
state->cleanup = state->dest->stream; state->cleanup = state->dest->stream;
state->queue_id = mystrdup(state->dest->id); state->queue_id = mystrdup(state->dest->id);
msg_info("%s: client=%s proto=%s", state->queue_id, msg_info("%s: client=%s", state->queue_id, state->namaddr);
state->namaddr, state->protocol);
/* /*
* Record the time of arrival. Optionally, enable content filtering (not * Record the time of arrival. Optionally, enable content filtering (not

View File

@@ -47,6 +47,7 @@
#include <mail_stream.h> #include <mail_stream.h>
#include <cleanup_user.h> #include <cleanup_user.h>
#include <mail_proto.h>
/* Application-specific. */ /* Application-specific. */
@@ -72,7 +73,7 @@ QMQPD_STATE *qmqpd_state_alloc(VSTREAM *stream)
state->reason = 0; state->reason = 0;
state->sender = 0; state->sender = 0;
state->recipient = 0; state->recipient = 0;
state->protocol = "QMQP"; state->protocol = MAIL_PROTO_QMQP;
state->where = "initializing client connection"; state->where = "initializing client connection";
state->why_rejected = vstring_alloc(10); state->why_rejected = vstring_alloc(10);
return (state); return (state);

View File

@@ -278,6 +278,9 @@ smtpd_state.o: ../../include/msg.h
smtpd_state.o: ../../include/cleanup_user.h smtpd_state.o: ../../include/cleanup_user.h
smtpd_state.o: ../../include/mail_params.h smtpd_state.o: ../../include/mail_params.h
smtpd_state.o: ../../include/mail_error.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: smtpd.h
smtpd_state.o: ../../include/vstring.h smtpd_state.o: ../../include/vstring.h
smtpd_state.o: ../../include/argv.h smtpd_state.o: ../../include/argv.h

View File

@@ -453,8 +453,6 @@ static int helo_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
smtpd_chat_reply(state, "501 Syntax: HELO hostname"); smtpd_chat_reply(state, "501 Syntax: HELO hostname");
return (-1); return (-1);
} }
if (state->helo_name != 0)
helo_reset(state);
if (argc > 2) if (argc > 2)
collapse_args(argc - 1, argv + 1); collapse_args(argc - 1, argv + 1);
if (SMTPD_STAND_ALONE(state) == 0 if (SMTPD_STAND_ALONE(state) == 0
@@ -463,8 +461,14 @@ static int helo_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
smtpd_chat_reply(state, "%s", err); smtpd_chat_reply(state, "%s", err);
return (-1); 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->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); smtpd_chat_reply(state, "250 %s", var_myhostname);
return (0); return (0);
} }
@@ -485,13 +489,6 @@ static int ehlo_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
smtpd_chat_reply(state, "501 Syntax: EHLO hostname"); smtpd_chat_reply(state, "501 Syntax: EHLO hostname");
return (-1); 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) if (argc > 2)
collapse_args(argc - 1, argv + 1); collapse_args(argc - 1, argv + 1);
if (SMTPD_STAND_ALONE(state) == 0 if (SMTPD_STAND_ALONE(state) == 0
@@ -500,8 +497,13 @@ static int ehlo_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
smtpd_chat_reply(state, "%s", err); smtpd_chat_reply(state, "%s", err);
return (-1); 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->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-%s", var_myhostname);
smtpd_chat_reply(state, "250-PIPELINING"); smtpd_chat_reply(state, "250-PIPELINING");
if (var_message_limit) if (var_message_limit)

View File

@@ -52,6 +52,7 @@
#include <cleanup_user.h> #include <cleanup_user.h>
#include <mail_params.h> #include <mail_params.h>
#include <mail_error.h> #include <mail_error.h>
#include <mail_proto.h>
/* Application-specific. */ /* Application-specific. */
@@ -86,7 +87,7 @@ void smtpd_state_init(SMTPD_STATE *state, VSTREAM *stream)
state->sender = 0; state->sender = 0;
state->recipient = 0; state->recipient = 0;
state->etrn_name = 0; state->etrn_name = 0;
state->protocol = "SMTP"; state->protocol = MAIL_PROTO_SMTP;
state->where = SMTPD_AFTER_CONNECT; state->where = SMTPD_AFTER_CONNECT;
state->recursion = 0; state->recursion = 0;
state->msg_size = 0; state->msg_size = 0;