summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/smtpd.h4
-rw-r--r--usr.sbin/smtpd/store.c22
2 files changed, 14 insertions, 12 deletions
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h
index 2c6da0c217d..e2446f51438 100644
--- a/usr.sbin/smtpd/smtpd.h
+++ b/usr.sbin/smtpd/smtpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.h,v 1.64 2009/01/30 17:34:58 gilles Exp $ */
+/* $OpenBSD: smtpd.h,v 1.65 2009/01/30 20:11:13 form Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -835,7 +835,7 @@ void session_respond(struct session *, char *, ...)
SPLAY_PROTOTYPE(sessiontree, session, s_nodes, session_cmp);
/* store.c */
-int store_write_header(struct batch *, struct message *, FILE *);
+int store_write_header(struct batch *, struct message *, FILE *, int);
int store_write_message(struct batch *, struct message *);
int store_write_daemon(struct batch *, struct message *);
int store_message(struct batch *, struct message *,
diff --git a/usr.sbin/smtpd/store.c b/usr.sbin/smtpd/store.c
index 4d1ac9b1751..517aa814084 100644
--- a/usr.sbin/smtpd/store.c
+++ b/usr.sbin/smtpd/store.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: store.c,v 1.12 2009/01/29 15:20:34 gilles Exp $ */
+/* $OpenBSD: store.c,v 1.13 2009/01/30 20:11:13 form Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -84,7 +84,8 @@ file_copy(FILE *dest, FILE *src, enum action_type type)
}
int
-store_write_header(struct batch *batchp, struct message *messagep, FILE *fp)
+store_write_header(struct batch *batchp, struct message *messagep, FILE *fp,
+ int finalize)
{
time_t tm;
char timebuf[26]; /* current time */
@@ -125,12 +126,13 @@ store_write_header(struct batch *batchp, struct message *messagep, FILE *fp)
}
if (fprintf(fp, "Received: from %s (%s [%s%s])\n"
- "\tby %s with ESMTP id %s\n"
- "\tfor <%s@%s>; %s\n\n",
- 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, ctimebuf) == -1) {
+ "\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, ctimebuf,
+ finalize ? "\n" : "") == -1) {
return 0;
}
return 1;
@@ -152,7 +154,7 @@ store_write_daemon(struct batch *batchp, struct message *messagep)
if (messagefp == NULL)
goto bad;
- if (! store_write_header(batchp, messagep, mboxfp))
+ if (! store_write_header(batchp, messagep, mboxfp, 1))
goto bad;
if (fprintf(mboxfp, "Hi !\n\n"
@@ -248,7 +250,7 @@ store_write_message(struct batch *batchp, struct message *messagep)
if (messagefp == NULL)
goto bad;
- if (! store_write_header(batchp, messagep, mboxfp))
+ if (! store_write_header(batchp, messagep, mboxfp, 0))
goto bad;
if (! file_copy(mboxfp, messagefp, messagep->recipient.rule.r_action))