diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-05-27 13:14:19 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-05-27 13:14:19 +0000 |
commit | 4a7ebaf1aee0b6855c2ddfa6c4ecf6403e59ceba (patch) | |
tree | a1af4738fea4dd78d3d3b74cdeb2c03c54b214eb /usr.sbin | |
parent | 6a8a5a251dfc9d033763ade4c29ff7d7f67151e5 (diff) |
Insert Received: at receive time instead of delivery time; ok gilles@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/mta.c | 11 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 8 | ||||
-rw-r--r-- | usr.sbin/smtpd/store.c | 15 |
3 files changed, 12 insertions, 22 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c index 8c5f1e8be4f..3d94b971f9c 100644 --- a/usr.sbin/smtpd/mta.c +++ b/usr.sbin/smtpd/mta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta.c,v 1.49 2009/05/24 14:38:56 jacekm Exp $ */ +/* $OpenBSD: mta.c,v 1.50 2009/05/27 13:14:18 jacekm Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -913,15 +913,6 @@ mta_reply_handler(struct bufferevent *bev, void *arg) } case S_DATA: { - session_respond(sessionp, "Received: from %s (%s [%s])", - batchp->session_helo, batchp->session_hostname, - ss_to_text(&batchp->session_ss)); - - session_respond(sessionp, "\tby %s with ESMTP id %s;", - batchp->env->sc_hostname, batchp->message_id); - - session_respond(sessionp, "\t%s", time_to_text(batchp->creation)); - if (sessionp->s_flags & F_SECURE) { log_info("%s: version=%s cipher=%s bits=%d", batchp->message_id, diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index 08a52294cee..0c9d272ffdd 100644 --- a/usr.sbin/smtpd/smtp_session.c +++ b/usr.sbin/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.99 2009/05/27 13:11:39 jacekm Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.100 2009/05/27 13:14:18 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -659,6 +659,12 @@ session_pickup(struct session *s, struct submit_status *ss) s->s_state = S_DATACONTENT; session_respond(s, "354 Enter mail, end with \".\" on a line by" " itself"); + fprintf(s->datafp, "Received: from %s (%s [%s])\n", + s->s_msg.session_helo, s->s_hostname, ss_to_text(&s->s_ss)); + fprintf(s->datafp, "\tby %s with %sSMTP id %s;\n", + s->s_env->sc_hostname, s->s_flags & F_EHLO ? "E" : "", + s->s_msg.message_id); + fprintf(s->datafp, "\t%s\n", time_to_text(time(NULL))); break; case S_DONE: diff --git a/usr.sbin/smtpd/store.c b/usr.sbin/smtpd/store.c index 437d1de8a4c..f56d7306a33 100644 --- a/usr.sbin/smtpd/store.c +++ b/usr.sbin/smtpd/store.c @@ -1,4 +1,4 @@ -/* $OpenBSD: store.c,v 1.17 2009/03/15 19:15:25 gilles Exp $ */ +/* $OpenBSD: store.c,v 1.18 2009/05/27 13:14:18 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -119,17 +119,10 @@ store_write_header(struct batch *batchp, struct message *messagep, FILE *fp, return 0; } } - - if (fprintf(fp, "Received: from %s (%s [%s%s])\n" - "\tby %s with ESMTP id %s\n" - "\tfor <%s@%s>; %s\n%s", - messagep->session_helo, messagep->session_hostname, - messagep->session_ss.ss_family == PF_INET ? "" : "IPv6:", addrbuf, - batchp->env->sc_hostname, messagep->message_id, - messagep->sender.user, messagep->sender.domain, time_to_text(messagep->creation), - finalize ? "\n" : "") == -1) { + + if (finalize && fprintf(fp, "\n") == -1) return 0; - } + return 1; } |