Hi mutt experts,

I'm fighting an problem with folder-hooks that I did not find a good
answer for.  I basically have two IMAP accounts in mutt, personal and work.
What I would like to do is that if a new mail or reply is written in a
in folder (except INBOX), the new mail or the reply should be stored in
that folder.

I have this in the muttrc files (I hope that I'm covering the relevant
parts):

.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>'

folder-hook !INBOX set record=^


.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"'

What happens is that when I switch the account with F2, the record
variable does not correctly point to the default sent folder for INBOX. So, 
right after starting mutt, i get this:

:echo $record
=Gesendete Elemente

But after switching the second account via F2, I'm getting this:

:echo $record
imaps://server2/

And switching back to the first via F1:

:echo $record
imaps://server2/

So, figure that I have screwed up my mutt configuration and I do not see
where this is coming from.  I might be using the regex for folder-hook
wrong.  Do I?

Kind regards,
        -michael

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to