Changed the new "plussed_user" option to mts.conf's "masquerade:" to
authorDan Harkless <dan@harkless.org>
Sat, 4 Mar 2000 00:02:46 +0000 (00:02 +0000)
committerDan Harkless <dan@harkless.org>
Sat, 4 Mar 2000 00:02:46 +0000 (00:02 +0000)
"username_extension" after getting feedback from qmail users, who use '-' as a
separator rather than '+'.  Removed checking of $USERPLUS variable.  Now check
$USERNAME_EXTENSION, which needs to include the appropriate separator for your
MTA ('-', '+', or whatever) as its first character.

ChangeLog
etc/mts.conf.in
man/mh-tailor.man
man/post.man
zotnet/mts/mts.c

index deb6163..9a29c0f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Fri Mar 03 16:07:33 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
+
+       * Changed the new "plussed_user" option to mts.conf's
+       "masquerade:" to "username_extension" after getting feedback from
+       qmail users, who use '-' as a separator rather than '+'.  Removed
+       checking of $USERPLUS variable.  Now check $USERNAME_EXTENSION,
+       which needs to include the appropriate separator for your MTA
+       ('-', '+', or whatever) as its first character.
+               
 Thu Mar 02 23:04:30 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
 
        * Added a new "boolean" type to mh.h and TRUE and FALSE constants.
 Thu Mar 02 23:04:30 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
 
        * Added a new "boolean" type to mh.h and TRUE and FALSE constants.
index 6f1af4f..4151d65 100644 (file)
@@ -15,7 +15,7 @@ hostable: %etcdir%/hosts
 
 # Uncomment the following line to allow username masquerading.  Any or all of
 # the three types of masquerading may be used (see mh-tailor(5) for details).
 
 # Uncomment the following line to allow username masquerading.  Any or all of
 # the three types of masquerading may be used (see mh-tailor(5) for details).
-#masquerade: draft_from mmailid plussed_user
+#masquerade: draft_from mmailid username_extension
 
 # Default location of mail drops.  If this option is
 # set, but empty, the user's home directory is used.
 
 # Default location of mail drops.  If this option is
 # set, but empty, the user's home directory is used.
index ff767b0..53c0875 100644 (file)
@@ -103,7 +103,8 @@ masquerade:
 .br
 This directive controls three different types of email address masquerading.
 The three possible values, which may be specified in any combination on the
 .br
 This directive controls three different types of email address masquerading.
 The three possible values, which may be specified in any combination on the
-line, are "draft_from", "mmailid", and "plussed_user".
+line, separated by spaces, are "draft_from", "mmailid", and
+"username_extension".
 
 "mmailid" was the only type of masquerading in the original MH package, and
 apparently stands for "masquerade mail identification".  This type of
 
 "mmailid" was the only type of masquerading in the original MH package, and
 apparently stands for "masquerade mail identification".  This type of
@@ -124,16 +125,18 @@ the case, the GECOS field for each user should look like:
 .ti +.5i
 First [Middle] Last <First.Last>
 
 .ti +.5i
 First [Middle] Last <First.Last>
 
-"plussed_user", when specified on the "masquerade:" line, allows a second type
-of username masquerading.  If the user sets the \fB$USERPLUS\fR environment
-variable, its value will be tacked onto the actual login name, following a '+'
-sign.  For instance, if I am dan@company.com, and I set \fB$USERPLUS\fR to
-"www", my mail will appear to come from "dan+www@company.com".  This feature is
-meant to interact with MTA features like the one in sendmail that automatically
-delivers all mail sent to \fIuser\fR+\fIstring\fR to \fIuser\fR.  One can use
-different email addresses in different situations (to aid in automatic mail
-filtering or in determining where spammers got your address) while only actually
-having a single account.
+"username_extension", when specified on the "masquerade:" line, allows a second
+type of username masquerading.  If the user sets the \fB$USERNAME_EXTENSION\fR
+environment variable, its value will be appended to the actual login name.  For
+instance, if I am dan@company.com, and I set \fB$USERNAME_EXTENSION\fR to
+"\-www", my mail will appear to come from "dan\-www@company.com".  This is meant
+to interact with qmail's "user\-extension" feature, where mail sent to
+\fIuser\fR\-\fIstring\fR will be delivered to \fIuser\fR.  Likewise, those using
+versions of sendmail for which "plussed user" processing is active can set
+\fB$USERNAME_EXTENSION\fR to "+\fIstring\fR".  These MTA features are useful
+because they allow one to use different email addresses in different situations
+(to aid in automatic mail filtering or in determining where spammers got one's
+address) while only actually having a single account.
 
 "draft_from" controls the most powerful type of address masquerading.  Normally,
 when a user explicitly specifies a "From:" header in a draft, \fInmh\fR uses it
 
 "draft_from" controls the most powerful type of address masquerading.  Normally,
 when a user explicitly specifies a "From:" header in a draft, \fInmh\fR uses it
