On 25Sep2015 17:54, Paul Tansom <[email protected]> wrote:
** Cameron Simpson <[email protected]> [2015-09-25 09:22]:
On 24Sep2015 12:22, Paul Tansom <[email protected]> wrote:
>Is there a way to change the status_format when you change folders / accounts?
[...]
It looks like account-hook should do the trick for you but I don't have an
myself at present. [...]
In my main muttrc file I have:

account-hook imaps://[email protected]@imap.localdomain.com 'set imap_user = 
[email protected]'
source ~/.mutt/muttrc.domain1.com
account-hook imaps://[email protected]@imap.localdomain.com 'set imap_user = 
[email protected]'
source ~/.mutt/muttrc.domain2.com
account-hook imaps://[email protected]@imap.localdomain.com 'set imap_user = 
[email protected]'
source ~/.mutt/muttrc.domain3.com
account-hook imaps://[email protected]@imap.localdomain.com 'set imap_user = 
[email protected]'
source ~/.mutt/muttrc.domain0.com

The last one seems to end up as the default one you log into and then it cycles through from the top. Not quite sure why.

The muttrc is read just once at startup. It looks like you want to source your per-domain files on folder switch. I'd be inclined to prepend "set imap_user = [email protected]" to your muttrc.domain1.com file, and write the hooks like this:

 account-hook imaps://[email protected]@imap.localdomain.com 'source 
~/.mutt/muttrc.domain1.com'
 account-hook imaps://[email protected]@imap.localdomain.com 'source 
~/.mutt/muttrc.domain2.com'

and so forth. That way the _entire_ domainX.com setup is sources on folder switch.

As you have it above you source the various per-domain things once at mutt startup, ending up with the last one. Your account hooks only change imap_user; they don't re-source the per domain setup files.

Cheers,
Cameron Simpson <[email protected]>

Reply via email to