The mutt mail client Ryan R. Curtin October 21, 2015 1 / 22 - - PowerPoint PPT Presentation

the mutt mail client
SMART_READER_LITE
LIVE PREVIEW

The mutt mail client Ryan R. Curtin October 21, 2015 1 / 22 - - PowerPoint PPT Presentation

The mutt mail client Ryan R. Curtin October 21, 2015 1 / 22 Outline Outline Should you remain here, the next N minutes of your life will The basics contain What? Why? vs. alpine a discussion of the basics of how email works


slide-1
SLIDE 1

1 / 22

The mutt mail client

Ryan R. Curtin

October 21, 2015

slide-2
SLIDE 2

Outline

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 2 / 22

Should you remain here, the next N minutes of your life will contain

  • a discussion of the basics of how email works
  • a list of the differences between mutt, pine, and other

mailreaders

  • an overview of the capabilities of mutt
  • information on how to make mutt connect to GT PRISM

accounts (IMAP)

  • mutt configuration for parsing through mail
  • basic mutt commands
  • an overview of the .muttrc file
  • a list of further references
slide-3
SLIDE 3

The basics

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 3 / 22

A whiteboard discussion. MTA: mail transfer agent MDA: mail delivery agent MUA: mail user agent

slide-4
SLIDE 4

The basics

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 3 / 22

A whiteboard discussion. MTA: mail transfer agent MDA: mail delivery agent MUA: mail user agent Mail delivery protocols: POP3: push-then-delete IMAP: server-side storage Exchange: life is bad for you.

slide-5
SLIDE 5

What is mutt?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 4 / 22

  • mutt is a “small, but very powerful text-based mail client

for Unix operating systems”

slide-6
SLIDE 6

What is mutt?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 4 / 22

  • mutt is a “small, but very powerful text-based mail client

for Unix operating systems”

  • Based largely on the elm mail client
slide-7
SLIDE 7

What is mutt?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 4 / 22

  • mutt is a “small, but very powerful text-based mail client

for Unix operating systems”

  • Based largely on the elm mail client
  • Highly customizable: keybindings, macros, etc.
slide-8
SLIDE 8

What is mutt?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 4 / 22

  • mutt is a “small, but very powerful text-based mail client

for Unix operating systems”

  • Based largely on the elm mail client
  • Highly customizable: keybindings, macros, etc.
  • IMAP

, POP3 support (plus maildir and mbox)

slide-9
SLIDE 9

What is mutt?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 4 / 22

  • mutt is a “small, but very powerful text-based mail client

for Unix operating systems”

  • Based largely on the elm mail client
  • Highly customizable: keybindings, macros, etc.
  • IMAP

, POP3 support (plus maildir and mbox)

  • MIME, DSN, PGP support, plus further extensibility
slide-10
SLIDE 10

What is mutt?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 4 / 22

  • mutt is a “small, but very powerful text-based mail client

for Unix operating systems”

  • Based largely on the elm mail client
  • Highly customizable: keybindings, macros, etc.
  • IMAP

, POP3 support (plus maildir and mbox)

  • MIME, DSN, PGP support, plus further extensibility
  • ncurses-based! Use it with GNU screen (along with irssi)
slide-11
SLIDE 11

Why should I use mutt?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 5 / 22

  • You are me.
slide-12
SLIDE 12

Why should I use mutt?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 5 / 22

  • You are me.
  • Lightweight, fast, and simple
slide-13
SLIDE 13

Why should I use mutt?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 5 / 22

  • You are me.
  • Lightweight, fast, and simple
  • Can run inside screen
slide-14
SLIDE 14

Why should I use mutt?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 5 / 22

  • You are me.
  • Lightweight, fast, and simple
  • Can run inside screen
  • No need for a mouse—everything is controllable by

keybindings

slide-15
SLIDE 15

Why should I use mutt?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 5 / 22

  • You are me.
  • Lightweight, fast, and simple
  • Can run inside screen
  • No need for a mouse—everything is controllable by

keybindings

  • It looks cool (-Ryan, 2008)
slide-16
SLIDE 16

Comparison with alpine

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 6 / 22

mutt : vim :: alpine : nano

slide-17
SLIDE 17

What else have we got?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 7 / 22

  • alpine
  • gnus (in Emacs)
  • nmh
  • Thunderbird
  • Evolution
  • Zimbra...?
slide-18
SLIDE 18

Reading Mail

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 8 / 22

The important commands: (up/down arrows) select message

PgUp / PgDn

page up / down

Enter

display message

r

reply to selected message

g

group reply

m

begin composing mail

q

quit / return to message listing

d

delete message

u

undelete message

F

flag message

$

commit changes (if IMAP)

?

help

slide-19
SLIDE 19

Reading messages

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 9 / 22

Useful commands when you are looking at a message:

Enter

scroll down a line

Backspace

scroll up one line

PgUp / PgDn

scroll up/down a page

Space

next message

h

view full headers

a

create alias from a sender

/

search within message

ˆ

jump to top of message

v

show attachments

slide-20
SLIDE 20

