Hot answers tagged

51

You need to run the tag-pattern command. The default for that is T (Shift+t). You can then give it a regular expression. By default this will match message subjects. If you need to select a range of messages by number, you can provide the ~m [MIN]-[MAX] pattern to tag-pattern. There are many other options I've found useful over the years, and you can ...


31

The obvious answer is Alpine, which used to be Pine, but was freed by the University of Washington. Pine is non-free software, Alpine is free software. Alpine is quite similar to Mutt, but Mutt is generally considered to be more powerful and flexible. The current active branch of Alpine is a fork called Re-Alpine, since the University of Washington has ...


30

Bind a key (G for "Get" is recommended) to imap-fetch-mail in your ~/.muttrc. bind index G imap-fetch-mail Pressing G while in the index will now fetch new mail from the imap server. (for POP users, the fetch-mail function fetches mail from a POP server)


30

The s command saves to a mailbox, which for you is in maildir format. Unfortunately, there is no save-to-file command, perhaps because in the historical mbox format, a mailbox that contains a single mail is just a file containing that mail. The mutt command pipe-message (default shortcut |) can be used for this. It opens a command line and you write cat >...


28

search and limit can also actually search inside messages, depending on the search patterns you give. From the Patterns subsection of the Mutt reference: ~b EXPR messages which contain EXPR in the message body ~B EXPR messages which contain EXPR in the whole message That is, ~b only searches in the body, whereas ~B also searches in the ...


28

I finally got it to work by enabling Google 2-step verification and using an app-specific password for mutt. More detail: I enabled 2-step verification on my Google account, which means that when I log in to Google, I have to enter a pin number from either a text or from the Google Authenticator app. Then I had to get an app-specific password for mutt. ...


26

Create a passwords file: ~/.mutt/passwords: set imap_pass="password" set smtp_pass="password" This file can be encrypted using GPG. First, create a public/private key pair: $ gpg --gen-key Encrypt the passwords file: $ gpg -r your.email@example.com -e ~/.mutt/passwords $ ls ~/.mutt/passwords* /home/user/.mutt/passwords /home/user/.mutt/passwords.gpg $ ...


26

You can do this with mutt's mime support. In addition, you can use this with Autoview to denote two commands for viewing an attachment, one to be viewed automatically, the other to be viewed interactively from the attachment menu. Essentially, you include two options in your mailcap file1. text/html; luakit '%s' &; test=test -n "$DISPLAY"; needsterminal; ...


26

As one of the comments says it looks like Google have moved to blocking apps that are using IMAP/SMTP PLAIN authentication by default and you can read official blogs stating that Google strongly recommends IMAP/SMTP protocol users switch to OAuth 2.0 (as XMPP is also listed I wonder if (older?) OSX iChat will stop working with GTalk at some point). Elsewhere,...


25

After you compose a message, but before sending you have lots of options available to you. Press ? to view them. Some that may help here: F to filter the attachment through an external processor Use pandoc -s -f markdown -t html to convert to HTML ^T to edit the attachment MIME type Change from text/plain to text/html. Now a macro that will do ...


22

The actual message shows up as an attachment as well, so you can save it from the attachment list. From either the index or the message itself, hit v to open the attachments and s to save


22

When using smtp submission on port 587, the value for smtp_url should start with "smtp://", i.e. not with "smtps://". It is also important to make sure ssl_starttls is set to "yes", as correctly done in the config above. While setting up my own server I got the exact same problem. Having access to logs on both the client & the server side, made it ...


20

mutt doesn't seem able to open individual messages. What you can do is convert the .eml file into an mbox folder containing a single message. This basically involves adding a From line at the top, which can be done using formail -b: formail -b < themessage.eml > themessage.mbox This can then be opened within mutt using change-folder (default key c).


19

There is also Muttprint. It does support UTF-8 and its output looks decent by default. Muttprint uses LaTeX and provides hooks for customization. Since I am printing mails from different environments I can't use a default printer. Thus I have set it up (via ~/.muttrc) to use a PDF viewer where I can dynamically select a printer: set print_command='set -e; ...


