Always CC specific messages to some people (send-hook and my_hdr)

Cameron Simpson cs at cskk.id.au
Thu Nov 12 21:02:41 UTC 2020


On 12Nov2020 17:58, Raphaël Fournier-S'niehotta <raphael at raphaelfournier.net> wrote:
>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".
>
>I wanted to use a send-hook and the my_hdr variable, but it works for other fields (such as adding a "Organization: A Really Big Company, Anytown, USA", from the manual). But not for the CC field (the manual says: "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").
>
>Is there a workaround? Perhaps with the recent muttlisp?

Well, this doesn't work for an original message, but I have a shared 
email address with the SO, and have my reply-hooks set to CC the shared 
address for that:

    reply-hook . "my_hdr BCC: $my_cs"
    reply-hook . 'set from="$NAME <$EMAIL>"'
    reply-hook "! ~p ~C $my_shared" 'set from="$my_SHARED"'
    reply-hook "! ~p ~C $my_shared" 'my_hdr CC: $my_SHARED'
    reply-hook "! ~p ~C $my_shared2" 'set from="$my_SHARED2"'
    reply-hook "! ~p ~C $my_shared2" 'my_hdr CC: $my_SHARED2'

So when I reply, the following happen:

- I BCC myself and set my preferred from
- stuff _not_ to my personal address which _is_ to/cc my shared address 
  gets the shared From: address and a shared CC: header
- repeat for the other flavour of my shared address

For clarity, $my_shared is our shared address (both-of-us at our-domain) 
and $my_SHARED is "My Name and Her Name <both-of-us at our-domain>".

I'd be a little leery of automatic CCs, some email is genuinely personal 
and you're kind of making your reply public. Provided you get to 
manually vet that before sending you're probably fine.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Mutt-users mailing list