Use mutt with several accounts on same server

Paul Tansom paul at aptanet.com
Wed Apr 23 11:44:22 UTC 2025


On 18/04/2025 12:50, Erwan David wrote:
> 	I use mutt with sevreal accounts on different servers through folder-hook, account-hook, etc.
> But now I need to use it with two different accounts on same server.
> I do not succeed in differentiating them since folders are names imap://server, and I cannot use
> imap://user1@server and imap://user2@server.
>
> How would you do this ?

I do this with multiple accounts on the same server. My muttrc file has 
account-hook lines using imap_user to define the account, so:

account-hook imaps://user1@server 'set imap_user = user1'

account-hook imaps://user2@server 'set imap_user = user2'

I also use separate files for per account configuration with the 
folder-hook (signatures, etc.):

folder-hook imaps://user1@server source ~/.mutt/user1

folder-hook imaps://user2@server source ~/.mutt/user2

... and editing that in Thunderbird instead of Mutt with Vim as my 
editor was hard work, so I'll stop there. I can give more detail if it 
helps, but obfuscating things in this editor will be a pain!

-- 
  Paul Tansom  |  Aptanet Ltd.  |  https://www.aptanet.com/  |  023 9238 0001
=============================================================================
Registered in England | Company No: 4905028 | Registered Office: Ralls House,
Parklands Business Park, Forrest Road, Denmead, Waterlooville, Hants, PO7 6XP



More information about the Mutt-users mailing list