Date: Wed, 25 May 2005 19:17:55 +0200 From: Ed Schouten <ed@fxq.nl> To: FreeBSD Ports <ports@freebsd.org> Subject: mail/mutt-devel: add reverse_reply patch Message-ID: <20050525171755.GA98538@hoeg.nl>
next in thread | raw e-mail | index | archive | help
--O5XBE6gyVG5Rl6Rj Content-Type: multipart/mixed; boundary="YZ5djTAD1cGYuMQK" Content-Disposition: inline --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, Today I was wondering if it was possible to let Mutt reverse-resolve the names from your aliases file when replying on an email (comes in handy if someone has set his name wrong or if they don't specify names with their addresses). I found this patch on the internet: http://www.df7cb.de/projects/mutt/reverse_reply/patch-1.5.6.cb.reverse_repl= y.2 I patched it to 1.5.9 (which is in the ports tree at the moment) and it seems to work fine. I've patched the FreeBSD port so you can build Mutt with WITH_MUTT_REVERSE_REPLY_PATCH to build it with the patchset. The diff file is attached with this message. Yours sincerely, --=20 Ed Schouten <ed@fxq.nl> --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mutt-reverse_reply.patch" Content-Transfer-Encoding: quoted-printable diff -ur --new-file ports/mail/mutt-devel.orig/Makefile ports/mail/mutt-dev= el/Makefile --- ports/mail/mutt-devel.orig/Makefile Wed May 25 19:03:42 2005 +++ ports/mail/mutt-devel/Makefile Wed May 25 19:08:32 2005 @@ -93,6 +93,9 @@ # If you do not want mutt to use the flock() function define: # WITHOUT_MUTT_FLOCK # +# If you want to enable reverse_reply option define: +# WITH_MUTT_REVERSE_REPLY_PATCH +# =20 PORTNAME=3D mutt-devel PORTVERSION=3D 1.5.9 @@ -307,6 +310,11 @@ .if defined(WITH_MUTT_ASPELL) pre-configure:: @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-aspell +.endif + +.if defined(WITH_MUTT_REVERSE_REPLY_PATCH) +pre-configure:: + @${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-reverse_reply .endif =20 .if defined(WITHOUT_MUTT_FLOCK) diff -ur --new-file ports/mail/mutt-devel.orig/files/extra-patch-reverse_re= ply ports/mail/mutt-devel/files/extra-patch-reverse_reply --- ports/mail/mutt-devel.orig/files/extra-patch-reverse_reply Thu Jan 1 0= 1:00:00 1970 +++ ports/mail/mutt-devel/files/extra-patch-reverse_reply Wed May 25 19:09:= 13 2005 @@ -0,0 +1,87 @@ +--- init.h.orig 2005-03-01 16:56:02.000000000 +0100 ++++ init.h 2005-05-25 18:20:57.000000000 +0200 +@@ -2257,6 +2257,13 @@ + ** possibly including eventual real names. When it is unset, mutt will + ** override any such real names with the setting of the $realname varia= ble. + */ ++ { "reverse_reply", DT_BOOL, R_NONE, OPTREVREPLY, 0 }, ++ /* ++ ** .pp ++ ** When set, this variable uses the name from your aliases in the To an= d Cc ++ ** headers of reply mails you send, like $reverse_alias does in the ind= ex. ++ ** When unset, the headers taken from the original mail are left unchan= ged. ++ */ + { "rfc2047_parameters", DT_BOOL, R_NONE, OPTRFC2047PARAMS, 0 }, + /* + ** .pp +--- mutt.h.orig 2005-02-28 16:13:57.000000000 +0100 ++++ mutt.h 2005-05-25 18:20:57.000000000 +0200 +@@ -410,6 +410,7 @@ + OPTREVALIAS, + OPTREVNAME, + OPTREVREAL, ++ OPTREVREPLY, + OPTRFC2047PARAMS, + OPTSAVEADDRESS, + OPTSAVEEMPTY, +--- protos.h.orig 2005-02-01 09:59:02.000000000 +0100 ++++ protos.h 2005-05-25 18:20:57.000000000 +0200 +@@ -84,6 +84,7 @@ + ADDRESS *mutt_get_address (ENVELOPE *, char **); + ADDRESS *mutt_lookup_alias (const char *s); + ADDRESS *mutt_remove_duplicates (ADDRESS *); ++ADDRESS *mutt_reverse_address (ADDRESS *); + ADDRESS *mutt_expand_aliases (ADDRESS *); + ADDRESS *mutt_parse_adrlist (ADDRESS *, const char *); +=20 +--- send.c.orig 2005-02-03 19:47:53.000000000 +0100 ++++ send.c 2005-05-25 18:20:57.000000000 +0200 +@@ -588,6 +588,10 @@ + /* the CC field can get cluttered, especially with lists */ + env->to =3D mutt_remove_duplicates (env->to); + env->cc =3D mutt_remove_duplicates (env->cc); ++ if (option (OPTREVREPLY)){ ++ env->to =3D mutt_reverse_address (env->to); ++ env->cc =3D mutt_reverse_address (env->cc); ++ } + env->cc =3D mutt_remove_xrefs (env->to, env->cc); + } +=20 +--- sendlib.c.orig 2005-02-21 05:45:57.000000000 +0100 ++++ sendlib.c 2005-05-25 18:20:57.000000000 +0200 +@@ -2341,6 +2341,35 @@ + } + } +=20 ++/* given a list of addresses, return a list of reverse_alias'ed addresses= */ ++ADDRESS *mutt_reverse_address (ADDRESS *addr) ++{ ++ ADDRESS *top,*tmp,*alias; ++ ++ if (addr =3D=3D NULL) ++ return NULL; ++ ++ if ((alias =3D alias_reverse_lookup (addr)) && alias->personal) { ++ tmp =3D rfc822_cpy_adr_real(alias); ++ tmp->next =3D addr->next; ++ addr->next =3D NULL; ++ rfc822_free_address(&addr); ++ addr =3D tmp; ++ } ++ ++ for (top =3D addr; top->next !=3D NULL; top =3D tmp) { ++ tmp =3D top->next; ++ if ((alias =3D alias_reverse_lookup (tmp)) && alias->personal) { ++ top->next =3D rfc822_cpy_adr_real(alias); ++ top->next->next =3D tmp->next; ++ tmp->next =3D NULL; ++ rfc822_free_address(&tmp); ++ tmp =3D top->next; ++ } ++ } ++ return addr; ++} ++ + int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int= post, char *fcc) + { + CONTEXT f; --YZ5djTAD1cGYuMQK-- --O5XBE6gyVG5Rl6Rj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFClLNDmVI4SHXwmhERApWEAKCIYM0Kje/2DkKiaPIHO4VFvSZKqQCfVOpj I2lswARhUKsNHLEI1xSIY0o= =I8EK -----END PGP SIGNATURE----- --O5XBE6gyVG5Rl6Rj--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050525171755.GA98538>