X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=alias.cpkg;h=7342c31cbf7cd1a9e56cc8878b6fa8351911bf49;hb=378ab81aa9abf4db714638c3e2e786e6cc58d2b1;hp=2efa1efb9065337f8fbd8c3477453b5c72600b87;hpb=68d92974c5785799ffb24f6577ae030594f91b29;p=apps%2Fmadmutt.git diff --git a/alias.cpkg b/alias.cpkg index 2efa1ef..7342c31 100644 --- a/alias.cpkg +++ b/alias.cpkg @@ -88,6 +88,21 @@ rx_t *SubscribedLists = NULL, *UnSubscribedLists = NULL; */ path_t record = NULL; + /* + ** .pp + ** This variable contains a default from address. It + ** can be overridden using my_hdr (including from send-hooks) and + ** ``$$reverse_name''. This variable is ignored if ``$$use_from'' + ** is unset. + ** .pp + ** E.g. you can use + ** \fTsend-hook Madmutt-devel@lists.berlios.de 'my_hdr From: Foo Bar '\fP + ** when replying to the Madmutt developer's mailing list and Madmutt takes this email address. + ** .pp + ** Defaults to the contents of the environment variable \fT$$$EMAIL\fP. + */ + address_t from = rfc822_parse_adrlist(NULL, NONULL(getenv("EMAIL"))); + void alternates(rx_t rx) { rx_list_remove(&UnAlternates, rx); rx_list_add(&Alternates, rx); @@ -192,11 +207,11 @@ int mutt_addr_is_user(address_t *addr) if (!addr->mailbox) return 0; - if (!ascii_strcasecmp(addr->mailbox, MCore.username) - || string_is_address(addr->mailbox, MCore.username, MCore.shorthost) - || string_is_address(addr->mailbox, MCore.username, mutt_fqdn(0)) - || string_is_address(addr->mailbox, MCore.username, mutt_fqdn(1)) - || (From && !ascii_strcasecmp(From->mailbox, addr->mailbox))) + if (!ascii_strcasecmp(addr->mailbox, mod_core.username) + || string_is_address(addr->mailbox, mod_core.username, mod_core.shorthost) + || string_is_address(addr->mailbox, mod_core.username, mutt_fqdn(0)) + || string_is_address(addr->mailbox, mod_core.username, mutt_fqdn(1)) + || (MAlias.from && !ascii_strcasecmp(MAlias.from->mailbox, addr->mailbox))) { return 1; } @@ -430,7 +445,7 @@ static address_t *mutt_expand_aliases_r(address_t *a, string_list_t **expn) if (pw) { char namebuf[STRING]; - mutt_gecos_name(namebuf, sizeof(namebuf), pw, MCore.gecos_mask); + mutt_gecos_name(namebuf, sizeof(namebuf), pw, mod_core.gecos_mask); m_strreplace(&pop->personal, namebuf); } } @@ -439,7 +454,7 @@ static address_t *mutt_expand_aliases_r(address_t *a, string_list_t **expn) last = address_list_append(last, pop); } - if (MCore.use_domain) { + if (mod_core.use_domain) { /* now qualify all local addresses */ rfc822_qualify(head, mutt_fqdn(1)); }