Hello All, I tried to send the following message to mutt-users and mutt-dev, but I forgot to attach the patch and I did send it to the wrong mutt-users-address, so here is a retry ----- Forwarded message from Hans Bogaards <[EMAIL PROTECTED]> ----- Date: Thu, 21 Oct 1999 15:15:38 +0200 From: Hans Bogaards <[EMAIL PROTECTED]> To: [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Feature patch: patch-1.0.hb.save_alias.1 X-Mailer: Mutt 1.0pre4i Hello, I've been away for a while from mutt, but I received a request for my save_alias patch, so here it is. This version works on 0.95.x, 0.96.x and 1.0prex. I would like to know who of you do use this patch and if you would like some added or changed behaviour for this option, so if you use it, please send me a note. Just a reminder what this patch does: It adds the option save_alias, which changes the default save and fcc folders if you have an alias defined for the sender/receiver of the message. So if you have: alias joe John Doe <[EMAIL PROTECTED]> messages normally are saved (by default) in =213748823. If save_alias is set then messages are saved in =joe. To the developers, is there any change this patch will be incorparated in mutt-1.0? Or is there a feature-freeze? -- Doei Hans =========================+====================================== | Hans Bogaards | Pilate asked: What is Truth? | | email: [EMAIL PROTECTED] | And he nailed the answer | | | On the cross of Reality | ================================================================ ----- End forwarded message ----- -- Doei Hans =========================+====================================== | Hans Bogaards | Pilate asked: What is Truth? | | email: [EMAIL PROTECTED] | And he nailed the answer | | | On the cross of Reality | ================================================================
diff -uNr mutt-0.95.3/alias.c mutt-new/alias.c --- mutt-0.95.3/alias.c Thu Jan 7 10:14:39 1999 +++ mutt-new/alias.c Mon Feb 22 17:22:49 1999 @@ -272,7 +272,7 @@ * This routine looks to see if the user has an alias defined for the given * address. */ -ADDRESS *alias_reverse_lookup (ADDRESS *a) +ALIAS *alias_reverse_lookup (ADDRESS *a) { ALIAS *t = Aliases; ADDRESS *ap; @@ -287,7 +287,7 @@ { if (!ap->group && ap->mailbox && mutt_strcasecmp (ap->mailbox, a->mailbox) == 0) - return ap; + return t; } } return 0; diff -uNr mutt-0.95.3/doc/manual.sgml.in mutt-new/doc/manual.sgml.in --- mutt-0.95.3/doc/manual.sgml.in Thu Feb 11 13:41:53 1999 +++ mutt-new/doc/manual.sgml.in Mon Feb 22 17:22:50 1999 @@ -3841,6 +3841,18 @@ name="force_name"> is set too, the selection of the fcc folder will be changed as well. +<sect2>save_alias<label id="save_alias"> +<p> +Type: boolean<newline> +Default: unset + +If set, mutt will take the alias belonging to the sender, if it exists, +when choosing a default folder for saving a mail. If there isn't an alias +defined for the current sender the default folder is chosen as normal. +If <ref id="save_name" name="save_name"> or <ref id="force_name" +name="force_name"> is set too, the selection of the fcc folder +will be changed as well. + <sect2>save_empty<label id="save_empty"> <p> Type: boolean<newline> diff -uNr mutt-0.95.3/init.h mutt-new/init.h --- mutt-0.95.3/init.h Wed Feb 10 17:20:11 1999 +++ mutt-new/init.h Mon Feb 22 17:22:50 1999 @@ -241,6 +241,7 @@ { "reverse_alias", DT_BOOL, R_BOTH, OPTREVALIAS, 0 }, { "reverse_name", DT_BOOL, R_BOTH, OPTREVNAME, 0 }, { "save_address", DT_BOOL, R_NONE, OPTSAVEADDRESS, 0 }, + { "save_alias", DT_BOOL, R_NONE, OPTSAVEALIAS, 0 }, { "save_empty", DT_BOOL, R_NONE, OPTSAVEEMPTY, 1 }, { "save_name", DT_BOOL, R_NONE, OPTSAVENAME, 0 }, { "sendmail", DT_PATH, R_NONE, UL &Sendmail, UL SENDMAIL " -oem -oi" }, diff -uNr mutt-0.95.3/lib.c mutt-new/lib.c --- mutt-0.95.3/lib.c Wed Feb 10 22:54:01 1999 +++ mutt-new/lib.c Mon Feb 22 17:28:16 1999 @@ -842,8 +842,19 @@ void mutt_save_path (char *d, size_t dsize, ADDRESS *a) { + ALIAS *ali; + if (a && a->mailbox) { + if (option (OPTSAVEALIAS)) + ali = alias_reverse_lookup(a); + else + ali = 0; + + if (ali) + strfcpy (d, ali->name, dsize); + else + { strfcpy (d, a->mailbox, dsize); if (!option (OPTSAVEADDRESS)) { @@ -851,6 +862,7 @@ if ((p = strpbrk (d, "%@"))) *p = 0; + } } mutt_strlower (d); } diff -uNr mutt-0.95.3/mutt.h mutt-new/mutt.h --- mutt-0.95.3/mutt.h Wed Feb 10 17:20:22 1999 +++ mutt-new/mutt.h Mon Feb 22 17:22:51 1999 @@ -323,6 +323,7 @@ OPTREVALIAS, OPTREVNAME, OPTSAVEADDRESS, + OPTSAVEALIAS, OPTSAVEEMPTY, OPTSAVENAME, OPTSIGDASHES, diff -uNr mutt-0.95.3/protos.h mutt-new/protos.h --- mutt-0.95.3/protos.h Wed Feb 10 22:47:26 1999 +++ mutt-new/protos.h Mon Feb 22 17:22:51 1999 @@ -299,7 +299,7 @@ int safe_symlink (const char *, const char *); FILE *safe_fopen (const char *, const char *); -ADDRESS *alias_reverse_lookup (ADDRESS *); +ALIAS *alias_reverse_lookup (ADDRESS *); #define strfcpy(A,B,C) strncpy(A,B,C), *(A+(C)-1)=0 diff -uNr mutt-0.95.3/sort.c mutt-new/sort.c --- mutt-0.95.3/sort.c Wed Feb 10 00:53:40 1999 +++ mutt-new/sort.c Mon Feb 22 17:27:16 1999 @@ -85,12 +85,12 @@ char *mutt_get_name (ADDRESS *a) { - ADDRESS *ali; + ALIAS *ali; if (a) { - if (option (OPTREVALIAS) && (ali = alias_reverse_lookup (a)) && ali->personal) - return ali->personal; + if (option (OPTREVALIAS) && (ali = alias_reverse_lookup (a)) && +ali->addr->personal) + return ali->addr->personal; else if (a->personal) return a->personal; else if (a->mailbox)