Using Mutt
Using Mutt
Contents
1 2 Introduction Why Mutt? Usage: The Basics 2.1 2.2 Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reading Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 2.2.2 2.2.3 2.2.4 2.3 2.4 Your Inbox (Index View) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sorting and Threading Messages in the Index View . . . . . . . . . . . . . . . . . . Reading Messages (Pager View) . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deleting Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 4 4 5 5 6 6 7 7 8 9 9 9 9 10 11 11 12 12 12 13
Composing Messages and Saving Drafts (Postponing Messages) . . . . . . . . . . . . . . . Attachments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.1 2.4.2 Forwarding Attachments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deleting and Undeleting Attachments . . . . . . . . . . . . . . . . . . . . . . . . .
Printing Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reading Mail in Other Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Saving Messages to Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Operating on Multiple Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.8.1 2.8.2 2.8.3 2.8.4 Selection Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tagging and Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Limiting Messages Shown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Patterns to Archive Groups of Messages . . . . . . . . . . . . . . . . . . . .
2.9
CONTENTS
Conguring Mutt 3.1 3.2 Basic Conguration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting Up Your Mail Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 3.2.2 3.2.3 3.3 3.4 3.5 Downloading from a server (POP3) . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing your Mail at the Server (IMAP) . . . . . . . . . . . . . . . . . . . . . . Ofine IMAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13 13 14 15 15 16 17 19 19 19 20 21 22 22 22 23 24 25 25 26 26 26 26 28 30 30 31 32 33 34 34
Sending Mail: Sendmail and Friends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Your Sent Mail box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conguring Your Address Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 Alias File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Abook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Querying an LDAP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Little Brother Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rolo Addressbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Choosing an Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dealing with HTML Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dealing with Attachments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.10 Dealing with Word Doc Attachments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11 Dealing with URLs in Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Advanced Customization 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 Using Mutt with different congurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conguring Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Rebinding Keyboard Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Writing Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Changing the Index View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Changing the Pager View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dealing with non-ASCII Character Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dealing With Particularly Troublesome Characters . . . . . . . . . . . . . . . . . . . . . . Advanced Printing: Mutt-Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Other Resources and More Information 5.1 5.2 Information and Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Software with which Mutt Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . .
34 34 35 36 37 37 37 39 41 41 41 41 42 42 43 43 43 44
A Appendix: Patterns B Appendix: Functions available for Macros B.1 Generic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.2 The Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.3 The Pager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.4 Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.5 Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.6 The Attach menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.7 The Compose menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.8 The Postpone menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.9 Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.10 PGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B.11 The Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C Appendix: Acknowledgments and License D Appendix: Version History
Mutt is not the tool of choice for everybody, but if you prefer the keyboard to the mouse, appreciate simplicity but not at the expense of power, and are particular enough about your work environment to choose tools that provide maximum congurability, learning how to use Mutt will make email a lot more fun to deal with. Top reasons to use mutt over another mail client: 1. its fast and efcient, and lets you keep your hands on the keyboard, where they belong. 2. mutt makes maximum use out of your limited screen real estate 3. you can use it with the editor of your choice (emacs, vi, nedit, pico, etc.) 4. you know exactly what you like and therefore appreciate mutts unsurpassed congurability 5. you want fast keystroke access to functionality and therefore appreciate mutts powerful macro capability 6. you grew up in the stone age, like me, and prefer distraction-free, text-based computing Great tricks to do with Mutt: 1. cut to the chase when receiving a message inside a message inside a message (sec. 2.4) 2. automatically fold Word doc attachments right into the text of the message (sec. 3.10) 3. archive hundreds of messages at once in one simple step (sec. 2.8.4) 4. make annoying HTML email look like plain text (sec. 3.8) 5. on a dial-up connection, queue up your mail in a sendmail spool le, which is automatically sent the moment an internet connection is detected without any further interaction needed (sec. 3.4) 6. write powerful macros to make complex tasks into a single keystroke (sec. 4.4) 7. delete just attachments from a message without deleting the whole message (sec. 2.4.2) 8. color code messages in your inbox to indicate their origin, or the address the messages were sent to, and more (sec. 4.2)
but if not, you can type man mutt or man muttrc at a terminal prompt to read the man pages. Other help resources are listed in section 5 of this Woodnotes guide. Assuming little gnomes and trolls have already magically congured your system for you, you can open a virtual terminal window and type mutt to proceed directly to reading your mail; otherwise, skim the next sections and proceed to section 3 to read about conguring your system for mutt.
Figure 1: Mutts Index View The rst column shows you the message number, and you can navigate to messages just by typing the number. The second, third, and fourth columns show you the status ags associated with each message, such as N for new mail, T for messages in which you are on the To line, C where youre copied, and so on. See gure 2 below for a complete list. Use the arrow keys or j and k to navigate up and down through the messages, or type the number of the message and press enter to jump straight to it. When the cursor bar is highlighting a message, press return to read it (that is, go to the pager view). When youve nished reading it, press q to return to the index view. As the menu bar at the top of the screen indicates, you can press f to forward a message, r to reply, and m to compose a new message.
6 Flag N O r D d T F C + L s Meaning new message old message message to which youve replied message marked for deletion message with attachments marked for deletion message where you are on the to line message from you message where you are on the cc line message sent only to you message sent to a subscribed mailing list message which has been tagged (see section 2.8.2) message with a PGP signature Figure 2: Message Flags 2.2.2 Sorting and Threading Messages in the Index View
By default, the messages in your index view are shown in date order, but you can sort on any number of criteria, including date, sender, recipient, message size, and subject, among others. To sort messages, press o and select your criterion. A capital letter indicates reverse sort, so if you press z for size, the messages will be presented in size order from small to large, but if you press Z they will be sorted from large to small. The most useful view, in my opinion, is the threaded view (press t or T), which groups messages into conversations and manages to keep track even when message subjects change through the course of a conversation. Mutts display of threaded messages is unrivalled in other software and I miss it everywhere else.1 A bit later, well look at limiting the messages you see in this view, which is another powerful way of looking at some of the messages in your inbox (see section 2.8.3). 2.2.3 Reading Messages (Pager View) From the index view, pressing return with the cursor on any message takes you to the pager view for reading that message. There, mutt provides some functions in the pager that can be extremely useful. While reading a message, press h to toggle the Header view, in which all the messages headers are shown, and h again to toggle it back to the view without headers. This is useful when you would like to know something about along which route your message traveled, or which program your correspondent used to compose a message, or (these days) what caused a message to be agged as spam. You can also press T to hide all quoted text from the view. This only works with messages whose quoted portions are preceded by > signs, but in those cases its quite useful. Its a toggle, so press t again to include the quoted text again. While in the pager view, mutt might report that the message arrived with attachments. You can press v to see a folder tree of the attachments, their text labels, and sizes. See section 2.4 for dealing with attachments.
1 Im
told the algorithm that does this is more powerful in mutt than in other software which simply sorts by subject line and date.
Figure 3: Mutts Pager View 2.2.4 Deleting Messages When you press d in the index or pager views to delete a message mutt will ag it with a D in the index view (it may also reect the deletion using color: my mutt is congured to show deleted messages in red. Well look at the options available to you in sec. 4.2) but doesnt actually delete the message until you either change to a new folder or sync the mailbox to commit the changes. To make the deletion permanent, press the $ key, which is the default command to sync the index with the server and actually deletes all messages agged for deletion. Up until that moment, you still have the option to undelete those messages. Undelete a message by putting the cursor over the desired message and pressing the u key. You can navigate there either by using the message number, or by holding down shift as you type J and K. Otherwise, the cursor will cavalierly jump right over all deleted messages as you navigate.
adheres more strongly than most programs to the Unix philosophy of do one thing only but do it well, and rather than
8 Key d r f s g m Command delete message reply to message forward message save message (group) reply to all (mail) compose new message Figure 4: Mail Commands (Reply, Forward, Etc.)
you can often search for the temporary text les in the /tmp directory. When youre ready, save the le one last time and exit your editor. Mutt will take you back to the screen where you can add or modify recipient addresses to the address elds, if you havent already done so. Follow the prompts at the top of the screen (t for the To line, c for the Cc: line, and so on), separating addresses with a comma. If you would like to attach some le to your message, you can do so from this same screen by pressing a. When you have nished writing your message and adding your attachments, pressing y sends the message. If you decide at the last minute to cancel the composition of your message and return to it later, instead of pressing y at this point, press q. Mutt will ask you if youd like to postpone or kill the current message. Postponing it puts the message into a queue of postponed messages saved locally. When you are ready to continue, pressing Control-r will bring up the message and open your editor to begin working on it, or in the case youve got several postponed messages, will bring up an index of them so you can choose which one to continue. Mutt is surprisingly capable of performing much more complicated tasks at this point. For starters, you can press i to spellcheck your message with Ispell (if you havent already done so using your text editor), and by pressing e with the cursor over the temp le, you can re-edit your message. You can rename attachments, and much more. For a taste of what else is possible, press the ? key (press q to exit the help menu when you have nished).
2.4 Attachments
Either from the index or from the pager view, pressing v will take you to a list of all attachments of the message. This might be more informative than you think! For example, many messages come with both plain text and HTML parts (see Figure 5, showing a message sent in both ASCII and HTML and including a picture). You can also take advantage of this to drill down to the heart of messages that have been forwarded and re-forwarded through many senders. Open up the list of attachments, and note which one has the greatest size; put the cursor over it and press enter to read the joke ten people thought so funny they had to forward it to all of their friends. Isnt that easier than mail software that makes you double click on each of the ten messages in turn?
incorporate its own text editor relegates the task to programs better suited to it. As such, because you are guaranteed of being able to use the text editor you like best to write your message. If you havent specied an editor in your conguration le, the system default probably vi or vim will launch. Well cover this conguration in section 3.
Figure 5: Mutts Display of the Different Parts of an Email Including Attachments 2.4.1 Forwarding Attachments If you forward a message, odds are the text of the message will not include any attached les, unless you specify so. This is important. If someone sends you, say a picture, and you would like to forward it onto someone else, you must specify the attachment for forwarding. From this menu, put the cursor next to anything youd like to forward and tag it (press t). Then press ;f (note the semicolon) to forward everything thats been tagged. While at rst this might seem like a hassle, once you get used to it you will appreciate the efciency. For bonus points, assuming you too want to forward the message to someone else, clean it up by deleting all those other parts of the message so the next recipient doesnt have to dig. For details, continue reading the next section. 2.4.2 Deleting and Undeleting Attachments Its often convenient to remove an attachment from your inbox but not the message itself. To delete an attachment from a message without deleting the message itself, open a message and then press v to see the list of attachments. Put the cursor over the one youd like to delete and press d. When you return to the index, the index will show a lowercase d next to the message to indicate the change, and when you sync the mailbox by pressing $, the change will be committed (and the index will reect the changed size of the message). This is a good way of reducing the size of mail in your mailbox without having to delete any message text, and once you get used to being able to do this, youll miss it in other software.
10
rst, ! refers to your spool le, or inbox, and second, the = key refers to any non-inbox folder. So to change to the Work folder, enter c=Work and hit return. To return to the inbox, hit c! and hit return. Hitting c alone makes mutt prompt you to see a list of folders. At the prompt, hit the ? key to be shown a list of folders. Arrow down through them and hit return to change folders. At just about any time, mutt will try to complete words for you, so you might be able to get away with hitting simply c=W and then pressing tab. If you have no other folders that begin with W the word Work will be completed for you. Likewise, the s key saves the current message to a folder of your choosing. From the index, select the message and hit s=Work to save the current message to the folder called Work. If the folder doesnt already exist mutt will query you if youd like to create it, and will probably suggest a folder name based on that messages senders name unless congured otherwise. Below is a list of the key mail boxes. Key ! + or = < ~ Location Inbox/Spool folder collection (archives) sent mail folder (e.g. =FamilyMail) home directory on local (not remote) system Figure 6: Special Mailboxes
Special case: IMAP Shared Folders: If you are accessing an IMAP server, there may be shared folders. Exhaustive experimentation reveals that you can access a shared IMAP folder called Users/Shared/FunStuff by entering c imap://mail.server.com/Users.Shared.FunStuff. Thats a lot of typing, so save yourself some trouble and bind that expression to a keystroke (see section 4.3).
11
12
2.8.2 Tagging and Flags To operate on many messages at a time you need to tag them rst, then choose your command. Use the t key to tag messages. Its a toggle, so hit t again to untag them. Once youve selected the messages youd like to operate on, preface your command with a semicolon to indicate the command should be applied to all tagged messages. For example, the command ;s=Nicaragua will save all tagged messages to the mail folder by the name of Nicaragua and ;d will delete them. You can tag messages individually if you like, but its faster to use a pattern to select them. Shift-T tags messages that match a pattern, and control-T untags messages that match a pattern. Escape-T will tag a whole thread, if youve chosen to display your messages based on threads. Once youve tagged a group of messages, you can do anything you want to them. For example, you can even tag several messages and hit r for reply and mutt will combine the text of all those messages into a single message and, once youve composed your message text, send it to the authors of each of those messages. This is useful if you correspond with a person who sends you 6 separate emails about 6 separate topics. 2.8.3 Limiting Messages Shown Limiting is another way that patterns increase your efciency. More often than not, youve got too much mail in your box to deal with. Limiting how much of it you see is convenient and helpful, and only a keystroke away. The l command (lower case L) limits the messages shown in the index. It doesnt delete anything, it just limits which messages are presented in the index according to your criteria, which you can specify using regular expressions or certain keys. For example, hit l and then type the word proje and hit return. Of all the messages in the index, only those that have the expression proje somewhere in the subject or address elds will be shown. To remove the limitation, hit l. (thats L followed by a period), which shows messages that contain any character at all, that is, every message. See section 7 for a complete list of patterns. For example, to limit by date, l ~d>2w to limit the index to all messages whose received date (~d) is greater than two weeks (>2w), or set l ~N to see only messages that have been agged new. If you forget what your criteria for limiting was, or would just like to conrm whether or not you are limiting them, pressing Esc-L will reveal in the status bar what the current limiter is. The ~d sequence limits messages based on date criteria. This is highly useful. An example is worth a thousand words, so let the following serve as guides: Limiter l ~d 20/1/05-31/10 l ~d<1d l ~d 15/1/2001*2w Limits messages to: all messages whose date is between 20 Jan 1995 and 31 Oct of the current year all messages less than one day old, that is, all messages received today all messages plus or minus two weeks from 15 Jan 2001 Figure 8: Criteria for Working with Dates
2.8.4 Using Patterns to Archive Groups of Messages By tagging groups of messages and saving them to off-line folders you can easily archive in a format that remains readable rather than some mysterious binary format. The format of that le will either be a mailbox
13
(i.e., a single, at le), a maildir like those on IMAP systems, depending on the default for your system (see sec. 3.7 on how to set this variable). I like to use tags to gather messages by date range and archive them to a at le, then zip the le to save space on my hard drive. When I want to read through archives I can do so by starting mutt from the -f command. First tag the messages, using T ~d>30d, which will tag all messages greater than 30 days old. THen save them to a le called sept-2006 using the command ;s=~/Documents/Mailarchives/sept-2006 To read the messages in that archive, treat it like a mailbox and read it using mutt -f ~/Documents/ Mailarchives/ sept-2006.
3 Conguring Mutt
3.1 Basic Conguration
Mutt is a mail user agent (MUA), and makes no effort to provide native ability to download, upload, or compose messages, relinquishing responsibility for those tasks to programs better suited to the job. Neither
14
3 CONFIGURING MUTT
does it deal with HTML mail, attachments, or help you click on a URL in the text to be taken to the relevant web page. Rather, mutt interfaces with lots of other programs that already perform these tasks admirably. This means to use mutt you have to congure several different programs, including sendmail or equivalent for uploading (sending), fetchmail for downloading (assuming you have a POP3 account rather than IMAP), the lynx text browser for viewing HTML messages, and urlview for dealing with URLs in mail. In general, you will need the following conguration les on your system: .muttrc Denes all settings for Mutt itself .mailcap Tells mutt which software to associate with different attachments .fetchmailrc For downloading mail from a POP3 server, if thats how you are connecting a mail spool le probably /var/mail/spool/$USERNAME an alias le of your choosing, such as .mutt-alias. This is your address book The spool le is where mutt expects to nd mail thats been downloaded from your ISP (i.e. your inbox). Youll also want to choose and congure your favorite text editor. Unix and Linux systems come with several text editors already installed, so its just a matter of your choosing which one you like. Mutt also requires an address book called an alias le, and will help you develop one as you go through your mail, if you like. More on each of these things below. Your .muttrc le is a conguration le that should be stored in your home directory. If you dont have one in your home directory mutt will utilize the system-wide conguration le at /etc/Muttrc (note the capital M). You can copy that le to your home directory, calling it .muttrc (note the period; its a dot-le). This is the le you will modify to set up mutt to your liking. Alternatively, you can start a new .muttrc le using the text editor of your choice using the code in this document as a base. The .muttrc le contains code that determines mutts keybindings (which keys perform which function), code that determines what mutt looks like, including colors, and code that determines how mutt behaves. First of all, the hash mark (#) is interpreted as a comment sign, so any text after a hash mark is ignored when mutt processes its les. If you want to try a test .muttrc you can name it something different and start mutt from the command line with mutt -F TESTFILE to use it in place of your .muttrc. However, you can also test out commands one by one once mutt is running, by pressing the colon sign and entering the command. You wouldnt want to do that for large sets of commands, obviously, but if you simply want to try something both ways, you can do so in this way. Still another way is to get mutt started, then make edits to your .muttrc le, and have mutt reload the conguration le by entering :source .muttrc. This is my favorite way of testing congurations as I go.
15
3.2.1 Downloading from a server (POP3) Getting your mail: In this scenario, your ISP has provided you with a mailbox, and you download its contents and deal with your mail ofine. If this is your situation, mutt expects to nd your mail waiting for you on your system at the location /var/spool/mail/USERNAME, and you will use Fetchmail to retrieve it from the server. First, Fetchmail: Fetchmail is included on all Linux distributions worth their salt these days. In your home directory you should create a dot le (conguration le) by the name of .fetchmailrc. In it, provide your download information. Fetchmail is well documented, so either start with your systems sample fetchmail le (/etc/fetchmailrc) or read the man page for fetchmail to get an idea of all the things fetchmail is capable of. For any POP3 account Ive ever had, all Ive needed has been something like the following. Replace the UPPERCASE terms with your own information; USERNAME is the name by which your ISP knows you; LOCALUSERNAME is the name by which you log onto your Linux box. poll MAIL.MYISP.COM with protocol pop3 user USERNAME with pass PASSWORD is LOCALUSERNAME here; To get your mail, open up a terminal and download it by entering the command fetchmail. Some distros like SUSE set up your machine so your mail is automatically downloaded every time you establish an internet connection. When you sit down at your computer you can open up a terminal and rst run fetchmail, then run mutt. Or you can start with mutt, and run fetchmail by entering ! fetchmail. The exclamation point is the mechanism for getting to a shell from within mutt. After ! you could easily input any shell command you like (less, sort, ls, vim, etc.) Now, mutt: If your log-in name on your system is randymon, mutt expects to nd a text le with appropriate permissions (that is, user can read and write) at /var/spool/mail/randymon. If that le doesnt exist, root will have to create it for you. Remember, its a le, not a directory, so you can create it with the touch command and then set the permissions using chmod. mailboxes /var/spool/mail/randymon set spoolfile=/var/spool/mail/randymon set folder="$HOME/Mail" set record="$HOME/Mail/Sent"
Sending your mail: If youre working ofine, you will probably be using Sendmail or Postx as a mail transfer agent (MTA), or something equivalent, and your Linux box will send off the queued mail whenever you connect. See section 3.3 for other options.
3.2.2 Accessing your Mail at the Server (IMAP) Getting your mail: If you use IMAP, your mail never gets downloaded. There are lots of advantages to this method. Use something like the following in your .muttrc
16
3 CONFIGURING MUTT
mailboxes imap://myfirstisp.com set folder="imap://myfirstisp.com/INBOX" set imap_user="myusername" #your IMAP user name or login set imap_pass="password" #your IMAP password If you are uncomfortable about having your IMAP password stored in plain text, set the permissions for .muttrc using the chmod command so only you can read and write to the le, no one else. In this same section of your .muttrc, show mutt where to nd your IMAP inbox. This is sometimes not apparent, even when youve specied where to nd your mail. set spoolfile="imap://myfirstisp.com" Header Caching: Mutt suffers from one of IMAPs deciencies: every time you enter a new IMAP folder Mutt has to reread the contents of the entire folder in order to present you with the index. For folders with a lot of messages, or any folder if youre working over a slow connection, that can be the source of a very lengthy pause. Caching the headers takes care of the problem, by providing mutt with a mechanism for storing the headers locally; mutt then only needs to compare the contents of your IMAP folder with the local cache, and react accordingly. For most IMAP users, this is a huge improvement. Prior to about 2008, header caching was a patch you had to compile in yourself. These days, its standard (it came automatically with my SUSE 9.2 distro). The header cache can take two forms: a folder of les, or a single le. If .muttheadercache (or whatever you call it) is a le, your cache will be a single le. I prefer it to be a folder of les, so simply mkdir .mutt-headercache to do so. Make it a dot le so you dont have to look at it every day in my home folder. Once youve created a home for the cache, simply tell mutt where to nd it, as follows: set header_cache=/home/randymon/.mutt-headercache Sending your mail: Again, youll either be using Sendmail or an equivalent, to send email. But here, Mutts internal SMTP capability is also available to you, since you will have a live Internet connection while youre working. The trick in this scenariois to ensure youve congured your Sent Mail folder correctly so that all your sent messages are registered on the server instead of simply being saved locally. See section 3.3. 3.2.3 Ofine IMAP Getting your mail: From a users point of view, Mac OSXs Mail program got it right: your IMAP account is cached locally, and updates changes whenever you connect. It does away with Im not connected to the Net so I cant access my old mail and basically allows the user not to care what kind of mail account hes using. Mutt users can now do the same. Ofineimap is a package of Python scripts that replicates your entire IMAP account locally, sub-folders and all. The rst time you sync, it can take some time, but afterwards the program runs quickly, and you can even set it to run in the background. First, download and install ofineimap. It requires a somewhat modern version of Python. Next, give ofineimap a place to store its local cache (this will turn into a gigabyte- or greater-sized directory, so choose
17
carefully): mkdir .mailcache. The man page will walk you through the next steps, but essentially, you need only to declare the parameters for the local and IMAP accounts, and then execute the program periodically. Heres a sample ofineimap conguration: [general] accounts = personalmail [Account personalmail] localrepository = local remoterepository = remote [Repository local] type = Maildir localfolders = ~/.mailcache sep = / [Repository remote] type = IMAP remotehost = MYISP.WHATEVER.NET remoteuser = MYLOGINNAME ssl = yes remotepass = MYPASSWORD Finally, since you will now be accessing not your IMAP account but the local, replicated repository, your .muttrc should point to it as follows: set folder=$HOME/.mailcache/INBOX/ set spoolfile=$HOME/.mailcache/INBOX set record="=Sent" # or whatever your sent mailbox is called
Sending your mail: You have two options: one is to use the sendmail installed on your system, having congured it for ofine mode (mail is queued locally, and sent only when your machine detects a network connection). Your second option is to use putmail.py-queue, a partner script to putmail. Putmail.py-queue stores outgoing mail in a folder, and then sends it to putmail one by one when you instruct it to dequeue. In that case, you would use set sendmail=/usr/local/bin/putmail_enqueue.py in your .muttrc. When you get a net connection, run putmail_dequeue.py to send out all the stored mail youve accumulated.
18
3 CONFIGURING MUTT
mutt where to nd the sendmail program. In most cases, sendmail is located at /usr/sbin/sendmail, so the following line should sufce. Postx even provides a simlink at that location to deal with mail programs expecting to nd sendmail there. So once you know where to nd sendmail, put a line in your .muttrc le that tells mutt where to hand off written mail for sending, as follows: set sendmail=/usr/sbin/sendmail However, installing and conguring Postx or Sendmail is not fun in an age when any self-respecting ISP requires authentication to stem the spamood, so choosing a distribution that does this for you, like SUSE, will take a lot of pain out the process (Ubuntu users, you are out of luck, change distros or learn how to congure sendmail). If youre just a casual emailer instead of a systems administrator, and just need a simple and easy way to get your mail to your ISP, perhaps a full-blown Postx conguration is overkill. There are several alternatives created for the likes of mutt users who just need an easy way to send mail to their ISP, and nothing fancier than that. Mutts own SMTP: Starting with version 1.5.17, mutt now miracle of miracles has the capability of sending your messages without the need for another program like sendmail. This goes essentially against the mutt philosophy, but was requested by enough users that the decision was made to include SMTP capability. To take advantage of this, in your muttrc le you would add your log in information in the following format: set smtp_url="smtp[s]://[user[:pass]@]host[:port]/" Lets say you have a mail account whose SMTP address is outmail.mailhost.com, where you log in using the name squeaker with password bear. set smtp_url="smtp://squeaker:bear@outmail.mailhost.com" SSMTP: The rst is ssmtp (simple SMTP),a package that allows you to send mail via the SMTP protocol to your ISP, authenticating with a username and password. For most people, thats all you need to do anyway, and choosing this option simplies the process of installing mail transport agents that were really intended to go on servers and handle immense volumes of mail, spam, and bounces every day. If thats the mechanism you choose, your .muttrc le should look like this: set sendmail="/usr/sbin/ssmtp -audUserName@domain -apSecretPassword" Putmail.py: Just as easy, if not easier, is Putmail.py, a tiny python script that provides a dead simple interface for sending mail. Its a simple 13 KB download and an even simpler 5 line conguration le, and you are up and running. Once it is working you can even congure other software to use it, such as the slrn newsreader. This is now my preferred conguration on the Macintosh, which lacks easy postx conguration utilities, while on SUSE I stick with YaST2 and Postx.4 There are two packages: putmail.py and putmail-queue.py. The latter allows you to build up a queue of outgoing mail while youre ofine, then send it all at once. A putmail.py conguration le is as simple as the following. In most cases, your email address and username should be the same:
4 Thanks to Kevin Neely for convincing me to take another look at Putmail.py. It so impressed me Im taking a much harder look at Python in general!
19
[config] server = OUTGOING.MAIL.SERVER email = YOUR@FROMMAIL.ADDRESS password = PASS username = USERNAME@FROMMAIL.ADDRESS Others: There are several other light SMTP agents that do what the ssmtp program does, including esmtp, msmtp, nullmailer, and others. See the Mutt Wiki for a complete list (see section 5). Otherwise, welcome to the wonderful world of conguring mail transfer agents. That task is beyond the scope of this guide. The most useful resource for conguring postx for the purposes of a mutt user (that is, you just need it to send mail to your ISP) is entitled Postx State of Mind. See the Appendices for its URL.
20
3 CONFIGURING MUTT
<linuxlover@yahoo.com>
where linux_lover is an alias you choose for the address, the next couple of words are the persons real name, and everything between brackets is the email address. We source that le (identify it as a le to be read into memory when using mutt to make it available by identifying it as our alias le (again, if it doesnt exist, youll have to create it yourself rst). set alias_file="~/.muttalias" And heres a neat trick: we set reverse_alias so that any mail sent to us by a person in our address book is shown using the name in our address book, not the name their mail goes out with. That is, if our correspondent is really an idiot, our alias can read alias Idiot Firstname Lastname <coworker@myworkplace.com>
and our mailbox will show mail from that person as coming from the name Idiot. A better use of this trick is to deal with people whose names arent easy understandable, like x36gd9o_33a@hotmail.com. And no, the other person will not know youve labeled him Idiot, it simply changes the display of his name in your mailbox, not in your messages. set reverse_alias #use names from my own address book, if they exist There are more sophisticated ways to manage your address book, by using external programs like abook. See section 3.5.2 for details. If youd like more functionality in your address book without leaving the console, think about helping mutt interface with something more powerful. There are several small console-based address books with which mutt is able to interface, but unfortunately no real way to interface with something truly powerful like Apples Addressbook or Kmails KAddressbook.
3.5.2 Abook Abook is a simple console address book that stores all your information in text les and interfaces well with mutt. Written by Jaakko Heinonen, it is undergoing active development as of September 2006. Abook is easy to congure and use. It does not, however, understand the vcard standard le format: this is its most serious limitation. Also, in earlier versions, abook ran parallel to your alias le and you had to manually syncronize them every so often, which was not very convenient; fortunately, that has been dealt with, and these days, for a decent address book and an easy interface with mutt, abook is hard to beat. To use abook, rst download and install it (see section 5.2 for the link), and get familiar with how it works by running it from a console. Its pretty straightforward, and you can either type in a couple of addresses to practice with or import your mutt alias le. Now that youve got some addresses to work with, integrate it with mutt. The rst step is to remove the links to the mutt alias le, so assuming you called your alias le .mutt-alias, make sure to remove the following two lines from your .muttrc:
21
set alias_file=".mutt-alias" source .mutt-alias And now add the following two lines in their place: set query_command= "abook --mutt-query %s" macro index,pager A "<pipe-message>abook --add-email-quiet<return>" "add the sender address to abook" The rst line sets up the link to abook for extracting addresses from your addressbook, and the second one creates a macro so that when you press A just about anywhere, the email address of that messages sender will be sent to abook. Lastly, get used to using "query" functionality instead of alias functionality, as mutt treats them differently. Lets say you start a new message by pressing m in the index view. Mutt presents you with "To: " and waits for you to enter the address of your recipient. Normally youd press tab at this point for a quick search of the aliases in your alias le. Instead, now you press Control-T in order to do the same thing, but via a query to abook instead of your alias le. Put the cursor over the person youd like to write and press enter to start the message. If youd like to several people from the abook, tag them using the t key and then press ;m to have them all placed on the "To:" line of your message. You can add additional queries to the same line by pressing A. For example, type Control-t to start a query, "Do" to search for names that start with "Do." You select a few by pressing t and then press A to search for additional names using a different criteria. Press "Ri" to search for names that start with "Ri" and select them in the same way. When youve tagged everyone youd like to mail, press ";m" to send all those addresses to the "To: " line. Repeat this process for the "Cc: " line and so on. Some people like to use the abook and the alias le in parallel, keeping good/important addresses in the abook and using the alias le to collect addresses from mail they read. This is a bit inelegant since it forces you to manually synchronize from time to time, but has its advantages, since, for one, the alias le allows you to include a mailing list composed of other names present in the alias le, while abook does not. Nothing is simple, but take a look at http://wolfermann.org/abook-autoexport for one way of doing so.
3.5.3 Querying an LDAP Server Mutts query command (Q, pressed at any prompt, or control-T after youve input a couple of characters to search for) is powerful and impressive. To query an LDAP server, rst download the mutt-ldap.pl script (nd a link to it at the mutt wiki) and save it to someplace where you can execute les (I saved it to ~/bin). You need to update just four lines in the perl script, and you are good to go. Increasingly, this is how I deal with addresses.5
5 Of course, since its just an executable perl script, you can call it from the command line at any time. From the command prompt, just enter mutt-ldap.pl hoozit to search your LDAP server for a user named hoozit.
22
3 CONFIGURING MUTT
3.5.4 The Little Brother Database You can get the Little Brother Database (lbdb) from its sourceforge site (see 5). Set mutt to query the LBDB for addresses by adding the following to your muttrc: set query_command="lbdb %s" The LBDB can query different sources of information to manage your addresses. See the Marks Mutt Fan and Tip Page (Resources) for more information on how to congure the LBDB with mutt. In particular, the LBDB is a useful way for Mac users to get Mutt to interface with the Apple Addressbook that comes standard on Mac OS X. Vincent Danen does a tremendously good job at describing not just how to get this link to happen but also how to set up and use Mutt on Mac OS X in general. His website is listed in the Resources section of this guide. 3.5.5 Rolo Addressbook The Rolo Address book purports to do what Abook does, but using the vcard standard. I havent used it so I cant say, but working with vcards is an important step toward being able to import and export addressbooks from other software packages. See the references in section 5 for the source of this software.
23
24
3 CONFIGURING MUTT
unset mark_old #dont mark messages as old when I pass over them with the cursor These are just several of the hundreds of conguration parameters over which mutt gives you control. This is what people mean when they say mutt is highly congurable. For more settings and a glimpse of what your options are, read the muttrc man page or mutts online documentation (see sec. 5 for the URL). Now lets look at the settings that affect our general interaction with mutt. The following lines of code establish my name and email address. set include gives you the opportunity of automatically stripping out the message youre replying to in the text of your email. Mutt can also by default hide the Cc and Bcc lines of the address if you dont typically use them. I dont BCC anybody, so in my .muttrc I have unset that option, leaving only ccs. unset self is a great feature I wish other email clients would implement. When replying to a group email, mutt is smart enough to recognize and remove your address from the list of recipients so you dont accidentally send yourself the message. The following two lines deal with attribution of replies and forwarded messages. You could change this so that in an email reply, underneath your text it reads On July 4, 2005, you vomited up the following nonsense: or equivalent. # Composing Messages set from="Randall Wood <my_email@address.com>" #My name and email address as shown in other peoples inboxes set include=yes #include message in replies set askcc #include a cc: line on which to add recipients # set askbcc #include a bcc: line set fcc_attach #forward attachments unset reply_self #dont include myself when replying to a group set attribution="On %d, %n wrote:" set forward_format="Fwd: %s" set indent_str="> " #indented text prefaced by this string. set postpone=ask-no #default for postponing a message is to confirm, default to no set tilde
25
home directory that lists possible MIME types (attachment types) and how to deal with them. Your .mailcap le is a simple text le and may already exist in your home directory, depending on your distribution. If it does exist, simply add the following line: text/html; lynx -dump -force_html %s; needsterminal; copiousoutput
Once your .mailcap tells mutt how to process HTML les, you must tell mutt to rst source the .mailcap, and second to process the HTML and present it inline, instead of treating it as an attachment to be shown separately. This takes away the HTML mystery of your friends who insist on using hotmail: mutt will lter out the text and simply present it without the formatting. If you respond to or forward the message, the text will remain and the formatting will be permanently removed. People who tend to gravitate towards console email clients tend to like this ability to strip out all extraneous formatting that makes email large and unwieldy. Once youve modied the .mailcap le, add the following lines to your .muttrc: set implicit_autoview auto_view text/html application/x-pgp-message set mailcap_path="~/.mailcap" The rst line tells mutt to automatically show everything it knows how to show without being prompted, the second line tells mutt which types of les to show as part of the body text, and the third line tells mutt where to nd the mailcap.
26
4 ADVANCED CUSTOMIZATION
them to plain text. Its highly useful on its own as a document tool, but combined with mutt it becomes more powerful still. Assuming you have installed antiword on your machine, add the following to your mailcap le: application/msword; antiword %s ; copiousoutput And Word doc text will be displayed inline. This is an extraordinarily useful trick! If your distribution doesnt include antiword, try the application wvText instead, which works just as well. This doesnt solve all your problems, but should solve many of them. Some broken webmail email applications dont label MIME types appropriately, which will hinder Mutts ability to appropriately determine which application to use to open the le.
4 Advanced Customization
4.1 Using Mutt with different congurations
If you wind up using mutt sometimes with IMAP and sometimes with ofineimap, or once for your home account and once for your work account, you will need different congurations. My simple solution is simply to use different .muttrc les, and create aliases to run them. For example, create .mutt-home, .muttschool, and .mutt-home-ofine les. Then in your .bashrc le, create aliases, so that homemutt becomes a command that runs mutt -F .mutt-home. In your .bashrc, that would be alias homemutt=mutt -F .mutt-home. Do the same for your other congurations.
27
consoles are white on black. In addition, aterm, gnome-terminal, and konsole are all terminal emulators capable of using transparency and background images, both of which are very pleasant effects. So instead of committing yourself to colors in your .muttrc le its better to put groups of colors in additional les and source them as necessary. For example, create .mutt-clear, which will be the color conguration when you use mutt in a transparent terminal, .mutt-white for black on white scenarios, and .mutt-black for white on black scenarios. Then once mutt is running you can source the one you would like to use by entering: : source ~/.mutt-clear Note the colon at the beginning of the line, which indicates to mutt youd like to enter a command. Alternately, you can simply source the le in your .muttrc le by adding that line to your .muttrc. Color works as follows: You indicate which object youd like to dene a color for and its foreground and background colors, plus a regular expression if the color is to be conditional (for example, to provide color for text that looks like an email address). You can remove a color with the uncolor command, something Ive never had ocassion to do. The following three lines are examples of the format, and you can then choose an object from chart 9 and a color from the following list: white, black, green, magenta, blue, cyan, yellow, red, default, colorx. The foreground color can also be prexed with the keyword bright to make the foreground color boldfaced (e.g., brightred). If you run mutt in a clear terminal, make sure to choose default as your background color in order to preserve the transparency. color object foreground background [ regexp ] color index foreground background pattern uncolor index pattern [ pattern ... ] As usual, an example is worth its weight in gold. The following are my color selections, including some that I copied from the defaults that come along with the Debian package for mutt. In general, this provides a black background, white text, attachment labels in yellow, quoted text in green, and deleted messages in red. In addition, email addresses and URLs are highlighted in bright colors in the message body. color color color color color color color color color color normal white black attachment brightyellow black hdrdefault cyan black indicator black cyan markers brightred black quoted green black signature cyan black status brightgreen blue tilde blue black tree red black
color index red black ~D color index magenta black ~T #color header brightgreen black ^From: #color header brightcyan black ^To:
28 Name attachment body bold error header hdrdefault index indicator markers message normal quoted quoted1 . . . quotedN search signature status tilde tree underline
4 ADVANCED CUSTOMIZATION
Description any attachments present match regexp in the body of messages highlighting bold patterns in the body of messages error messages printed by Mutt match regexp in the message header default color of the message header in the pager match pattern in the message index arrow or bar used to indicate the current item in a menu the + markers at the beginning of wrapped lines in the pager informational messages normal (not quoted) text text matching $quote_regexp in the body of a message higher levels of quoting highlighting of words in the pager any text beneath the signature line mode lines used to display info about the mailbox or message the ~ used to pad blank lines in the pager thread tree drawn in the message index and attachment menu hiliting underlined patterns in the body of messages Figure 9: Parts (Objects) of Messages that can be Highlighted
#color header brightcyan black ^Reply-To: #color header brightcyan black ^Cc: #color header brightblue black ^Subject: color body brightred black [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # identifies email addresses color body brightblue black (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ # identifies URLs Heres one way to make it useful. Lets say you receive mail at both penguin@iceberg.net and penguin@school.edu, and the latter account simply forwards all received mail to your iceberg.net account. You can different between the two types of mail in your inbox by including in your .muttrc color index green default C penguin. Any mail where the word penguin appears in the to: or CC: lines will be shown as green.
29
keyboard layout like Dvorak). The bind command allows you to congure mutt the way you like to work. The command takes the following form: bind map key function. Maps can be one of the following: generic, alias, attach, browser, editor, index, compose, pager, pgp, and postpone, and determines in which context the key is to be bound, i.e. when you are maneuvering around the index, when you are in the pager, when you are searching for an alias in your address book, and so on. Key is the key (or key sequence) you wish to bind. To specify a control character, use the sequence \Cx, where x is the letter of the control character (for example, to specify control-A use \Ca). Note that the case of x as well as \C is ignored, so that \CA, \Ca, \cA and \ca are all equivalent. Mutt allows you to use non alpha-numeric keys on a lot of platforms, but I was unable to get the F keys (F1, F2, etc.) to work on my Macintosh, so its not universal. Using the brackets shown below you can access any key listed in table 10 below: Code \t <tab> \r \n \e <esc> <up> <down> <left> <right> <pageup> <pagedown> <backspace> <delete> <insert> <enter> <return> <home> <end> <space> <f1> <f10> Produces: tab tab carriage return newline escape escape up arrow down arrow left arrow right arrow Page Up Page Down Backspace Delete Insert Enter Return Home End Space bar function key 1 function key 10 Figure 10: Special keys to which you can bind functions These are some of the shortcuts I have bound keys to in order to facilitate easy navigation, but you can bind just about anything you like. See section B for a list of all the functions available to you when programming keys. bind generic - first-entry #minus sign takes me to the top of the list bind generic = last-entry
30
4 ADVANCED CUSTOMIZATION
#equals sign takes me to the bottom of the list bind generic L bottom-page #to the bottom, bind generic M middle-page # middle, and bind generic H top-page # top of the screen bind index [ previous-unread #to the previous unread message in the list bind index ] next-unread #or the next unread message. The keys bound to generic are congured for usage throughout the program. So above we have two key bindings that only function in the index, and in the pager while youre reading a message, the [ and ] keys will have no effect.
31
Two additional variables are useful to set here. The rst is tilde, which, if set, pads the screen at the end of the message with tildes to indicate the end of le (the same way vim does). If thats interesting to you, include set tilde The other is resolve. When you operate on a message, by default, Mutt then takes you to the next message automatically. But if the next message includes a big attachment you will be stuck until Mutt nishes downloading the entire attachment, which might take a while and be annoying if you are working online, i.e. with an IMAP mail account. You can prevent this by unsetting the resolve variable, i.e.
32
4 ADVANCED CUSTOMIZATION
unset resolve Otherwise, redene the delete command so that it takes you back to the index before deleting the message. That way the cursor will move automatically to the next message but not automatically open/download it. Add this to your .muttrc:6 folder-hook . macro pager d "<exit><delete-message>" "Delete the message" See section 4.10 for more information about folder hooks and how this folder hook works. You can add lines like the following to ensure your pager works the way you think it will (up and down scrolling). I also added commands to go rapidly to the next message. Be creative. bind bind bind bind pager pager pager pager <up> previous-line <down> next-line [ previous-unread ] next-unread
to Tim Brown for this trick. 2007: visit http://www.therandymon.com for details.
33
34
35
The mutt manual: http://www.mutt.org/doc/manual/manual.html The denitive guide to mutt. Mutt Newsgroup: comp.news.mutt a very active usenet newsgroup, but watch your netiquette and do some Googling before asking simple questions. The mutt-users mailing list: http://www.mutt.org/mail-lists.html Marks Mutt Fan and Tip Page: http://mark.stosberg.com/Tech/mutt.html My First Mutt, by Bruno Postle: http://mutt.blackfish.org.uk A good start for many new users, and very user friendly The Mutt Wiki: Character Sets http://wiki.mutt.org Good information on working with nonLatin character sets (Greek, Polish, Russian, etc.) light SMTP agents, and a lot more Rano.org Unicode Mutt: http://www.rano.org/mutt.html info on getting mutt to work in a unicode environment Postx state of mind: http://postfix.state-of-mind.de/patrick.koetter/smtpauth/ smtp_auth_mailservers.html: info on setting up Postx to the point where you can send mail to your ISP. Wolferman: A neat little script for keeping your mutt alias le and your abook addressle in synch: http: //wolfermann.org/abook-autoexport Vincent Danen: Using Mutt on Mac OS X: http://linsec.ca/Using_mutt_on_OS_X In addition, many people have posted their .muttrc les to the internet. Google for muttrc to nd some of them.
36
A APPENDIX: PATTERNS
Appendix: Patterns
~A ~b ~B ~c ~C ~D ~d ~E ~e ~F ~f ~g ~G ~h ~k ~i ~L ~l ~m ~n ~N ~O ~p ~P ~Q ~R ~r ~S ~s ~T ~t ~U ~v ~x ~y ~z ~=
all messages messages which contain EXPR in the message body messages which contain EXPR in the whole message messages carbon-copied to USER message is either to: or cc: EXPR deleted messages messages with date-sent in a Date range expired messages message which contains EXPR in the Sender field flagged messages messages originating from USER PGP signed messages PGP encrypted messages messages which contain EXPR in the message header message contains PGP key material message which match ID in the Message-ID field message is either originated or received by EXPR message is addressed to a known mailing list message in the range MIN to MAX *) messages with a score in the range MIN to MAX *) new messages old messages message is addressed to you (consults $alternates) message is from you (consults $alternates) messages which have been replied to read messages messages with date-received in a Date range superseded messages messages having SUBJECT in the Subject field. tagged messages messages addressed to USER unread messages message is part of a collapsed thread. messages which contain EXPR in the References field messages which contain EXPR in the X-Label field messages with a size in the range MIN to MAX *) duplicated messages (see $duplicate_threads)
37
The generic menu is not a real menu, but species common functions (such as movement) available in all menus except for pager and editor. Changing settings for this menu will affect the default bindings for all menus (except as noted). bottom-page current-bottom current-middle current-top enter-command exit first-entry half-down half-up help jump last-entry middle-page next-entry next-line next-page previous-entry previous-line previous-page refresh search search-next search-opposite search-reverse select-entry shell-escape tag-entry tag-prefix top-page L not bound not bound not bound : q = ] [ ? number * M j > z k < Z ^L / n not bound ESC / RET ! t ; H move to the bottom of the page move current entry to bottom of page move current entry to middle of page move current entry to top of page enter a muttrc command exit this menu move to the first entry scroll down 1/2 page scroll up 1/2 page this screen jump to an index number move to the last entry move to the middle of the page move to the next entry scroll down one line move to the next page move to the previous entry scroll up one line move to the previous page clear and redraw the screen search for a regular expression search for next match search for next match in opposite direction search backwards for a regular expression select the current entry run a program in a subshell toggle the tag on the current entry apply next command to tagged entries move to the top of the page
B.2
The Index
remail a message to another user open a different folder open a different folder in read only mode check for classic pgp clear a status flag from a message
38
copy-message C create-alias a decode-copy ESC C decode-save ESC s delete-message d delete-pattern D delete-subthread ESC d delete-thread ^D display-address @ display-toggle-weed h display-message RET edit e edit-type ^E exit x extract-keys ^K fetch-mail G flag-message F forget-passphrase ^F forward-message f group-reply g limit l list-reply L mail m mail-key ESC k next-new TAB next-subthread ESC n next-thread ^N next-undeleted j next-unread not bound parent-message P pipe-message | previous-new ESC TAB previous-page Z previous-subthread ESC p previous-thread ^P previous-undeleted k previous-unread not bound print-message p query Q quit q read-subthread ESC r read-thread ^R recall-message R reply r resend-message ESC e save-message s
copy a message to a file/mailbox create an alias from a message sender decode a message and copy it to a file/mailbox decode a message and save it to a file/mailbox delete the current entry delete messages matching a pattern delete all messages in subthread delete all messages in thread display full address of sender display message and toggle header weeding display a message edit the current message edit the current messages Content-Type exit without saving changes extract PGP public keys retrieve mail from POP server toggle a messages important flag wipe PGP passphrase from memory forward a message with comments reply to all recipients show only messages matching a pattern reply to specified mailing list compose a new mail message mail a PGP public key jump to the next new message jump to the next subthread jump to the next thread move to the next undeleted message jump to the next unread message jump to parent message in thread pipe message/attachment to a shell command jump to the previous new message move to the previous page jump to previous subthread jump to previous thread move to the last undelete message jump to the previous unread message print the current entry query external program for addresses save changes to mailbox and quit mark the current subthread as read mark the current thread as read recall a postponed message reply to a message resend message and preserve MIME structure save message/attachment to a file
39
set-flag show-version show-limit sort-mailbox sort-reverse sync-mailbox tag-pattern tag-thread toggle-new toggle-write undelete-message undelete-pattern undelete-subthread undelete-thread untag-pattern view-attachments
set a status flag on a message show the Mutt version number and date show currently active limit pattern, if any sort messages sort messages in reverse order save changes to mailbox tag messages matching a pattern tag/untag all messages in the current thread toggle a messages new flag toggle whether the mailbox will be rewritten undelete the current entry undelete messages matching a pattern undelete all messages in subthread undelete all messages in thread untag messages matching a pattern show MIME attachments
B.3
The Pager
bound b c ESC c ESC P C a ESC C ESC s d ESC d ^D @ h e ^E : i ^K F ^F f g bound bound ? jump to the bottom of the message remail a message to another user open a different folder open a different folder in read only mode check for classic pgp copy a message to a file/mailbox create an alias from a message sender decode a message and copy it to a file/mailbox decode a message and save it to a file/mailbox delete the current entry delete all messages in subthread delete all messages in thread display full address of sender display message and toggle header weeding edit the current message edit the current messages Content-Type enter a muttrc command return to the main-menu extract PGP public keys toggle a messages important flag wipe PGP passphrase from memory forward a message with comments reply to all recipients move up one-half page move down one-half page this screen
bottom not bounce-message change-folder change-folder-readonly check-traditional-pgp copy-message create-alias decode-copy decode-save delete-message delete-subthread delete-thread display-address display-toggle-weed edit edit-type enter-command exit extract-keys flag-message forget-passphrase forward-message group-reply half-up not half-down not help
40
list-reply mail mail-key mark-as-new next-line next-entry next-new next-page next-subthread next-thread next-undeleted next-unread parent-message pipe-message previous-line previous-entry previous-new previous-page previous-subthread previous-thread previous-undeleted previous-unread print-message quit read-subthread read-thread recall-message redraw-screen reply save-message search search-next search-opposite search-reverse search-toggle shell-escape show-version skip-quoted sync-mailbox tag-message toggle-quoted top undelete-message undelete-subthread undelete-thread view-attachments
L m ESC k N RET J TAB ESC n ^N j not bound P | BackSpace K not bound ESC p ^P k not bound p Q ESC r ^R R ^L r s / n not bound ESC / \ ! V S $ t T ^ u ESC u ^U v
reply to specified mailing list compose a new mail message mail a PGP public key toggle a messages new flag scroll down one line move to the next entry jump to the next new message move to the next page jump to the next subthread jump to the next thread move to the next undeleted message jump to the next unread message jump to parent message in thread pipe message/attachment to a shell command scroll up one line move to the previous entry jump to the previous new message move to the previous page jump to previous subthread jump to previous thread move to the last undelete message jump to the previous unread message print the current entry save changes to mailbox and quit mark the current subthread as read mark the current thread as read recall a postponed message clear and redraw the screen reply to a message save message/attachment to a file search for a regular expression search for next match search for next match in opposite direction search backwards for a regular expression toggle search pattern coloring invoke a command in a subshell show the Mutt version number and date skip beyond quoted text save changes to mailbox tag a message toggle display of quoted text jump to the top of the message undelete the current entry undelete all messages in subthread undelete all messages in thread show MIME attachments
B.4 Aliases
41
B.4
Aliases
/ n ESC / search for a regular expression search for next match search backwards for a regular expression
B.5
Queries
a m Q A / n not bound ESC / create an alias from a message sender compose a new mail message query external program for addresses append new query results to current results search for a regular expression search for next match search for next match in opposite direction search backwards for a regular expression
B.6
bounce-message collapse-parts delete-entry display-toggle-weed edit-type extract-keys forward-message group-reply list-reply pipe-entry print-entry reply resend-message save-entry undelete-entry view-attach view-mailcap view-text
B.7
42
copy-file detach-file display-toggle-weed edit-bcc edit-cc edit-description edit-encoding edit-fcc edit-from edit-file edit-headers edit edit-mime edit-reply-to edit-subject edit-to edit-type filter-entry forget-passphrase ispell new-mime pgp-menu pipe-entry postpone-message print-entry rename-file send-message toggle-unlink view-attach write-fcc
C D h b c d ^E f ESC f ^X e E e m r s t ^T F ^F i n p | P l R y u RET w
save message/attachment to a file delete the current entry display message and toggle header weeding edit the BCC list edit the CC list edit attachment description edit attachment transfer-encoding enter a file to save a copy of this message in edit the from: field edit the file to be attached edit the message with headers edit the message edit attachment using mailcap entry edit the Reply-To field edit the subject of this message edit the TO list edit attachment type filter attachment through a shell command wipe PGP passphrase from memory run ispell on the message compose new attachment using mailcap entry show PGP options pipe message/attachment to a shell command save this message to send later print the current entry rename/move an attached file send the message toggle whether to delete file after sending it view attachment using mailcap entry if necessary write the message to a folder
B.8
delete-entry undelete-entry
B.9
Browser
c TAB m / n ESC / change directories check mailboxes for new mail enter a file mask search for a regular expression search for next match search backwards for a regular expression
B.10 PGP
43
N o O TAB SPACE s u T
select a new file in this directory sort messages sort messages in reverse order toggle whether to browse mailboxes or all files view file subscribe to current mailbox (IMAP Only) unsubscribe to current mailbox (IMAP Only) toggle view all/subscribed mailboxes (IMAP Only)
B.10
PGP
% c view the keys user id verify a PGP public key
view-name verify-key
B.11
The Editor
BackSpace ^B ESC b ^A Space ESC c TAB ^T ^D ESC l ^E ^F ESC f not bound not bound ^K ESC d ^U ^W ^V not bound ESC u delete the char in front of the cursor move the cursor one character to the left move the cursor to the previous word jump to the beginning of the line cycle among incoming mailboxes uppercase the first character in the word complete filename or alias complete address with query delete the char under the cursor lowercase all characters in current word jump to the end of the line move the cursor one character to the right move the cursor to the next word scroll down through the history list scroll up through the history list delete chars from cursor to end of line delete chars from cursor to end of word delete all chars on the line delete the word in front of the cursor quote the next typed key transpose character under cursor with previous uppercase all characters in current word
backspace backward-char backward-word bol buffy-cycle capitalize-word complete complete-query delete-char downcase-word eol forward-char forward-word history-down history-up kill-eol kill-eow kill-line kill-word quote-char transpose-chars upcase-word
This Woodnotes Guide is my own, in that the many weeks that went into researching, writing, editing, and correcting this document were mine; nevertheless I am indebted to the many sources of mutt information
44
I have taken and modied to learn about mutt myself and develop this Woodnotes Guide, including the archives of the mutt newsgroup and the personal mutt web pages of scores of mutt acionados. They are too numerous to name individually, so instead I dedicate this document to them and release it to the public without charge. As I am a writer, not a programmer by trade, this is my contribution to the community in appreciation of the software that other volunteers have made available to me for free. Such is the Open Source community. This document is published under the Creative Commons Attribution-NonCommercial-ShareAlike 2.5 license as described at http://creativecommons.org/licenses/by-nc-sa/2.5/. Please send comments, criticism, and corrections to me at the email address found at my website. Enjoy this guide: I enjoyed creating it.