/* Variables for username masquerading: */
boolean draft_from_masquerading = FALSE; /* also used from post.c */
static boolean mmailid_masquerading = FALSE;
-static boolean username_extension_masquerading = FALSE;
+ boolean username_extension_masquerading = FALSE; /* " from addrsbr.c */
static char* masquerade = "";
-
/*
* MTS specific variables
*/
-#if defined(SENDMTS) || defined(SMTPMTS)
+#if defined(SMTPMTS)
+static char *sm_method = "smtp";
+int sm_mts = MTS_SMTP;
char *hostable = nmhetcdir(/hosts);
char *sendmail = SENDMAILPATH;
#endif
{ "mmdelim2", &mmdlm2 },
{ "masquerade", &masquerade },
-#if defined(SENDMTS) || defined(SMTPMTS)
- { "hostable", &hostable },
-#endif
-
-#ifdef SENDMTS
- { "sendmail", &sendmail },
+#if defined(SMTPMTS)
+ { "mts", &sm_method },
+ { "hostable", &hostable },
+ { "sendmail", &sendmail },
#endif
{ "clientname", &clientname },
if (strstr(masquerade, "username_extension") != NULL)
username_extension_masquerading = TRUE;
+
+#ifdef SMTPMTS
+ if (strcmp(sm_method, "smtp") == 0)
+ sm_mts = MTS_SMTP;
+ else if (strcmp(sm_method, "sendmail") == 0)
+ sm_mts = MTS_SENDMAIL;
+ else {
+ advise(NULL, "unsupported \"mts\" value in mts.conf: %s", sm_method);
+ sm_mts = MTS_SMTP;
+ }
+#endif
}
if (!mmailid_masquerading || *np == '\0')
strncpy (username, pw->pw_name, sizeof(username));
- if (username_extension_masquerading) {
- char* username_extension = getenv("USERNAME_EXTENSION");
-
- 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
your real name. */
if ((cp = getenv ("SIGNATURE")) && *cp)