Differences between revisions 12 and 13
Revision 12 as of 2018-08-30 15:09:05
Size: 4972
Editor: maegger
Comment:
Revision 13 as of 2018-11-22 12:16:22
Size: 4989
Editor: maegger
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#rev 2018-08-30 maegger #rev 2018-11-22 maegger
Line 4: Line 4:
= 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 [[http://muttrcbuilder.org/|online configurator]] which creates a configuration based on the selected values.
= Mutt command line email client =
Mutt is completely configured through 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 (respectively `muttrc`) or you can use the [[http://muttrcbuilder.org/|online configurator]] which creates a configuration based on the selected values.
<<BR>><<BR>>
For a simple running configuration on our infrastructure, read below.
Line 7: Line 9:
For a simple running configuration, read below. = Password - comfort versus security =
In cases where mutt needs your user credentials, we recommend to use the secure (but not comfortable) way. This means that you should NOT add any passwords into the configuration file and instead always enter the password manually whenever you are asked for it. We know, that it is not very comfortable to re-enter the password over and over again. But since the password is stored in plaintext, everyone which gains access to your `.muttrc` configuration file, also gains access to your NETHZ account.
<<BR>><<BR>>
Line 9: Line 13:
== 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.
But if you think you can handle that, we also describe the variant to store the password.
Line 12: Line 15:
 1. Open '''~/.muttrc''' with your favorite editor
 1. Define where the client has to look for mailfolders by setting '''folder'''. Replace USERNAME with your username.
= Minimal Configuration =

 1. Open (or create) '''`~/.muttrc`''' with your favorite editor
 1. Start with the IMAP Settings and specify the default IMAP location of your mailboxes. When this path is set, you can later reference to it with "=". So instead of writing {{{imaps://imap.ee.ethz.ch/INBOX/Trash}}} you can use {{{=Trash}}}.
Line 15: Line 20:
set folder="imaps://USERNAME@imap.ee.ethz.ch:993/" # IMAP Settings
# #############
# Specifies the default IMAP location of your mailboxes which can then be used as "=".
set folder="imaps://imap.ee.ethz.ch/INBOX"
Line 17: Line 25:
 1. Now specify which folder should be showed everytime you use mutt. The default setting below always shows your INBOX.  1. Next define your IMAP username (and if you know what you are doing) the IMAP password. /!\ Again, be aware that this configfile and its password can be potentially read by others, therefore we DO NOT recommend to set a password! If you omit any of these settings, mutt asks you for them everytime it needs them. Replace ''USERNAME'' and ''PASSWORD'' with your NETHZ Username and NETHZ Password!
Line 19: Line 27:
set spoolfile="imaps://USERNAME@imap.ee.ethz.ch:993/" # Uncomment to set a default IMAP Username and password. Be AWARE that a password in
# here is NOT SECURE and can be potentially read!
set imap_user=USERNAME
#set imap_pass="YOUR_PASSWORD"
}}}
 1. By configuring the spoolfile we decide which folder should be shown at startup. If you leave the default below, mutt starts by showing your Inbox.
 {{{
# Define which mailbox should be showed at startup. "=" means, use the same content
# as defined in folder. BTW! Whenever you use c to change into a folder (e.g. =Sent
# to change into the Sent folder), use = to return to the INBOX!
set spoolfile="="
}}}
 1. When working with emails you need directories to save your drafts, sent mails or your trash. We define them below on the IMAP Server.
 {{{
# Define which folders to use for Drafts, Sent Mails, Trash
set postponed="=Drafts"
set record="=Sent"
set trash="=Trash"
}}}
 1. Now let us continue with the SMTP Section. First we recommend to configure your FROM Address so that others receiving your email do not see something like username@hostname as a sender address. /!\ make sure to enter an existing mail address in here or others are not able to reply to your message! We recommend to use the format '''Firstname Lastname <address@institute>'''. So if for example, you are from TIK, then you could use something like "Peter Muster <`p.muster@tik.ee.ethz.ch`>" as an example
 {{{
# SMTP Settings
# #############
# Configure a correct FROM address. Common practice is to use the
# format "Firstname Lastname <address@institute>"
set from="Firstname Lastname <address@institute>"
}}}
 1. To connect to our smtp server and to send your emails, you need at least to define your username. Uncomment the second line instead, if you would like to add your password into the configurations file.
 {{{
# Uncomment the first line, if you want to enter your password every time you
# send an email, uncomment the second line to add it in here. But be AWARE that a
# password in here is NOT SECURE and can be potentially read!
#
set smtp_url="smtp://USERNAME@smtp.ee.ethz.ch:587"
#set smtp_url="smtp://USERNAME:PASSWORD@smtp.ee.ethz.ch:587"
}}}
 1. Below are a few settings which CAN but DO NOT HAVE TO be enabled in your configuration file. Uncomment any of them as you like.
 {{{
# Additional Settings
# ###################
#
# Improve speed when opening POP, IMAP or Maildir folders.
#set header_cache="${HOME}/.mutt_header_cache"
Line 21: Line 71:
# The Example below always opens mutt with your TODO mailfolder
set spoolfile="imaps://USERNAME@imap.ee.ethz.ch:993/TODO"
}}}
 1. Define the SMTP smarthost where sent messages should relayed for delivery.
 {{{
set smtp_url="smtp://USERNAME@smtp.ee.ethz.ch:587/"
}}}
 1. Define your Sender Address. Use the format below and replace INSTITUTE with your institute address.
 {{{
set from="Firstname Lastname <MAILADDRESS@INSTITUTE>"
# activate TLS if available on the server
set ssl_starttls=yes
Line 32: Line 74:
# Example
set from="Matthias Egger <maegger@ee.ethz.ch>"
}}}
 1. 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>"
}}}
# always use SSL encryption when connecting to a server
set ssl_force_tls=yes
Line 43: Line 77:
== Minimal settings with password == # use an arrow to highlight current line
#set arrow_cursor=yes
Line 45: Line 80:
{{{{#!wiki important
'''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
 1. 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/"
}}}
 1. 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"
}}}
 1. Define the SMTP smarthost where sent messages should relayed for delivery.
 {{{
set smtp_url="smtp://USERNAME@smtp.ee.ethz.ch:587/"
}}}
 1. 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>"
}}}
 1. 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"
}}}
 1. Header caching can greatly improve speed when opening POP, IMAP or Maildir folders.
 {{{
set header_cache="${HOME}/.mutt_header_cache"
}}}
 1. If ssl_force_tls is set, Mutt will require that all connections to remote servers be encrypted.
 {{{
set ssl_force_tls=yes
}}}
 1. 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
}}}
 1. 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
# poll subscribed mailboxes for new mail
#set imap_check_subscribed
#set mail_check=60
#set timeout=10
#unset imap_passive

Mutt command line email client

Mutt is completely configured through 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 (respectively muttrc) or you can use the online configurator which creates a configuration based on the selected values.

For a simple running configuration on our infrastructure, read below.

Password - comfort versus security

In cases where mutt needs your user credentials, we recommend to use the secure (but not comfortable) way. This means that you should NOT add any passwords into the configuration file and instead always enter the password manually whenever you are asked for it. We know, that it is not very comfortable to re-enter the password over and over again. But since the password is stored in plaintext, everyone which gains access to your .muttrc configuration file, also gains access to your NETHZ account.

But if you think you can handle that, we also describe the variant to store the password.

Minimal Configuration

  1. Open (or create) ~/.muttrc with your favorite editor

  2. Start with the IMAP Settings and specify the default IMAP location of your mailboxes. When this path is set, you can later reference to it with "=". So instead of writing imaps://imap.ee.ethz.ch/INBOX/Trash you can use =Trash.

    # IMAP Settings
    # #############
    # Specifies the default IMAP location of your mailboxes which can then be used as "=".
    set folder="imaps://imap.ee.ethz.ch/INBOX"
  3. Next define your IMAP username (and if you know what you are doing) the IMAP password. /!\ Again, be aware that this configfile and its password can be potentially read by others, therefore we DO NOT recommend to set a password! If you omit any of these settings, mutt asks you for them everytime it needs them. Replace USERNAME and PASSWORD with your NETHZ Username and NETHZ Password!

    # Uncomment to set a default IMAP Username and password. Be AWARE that a password in
    # here is NOT SECURE and can be potentially read!
    set imap_user=USERNAME
    #set imap_pass="YOUR_PASSWORD"
  4. By configuring the spoolfile we decide which folder should be shown at startup. If you leave the default below, mutt starts by showing your Inbox.
    # Define which mailbox should be showed at startup. "=" means, use the same content
    # as defined in folder. BTW! Whenever you use c to change into a folder (e.g. =Sent
    # to change into the Sent folder), use = to return to the INBOX!
    set spoolfile="="
  5. When working with emails you need directories to save your drafts, sent mails or your trash. We define them below on the IMAP Server.
    # Define which folders to use for Drafts, Sent Mails, Trash
    set postponed="=Drafts"
    set record="=Sent"
    set trash="=Trash"
  6. Now let us continue with the SMTP Section. First we recommend to configure your FROM Address so that others receiving your email do not see something like username@hostname as a sender address. /!\ make sure to enter an existing mail address in here or others are not able to reply to your message! We recommend to use the format Firstname Lastname <address@institute>. So if for example, you are from TIK, then you could use something like "Peter Muster <p.muster@tik.ee.ethz.ch>" as an example

    # SMTP Settings
    # #############
    # Configure a correct FROM address. Common practice is to use the
    # format "Firstname Lastname <address@institute>"
    set from="Firstname Lastname <address@institute>"
  7. To connect to our smtp server and to send your emails, you need at least to define your username. Uncomment the second line instead, if you would like to add your password into the configurations file.
    # Uncomment the first line, if you want to enter your password every time you
    # send an email, uncomment the second line to add it in here. But be AWARE that a
    # password in here is NOT SECURE and can be potentially read!
    #
    set smtp_url="smtp://USERNAME@smtp.ee.ethz.ch:587"
    #set smtp_url="smtp://USERNAME:PASSWORD@smtp.ee.ethz.ch:587"
  8. Below are a few settings which CAN but DO NOT HAVE TO be enabled in your configuration file. Uncomment any of them as you like.
    # Additional Settings
    # ###################
    #
    # Improve speed when opening POP, IMAP or Maildir folders.
    #set header_cache="${HOME}/.mutt_header_cache"
    
    # activate TLS if available on the server
    set ssl_starttls=yes
    
    # always use SSL encryption when connecting to a server
    set ssl_force_tls=yes
    
    # use an arrow to highlight current line
    #set arrow_cursor=yes
    
    # poll subscribed mailboxes for new mail
    #set imap_check_subscribed
    #set mail_check=60
    #set timeout=10
    #unset imap_passive


CategoryMAIL

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