Searching mail

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 10 / 22

Mutt supports regular expressions in its searches. To search through messages use / or use l to limit messages. More complicated queries:

˜f ryan@ratml.org matches all messages from ryan@ratml.org ˜A

all messages

˜b

in message body (careful!)

˜f

from

˜t

to

˜l

mailing list

˜F

flagged messages

˜N

new messages

˜d

date (accepts a range)

˜Q

replied-to messages

˜s

in subject line

slide-21
SLIDE 21

Basic configuration

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 11 / 22

Basic Mutt setup:

set from=’ryan@ratml.org’ set realname="Ryan Curtin" set use_form=yes set sort=threads set sort_aux=last-date-received set visual="vim" set editor="vim" set signature=/usr/bin/fortune|

slide-22
SLIDE 22

Configuring mutt for IMAP

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 12 / 22

Here is an example of how Mutt can be configured to connect to GT PRISM IMAP accounts. Setup for other IMAP servers will be very similar.

set spoolfile=imaps://imap.mail.gatech.edu/INBOX set folder=imaps://imap.mail.gatech.edu/INBOX set imap_user=gth671b set imap_keepalive=40 set imap_servernoise=yes

Also useful is imap_authenticators if you want to specify the methods of authentication mutt will try.

slide-23
SLIDE 23

Configuring mutt for POP3

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 13 / 22

Simple configuration to connect to a POP3 mailserver:

set pop_host=pops://pops.server.com/ set pop_user=username set pop_reconnect=yes set pop_checkinterval=1 set pop_delete=yes

Similar to IMAP , a pop_authenticators option also exists.

slide-24
SLIDE 24

Configuring mutt for local mail

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 14 / 22

For local mail (some of these options may be unnecessary):

set mbox_type=(mbox | Maildir | MH | MMDF) set spoolfile=/path/to/spool/

  • spoolfile is only necessary if $MAIL is not correct

set mbox=/saved/mail/dir/

slide-25
SLIDE 25

Setting up header caching

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 15 / 22

Mutt (since 1.5.7) supports header caching by default.

set header_cache=/location/of/header/cache/

Mutt must be compiled with the --enable-hcache option passed to the configure script.

slide-26
SLIDE 26

Setting up outgoing mail

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 16 / 22

Mutt is not an MTA; you must configure your own for Mutt to use.

set sendmail=/location/of/mta

An example with nbsmtp:

set sendmail="/usr/bin/nbsmtp -d gmail.com -h smtp.gmail.com -f user@gmail.com" sendmail defaults to /usr/bin/sendmail.

slide-27
SLIDE 27

Colors!

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 17 / 22

Formatting:

color object foreground background [ regexp ]

Some examples:

color index brightyellow default "˜s Package Receipt Notification" color index green default "˜t lug-(announce|chat)@lists.lugatgt.org" color body green default "(ftp|http)://[ˆ ]+" color quoted red default color signature cyan default

slide-28
SLIDE 28

Setting up hooks

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 18 / 22

[X]-hook: Execute an action when doing [X] [X]-hook regexp command

Types of hooks: send-hook, charset-hook, fcc-hook,

fcc-save-hook, folder-hook, mbox-hook, iconv-hook, message-hook, pgp-hook, save-hook, send-hook

Some examples:

folder-hook junk set sort=threads send-hook ’˜t gatech.edu’ ’set realname="George P. Burdell"’ message-hook ’˜f ryan@ratml.org’ ’color body brightyellow default’

slide-29
SLIDE 29

Dealing with attachments

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 19 / 22

v - view attachments

The .mailcap file specifies external commands mutt will use to view attachments. To set up mutt for HTML mail: In .mailcap:

text/html; links %s; nameplate=%s.html

In .muttrc:

auto_view text/html

Any MIME attachment type can be viewed by having mutt call an external program.

slide-30
SLIDE 30

Other things you can configure

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 20 / 22

Key bindings and macros:

bind map key function macro menu key sequence bind pager j next-page macro pager k jjjjj

slide-31
SLIDE 31

Links

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 21 / 22

Mutt reference:

http://www.mutt.org/doc/manual/

  • The Mutt manual; fully comprehensive and detailed

http://www.linux.com/articles/58760

  • "Training Your Mutt": useful article on basic Mutt

configuration Other useful links:

http://www.dotfiles.com/index.php?cat_id=12

  • List of other people’s .muttrc files (also includes other mail

clients)

http://www.dotfiles.com/files/27/263_.muttrc

  • .muttrc that reconfigures mutt to use pine’s default

keybindings

slide-32
SLIDE 32

Questions?

❖ Outline ❖ The basics ❖ What? ❖ Why? ❖ vs. alpine ❖ What else? ❖ Reading Mail ❖ Messages ❖ Searching ❖ Configuration ❖ IMAP config ❖ POP3 config ❖ Local config ❖ Header caching ❖ Outgoing mail ❖ Colors! ❖ Setting up hooks ❖ Attachments ❖ Other ❖ Links ❖ Questions? 22 / 22

Questions? Comments? Flamewars?