Re: Is it possible to use send-hook to 'edit' a header

2020-11-25 Thread ಚಿರಾಗ್ ನಟರಾಜ್
For a more generic solution that I just setup in my config file:

1. Use the following send-hook: send-hook ~l "set from='Name 
'"
2. Declare all of the mailing lists to be caught by the ~l parameter using 
lists: lists mutt-users@mutt.org gnupg-us...@gnupg.org

Now, whenever I reply to a mailing list, my From address is set using the 
send-hook. Of course, this is only desirable if, in fact, you want the same 
hook run for all mailing lists (my case). Otherwise, you can use my previous 
solution, which uses the ~t limiter to specify the pattern of To 
addresses that the send-hook should be run on.

Also, running this based on the To header (rather than the From header) is 
better because if you use the list-reply function (bound to L in the index by 
default), then you _know_ what the To address will be (the mailing address of 
the list) (remember, this is the To address of the email you're _sending_). The 
slight downside is that you might need a from-address-based pattern if you 
regularly reply to individuals who sent the email (rather than sending the 
email to the mailing list), since this type of pattern won't catch that. In 
that case, simply change it to ~f, but keep in mind that it's the From 
address _of the email you're sending_, *not* of the received email (the one 
you're replying to).

HTH!

- Chiraag
-- 
ಚಿರಾಗ್ ನಟರಾಜ್
Pronouns: he/him/his

25/11/20 13:46 ನಲ್ಲಿ, ಚಿರಾಗ್ ನಟರಾಜ್  ಬರೆದರು:
> The way I did it for this list is:
> 
> send-hook ~tmutt-us...@mutt.org "set from='ಚಿರಾಗ್ ನಟರಾಜ್ 
> '"
> 
> You should be able to edit the mutt-users@mutt.org to be *@groups.io or 
> something (you may have to escape the asterisk?) and then use set from='Name 
> ' as the command to run.
> 
> HTH!
> 
> - Chiraag
> -- 
> ಚಿರಾಗ್ ನಟರಾಜ್
> Pronouns: he/him/his
> 
> 25/11/20 09:26 ನಲ್ಲಿ, Chris Green  ಬರೆದರು:
> > 
> > Is there some sort of action/command I can run from send-hook that
> > would allow 'editing' of a header?
> > 
> > E.g. for the case I was recently enquiring about where groups.io munge
> > certain senders' addresses the requirement would be to have a
> > send-hook match on "via groups.io" in the From:  header and would then
> > change  to .
> > 
> > It's a fairly easy sort of search/replace but I can't see any obvious
> > way to implement it in mutt.
> > 
> > It can be done for specific From: addresses by matching the address
> > with a send-hook and using my_hdr to write a new From: (will that
> > remove the orginal From: ?).  However this would require a send-hook
> > for every individual address.
> > 
> > --
> > Chris Green





publickey - mailinglist@chiraag.me - b0c8d720.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Is it possible to use send-hook to 'edit' a header

2020-11-25 Thread ಚಿರಾಗ್ ನಟರಾಜ್
The way I did it for this list is:

send-hook ~tmutt-us...@mutt.org "set from='ಚಿರಾಗ್ ನಟರಾಜ್ 
'"

You should be able to edit the mutt-users@mutt.org to be *@groups.io or 
something (you may have to escape the asterisk?) and then use set from='Name 
' as the command to run.

HTH!

- Chiraag
-- 
ಚಿರಾಗ್ ನಟರಾಜ್
Pronouns: he/him/his

25/11/20 09:26 ನಲ್ಲಿ, Chris Green  ಬರೆದರು:
> 
> Is there some sort of action/command I can run from send-hook that
> would allow 'editing' of a header?
> 
> E.g. for the case I was recently enquiring about where groups.io munge
> certain senders' addresses the requirement would be to have a
> send-hook match on "via groups.io" in the From:  header and would then
> change  to .
> 
> It's a fairly easy sort of search/replace but I can't see any obvious
> way to implement it in mutt.
> 
> It can be done for specific From: addresses by matching the address
> with a send-hook and using my_hdr to write a new From: (will that
> remove the orginal From: ?).  However this would require a send-hook
> for every individual address.
> 
> --
> Chris Green


publickey - mailinglist@chiraag.me - b0c8d720.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Is it possible to use send-hook to 'edit' a header

2020-11-25 Thread Chris Green
Is there some sort of action/command I can run from send-hook that
would allow 'editing' of a header?

E.g. for the case I was recently enquiring about where groups.io munge
certain senders' addresses the requirement would be to have a
send-hook match on "via groups.io" in the From:  header and would then
change  to .

It's a fairly easy sort of search/replace but I can't see any obvious
way to implement it in mutt.

It can be done for specific From: addresses by matching the address
with a send-hook and using my_hdr to write a new From: (will that
remove the orginal From: ?).  However this would require a send-hook
for every individual address.

-- 
Chris Green