@@ -144,8 +147,8 @@ address specified in the draft, and there will be no "Sender:" header.  This is
 useful when a user wants to pretend to be sending mail "directly" from a remote
 POP3 account, or when remote mail robots incorrectly use the envelope "From:" in
 preference to the body "From:" (or refuse to take action when the two don't
 useful when a user wants to pretend to be sending mail "directly" from a remote
 POP3 account, or when remote mail robots incorrectly use the envelope "From:" in
 preference to the body "From:" (or refuse to take action when the two don't
-match).  Note that your MTA may still reveal the user's real identity (e.g.
-sendmail's "X-Authentication-Warning:" header).
+match).  Note that the MTA may still reveal the user's real identity (e.g.
+sendmail's "X\-Authentication\-Warning:" header).
 
 .ti -.5i
 maildelivery: %libdir%/maildelivery
 
 .ti -.5i
 maildelivery: %libdir%/maildelivery
index c344043..4526177 100644 (file)
@@ -75,13 +75,13 @@ delivery).
 
 Under normal circumstances, \fIpost\fR constructs the "From:" line of the
 message from the user's login name, the full name from the GECOS field of the
 
 Under normal circumstances, \fIpost\fR constructs the "From:" line of the
 message from the user's login name, the full name from the GECOS field of the
-passwd file, and the fully-qualified name of the local machine (or the value of
+passwd file, and the fully\-qualified name of the local machine (or the value of
 "localname" in mts.conf, if set).  An example is "From: Dan Harkless
 <dan@machine.company.com>".  There are four ways to override these values,
 "localname" in mts.conf, if set).  An example is "From: Dan Harkless
 <dan@machine.company.com>".  There are four ways to override these values,
-however.  Note that they apply equally to "Resent-From:" lines in messages sent
+however.  Note that they apply equally to "Resent\-From:" lines in messages sent
 with \fIdist\fR.
 
 with \fIdist\fR.
 
-The first way is GECOS-based username masquerading.  If the "masquerade:" line
+The first way is GECOS\-based username masquerading.  If the "masquerade:" line
 in mts.conf contains "mmailid", this processing is activated.  If a user's GECOS
 field in the passwd file is of the form "Full Name <fakename>" then "fakename"
 will be used in place of the real username.  For instance, a GECOS field of "Dan
 in mts.conf contains "mmailid", this processing is activated.  If a user's GECOS
 field in the passwd file is of the form "Full Name <fakename>" then "fakename"
 will be used in place of the real username.  For instance, a GECOS field of "Dan
@@ -92,16 +92,18 @@ instance, "Dan.Harkless" to "dan".
 
 The second way to override default construction of "From:" is to set the
 \fB$SIGNATURE\fR environment variable.  This variable overrides the full name
 
 The second way to override default construction of "From:" is to set the
 \fB$SIGNATURE\fR environment variable.  This variable overrides the full name
-from the GECOS field, even if GECOS-based masquerading is being done.  This
+from the GECOS field, even if GECOS\-based masquerading is being done.  This
 processing is always active, and does not need to be enabled from mts.conf.
 
 processing is always active, and does not need to be enabled from mts.conf.
 
