Learning Mutt

A solution for those mutterings of discontent with your mailer

  1. Here, pooch! Starting Mutt
  2. Round round get around I get around: Getting Around in the Menu

  3. Reading Messages

  4. Deleting Messages

  5. Speak! Sending Messages

  6. Replying to Messages

  7. Forwarding Messages

  8. Saving Messages

  9. Printing Messages

  10. Never Put Off Till Tomorrow What You Can Put Off Till Next Week: Postponing Messages

  11. Teaching an Old Mutt to Do New Tricks: Customizing Mutt

  12. #muttchart.html Mutt Commands Quick Reference


ls

Text in italics is stuff that will appear on the screen, such as:

Reading /var/spool/mail/lharden (20%)


Please tell us about any error messages you receive when you try to start mutt. Be sure to tell us which machine you were using when you had the problem.


The following options are available:

A more complex example:

mutt -s "Party Invitation" faber bolte george -c lharden jrickard -b lin < invitation

This sends the contents of the file "invitation" from your current working directory with the subject header "Party Invitation" to faber, bolte, and george, with carbon copies to lharden and jrickard and a blind carbon copy to lin.


(although, in your case, it had better not be /var/mail/lharden- I don't like other people reading my mail) After a while (depending on the size of your inbox) a list of messages will come up:



[./muttchart.html Mutt Commands Quick Reference]


&lt Tab &gt key.

located immediately to the right of your Ctrl and Shift keys (<font color=red>not</font> the arrows on the numeric keypad on the far right side of the keyboard)

keys, you can use <font color=red>j for down</font> and <font color=green>k for up</font>, just like in vi.

<font color=red>PageDown</font> keys.

you wish to go to. Say you want to go to message number 500. Type the following: 500 When you press Enter, you will see a list of messages including message 500 (for me, it starts with 495 and ends with 513- the number of messages in your list may vary).

* (Shift-8) to go to the last message, or = to go to the first message.

phrase. Say you want to find a message with the word "printer" in the subject. The search works similarly to searching in vi. Type: / (a forward slash) to search forward (messages after the current message), or: &lt Esc &gt / to search backward. You will be prompted: Search for: printer You will be moved to the first message after the current message whose subject line contains the word "printer" (upper case or lower case doesn't matter).

phrase. Type: &lt Esc &gt b You will be prompted and enter the word the same way as above. This works the same way as a forward search of subject headers, only it gives you the next message whose text contains the word you were looking for. In any of these searches, if you want to move on to the next message containing the word you searched for: n moves you to the next message containing the word. The search will "wrap" around the end of the mailbox- if you reach the last message, it will then return to the first message.

many more things you can do using this menu. For more information, type: ? Mutt will bring up a list of keys and what they do. ^ means the Control key, and &lt Esc &gt means the Escape key.

Control key and press the second key in the sequence (the same way you type Control-C at the shell prompt).</a>

need to hold the Escape key down- just hit Escape, then the second key.</a> This behaviour should be familiar to those of you who have used emacs.

To move through the Help menu, hit the space bar to move down a page, or type - to move up a page. To exit the Help menu, type: x

See Getting Into and Out Of the Mutt Menu if you've forgotten how to exit this menu. Table of Contents

[./muttchart.html Mutt Commands Quick Reference]


You can also use the <font color=green>PageUp</font> and <font color=red>PageDown</font> keys to move <font color=green>up</font> and <font color=red>down</font> in a message. If you try to move down (with either Space or PageDown) when you're at the bottom of a message, the top of the next message will be displayed. This doesn't work the other way- if you try to move up from the top of a message, the message: Already at top of message is displayed. The up and down arrow keys work the same way while reading a message as they do in the menu. The up arrow key takes you to the previous message, and the down arrow takes you to the next message. <a name=return>To return to the menu from reading a message, type</a> i and you will be returned to the menu with the message you were just reading selected as the current message. Table of Contents

[./muttchart.html Mutt Commands Quick Reference]


d while the message is being displayed. See Reading Messages for how to return to the menu.

Getting Around In The Menu), and type d.

Messages selected for deletion will be marked with a D. If you have selected a message to be deleted, Mutt will skip that message when you are moving up or down between messages (see Getting Around in the Menu). If you want to access a deleted message, type the number of the message, hit &lt Enter &gt , and it will be highlighted. <a name=undelete>If you change your mind and decide not to delete one or more of the messages marked for deletion, select the message and type u The message will no longer be marked for deletion, and will be treated in the same way as all other read messages. A message that has been marked for deletion has not actually been deleted. It is still present in the menu and still exists in your mail spool file. Messages selected for deletion can actually be deleted in two ways.

messages selected for deletion. If you say Yes, the next time you open your mailbox, they will be gone.

$ while in the menu, the messages you have selected for deletion will be removed. The Mutt help calls this "syncing your mailbox".

Table of Contents

[./muttchart.html Mutt Commands Quick Reference]


setenv EDITOR emacs -nw

(substitute your favorite editor for emacs -nw)

an editor.

<a name=exited>Write your message, then save your work and exit the editor.</a> Use

At this point, you will be asked if you want to save your work as /tmp/mutt-hostname-other-junk. Say Yes, unless you've changed your mind and don't want to send the message. You'll be in a screen that contains the header information for your message, and some commands listed at the top of the screen:

If you do this, you will be asked if you want to postpone the message. If you don't want to send anything or work on this message again, say No.

Table of Contents

[./muttchart.html Mutt Commands Quick Reference]


[./muttchart.html Mutt Commands Quick Reference]


[./muttchart.html Mutt Commands Quick Reference]


[./muttchart.html Mutt Commands Quick Reference]


[./muttchart.html Mutt Commands Quick Reference]


automatically be put into an editor to work on it.

a list of your postponed messages. Select the one you want to work on, and press &lt Enter &gt . You will be put into an editor to work on it.

d

It will be deleted when you start working on another postponed message.

creating a new message]. Your postponed messages will still be there waiting for you the next time you compose a message. They will not be deleted.