19

An old message is an unread message that is not new. A message is new if this is the first time the mail reader has noticed it in your mailbox. So if you start your mail reader and there are five new messages and you quit without reading any of them, the next time you start the reader there should be five old messages.


19

You can use D (uppercase) to remove the attachment under the cursor.


18

Gmail Setup For authentication, you'll have to do either of two things: Generate an application-specific password for your Google Account (your only option if you're using 2FA), Turn on less-secure app access (not an option with 2FA) In gmail, go click the gear icon, go to Settings, go to the tab Forwarding POP/IMAP, and click the Configuration ...


17

You can set the index_format variable to include all manner of different details about each message. In particular, you probably want the %d format string, which inserts the date formatted according to the value of date_format, or one of the other date format strings, such as %{fmt}, %[fmt], etc. As an example, here is my default index_format setting: set '...


14

tagged mails: macro index S ":set confirmappend=no delete=yes\n<tag-prefix-cond><save-message>=archive\n<sync-mailbox>:set confirmappend=yes delete=ask-yes\n" current only: macro index A ":set confirmappend=no delete=yes\n<save-message>=archive\n<sync-mailbox>:set confirmappend=yes delete=ask-yes\n" edit macro index S ":set ...


13

You can add a dollar-sign "$" after the "d" and mutt will sync immediately after marking the message(s). Hitting "$" any time will just sync.


13

I found the correct answer here: Inside mutt, use the command :exec what-key Then pressing the desired key (like Ctrl+arrow) you can learn how to reference any key. In my case I get <C-Up> for Ctrl+Up.


12

You could pipe the message to ripmime, which lets you specify a destination directory on the command line...e.g.: ripmime -i - -d ~/myfiles/ The -i - tells ripmime to read from standard input, and -d specifies a destination directory. If that's too much typing, stick it in a shell script and call that (which will also make it easier if you want to use ...


12

You can set the timeout variable to something like: set timeout=10 This will poll the current mailbox every 10 seconds at most when mutt is idle waiting for user input, more often than the default 600 seconds. This is not needed in post v1.5.11 when IDLE is enabled.


11

You can write a macro and bind it to a key, or key sequence. For example, in my muttrc I include this line: macro index \Cs "<change-folder> =JWR/INBOX.Sent<enter>" "go to Sent Items" It takes me to my Sent items with Ctrls. You can determine the correct name of the relevant maildir folder by bringing up the prompt with c and then hitting ? ...


11

I believe I found a solution to this on the Mutt wiki. How to make mutt check for new mail more often? What's the difference between $timeout and $mail_check? After every keyboard input mutt updates the status of all folders. To receive "New mail in ..." notifications even without needing to press a key, set $timeout == time to wait for idle mutt (no key ...


10

The formatting in the index is controlled by the index_format setting -- it's generated by mutt. The Date header isn't controlled by mutt, it's a header included with the message that just gets displayed. If it shows UTC time it's because the sending server decided to use UTC when generating the header. The only way to change it is to actually change the ...


10

If you touch a file and then try to save or copy a message to it mutt will use it as a mbox. Also you might want to use copy instead of save. Mutt assumes that a mail should only exist in one copy and saving a message to another mailbox will delete it from the first one, while copying will do a proper copy.


10

Create a file with the following content: alias my_alias1 recipient1@email, recipient1@email alias my_alias2 recipient3@email, recipient4@email Source it from your mutt config with source path/to/alias_file. Here you go!


10

OfflineIMAP and isync are both programs that integrate well with mutt and will satisfy your other criteria. OfflineIMAP is written in Python and isync in C; both are very quick. Both programs are well documented and straightforward to set up; isync perhaps slightly easier. There is one significant difference between the functionality of each that is worth ...


Only top voted, non community-wiki answers of a minimum length are eligible