-The third way is controlled by the "plussed_user" value of "masquerade:" line of
-mts.conf.  When that's turned on, setting the $USERPLUS environment variable
-will result in its value being tacked onto the user's login name, following 
-a '+' sign.  For instance, if I set $USERPLUS to "www", my "From:" line will
-contain "Dan Harkless <dan+www@machine.company.com>" (or "Dan.Harkless+www" if
-I'm using mmailid masquerading as well).  Recent versions of sendmail
-automatically deliver all mail sent to \fIuser\fR+\fIstring\fR to \fIuser\fR.
+The third way is controlled by the "user_extension" value of "masquerade:" line
+of mts.conf.  When that's turned on, setting the \fB$USERNAME_EXTENSION\fR
+environment variable will result in its value being appended the user's login
+name.  For instance, if I set \fB$USERNAME_EXTENSION\fR to "+www", my "From:"
+line will contain "Dan Harkless <dan+www@machine.company.com>" (or
+"Dan.Harkless+www" if I'm using mmailid masquerading as well).  Recent versions
+of sendmail automatically deliver all mail sent to \fIuser\fR+\fIstring\fR to
+\fIuser\fR.  qmail has a similar feature which uses '\-' as the delimiter by
+default, but can use other characters as well.
 
 The fourth method of address masquerading is to specify a "From:" line manually
 in the message draft.  It will be used as provided (after alias substitution),
 
 The fourth method of address masquerading is to specify a "From:" line manually
 in the message draft.  It will be used as provided (after alias substitution),
@@ -112,7 +114,7 @@ will use the address given in the draft "From:", and there will be no "Sender:"
 header.  This is useful in pretending to send mail "directly" from a remote POP3
 account, or when remote email robots give improper precedence to the envelope
 "From:".  Note that your MTA may still reveal your real identity (e.g.
 header.  This is useful in pretending to send mail "directly" from a remote POP3
 account, or when remote email robots give improper precedence to the envelope
 "From:".  Note that your MTA may still reveal your real identity (e.g.
-sendmail's "X-Authentication-Warning:" header). 
+sendmail's "X\-Authentication\-Warning:" header). 
 
 .Fi
 ^%etcdir%/mts.conf~^nmh mts configuration file
 
 .Fi
 ^%etcdir%/mts.conf~^nmh mts configuration file
index 0951c4c..9194404 100644 (file)
@@ -63,7 +63,7 @@ static char fullname[BUFSIZ];
 /* Variables for username masquerading: */
        boolean  draft_from_masquerading = FALSE;  /* also used from post.c */
 static boolean  mmailid_masquerading = FALSE;
 /* Variables for username masquerading: */
        boolean  draft_from_masquerading = FALSE;  /* also used from post.c */
 static boolean  mmailid_masquerading = FALSE;
-static boolean  plussed_user_masquerading = FALSE;
+static boolean  username_extension_masquerading = FALSE;
 static char*    masquerade = "";
 
 
 static char*    masquerade = "";
 
 
@@ -207,8 +207,8 @@ mts_init (char *name)
     if (strstr(masquerade, "mmailid") != NULL)
        mmailid_masquerading = TRUE;
 
     if (strstr(masquerade, "mmailid") != NULL)
        mmailid_masquerading = TRUE;
 
-    if (strstr(masquerade, "plussed_user") != NULL)
-       plussed_user_masquerading = TRUE;
+    if (strstr(masquerade, "username_extension") != NULL)
+       username_extension_masquerading = TRUE;
 }
 
 
 }
 
 
@@ -496,15 +496,16 @@ getuserinfo (void)
     if (!mmailid_masquerading || *np == '\0')
        strncpy (username, pw->pw_name, sizeof(username));
 
     if (!mmailid_masquerading || *np == '\0')
        strncpy (username, pw->pw_name, sizeof(username));
 
-    if (plussed_user_masquerading) {
-       /* Tack on '+' and $USERPLUS environment variable to actual username.
-          Presumably the local MTA (e.g. sendmail) has been set up to deliver
-          all mail sent to <user>+<string> to <user>. */
-       char*  plussed_user_addon = getenv("USERPLUS");
+    if (username_extension_masquerading) {
+       char*  username_extension = getenv("USERNAME_EXTENSION");
 
 
-       if (plussed_user_addon != NULL && *plussed_user_addon != '\0') 
-           snprintf(username, sizeof(username), "%s+%s",
-                    username, plussed_user_addon);
+       if (username_extension != NULL && *username_extension != '\0')
+           /* $USERNAME_EXTENSION environment variable has been set, so tack on
+              its value to the actual username.  This is meant to interact with
+              qmail's "user-extension" feature and sendmail's "plussed user"
+              feature. */
+           snprintf(username, sizeof(username), "%s%s",
+                    username, username_extension);
     }
 
     /* The $SIGNATURE environment variable overrides the GECOS field's idea of
     }
 
     /* The $SIGNATURE environment variable overrides the GECOS field's idea of