X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=zotnet%2Fmts%2Fmts.c;h=7d9b718d108cf773777e901735660a64032868c1;hp=0951c4c8f31c50e336a1d4e0a0baa10578a849b3;hb=df7b16cb148474b3b80dbf1e226e858cf1e47edb;hpb=a81c28f4a2ee69469c5e9f5d65389a89c6070ed4 diff --git a/zotnet/mts/mts.c b/zotnet/mts/mts.c index 0951c4c..7d9b718 100644 --- a/zotnet/mts/mts.c +++ b/zotnet/mts/mts.c @@ -63,14 +63,15 @@ static char fullname[BUFSIZ]; /* 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; + 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 @@ -132,12 +133,10 @@ static struct bind binds[] = { { "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 }, @@ -207,8 +206,19 @@ mts_init (char *name) 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; + +#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 } @@ -496,17 +506,6 @@ getuserinfo (void) 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 + to . */ - char* plussed_user_addon = getenv("USERPLUS"); - - if (plussed_user_addon != NULL && *plussed_user_addon != '\0') - snprintf(username, sizeof(username), "%s+%s", - username, plussed_user_addon); - } - /* The $SIGNATURE environment variable overrides the GECOS field's idea of your real name. */ if ((cp = getenv ("SIGNATURE")) && *cp)