summaryrefslogtreecommitdiffstats
path: root/send.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-06-09 12:01:26 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-06-09 12:01:26 +0000
commit31e5bcf1c77f2764278d703bb7efc1e389917523 (patch)
tree083d0f36359a617c24b23f91d9f246b0c6f220b0 /send.c
parent9b47f0be31e3ca3c48146893048efefdb22aaf75 (diff)
Give reverse_name precedence over my_hdr From:
Diffstat (limited to 'send.c')
-rw-r--r--send.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/send.c b/send.c
index 0d7f5866..c3ef6749 100644
--- a/send.c
+++ b/send.c
@@ -266,13 +266,7 @@ static void process_user_header (ENVELOPE *env)
for (; uh; uh = uh->next)
{
- if (mutt_strncasecmp ("from:", uh->data, 5) == 0)
- {
- /* User has specified a default From: address. Remove default address */
- rfc822_free_address (&env->from);
- env->from = rfc822_parse_adrlist (env->from, uh->data + 5);
- }
- else if (mutt_strncasecmp ("reply-to:", uh->data, 9) == 0)
+ if (mutt_strncasecmp ("reply-to:", uh->data, 9) == 0)
{
rfc822_free_address (&env->reply_to);
env->reply_to = rfc822_parse_adrlist (env->reply_to, uh->data + 9);
@@ -280,7 +274,8 @@ static void process_user_header (ENVELOPE *env)
else if (mutt_strncasecmp ("to:", uh->data, 3) != 0 &&
mutt_strncasecmp ("cc:", uh->data, 3) != 0 &&
mutt_strncasecmp ("bcc:", uh->data, 4) != 0 &&
- mutt_strncasecmp ("subject:", uh->data, 8) != 0)
+ mutt_strncasecmp ("subject:", uh->data, 8) != 0 &&
+ mutt_strncasecmp ("from:", uh->data, 5) != 0)
{
if (last)
{
@@ -294,6 +289,21 @@ static void process_user_header (ENVELOPE *env)
}
}
+static void process_user_from (ENVELOPE *env)
+{
+ LIST *uh = UserHeader;
+
+ for (; uh; uh = uh->next)
+ {
+ if (mutt_strncasecmp ("from:", uh->data, 5) == 0)
+ {
+ rfc822_free_address (&env->from);
+ env->from = rfc822_parse_adrlist (env->from, uh->data + 5);
+ break;
+ }
+ }
+}
+
LIST *mutt_copy_list (LIST *p)
{
LIST *t, *r=NULL, *l=NULL;
@@ -982,6 +992,14 @@ ci_send_message (int flags, /* send mode */
msg->env->from = set_reverse_name (cur->env);
}
+ /*
+ * process a my_hdr From: at this point, and don't override
+ * reverse_name by it.
+ */
+
+ if (!msg->env->from && option (OPTHDRS) && !(flags & (SENDPOSTPONED | SENDEDITMSG)))
+ process_user_from (msg->env);
+
if (!msg->env->from && option (OPTUSEFROM) && !(flags & (SENDEDITMSG|SENDPOSTPONED)))
msg->env->from = mutt_default_from ();