Discussion:
MUTT_PERSONAL_RECIP exceptions based on From: field?
John A Hawkinson
2018-09-20 03:06:07 UTC
Permalink
As I was dusting off my mutt build tree, I found the below patch, which is almost certainly wrong, but which solves an important problem for me.

Unfortunately, more and more mailing lists (Mailchimp, &c.) these days have seen fit to put one's personal address in the To: field, making it more annoying. In most cases it's feasible to change the list subscription address such that that doesn't happen, but in some cases not.

It's really annoying when such messages appear in ~p (MUTT_PERSONAL_RECIP). I find myself regularly limiting to ~p !~s foobar, to exclude that list, which is not nice.

In the case of the most annoying of these lists (and whose subscription address I cannot change and I also do not wish to unsubscribe from), list messages are identified by a variable From: field matching a pattern, e.g.:
From: Foo Bar <forumREDACTED+d1234-***@domain.com>
(This particular list is from Vanilla Forums, I think.)

The below patch, when evaluating ~p, searches the From field against the unalternates list and excludes such messages from ~p. This is obviously wrong because unalternates is supposed to be about recipient (To:/Cc:) fields, not sender (From:) fields.

But I'm not sure what the right fix should be? Maybe it should involve "lists"/"subscribe" functionality, which are not something that I really use (I have some lists in my muttrc that date from ... last century. Some still get mail.) But I think that lists (e.g. MUTT_LIST, MUTT_SUBSCRIBED_LIST: ~l, ~u) have the same general problem as MUTT_PERSONAL_RECIP, namely they only look at h->env->to and h->env->cc but not, say, env->from-mailbox.

So, what's the right way to solve this annoying problem? Is it necessary to introduce a whole additional set of RX_LISTs for matching against From: fields for lists, subscribedlists, their un- variants, and unalternates (and maybe Alterates, too, but that's unlikely)? Or to add some kind of flag extending their language to apply them to sender fields? Or... I just don't know?

Thanks.

--***@mit.edu
John Hawkinson


--- hdrline.c.dist 2016-08-10 21:47:00.000000002 -0400
+++ hdrline.c 2016-08-30 23:09:42.000000002 -0400
@@ -185,6 +185,10 @@
h->recipient = 2; /* non-unique recipient */
else
h->recipient = 1; /* unique recipient */
+
+ if (mutt_match_rx_list(env->from->mailbox, UnAlternates)) {
+ h->recipient = 0;
+ }
}
else if (user_in_addr (env->cc))
h->recipient = 3;
Kevin J. McCarthy
2018-09-20 19:23:09 UTC
Permalink
Post by John A Hawkinson
Unfortunately, more and more mailing lists (Mailchimp, &c.) these days
have seen fit to put one's personal address in the To: field, making
it more annoying. In most cases it's feasible to change the list
subscription address such that that doesn't happen, but in some cases
not.
I think this kind of post should to go to mutt-users first. My
impression is of a pain point too specific to merit a patch to Mutt.

However, that list constitutes a much broader selection of users who may
have great ideas. A discussion there may find a solution for you, or
perhaps will illuminate a deficiency in Mutt that needs addressing.

Off the top of my head, I would suggest looking into address groups.
Maybe a group would be easier to use when limiting,
e.g. "~p !%f mylists"
--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
Loading...