Table of Contents

[./muttchart.html Mutt Commands Quick Reference]


Using This Section

If you've used personal configuration files for mail and pine (.mailrc and .pinerc, respectively), you can probably guess that mutt's configuration file is found in your home directory and is called .muttrc. The way it's set up is not unlike .mailrc and .pinerc.

This section is designed to help you make a .muttrc file. If you're happy with the way mutt is configured by default on the system, you don't need to read this. You can return to the table of contents or cut to the chase by going to the [./muttchart.html quick reference] now. If you do want to create a .muttrc file, you have several choices of how to do it:

You can get a ready-made .muttrc file from the comfort of this webpage. There are 3 available:

its editor.

vi as its editor. It does allow for postponing messages, but it doesn't insist that you work on them when you compose a new message.

as its editor. It's similar to Muttrc1, because I used pine before I started using mutt.

Each .muttrc file is available in your choice of five color schemes. Each color scheme except for white text on blue background uses only two colors, and reverses the colors (black text on white background becomes white text on black background) for the status bar and selected message. The white text on blue background option uses yellow text on the blue background for highlighting, to emulate the old WordPerfect color scheme.

on your terminal)

screens)

terminals)

Save one of those files to ~/.muttrc, and you're in business.

You can write a .muttrc file from scratch in your home directory, using your favorite editor. Or, if there's a ready-made .muttrc file that does almost what you want, you can get it and customize it with an editor.

You can open a .muttrc file in your home directory, then cut and paste the settings you want from this page into it. The lines that are appropriate for cutting and pasting into a .muttrc file are in bold text.

Here's the buffet of settings that I find particularly useful in a basic .muttrc file. They are in alphabetical order here, but the ordering in your .muttrc file doesn't matter.

Values: yes, ask-yes, ask-no, no

set abort_nosubject=yes

This tells Mutt to automatically cancel a message if you leave the subject line blank, without asking if you want to cancel the message.

set abort_nosubject=ask-yes

set abort_nosubject=ask-no

