On 2022-09-15 10:23, Sébastien Hinderer wrote:
> Hello,
> 
> Many thanks for your reponse!
> 
> Cameron Simpson (2022/09/15 08:27 +1000):
> > I thought the common approach was what you next outline: a single muttrc
> > which sources the appropriate account-specific muttrc.
> 
> [...]
> 
> For files that define different thisgs yes, that works. But for
> accounts, which have different values for the smae variables, I think
> you don't want to include all them simultaneously, because then the last
> one would win, but you want to source exactly one of them. And then if
> you wnat to change accout without leaving mutt you just source another
> one...

I defined aliases for my accounts in .zshrc, because I do not mind
restarting mutt when switching to a different account:

alias m1='cd ~/Downloads && /opt/homebrew/bin/mutt -F ~/.mutt/account1.cf && cd'
alias m2='cd ~/Downloads && /opt/homebrew/bin/mutt -F ~/.mutt/account2.cf && cd'

For switching e-mail addresses, PGP keys etc within an account, I
adopted a suggestion by Cos:

http://lists.mutt.org/pipermail/mutt-users/Week-of-Mon-20220905/003863.html

I also bind the source commands used in the solution above to message-hooks:

message-hook '~C ^a...@eden.one$' 'source ~/.mutt/default.cf'
message-hook '~C ^x...@eden.one$' 'source ~/.mutt/alternative_address1.cf'

- Jan

Attachment: signature.asc
Description: PGP signature

Reply via email to