mutt Gmail Installation and Usage / Ubuntu 18.04 Environment

mutt Gmail Installation and Usage / Ubuntu 18.04 Environment

1. Installation and Usage Environment

The installation and usage environment is as follows.

  • Ubuntu 18.04 LTS 64bit, root user

2. mutt Installation

$ sudo apt-get install mutt

Install the mutt package.

3. Gmail Access Permission Configuration

Configure Gmail access permissions through the links below.

4. mutt Configuration

$ mkdir -p ~/Mail
$ touch /var/mail/root
$ chmod 660 /var/mail/root
$ chown root:mail /var/mail/root

Create mutt-related folders and files.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
set realname = "<first and last name>"
set from = "<gmail username>@gmail.com"
set use-from = yes
set envelope-from = yes

set smtp-url = "smtps://<gmail username>@gmail.com@smtp.gmail.com:465/"
set smtp-pass = "<gmail password>"
set imap-user = "<gmail username>@gmail.com"
set imap-pass = "<gmail password>"
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set ssl-force-tls = yes

# G to get mail
bind index G imap-fetch-mail
set editor = "vim"
set charset = "utf-8"
set record = ''
[File 1] ~/.muttrc

Create the ~/.muttrc file with the content from [File 1].

5. Usage

$ mutt

Run mutt. Shortcuts are as follows.

  • m: Compose a new mail message.
  • G: Fetch new messages.

6. References