Difference between revisions of "Mutt"

From the Linux and Unix Users Group at Virginia Teck Wiki
Jump to: navigation, search
imported>Echarlie
(IMAP/SMTP for acidburn)
(References)
 
(21 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Mutt VT/Google Mail Setup =
+
"''All mail clients suck. This one just sucks less.''"<ref>http://www.mutt.org/</ref>
  
This will cover basic mutt configuration files for connecting to VT webmail. VT recommends using POP until the quota system is in place because POP will store local copies, but IMAP still works. These settings will get mutt working with VT's email servers, but there are other settings you probably want if you are unfamiliar with mutt.
+
'''Mutt''' is a [[w:text user interface|text-based]] [[w:email client|email client]] for [[w:Unix-like|Unix-like]] systems. It was originally written by Michael Elkins in 1995 and released under the [[w:GNU General Public License|GPL]] version 2 or any later version.<ref>
 +
https://en.wikipedia.org/wiki/Mutt_%28email_client%29</ref>
  
== IMAP ==
+
Mutt was originally designed as a [[w:Mail User Agent|Mail User Agent]] (MUA) and relied on locally accessible mailbox and [[w:sendmail|sendmail]] infrastructure. According to the Mutt homepage "though written from scratch, Mutt's initial interface was based largely on the [[w:Elm (email client)|ELM mail client]]". New to Mutt were message scoring and threading capabilities. Support for fetching and sending email via various protocols such as [[w:POP3|POP3]], [[w:IMAP|IMAP]] and [[w:Simple Mail Transfer Protocol|SMTP]] was added later. Mutt relies on external tools for composing and filtering messages.
Anything in all caps should be replaced with your information
+
 
<pre>
+
== Mutt VT/Google Mail Setup ==
set imap_user = "PID@vt.edu"
+
 
set imap_pass = "PASSWORD"
+
VT email lives in Google GSuite (i.e. gmail). Because GSuite is deprecating "less secure devices/app-passwords",
set from = "PID@vt.edu"
+
you will need to use IMAP and SMTP with the XOAUTH2 authentication method.
set folder = "imaps://imap.vt.edu:993"
+
 
set spoolfile = "+Inbox"
+
Most mutt users use [[isync|isync/mbsync]] or [[offlineimap]] as imap reader tools. mbsync is better;
set hostname = vt.edu
+
offlineimap has longstanding bugs with conflicting message IDs that can cause messages to be deleted,
set postponed = "+Drafts"
+
and it is much easier to configure mbsync with multiple imap accounts, however mbsync's auth plugin
set record = "+Sent"
+
support is fragile, while offlineimap has built-in XOAUTH2 support.
</pre>
+
 
 +
Mutt has some [http://www.mutt.org/doc/manual/#oauth internal] OAUTH support that can be used. Alternately,
 +
use an external tool like [https://github.com/cscorley/send.py send.py] as your sendmail drop-in.
  
If trash is compiled into mutt you can add:
+
The caveat of setting up [[OAUTH2]] is that Google has disabled trial credential creation in billed
<pre>
+
accounts (i.e. GSuite), so you *cannot* use your VT account to create them. Further, to reduce abuse,
set trash = "+Trash"
+
Google must approve all public apps; a warning pops up if it is not approved, which can only
</pre>
+
be bypassed if you are the owner of the application. In short, you must create OAUTH credentials
 +
with a non-GSuite google account, add your @vt.edu account to the project, and then use it to
 +
log in.
  
== POP ==
+
== LUUGmail ==
Coming soon...
 
  
== SMTP ==
+
Acidburn currently has functional postfix/dovecot. This is how to use it with mutt.
<pre>
 
set smtp_url = "smtps://PID@vt.edu@auth.smtp.vt.edu:465/"
 
set smtp_pass = "PASSWORD
 
</pre>
 
If you are using GnuTLS in mutt and get an error saying the key is too small. GnuTLS supports 256 AES, but it defaults to 128 when connecting. For this you must add this:
 
<pre>
 
set ssl_min_dh_prime_bits = 500
 
</pre>
 
  
= LUUGmail =
+
=== IMAP/SMTP for acidburn ===
== IMAP/SMTP for acidburn ==
 
  
 
This is a sample configuration for imap/smtp in mutt for acidburn, provided by [[User:echarlie|echarlie]]
 
This is a sample configuration for imap/smtp in mutt for acidburn, provided by [[User:echarlie|echarlie]]
Line 41: Line 36:
 
<pre>
 
<pre>
 
set realname = 'Wadsworth Luugbot'  #your display name here
 
set realname = 'Wadsworth Luugbot'  #your display name here
set imap_user=wadsworth                 #this should be your LDAP account name
+
set imap_user=wadsworth             #this should be your LDAP account name
set imap_pass=$my_luug_pass           #Whatever your LUUG password is. Here we used a personal variable.
+
set imap_pass=$my_luug_pass         #Whatever your LUUG password is. Here we used a personal variable.
 
set ssl_force_tls=yes
 
set ssl_force_tls=yes
 
set ssl_starttls=yes
 
set ssl_starttls=yes
Line 54: Line 49:
 
set pgp_sign_as = "wadsworth@vtluug.org"  # If you like pgp-signing things
 
set pgp_sign_as = "wadsworth@vtluug.org"  # If you like pgp-signing things
  
set from = "wadsworth@vtluug.org"             #### THIS IS IMPORTANT ####
+
set from = "wadsworth@vtluug.org"   #### THIS IS IMPORTANT ####
 
set use_from = yes
 
set use_from = yes
 
set smtp_url=smtp://$imap_user:$imap_pass@acidburn.vtluug.org:587
 
set smtp_url=smtp://$imap_user:$imap_pass@acidburn.vtluug.org:587
Line 68: Line 63:
 
folder-hook $folder 'source ~/.mutt/vtluug'
 
folder-hook $folder 'source ~/.mutt/vtluug'
 
</pre>
 
</pre>
 +
 +
== Local Mail on acidburn ==
 +
 +
This is how one would read and send local mail on acidburn. This is a fully functional <code>.muttrc</code>, however we
 +
would suggest setting your mutt editor, setting your encoding preference (UTF-8), and changing keybindings to preference.
 +
 +
 +
<pre>
 +
set mbox_type=Maildir          #acidburn uses maildirs
 +
set folder=$HOME/Maildir
 +
set spoolfile=+/
 +
set header_cache=~/.cache/mutt  #optional; header caching speeds things up
 +
 +
set my_user=wadsworth
 +
 +
set realname = "Wadsworth Luugbot"
 +
set from = wadsworth@vtluug.org
 +
set use_from = yes
 +
 +
# This is needed if you want to send from another ldapified server
 +
#set smtp_url=smtps://$my_user:$my_pass@acidburn.vtluug.org:587
 +
#set ssl_force_tls = yes
 +
</pre>
 +
 +
== References ==
  
  
 
[[Category:Howtos]]
 
[[Category:Howtos]]
 +
[[Category:Software]]
 
[[Category:Mail clients]]
 
[[Category:Mail clients]]
 +
[[Category:Needs restoration]]

Latest revision as of 16:02, 2 June 2020

"All mail clients suck. This one just sucks less."[1]

Mutt is a text-based email client for Unix-like systems. It was originally written by Michael Elkins in 1995 and released under the GPL version 2 or any later version.[2]

Mutt was originally designed as a Mail User Agent (MUA) and relied on locally accessible mailbox and sendmail infrastructure. According to the Mutt homepage "though written from scratch, Mutt's initial interface was based largely on the ELM mail client". New to Mutt were message scoring and threading capabilities. Support for fetching and sending email via various protocols such as POP3, IMAP and SMTP was added later. Mutt relies on external tools for composing and filtering messages.

Mutt VT/Google Mail Setup

VT email lives in Google GSuite (i.e. gmail). Because GSuite is deprecating "less secure devices/app-passwords", you will need to use IMAP and SMTP with the XOAUTH2 authentication method.

Most mutt users use isync/mbsync or offlineimap as imap reader tools. mbsync is better; offlineimap has longstanding bugs with conflicting message IDs that can cause messages to be deleted, and it is much easier to configure mbsync with multiple imap accounts, however mbsync's auth plugin support is fragile, while offlineimap has built-in XOAUTH2 support.

Mutt has some internal OAUTH support that can be used. Alternately, use an external tool like send.py as your sendmail drop-in.

The caveat of setting up OAUTH2 is that Google has disabled trial credential creation in billed accounts (i.e. GSuite), so you *cannot* use your VT account to create them. Further, to reduce abuse, Google must approve all public apps; a warning pops up if it is not approved, which can only be bypassed if you are the owner of the application. In short, you must create OAUTH credentials with a non-GSuite google account, add your @vt.edu account to the project, and then use it to log in.

LUUGmail

Acidburn currently has functional postfix/dovecot. This is how to use it with mutt.

IMAP/SMTP for acidburn

This is a sample configuration for imap/smtp in mutt for acidburn, provided by echarlie

set realname = 'Wadsworth Luugbot'  #your display name here
set imap_user=wadsworth             #this should be your LDAP account name
set imap_pass=$my_luug_pass         #Whatever your LUUG password is. Here we used a personal variable.
set ssl_force_tls=yes
set ssl_starttls=yes

set folder = "imap://$imap_user@acidburn.vtluug.org:143/"
set spoolfile = +INBOX
set postponed = +Drafts
set record = +sent
set imap_check_subscribed

set pgp_sign_as = "wadsworth@vtluug.org"  # If you like pgp-signing things

set from = "wadsworth@vtluug.org"    #### THIS IS IMPORTANT ####
set use_from = yes
set smtp_url=smtp://$imap_user:$imap_pass@acidburn.vtluug.org:587

# this is for if you use multiple accounts. The ssl settings are necessary since we don't have a
# certified tls key right now
account-hook $folder "set imap_user=$imap_user imap_pass=$imap_pass ssl_verify_dates=no ssl_verify_host=no"

This section assumes you are using mutt with multiple accounts. For that, we reccomend putting the following into .muttrc/vtluug or something similar, and having this in your .mutt/muttrc :

source "~/.mutt/vtluug"
folder-hook $folder 'source ~/.mutt/vtluug'

Local Mail on acidburn

This is how one would read and send local mail on acidburn. This is a fully functional .muttrc, however we would suggest setting your mutt editor, setting your encoding preference (UTF-8), and changing keybindings to preference.


set mbox_type=Maildir           #acidburn uses maildirs
set folder=$HOME/Maildir
set spoolfile=+/
set header_cache=~/.cache/mutt  #optional; header caching speeds things up

set my_user=wadsworth

set realname = "Wadsworth Luugbot"
set from = wadsworth@vtluug.org
set use_from = yes

# This is needed if you want to send from another ldapified server
#set smtp_url=smtps://$my_user:$my_pass@acidburn.vtluug.org:587
#set ssl_force_tls = yes

References