(I recommend that you start off with the Debian or Ubuntu package for mutt since a large chunk of necessary customization work has already been done by the Debian maintainers.)
Here is how I handle two user accounts. Let's start off by listing both of these addresses so that mutt can recognize emails using these as being sent by me:
alternates "(fmarier@gmail\.com)|(francois@debian\.org)"Now this is to allow me to change the From address within the editor, in case I forgot to set the right one before pressing 'm':
set use_fromHere are the two settings that I'm going to change when switching to a different identity (from address and status bar display).
# default profileHere are the macros I use to switch from one account to the next (bound to ESC-1 and ESC-2):
set from="fmarier@gmail.com"
set status_format="-%r-fmarier@gmail.com: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---"
macro index \e1 ":set from=fmarier@gmail.com\n:set status_format=\"-%r-fmarier@gmail.com: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---\"\n" "Switch to fmarier@gmail.com"And this is the code that uses these macros to switch to the right identity automatically:
macro index \e2 ":set from=francois@debian.org\n:set status_format=\"-%r-francois@debian.org: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---\"\n" "Switch to francois@debian.org"
folder-hook =inbox 'push \e1oi'(The 'oi' part at the end is there to restore the default sort order.)
folder-hook =debian-inbox 'push \e2oi'
Finally, I've got this convenient shortcut which allows me to switch to my inbox quickly and to go from one inbox to the next:
macro index I "c=inbox\n" "Switch to inbox"Next up: indexing your emails using mairix.
folder-hook =inbox 'macro index I "c=debian-inbox\n" "Switch to debian-inbox"'
folder-hook =debian-inbox 'macro index I "c=inbox\n" "Switch to inbox"'


4 comments:
Nice post :-), this is a problem I was about to attempt to solve :p
Also, definitely keen on hearing about mairix (I've been thinking about a solution to this problem for a little while now ...).
Thank you very much, that's what I was looking for. Mutt is my favorite mail client.
If you deal a lot with profiles and templates, check out mailplate.
Also, you can have multiple alternates lines. See my alternates file.
I like to use postfix to relay my mails. But I am unable to set it up so that it would relay correctly mails from different mutt profiles. Would be grateful for any pointers.
V.
Post a Comment