summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/bounce.c5
-rw-r--r--usr.sbin/smtpd/store.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/bounce.c b/usr.sbin/smtpd/bounce.c
index add6d442087..fe6e74f6ce2 100644
--- a/usr.sbin/smtpd/bounce.c
+++ b/usr.sbin/smtpd/bounce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bounce.c,v 1.4 2009/08/06 14:27:41 gilles Exp $ */
+/* $OpenBSD: bounce.c,v 1.5 2009/08/06 16:26:39 gilles Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@openbsd.org>
@@ -151,9 +151,8 @@ bounce_session_switch(struct smtpd *env, FILE *fp, enum session_state *state, ch
fprintf(fp, "\r\n");
fprintf(fp, "Below is a copy of the original message:\r\n\r\n");
- if (! file_copy(fp, srcfp, NULL, 0, 1)) {
+ if (! file_copy(fp, srcfp, NULL, 0, 1))
return 0;
- }
fprintf(fp, ".\r\n");
diff --git a/usr.sbin/smtpd/store.c b/usr.sbin/smtpd/store.c
index b9cf478cf70..d34ead07700 100644
--- a/usr.sbin/smtpd/store.c
+++ b/usr.sbin/smtpd/store.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: store.c,v 1.22 2009/08/06 14:27:41 gilles Exp $ */
+/* $OpenBSD: store.c,v 1.23 2009/08/06 16:26:39 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -83,6 +83,14 @@ file_copy(FILE *dest, FILE *src, struct path *path, enum action_type type, int s
}
}
+ /* "If first character of the line is a period, one
+ * additional period is inserted at the beginning."
+ * [4.5.2]
+ */
+ if (session && *buf == '.')
+ if (fprintf(dest, ".") != 1)
+ return 0;
+
if (fprintf(dest, "%s%s", buf, session ? "\r\n" : "\n") !=
(int)len + (session ? 2 : 1))
return 0;