The above two are similar. Both tell Mutt to ask if you want to cancel a message if you leave the subject line blank. Ask-yes cancels the message by default (if you don't answer either y or n), and ask-no doesn't cancel the message by default.

set abort_nosubject=no

This tells Mutt to let you make messages with blank subject lines, without asking if this means you want to abort the message.

Values: yes, ask-yes, ask-no, no

set abort_unmodified=yes

This tells Mutt to automatically cancel a new message or a reply to a message if you haven't modified the original text or added new text, without asking if you want to cancel the message.

set abort_unmodified=ask-yes

set abort_unmodified=ask-no

The above two are similar. Both tell Mutt to ask if you want to cancel a message if you haven't modified the original text or added text. Ask-yes cancels the message by default, and ask-no doesn't cancel the message by default.

set abort_unmodified=no

This tells Mutt to let you make replies to messages without modifying the original text and send new messages containing no text, without asking if this means you want to abort the message.

Values: yes, no

set askbcc

This tells Mutt to ask you for blind carbon copy recipients when you create a message or reply to a message.

unset askbcc

This tells Mutt not to ask you for blind carbon copy recipients when you create a message or reply to a message.

Values: yes, no

set askcc

This tells Mutt to ask you for carbon copy recipients when you create a message or reply to a message.

unset askcc

This tells Mutt not to ask you for carbon copy recipients when you create a message or reply to a message.

Values: yes, no

set beep_new

This tells Mutt to beep when you receive a new message while your mailbox is open.

unset beep_new

This tells Mutt not to beep when you receive a new message while your mailbox is open.

You can set the colors that mutt uses. Unless you like your system's default colors, or one of the color schemes I created, you'll have to play around with them until you get something you like. Here are excerpts from sample .muttrc files using the color schemes I created:

#Black Text on White Background

color hdrdefault black white

color quoted black white

color signature black white

color status white black

color indicator white black

color normal black white

#White Text on Black Background

color hdrdefault white black

color quoted white black

color signature white black

color status black white

color indicator black white

color normal white black

#White Text on Blue Background

color hdrdefault white blue

color quoted white blue

color signature white blue

color status yellow blue

color indicator yellow blue

color normal white blue

#Green Text on Black Background

color hdrdefault green black

color quoted green black

color signature green black

color status black green

color indicator black green

color normal green black

#Amber Text on Black Background

color hdrdefault yellow black

color quoted yellow black

color signature yellow black

color status black yellow

color indicator black yellow

color normal yellow black

The most important thing here is that the indicator color scheme must be different from the normal color scheme. The indicator color tells Mutt how to highlight the currently selected message, and if they are the same, you won't be able to tell which message is selected.

Other colors, such as

for a mailer, but your mileage may vary.

Values: yes, ask-yes, ask-no, no

set copy=yes

This tells Mutt to save a copy of any message you send, to the location you specify in the record variable.

set copy=ask-yes

set copy=ask-no

Both of the above tell Mutt to ask if you want to save a copy of a message when you send it. Ask-yes saves a copy by default, and ask-no doesn't save a copy by default.

set copy=no

This tells Mutt not to save a copy of any message you send.

Values: yes, ask-yes, ask-no, no

set delete=yes

This tells Mutt to delete messages marked for deletion when you exit.

set delete=ask-yes

set delete=ask-no

The above two are similar. Both tell Mutt to ask if you want to delete the messages you marked for deletion when you exit. Ask-yes deletes the messages by default, ask-no doesn't delete the messages by default.

set delete=no

This tells Mutt not to delete the messages you have marked for deletion when you quit.

Values: yes, no

set edit_headers

This lets you edit the message headers while you're editing the message.

unset edit_headers

This hides the headers from you while you're editing a message.

This is where you tell Mutt which editor to use when writing a message. Some popular choices are:

set editor="vi"

set editor="emacs -nw"

Note: the -nw option tells emacs not to open a new window for editing. If you don't use -nw, you may have trouble writing messages when you're logging in remotely.

set editor="pico"

Pico is a simplified emacs-like editor. I think it's a good choice for people new to UNIX editors, because it lists the key bindings at the bottom of the screen.

This is a path to the files containing your saved messages. The default value is ~/Mail:

set folder="~/Mail"

If you want to change it to something else, change that path to the path where you want your mailboxes. Make sure it is a directory in which you have write permission; otherwise, you will receive error messages.

Values: yes, ask-yes, ask-no, no

set include=yes

This tells Mutt to automatically include a copy of the original message when you reply to a message.

set include=ask-yes

set include=ask-no

These tell Mutt to ask if you want to include a copy of the original message in a reply to a message. Ask-yes includes a copy by default, and ask-no doesn't include a copy by default.

set include=no

This tells Mutt not to include a copy of the original message when you reply to a message.

Values: yes, no

set mark_old

This tells Mutt to mark messages you have already read so they can be moved to mbox.

unset mark_old

This tells Mutt not to mark your old messages for moving to mbox.

Meaningless if your .muttrc contains set move=no

This variable contains the path to the file that contains the messages you have already read. The default is:

set mbox="~/mbox"

Values: yes, no

set metoo

When you reply to a message, this sends a copy of the reply to all recipients, yourself included.

unset metoo

This excludes your address from the list of addresses when you send a reply to a message.

Values: yes, ask-yes, ask-no, no

set move=yes

This tells Mutt to automatically move read messages to the mbox file, either mbox in your home directory or whatever you have set mbox to be. This will delete the messages you have read from the mail server.

set move=ask-yes

set move=ask-no

These tell Mutt to ask if you want to move read messages to mbox. Ask-yes moves the messages by default, and ask-no doesn't move the messages by default.

set move=no

This tells Mutt to not even think about moving your read messages off the mail server.

Values: yes, ask-yes, ask-no, no

set postpone=yes

This tells Mutt to automatically postpone any message you choose not to send when you exit the editor.

set postpone=ask-yes

set postpone=ask-no

The above tell Mutt to ask if you want to postpone a message when you choose not to send it. Ask-yes postpones the message by default, and ask-no doesn't postpone the message by default.

set postpone=no

This disables postponed messages. If you choose not to send a message, Mutt automatically aborts the message.

Meaningless if your .muttrc contains set postponed=no

This is the location where your postponed messages are stored. Default is "~/postponed". I like to use:

set postponed="~/Mail/postponed_mail"

Values: yes, ask-yes, ask-no, no

set print=yes

This tells Mutt to automatically print a message if you use the p command.

set print=ask-yes

set print=ask-no

These tell Mutt to ask if you want to print a message when you use the p command. Ask-yes prints the message by default, and ask-no doesn't print the message by default.

set print=no

This disables the p command, so you can't print messages directly from your inbox.

Meaningless if your .muttrc contains set print=no.

Tells Mutt what command to use when printing a message using the p command. Default is "lpr". The default I use in my sample Muttrc's is:

set print_command="lpr -Pfloor4"

You can, of course, change this to any printer you like.

Values: yes, ask-yes, ask-no, no

Meaningless if your .muttrc contains set postpone=no

set recall=yes

When you send a new message (not when you reply to a message), this automatically brings up your postponed messages for you to work on.

set recall=ask-yes

set recall=ask-no

These ask if you want to continue working on a postponed message when you send a new message. Ask-yes brings up the postponed messages by default, and ask-no doesn't bring up the postponed messages by default.

set recall=no

This tells Mutt to not bring up your postponed messages.

Meaningless if your .muttrc contains set copy=no

Tells Mutt where to save copies of messages you have sent. I like to use:

set record="~/Mail/sent_mail"

Values: date, from, date-received, size

(There are other ways to sort your mailbox as well- see the reference if you don't see the one you want here) This lets you sort your inbox. Default is:

set sort=date

which sorts by the date in the message header. Other values are:

set sort=from

This lets you look at all mail from a specific person together in your mailbox.

set sort=date-received

The above is good if you receive mail from different time zones. It will sort them based on the time when you received them.

set sort=size

This sorts your messages by size. The only circumstance I can think of where you'd use it is if you were trying to reduce the size of your mail spool file.

If you want to know more, here's a reference for all the variables and their default values (our default values may be different).


&lt mhals@ucolick.org &gt Table of Contents

Answers/Mail/Client/Mutt (last edited 2007-05-08 23:43:36 by CatherineSterner)