From 389877bae1fe1a9f7259b8979f6a930744d90fab Mon Sep 17 00:00:00 2001 From: David Levine Date: Wed, 18 Jan 2006 00:09:00 +0000 Subject: [PATCH] Fixed make_bcc_file () to use contents of From: in draft, if draft_from masquerade flag is enabled. --- ChangeLog | 9 +++++++++ uip/post.c | 13 ++++++++++++- uip/spost.c | 13 ++++++++++++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc54aeb..e7f3e1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-01-17 David Levine + + * uip/post.c, uip/spost.c: in make_bcc_file (), use same + logic as in finish_headers () to detect whether there is an + existing From: line in the draft. If draft_from masquerade + flag is enabled, this allows the From: to be obeyed in the + Bcc, instead of the old behavior of always replacing it with + the signature. + 2006-01-17 Oliver Kiddle * sbr/fmt_scan.c: more robust multi-byte/column support for field diff --git a/uip/post.c b/uip/post.c index 4ca5955..f880152 100644 --- a/uip/post.c +++ b/uip/post.c @@ -1167,7 +1167,18 @@ make_bcc_file (int dashstuff) if (msgid) fprintf (out, "Message-ID: <%d.%ld@%s>\n", (int) getpid (), (long) tclock, LocalName ()); - fprintf (out, "From: %s\n", signature); + if (msgflags & MFRM) { + /* There was already a From: in the draft. Don't add one. */ + if (!draft_from_masquerading) + /* mts.conf didn't contain "masquerade:[...]draft_from[...]" + so we'll reveal the user's actual account@thismachine + address in a Sender: header (and use it as the envelope + From: later). */ + fprintf (out, "Sender: %s\n", from); + } + else + /* Construct a From: header. */ + fprintf (out, "From: %s\n", signature); if (subject) fprintf (out, "Subject: %s", subject); fprintf (out, "BCC:\n"); diff --git a/uip/spost.c b/uip/spost.c index 7a880e9..c86ea18 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -761,7 +761,18 @@ make_bcc_file (void) chmod (bccfil, 0600); fprintf (out, "Date: %s\n", dtimenow (0)); - fprintf (out, "From: %s\n", signature); + if (msgflags & MFRM) { + /* There was already a From: in the draft. Don't add one. */ + if (!draft_from_masquerading) + /* mts.conf didn't contain "masquerade:[...]draft_from[...]" + so we'll reveal the user's actual account@thismachine + address in a Sender: header (and use it as the envelope + From: later). */ + fprintf (out, "Sender: %s\n", from); + } + else + /* Construct a From: header. */ + fprintf (out, "From: %s\n", signature); if (subject) fprintf (out, "Subject: %s", subject); fprintf (out, "BCC:\n\n------- Blind-Carbon-Copy\n\n"); -- 1.7.10.4