summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-08-06 16:26:40 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-08-06 16:26:40 +0000
commitccadcb0a7561d6a31cd1088810145739909b96a1 (patch)
treee9fc53479c7ced5c0c25c70a149f3aadf3fa4fbe /usr.sbin
parent6e7e8975626fe603529c0e60cefa188eeb5c890e (diff)
when writing a bounce, follow the same rule as for mta sessions and prepend
with a dot lines starting with a dot
Diffstat (limited to 'usr.sbin')
-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;