]> granicus.if.org Git - mutt/commitdiff
Unify alias expansion.
authorThomas Roessler <roessler@does-not-exist.org>
Sat, 4 Mar 2000 08:40:52 +0000 (08:40 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Sat, 4 Mar 2000 08:40:52 +0000 (08:40 +0000)
alias.c
headers.c
protos.h
send.c

diff --git a/alias.c b/alias.c
index a860696e8f4f982e522a85f04b4d17843711e01a..a5199d9ef58746309e3ec663b23ce9d243c7bfe1 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -139,6 +139,17 @@ ADDRESS *mutt_expand_aliases (ADDRESS *a)
   return (t);
 }
 
+void mutt_expand_aliases_env (ENVELOPE *env)
+{
+  env->from = mutt_expand_aliases (env->from);
+  env->to = mutt_expand_aliases (env->to);
+  env->cc = mutt_expand_aliases (env->cc);
+  env->bcc = mutt_expand_aliases (env->bcc);
+  env->reply_to = mutt_expand_aliases (env->reply_to);
+  env->mail_followup_to = mutt_expand_aliases (env->mail_followup_to);
+}
+
+
 /* 
  * if someone has an address like
  *     From: Michael `/bin/rm -f ~` Elkins <me@cs.hmc.edu>
index 843b3bba20e8d9cd5f4641ad9122cc949ae6c252..38542d79ceeff357763158ffacbf766aca6c7a5f 100644 (file)
--- a/headers.c
+++ b/headers.c
@@ -101,13 +101,8 @@ void mutt_edit_headers (const char *editor,
   mutt_free_envelope (&msg->env);
   msg->env = n;
 
-  msg->env->from = mutt_expand_aliases (msg->env->from);
-  msg->env->to = mutt_expand_aliases (msg->env->to);
-  msg->env->cc = mutt_expand_aliases (msg->env->cc);
-  msg->env->bcc = mutt_expand_aliases (msg->env->bcc);
-  msg->env->reply_to = mutt_expand_aliases (msg->env->reply_to);
-  msg->env->mail_followup_to = mutt_expand_aliases (msg->env->mail_followup_to);
-
+  mutt_expand_aliases_env (msg->env);
+  
   /* search through the user defined headers added to see if either a 
    * fcc: or attach-file: field was specified.  
    */
index b7380b97d121cb835413a8a21cb969ff55a734ee..540f68baef8ed9d8a2edca70877f98d1f9cb6078 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -144,6 +144,7 @@ void mutt_edit_file (const char *, const char *);
 void mutt_edit_headers (const char *, const char *, HEADER *, char *, size_t);
 void mutt_curses_error (const char *, ...);
 void mutt_enter_command (void);
+void mutt_expand_aliases_env (ENVELOPE *);
 void mutt_expand_file_fmt (char *, size_t, const char *, const char *);
 void mutt_expand_fmt (char *, size_t, const char *, const char *);
 void mutt_expand_link (char *, const char *, const char *);
diff --git a/send.c b/send.c
index b2de64c15bebf1823a3f77696055f0c0a3d20888..0b899cf32fb76f8a1064b457391af4e4e19ae6dc 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1042,9 +1042,7 @@ ci_send_message (int flags,               /* send mode */
 
   if (msg)
   {
-    msg->env->to = mutt_expand_aliases (msg->env->to);
-    msg->env->cc = mutt_expand_aliases (msg->env->cc);
-    msg->env->bcc = mutt_expand_aliases (msg->env->bcc);
+    mutt_expand_aliases_env (msg->env);
   }
   else
   {