You are not logged in.

#1 2013-12-29 13:00:38

Lustique
Member
From: DE
Registered: 2013-11-15
Posts: 17

[SOLVED] Mutt: Switching between multiple imap accounts does not work

Hi,
I've got a problem with my Mutt config: Whenever I open Mutt, it correctly opens my "default" mailbox, but when I try to change to another mailbox, Mutt asks for my password, accepts it (no message), says "Mailbox unchanged" (or something similar; for me it's actually "Mailbox unverändert"), which is probaly right, but then asks for a passwort for username_of_1st_account@url_of_2nd_account, which obviously is complete nonsense. Any help with this would be greatly appreciated!

(All of the accounts below work on their own, by the way.)

My muttrc:

 
source /etc/Muttrc.gpg.dist
set editor              =   `echo \$EDITOR`

set print_command       =   "/usr/bin/muttprint %s -p {PrinterName}"
# set print_command       =   "muttprint"

set mailcap_path        =   ~/.mutt/mailcap
auto_view text/html

set my_name             =   'My real name'
set realname            =   $my_name

# Folder-Hooks und Makros
source ~/.mutt/account.techfak
folder-hook 'Uni stuff 'source ~/.mutt/account.techfak' 
macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/account.techfak<enter><change-folder>!<enter>'

# 2 other accounts

# Default-Account:
source ~/.mutt/account.webde2
folder-hook 'Web.de (user2@web.de)' 'source ~/.mutt/account.webde2' 
macro index <f5> '<sync-mailbox><enter-command>source ~/.mutt/account.webde2<enter><change-folder>!<enter>'

# Einstellungen für Alias-Datei
set alias_file          =   ~/.mutt/aliases
set sort_alias          =   alias
set reverse_alias       =   yes
source $alias_file

# Abook
set query_command       =   "abook --mutt-query '%s'"
macro index,pager  a "<pipe-message>abook --add-email-quiet<return>" "Add this sender to Abook"
bind editor        <Tab> complete-query

# -*-muttrc-*-

source ~/.mutt/colors.zenburn

# Palette for use with the Linux console.  Black background.

# color hdrdefault blue black
# color quoted blue black
# color signature blue black
# color attachment red black
# color message brightred black
# color error brightred black
# color indicator black red
# color status brightgreen blue
# color tree white black
# color normal white black
# color markers red black
# color search white black
# color tilde brightmagenta black
# color index blue black ~F
# color index red black "~N|~O"

# color body brightwhite black '\*+[^*]+\*+'
# color body brightwhite black '_+[^_]+_+'

# Store message headers locally to speed things up.
# If hcache is a folder, Mutt will create sub cache folders for each account which may speeds things even more up.
set header_cache        =   ~/.cache/mutt

# Store messages locally to speed things up, like searching message bodies.
# Can be the same folder as header_cache.
# This will cost important disk usage according to your e-mail amount.
# set message_cachedir  =   "~/.cache/mutt"

# Specify where to save and/or look for postponed messages.
# set postponed         =   +[Gmail]/Drafts

# Allow Mutt to open new imap connection automatically.
unset imap_passive

# Keep IMAP connection alive by polling intermittently (time in seconds).
set imap_keepalive      =   300

# How often to check for new mail (time in seconds).
set mail_check          =   120

# Display download progress every 5K
set net_inc             =   5

account.techfak

 
set folder              =   imap://imap.techfak.uni-bielefeld.de:143 
set postponed           =   "=Drafts"
set imap_user           =   user1
set from                =   $imap_user@techfak.uni-bielefeld.de
set spoolfile           =   +INBOX
set imap_check_subscribed

set smtp_url            =   smtp://$imap_user@smarthost.techfak.uni-bielefeld.de:25 
set use_from            =   yes

set ssl_starttls        =   yes
set ssl_force_tls       =   yes

account.webde2

set folder              =   imaps://user2@imap.web.de/
set postponed           =   "=Drafts"
set imap_user           =   user2
set from                =   $imap_user@web.de
set spoolfile           =   +INBOX
set imap_check_subscribed

set smtp_url            =   smtp://$imap_user@smtp.web.de:587 
set use_from            =   yes

# set ssl_starttls        =   yes
set ssl_force_tls       =   yes

So Mutt asks for user1@imap.web.de.

Last edited by Lustique (2014-01-04 11:33:23)

Offline

#2 2013-12-29 17:53:47

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mutt: Switching between multiple imap accounts does not work

Where did you get the change-folder macro?

I use these to change between maildirs:

macro index gh       "<change-folder> =JWR/INBOX<enter>"       "go to Inbox"

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-12-31 22:51:46

Lustique
Member
From: DE
Registered: 2013-11-15
Posts: 17

Re: [SOLVED] Mutt: Switching between multiple imap accounts does not work

I got the macro(s) (and almost all of my config) from http://www.df7cb.de/blog/2010/Using_mul … _Mutt.html.

Since I don't (really) know how imap works: How could I use your command for my e-mail accounts? To me it looks like you're switching directly to a certain folder in your imap account, called INBOX (is "JWR" specific to your account (maybe some acronym for your name?) or something else?), but not to a different account, or does "JWR" point to the account, and "INBOX" to the inbox of that account?

Offline

#4 2013-12-31 23:20:56

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mutt: Switching between multiple imap accounts does not work

I have four different accounts on this box. You can see my setup here:
https://bitbucket.org/jasonwryan/shiv/src/tip/.mutt/


And rather than that blog, read Pat Brisbin's posts (linked to from the mutt page on the wiki).


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2014-01-03 11:20:28

Lustique
Member
From: DE
Registered: 2013-11-15
Posts: 17

Re: [SOLVED] Mutt: Switching between multiple imap accounts does not work

Thanks for your help, but after looking at your setup and Pat Brisbin's posts, I think these setups aren't really what I'm looking for at the moment, and I don't think I'm able to adjust them to my liking. I therefore looked at my config again, and it seems that the "unset imap_passive" line in my .muttrc was the culprit. Without it, everything works as intended.
However, as my setup probably is not really sensible, I might switch to something like you use in the future.

Using a DVCS to manage your config files seems like a great idea, by the way. I wanted to get into git anyway. big_smile

Offline

#6 2014-01-03 18:39:12

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Mutt: Switching between multiple imap accounts does not work

Nice. Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB