From: markus schnalke Date: Fri, 3 Feb 2012 17:28:51 +0000 (+0100) Subject: Removed draft_from masquerading. X-Git-Tag: mmh-thesis-end~374 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=b14ea6073f77b4359aaf3fddd0e105989db9f306;p=mmh Removed draft_from masquerading. We're an MUA and should not care for SMTP envelopes at all. --- diff --git a/INSTALL b/INSTALL index 7049a40..4057535 100644 --- a/INSTALL +++ b/INSTALL @@ -149,17 +149,13 @@ Options for configure --enable-debug Enable debugging support. ---enable-masquerade[='draft_from username_extension'] +--enable-masquerade[='username_extension'] If this option is disabled, the mts.conf file will contain the line "masquerade: " (with no value), which may be manually edited later. You may find it convenient to specify a value at configure-time, however, so that each time mmh is reinstalled, the right value will be there. By default, it is enabled. - The above usage shows the default, with all two masquerade - options being specified. Any subset of the two may be - specified. - See the mh-tailor(5) man page for full documentation of "masquerade:". --enable-mhe (DEFAULT) diff --git a/configure.ac b/configure.ac index e132f1f..8b23986 100644 --- a/configure.ac +++ b/configure.ac @@ -47,13 +47,13 @@ fi dnl Allow users to send email from addresses other than their default? AC_ARG_ENABLE(masquerade, - AS_HELP_STRING([--enable-masquerade='draft_from username_extension'], + AS_HELP_STRING([--enable-masquerade='username_extension'], [enable up to 3 types of address masquerading]), [if test x"$enable_masquerade" = x"yes"; then - masquerade="draft_from username_extension" + masquerade="username_extension" else masquerade="$enable_masquerade" - fi], [masquerade="draft_from username_extension"]) + fi], [masquerade="username_extension"]) AC_SUBST(masquerade)dnl dnl Do you want mhe support? diff --git a/etc/mts.conf.in b/etc/mts.conf.in index d4d4a0a..725a76b 100644 --- a/etc/mts.conf.in +++ b/etc/mts.conf.in @@ -6,5 +6,5 @@ # # The following directive allows email address masquerading. The string -# "draft_from username_extension" will allow all three types. +# "username_extension" is the default. masquerade: %masquerade% diff --git a/man/mh-tailor.man5 b/man/mh-tailor.man5 index e4c2d1e..5918714 100644 --- a/man/mh-tailor.man5 +++ b/man/mh-tailor.man5 @@ -33,13 +33,10 @@ local copy of .PP .BR masquerade: .RS 5 -This directive controls two different types of email address masquerading. -The two possible values, which may be specified in any combination on the -line, separated by spaces, are \*(lqdraft_from\*(rq and -\*(lqusername_extension\*(rq. +This directive controls email address masquerading. +The possible value is \*(lqusername_extension\*(rq. .PP -\*(lqusername_extension\*(rq, when specified on the \*(lqmasquerade:\*(rq line, allows a second -type of username masquerading. If the user sets the +If specified and if the user sets the .B $USERNAME_EXTENSION environment variable, its value will be appended to the actual login name. For instance, if I am \*(lqdan@company.com\*(rq, and I set @@ -64,20 +61,12 @@ generating \*(lq[Resent\-]From:\*(rq lines and the SMTP envelope for instance, will not try to read from a maildrop file called \*(lqdan\-www\*(rq (to recall the earlier example). .PP -\*(lqdraft_from\*(rq controls the most powerful type of address masquerading. Normally, -when a user explicitly specifies a \*(lqFrom:\*(rq header in a draft, +In any case: +When a user explicitly specifies a \*(lqFrom:\*(rq header in a draft, .B nmh uses it rather than constructing its own. However, to discourage email forgery, the SMTP envelope \*(lqFrom:\*(rq and a \*(lqSender:\*(rq header are set to the user's real address. -When \*(lqdraft_from\*(rq is turned on, though, the envelope \*(lqFrom:\*(rq will use the -address specified in the draft, and there will be no \*(lqSender:\*(rq header. This is -useful when a user wants to pretend to be sending mail \*(lqdirectly\*(rq from a remote -POP3 account, or when remote mail robots incorrectly use the envelope \*(lqFrom:\*(rq in -preference to the body \*(lqFrom:\*(rq (or refuse to take action when the two don't -match). Note that the MTA may still reveal the user's real identity (e.g. -.BR sendmail 's -\*(lqX\-Authentication\-Warning:\*(rq header). .RE .PP .BR maildelivery : diff --git a/sbr/mts.c b/sbr/mts.c index 89ed1b6..313cbbc 100644 --- a/sbr/mts.c +++ b/sbr/mts.c @@ -42,7 +42,6 @@ static char username[BUFSIZ]; static char fullname[BUFSIZ]; /* Variables for username masquerading: */ -boolean draft_from_masquerading = FALSE; boolean username_extension_masquerading = FALSE; /* " from addrsbr.c */ static char* masquerade = ""; @@ -92,9 +91,6 @@ mts_init(char *name) fclose(fp); } - if (strstr(masquerade, "draft_from") != NULL) - draft_from_masquerading = TRUE; - if (strstr(masquerade, "username_extension") != NULL) username_extension_masquerading = TRUE; } diff --git a/uip/spost.c b/uip/spost.c index ee36a6f..8fc2f21 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -155,8 +155,6 @@ extern char *sendmail; extern char *getfullname(void); extern char *getusername(void); -extern boolean draft_from_masquerading; /* defined in mts.c */ - /* ** static prototypes */ @@ -555,13 +553,8 @@ finish_headers(FILE *out) } if (!(msgflags & MFRM)) { fprintf(out, "%sFrom: %s\n", resentstr, signature); - } else 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). - */ + } else { + /* Add a Sender: header in case the From: header is fake. */ fprintf(out, "%sSender: %s\n", resentstr, from); } #ifdef notdef @@ -724,13 +717,8 @@ make_bcc_file(void) if (!(msgflags & MFRM)) { /* Construct a From: header. */ fprintf(out, "From: %s\n", signature); - } else 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). - */ + } else { + /* Add a Sender: header in case the From: header is fake. */ fprintf(out, "Sender: %s\n", from); } if (subject)