On 17/11, Chris Bannister wrote:
On Sat, Nov 16, 2013 at 10:18:10PM +0100, Niels Kobschaetzki wrote:
Hi,

I am relatively new to mutt but was able to set up some account-hooks.
I have three accounts A, B and C and when I start mutt everything
works as expected.  I start in account A and when I want to change
folders or want to copy mails I see the folders of account A. When I
send mail it is send from account A.  Now I switch to account B. And
everything works for account B, the same for account C. And then I
switch back to account A and the following problems occur: When I want
to change folders, I see the folders of the last account I was in (in
this example account C), when I write a mail the "From" and
"SMTP"-settings are those from the last account I was in.

When I switch to account B or C everything works as expected. The
problems happen only with account A (which is also my main-account).
After a restart of mutt everything works fine, until I changed from
account A to another one. Since the config for B and C are copied
completely from A and then changed the account-specific-settings, I
have no idea where to look what the problem could be.

Unless someone has a crystal ball, neither have we.
IOW, we need to see the code!

Ok, here is the code. Of course everything is anonymized.


The code for switching accounts and the appropriate folder-hooks

# switch accounts
macro index <f5> '<change-folder>imaps://user1@imapserver1/INBOX<enter>'
macro index <f6> '<change-folder>imaps://user2@imapserver2/INBOX<enter>'
macro index <f8> '<change-folder>imaps://user3@imapserver3<enter>'

# Folder-Hooks
folder-hook 'account1' 'source ~/.mutt/account.account1-settingsfile'
folder-hook 'account2' 'source ~/.mutt/account.account2-settingsfile'
folder-hook 'account3' 'source ~/.mutt/account.account3-settingsfile'

# switch to default account on startup
source ~/.mutt/account.account1-settingsfile

Here are the three settings-files

Settingsfile 1
set from = "loc...@domain1.com"
set use_from = yes

set imap_pass="Password1"
set spoolfile="imaps://user1@imapserver1"
set folder="imaps://user1@imapserver1/INBOX"
set record="=Sent"
set postponed="=Drafts"
#set trash="=Trash"

set sendmail="/usr/sbin/sendmail -oi -oem"
set smtp_url="smtps://user1@smtpserver1:465/"
set smtp_pass="Password1"

Code Account 2
set from = "loc...@domain2.com"
set use_from = yes

set imap_pass="Password2"
set spoolfile="imaps://user2@imapserver2"
set folder="imaps://user2@imapserver2/INBOX"
set record="=Sent"
set postponed="=Drafts"
#set trash="=Trash"

set sendmail="/usr/sbin/sendmail -oi -oem"
set smtp_url="smtps://user2@smtpserver2:465/"
set smtp_pass="Password2"


Code Account 3
set from = "loc...@domain3.com"
set use_from = yes

set imap_pass="Password3"
set spoolfile="imaps://user3@imapserver3"
set folder="imaps://user3@imapserver3"
set record="=Sent"
set postponed="=Drafts"
#set trash="=Trash"

set sendmail="/usr/sbin/sendmail -oi -oem"
set smtp_url="smtps://user3@smtpserver3:465/"
set smtp_pass="Password3"


Niels

Reply via email to