Thank you Ian, I find it reassuring that others also have thought about using scripts and actually even went further than just thinking about it!
Seb. [email protected] (2025/05/18 10:49 -0700): > On Sat, May 17, 2025 at 12:49:16PM +0200, Sébastien Hinderer wrote: > > > One final note: I don't now how other muttusers go about archiving > > their emails but I continue to have dedicated mailboxes (maildirs, > > to be precise) for mailing lists and this, too, requires a quantity > > of configuration that can be found a bit cumbersome. > > > For instance here is the configuration I have for this list: > > > subscribe [email protected] > > fcc-hook '~t [email protected]|~c [email protected]' '=list/mutt-users/' > > save-hook '~t [email protected]|~c [email protected]' > > '=list/mutt-users/' > > > It's definitely not unbearable, but each time I add a mailing list > > and duplicate such lines I feel a bit sad about the redundancy, to > > the point that I regularly find myself thinking that one day I will > > write a generator to generate my Mutt configuration from a less > > verbose format. > > Here is what I do. Like Chris, I use a generator script to start from > a unified config file (which is JSON5 in my case). There are two > significant outputs: > > - a file that ends up included in my .muttrc > - a "filter" file for exim > > My case is complicated a bit more by the fact that I use unique > aliases per mailing list, but OTOH this makes *recognizing* list > messages more robust. > > Here are snippets of my configuration relevant to *this* mailing list: > > - JSON5 input: > > { > mailbox: "mutt", > primary: "[email protected]", > completion: "mutt-users-mutt-org", > alias: "googly.negotiator862", > }, > > - muttrc result: > > subscribe mutt\-users@mutt\.org > alias mutt-users-mutt-org [email protected] > send-hook '~L mutt\-users@mutt\.org' 'set > from="[email protected]"' > reply-hook '~t googly\.negotiator862@aceecat\.org' 'set > from="[email protected]"' > alternates googly\.negotiator862@aceecat\.org > > - exim filter result: > > # rule mutt-0 > if "$h_to:, $h_cc:, $h_list-post:" contains "[email protected]" then > logwrite "$tod_log $message_exim_id $h_message-id: rule mutt-0" > save $home/Mail/mutt/ > endif > > The only reason I don't also show the script itself is that it does > some other vestigial stuff that would only muddy the waters. >
