Differences between revisions 11 and 12
Revision 11 as of 2015-01-21 11:35:26
Size: 4947
Editor: maegger
Comment:
Revision 12 as of 2018-08-30 15:09:05
Size: 4972
Editor: maegger
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#rev 2018-08-30 maegger

IMAP configuration for the Mutt command line email client

Mutt is completely configured throughout a config file named .muttrc which has to reside in your home directory. It offers a lot of configuration settings which can't be handled in this article. You can either read the man page of mutt or you can use the online configurator which creates a configuration based on the selected values.

For a simple running configuration, read below.

Minimal settings w/o password

The following simple configuration lets you connect to the IMAP server and enables you to send and receive emails. Every time you start mutt you have to enter your password. Use c followed by ? to change into another mailfolder.

  1. Open ~/.muttrc with your favorite editor

  2. Define where the client has to look for mailfolders by setting folder. Replace USERNAME with your username.

    set folder="imaps://USERNAME@imap.ee.ethz.ch:993/"
  3. Now specify which folder should be showed everytime you use mutt. The default setting below always shows your INBOX.
    set spoolfile="imaps://USERNAME@imap.ee.ethz.ch:993/"
    
    # The Example below always opens mutt with your TODO mailfolder
    set spoolfile="imaps://USERNAME@imap.ee.ethz.ch:993/TODO"
  4. Define the SMTP smarthost where sent messages should relayed for delivery.
    set smtp_url="smtp://USERNAME@smtp.ee.ethz.ch:587/"
  5. Define your Sender Address. Use the format below and replace INSTITUTE with your institute address.
    set from="Firstname Lastname <MAILADDRESS@INSTITUTE>"
    
    # Example
    set from="Matthias Egger <maegger@ee.ethz.ch>" 
  6. Save the configuration (which should look like below) and start mutt.
    set folder="imaps://USERNAME@imap.ee.ethz.ch:993/"
    set spoolfile="imaps://USERNAME@imap.ee.ethz.ch:993/"
    set smtp_url="smtp://USERNAME@smtp.ee.ethz.ch:587/"
    set from="Firstname Lastname <MAILADDRESS@INSTITUTE>"

Minimal settings with password

Important

It may be more comfortable to add your password into the config file, so that mutt just starts without asking for your password. But if you are in a multiuser environment like ours, you have to be aware that misconfiguration or wrong permission settings could let other people read the configfile with your password! And we as Administrators are ALWAYS able to read the file! (even if we don't do that, but you have been warned!).

Therefore you should use this method only if you want to configure mutt for a personal computer where only you have access to it.

  1. Open ~/.muttrc with your favorite editor

  2. Define where the client has to look for mailfolders by setting folder. Replace USERNAME with your username and PASSWORD with your password ( /!\ escape @ with \@ if your password contains one!)

    set folder="imaps://USERNAME:PASSWORD@imap.ee.ethz.ch:993/"
  3. Now specify which folder should be showed everytime you use mutt. The default setting below always shows your INBOX.
    set spoolfile="imaps://USERNAME:PASSWORD@imap.ee.ethz.ch:993/"
    
    # The Example below always opens mutt with your TODO mailfolder
    set spoolfile="imaps://USERNAME:PASSWORD@imap.ee.ethz.ch:993/TODO"
  4. Define the SMTP smarthost where sent messages should relayed for delivery.
    set smtp_url="smtp://USERNAME@smtp.ee.ethz.ch:587/"
  5. Define your Sender Address. Use the format below and replace INSTITUTE with your institute address.
    set from="Firstname Lastname <MAILADDRESS@INSTITUTE>"
    
    # Example
    set from="Matthias Egger <maegger@ee.ethz.ch>" 
  6. Save the configuration (which should look like below) and start mutt.
    set folder="imaps://USERNAME:PASSWORD@imap.ee.ethz.ch:993/"
    set spoolfile="imaps://USERNAME:PASSWORD@imap.ee.ethz.ch:993/"
    set smtp_url="smtp://USERNAME@smtp.ee.ethz.ch:587/"
    set from="Firstname Lastname <MAILADDRESS@INSTITUTE>"

Other usefull settings

  1. By default the sent emails will be locally saved into ~/sent. Use the following setting to put them into the IMAP Sent folder.

    set record="imaps://USERNAME@imap.ee.ethz.ch:993/Sent"
  2. Header caching can greatly improve speed when opening POP, IMAP or Maildir folders.
    set header_cache="${HOME}/.mutt_header_cache"
  3. If ssl_force_tls is set, Mutt will require that all connections to remote servers be encrypted.
    set ssl_force_tls=yes
  4. When arrow_cursor is set, an arrow ("->") will be used to indicate the current entry in menus instead of highlighting the whole line.

    set arrow_cursor=yes
  5. The timout variable controls how many seconds Mutt will at most wait until it aborts waiting for input, performs these operations and continues to wait for input.
    set timeout=10


CategoryMAIL

Email/MailClient/Mutt (last edited 2020-09-10 14:48:59 by gfreudig)