2

When emailing to someone with mutt, I would like to have my messages automatically CC'd to someone. Typically, we are a team of academics working with a student, and I would like my exchanges with the student to be sent to others.

Mutt aliases seems to be on a "per field" basis. So I could use it to put my coworkers in an alias, but they would be in the "To:" field, not "CC". Is there a workaround?

Setting edit_headers to yes (and having a nice macro in my editor) would not help, since I'd like such a behavior for only a fraction of my communication. Modern tools like Slack/mattermost are also used, but not always.

rfs
  • 81
  • 5

1 Answers1

1

Answer

Add following into your config:

alias coworkers peter@example.com, joe@example.com, bob@example.com
my_hdr CC: coworkers

then all addresses listed in alias coworkers will be added to CC. You can employ hooks to better control to which newly composed messages or replies will my_hdr used or not.

References

neomutt docs:

Jakub Jindra
  • 551
  • 6
  • 12
  • Thanks! I will try that soon, it should work and solve my problem. – rfs Oct 23 '20 at 12:33
  • Unfortunately, it does not work! The manual states: `note that _my_hdr_ commands which modify recipient headers, or the message's subject, don't have any effect on the current message when executed from a send-hook`. I tried with send2-hook, but to no avail also. – rfs Nov 12 '20 at 13:29
  • Well, I mean: the recipient list is not modified by the send-hook, and the specific my_hdr is not read/used. I tried with a my_hdr with other fields, and it works (with a custom one such as "Organisation:", as given in neomutt manual). – rfs Nov 12 '20 at 16:51
  • I see you're already asking on mutt users mailing list. Please add your solution here once you find one. – Jakub Jindra Nov 12 '20 at 18:09
  • 1
    Yes, I wondered if SO was the best place to ask, I rapidly got more answers on the mailing-list. All hack-ish, I will summarize them and link to the ML archive. – rfs Nov 16 '20 at 16:31