# Mutt and copying a cc list to aliases



## scottro (Jun 17, 2018)

I've googled this with terms similar to the title. Suppose I receive an email with a cc list of say, scott1, scott2, scott3. Is there a simple way to make an alias of all the addresses? That is, say some key combo that says, make alias of scott1, scott2, and scott3? 

I haven't found anything, but I suspect there is a way to do this that I'm missing. 

Thanks for any input.


----------



## rigoletto@ (Jun 17, 2018)

I didn't understand it. Do you want something to reply to all on CC list, or create a group of mails, or...?

If the idea is to reply-all, just click 'g' to have a group reply.


----------



## scottro (Jun 17, 2018)

In this particular case, I wanted to take a list of about 10 names, and not reply to it, but make a group of it.
In addition, it was in the cc section and had I answered the mail, I would have wanted to use bcc. 

Sorry if I wasn't clear.


----------



## rigoletto@ (Jun 17, 2018)

From the top of my head, something like this should work.

`alternates -group scottgroup scott1@ scott2@ scott3@ etc.`

So, later just add 'scottgroup' (the name of the group) to the BCC field.


----------



## shepper (Jun 17, 2018)

I use mail/abook to maintain my contacts and prefer to send group emails w/ the BCC field.  Abook does not provide that utility.
My workaround was to select the recipients in Abook and then bring up mutt <m>.  Copy the recipients in the To: field and paste into a text file or directly into the Bcc: field..  If you bulk email the same group  it is easy to paste the text file into the CC:/BCC: fields on future emails


----------



## rigoletto@ (Jun 17, 2018)

If you want something more on-the-fly, I am afraid _best I can do_ is `set edit_headers=yes` to make the headers editable while you compose the e-mails.

For external contact management there are other options beyond the shepper example: www/py-goobook (Google Contacs), www/pycarddav, and Khard PR 227807.


----------



## meine (Jun 17, 2018)

scottro said:


> In this particular case, I wanted to take a list of about 10 names, and not reply to it, but make a group of it.



Maybe this page should guide you to it:

http://www.mutt.org/doc/manual/#addrgroup

I didn't fully read and try it, but it looks like an alias group consists of several one-by-one recipients -- see:

http://www.upenn.edu/computing/email/help-old/Email/mutt_alias_file.html


----------



## meine (Jun 17, 2018)

shepper said:


> I use mail/abook



https://wiki.archlinux.org/index.php/Mutt#Address_aliases --> Abook


----------



## scottro (Jun 17, 2018)

Yes, I was thinking of abook. Thanks to all for suggestions.  My _hope_ was something like a key combo of select all, add to aliases and the like, but it doesn't seem to be there.

Thanks again.


----------



## shepper (Jun 17, 2018)

scottro said:


> Yes, I was thinking of abook.


The man page for abook(1) allows configuration (--datafile) of separate addressbooks, for example familyaddresses and bizaddresses.  From abook, the spacebar will tag (+) multiple recipients (To: field).  Or just use the <+>key to select all members of an addressbook.


----------



## Sensucht94 (Jun 30, 2018)

What about  adding an entry in an alias file and sourcing  it into your ~/.mutt/muttrc?



```
echo "alias scott  -group scott_group scott1@provider1.com, scott2@provider2.com, scott3@provider3.com" >> ~/.mutt/aliases
cat >> ~/.mutt/muttrc << EOF
> set alias_file= ~/.mutt/aliases
> set sort_alias= alias
> set reverse_alias=yes
> source $alias_file
> EOF
```

And then use `mutt -c scott...` everytime you need it, or add an alias for `mutt='mutt -c scott'` in your default shell configuration file


----------



## scottro (Jun 30, 2018)

That's close to what I did, but the way the addresses were arranged, I wound up having to manually edit them.  (It was probably sent on an iPhone or similar, I no longer have the original format or I could show you.  I have .mutt_aliases sourced whenever I start neomutt.


----------

