Changing existing headers?

22 views
Skip to first unread message

Hippo Man

unread,
Aug 14, 2016, 6:48:42 PM8/14/16
to mu-discuss

I'm using contexts within mu4e, and I also know how to add custom headers via the `mu4e-header-info-custom' list.


What I'd like to do, however, is to alter existing headers when replying or composing within certain contexts. Here's one example: if I reply to a message that matches one of these special contexts, I'd like the "To:" header to be automatically changed to a different address, or to add additional addresses to the "To:" line.


Suppose the sender is sen...@example.com. For this example, if I reply to the message, I'd like the "To:" line to automatically be changed to ...


To: new...@example.com


... or even perhaps to ...


To: sen...@example.com, newu...@example.com, newu...@example.com


I might want to automatically change other existing headers, as well, such as "Subject:".


Is there any way to do this that is built into mu4e?


Thank you very much.


Dirk-Jan C. Binnema

unread,
Aug 15, 2016, 2:22:24 AM8/15/16
to mu-di...@googlegroups.com
Hi,
You could set something up in the mu4e-compose-mode-hook, using the
various `message-add-header', `message-replace-header', etc. or any
general emacs text-processing function etc. functions.

See the section on 'Compose hooks' in the mu4e manual.

Cheers,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

Hippo Man

unread,
Aug 15, 2016, 4:20:14 AM8/15/16
to mu-discuss
Thank you.

During the execution of `mu4e-compose-mode-hook', is the current context known? I'd like the header changes that I make via this hook to be dependent upon the context.

Dirk-Jan C. Binnema

unread,
Aug 15, 2016, 6:55:57 AM8/15/16
to mu-di...@googlegroups.com
Yes - the function mu4e-context-current gives you the current context.

Hippo Man

unread,
Aug 15, 2016, 5:49:28 PM8/15/16
to mu-discuss
Thank you very much.

On Monday, August 15, 2016 at 6:55:57 AM UTC-4, djcb wrote:

...
Reply all
Reply to author
Forward
0 new messages