From: Glenn Burkhardt Date: Mon, 22 Sep 2003 01:04:04 +0000 (+0000) Subject: make 'spost' handling of "masquerade:" line of mts.conf containing X-Git-Tag: RELEASE_1_2~76 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=2d2b2581db2998febf460eb43e6e993e516a7da9 make 'spost' handling of "masquerade:" line of mts.conf containing 'draft_from' same as for 'post'. Debian bug report 144098, filed by Terran Melconian. --- diff --git a/uip/spost.c b/uip/spost.c index 4930cbb..5a7d943 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -181,6 +181,8 @@ extern char *sendmail; extern char *getfullname (void); extern char *getusername (void); +extern boolean draft_from_masquerading; /* defined in mts.c */ + /* * static prototypes */ @@ -578,10 +580,19 @@ finish_headers (FILE *out) case normal: if (!(msgflags & MDAT)) fprintf (out, "Date: %s\n", dtimenow (0)); - if (msgflags & MFRM) - fprintf (out, "Sender: %s\n", from); + + 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 fprintf (out, "From: %s\n", signature); + #ifdef notdef if (!(msgflags & MVIS)) fprintf (out, "Bcc: Blind Distribution List: ;\n"); @@ -591,9 +602,17 @@ finish_headers (FILE *out) case resent: if (!(msgflags & MRDT)) fprintf (out, "Resent-Date: %s\n", dtimenow(0)); - if (msgflags & MRFM) - fprintf (out, "Resent-Sender: %s\n", from); + if (msgflags & MRFM) { + /* There was already a Resent-From: in 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, "Resent-Sender: %s\n", from); + } else + /* Construct a Resent-From: header. */ fprintf (out, "Resent-From: %s\n", signature); #ifdef notdef if (!(msgflags & MVIS))