On Thu, Feb 04, 2021 at 01:48:09PM +0100, Michael Klemm wrote:
.muttrc:
folder-hook 'server1 'source ~/.muttrc.server1'
folder-hook 'server2' 'source ~/.muttrc.server2'

macro index <f1> '<change-folder>imaps://server1<enter>'
macro index <f2> '<change-folder>imaps://server2<enter>'

It looks like the above two macros don't include the string 'INBOX'. When you start Mutt, it will open $spoolfile, so that may be why it's working only on startup?

.muttrc.server1:
set folder                   = "imaps://server1"
set spoolfile                = "+INBOX"
set record                   = "+Gesendete Elemente"
set postponed                = "+Entwürfe"
set trash                    = "+Gelöschte Elemente"

folder-hook INBOX 'set record = "+Gesendete Elemente"'

.muttrc.server2:
set folder                   = "imaps://server2"
set spoolfile                = "+INBOX"
set record                   = "+Sent Items"
set postponed                = "+Drafts"
set trash                    = "+Deleted Items"

folder-hook INBOX 'set record="+Sent Items"'

Note that folder-hooks allow multiple commands with the same regexp. So the folder-hooks with the same regexp in .muttrc.server1 and .muttrc.server2 will NOT overwrite each other. You may want to make their regexps more specific to each server and just define them in the outer muttrc.

--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA

Attachment: signature.asc
Description: PGP signature

Reply via email to