Linux.com

Feature

Training your Mutt

By Joe 'Zonker' Brockmeier on December 12, 2006 (8:00:00 AM)

Share    Print    Comments   

Mutt is a great mail client, in large part because it is extremely customizable. You can tweak Mutt's behavior and have it do tricks that are nearly impossible to do with other mail clients -- but it can be a bit daunting to get started with. Let's take Mutt on a short trip to mail client obedience school and see how easy it can be to make Mutt handle mail just the way you want it to.

Miscellaneous useful settings

When you're reading a message that has long lines, Mutt will automatically display a "+" marker at the beginning of each wrapped line. This is a bit ugly, but it's easy to get rid of by setting the markers directive to no:

set markers=no

As we've already covered, you can change Mutt's sort order on the fly. You can also configure Mutt to use a different sort order by default, if sorting by date isn't your cup of tea. Mutt allows you to sort by the from header, by threads, the date mail was received (as opposed to the date sent), by size, and several other categories. You'll see the full list of options in the muttrc manpage. To sort by thread, you would use this directive in your .muttrc file:

set sort=threads

If you just want to see messages in the order that they appear in your mailbox, you can use:

set sort=mailbox-order

To bypass Mutt's prompt for To: and Subject: when composing messages, I set two options in my .muttrc file:

set edit_headers=yes
set autoedit

This will put you directly into your editor of choice, and you can edit the header fields directly in your editor rather than entering the To: and Subject: fields at Mutt's prompt. Of course, it's possible to set the editor you wish to use as well. For instance, if you prefer the Pine feel, you can set the editor to nano:

set editor="nano"

Mutt isn't picky -- you can even set the editor to gEdit or Kate if you'd like to use a GUI editor.

When I'm plowing through a large amount of mail, I get annoyed at being asked whether I really want to append a message to a mailbox every time I try to file a message. Mutt's behavior here can be overridden by setting noconfirmappend:

set noconfirmappend

On the other hand, I'd actually like a prompt before Mutt exits, so that if I hit the exit command accidentally, I can tell Mutt not to exit. So, I set the quit option to ask-yes.

set quit=ask-yes

If this isn't set, the default is for Mutt to exit without any confirmation from the user.

Finally, you might want to set the program that Mutt uses to send mail off the local machine. For instance, I use the simple SMTP application to send mail off of my machine to an actual mail server. To configure Mutt to use that, I set the sendmail directive:

set sendmail="~/bin/account"

Here, I've set the sendmail directive to a shell script that calls ssmtp with the authentication information for my server.

Keeping things organized

After a while, your .muttrc file might start to get large. If you'd likes to keep it organized, you can split the configuration out into multiple files and use the source directive in your .muttrc, like so:

source "~/.mutt/save-hook"
source "~/.mutt/headers"
source "~/.mutt/colors"

You might also want to use an alternate configuration file to keep multiple mail accounts separate. Mutt can source different configurations on the fly -- all you need to do is to set up appropriate macros to call the profiles' configurations:

macro index <F9> ":source ~/.mutt/work"
macro index <F10> ":source ~/.mutt/home"

After setting the macros, just press F9 or F10 to switch your profiles on the fly. This can be useful for managing multiple mail accounts, mail signatures, and anything else you might want to configure on the fly.

Obviously, Mutt has many configuration options. The odds are, if there's something in Mutt's behavior that you want to change, you can change it. Poke through the muttrc manpage, and check out the Mutt manual, and you should be able to find your way.

 

Share    Print    Comments   

Comments

on Training your Mutt

Note: Comments are owned by the poster. We are not responsible for their content.

Training your Mutt

Posted by: Anonymous Coward on December 12, 2006 06:38 PM
I am Swedish, and I find that quite funny...<nobr> <wbr></nobr>:D

#

Re:Training your Mutt

Posted by: Anonymous Coward on December 12, 2006 07:43 PM
So, what does "mutt" mean in Swedish? If it's inappropriate, I'm satisfied with the Norwegian word for it (if you know)<nobr> <wbr></nobr>:)

#

Re:Training your Mutt

Posted by: Anonymous Coward on December 13, 2006 05:06 AM
I am using mutt for 7-8 months. I am now very comfortable with it and very happy with it. Imap account is pretty decent. It should have support of builtin MTA client.

I have few issues with it :
1. For pop account, it tries to download all the mails (atleast headers) every time when I login into which is a different behaviour than thunderbird. I feel thunderbird way is lot natural. I guess that there may be some way to mimic what thunderbird does. Also I want to know if there is way so that it will save the mail in local file from pop account. It should delete mail when I delete it from local mbox.
2. Multiple mbox is very painful to setup in mutt.

#

imap?

Posted by: Anonymous Coward on December 13, 2006 12:37 AM
How do I switch between multiple IMAP accounts? How do I switch between different IMAP folders?
How do I cache IMAP messages, so mutt doesn't download them all every time?
P.S. Crap, and now I have to use IMAP in lowercase in the subject, because linux.com thinks I am yelling!!!

#

Re:imap?

Posted by: Anonymous Coward on December 13, 2006 02:25 PM
> How do I switch between multiple IMAP accounts?
press c to change address, start address with "imaps://" or "imap://" if no SSL.

> How do I switch between different IMAP folders?
press c then cycle list with tab key (may have to start tabbing after typing in "imap".

> How do I cache IMAP messages, so mutt doesn't download them all every time?
set message_cachedir in<nobr> <wbr></nobr>.muttrc to an existing directory.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya