+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.
# 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.
.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
.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
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
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,
-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.
-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
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.
-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),
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
/* 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 = "";
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;
}
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