Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

docker-mutt

Run your favorite mail client mutt in a Docker container without installing mutt on your host system.

Configuration

The fstab/mutt docker image contains only the mutt and msmtp applications, but no configuration. The configuration must be created in a directory on the host system and mounted as a volume to /home/mutt in the container.

On the host system, create a folder ~/.mutt/. In this folder, create the configuration files as follows:

msmtp configuration

msmtp is a sendmail replacement that can be used for sending mail via an SMTP server. It is configured on the host system in a file ~/.mutt/.msmtprc as follows:

defaults
logfile ~/.msmtp.log

account alice
host mail.example.com
from alice@example.com
auth on
user alice
password xxxxxxxx

account default : alice

mutt configuration

mutt is configured on the host system in ~/.mutt/.muttrc.

#########################
# sending with msmtp
#########################

set sendmail="/usr/bin/msmtp"
set use_from=yes
set realname="Alice Springs"
set from=alice@example.com
set envelope_from=yes

#########################
# receiving with imap
#########################

set folder="imaps://alice:xxxxxxx@mail.example.com"
set spoolfile="+INBOX"
set record="+Sent"
set postponed="+Drafts"
set trash="+Trash"
set header_cache = "/home/mutt/.mutt_cache"
set message_cachedir = "/home/mutt/.mutt_cache"

# Automatically poll subscribed mailboxes for new mail (new in 1.5.11)
set imap_check_subscribed
# Reduce polling frequency to a sane level
set mail_check=60

#########################
# usability
#########################

set editor="vim"

Create the mutt cache directory ~/.mutt/.mutt_cache/ on the host system and change access rights of ~/.mutt/ to 700.

Run from Docker Hub

A pre-built image is available on Docker Hub. Once the configuration is created on the host system, the container can be run as follows:

docker run -v ~/.mutt:/home/mutt -t -i fstab/mutt

The container will start up with the mutt mail client.

Build from Source

  1. Make sure Docker is installed.
  2. Clone fstab/docker-mutt from GitHub.

    git clone https://github.com/fstab/docker-mutt.git
    
  3. Build the docker image

    cd docker-mutt
    docker build -t="fstab/mutt" .
    
  4. Once the configuration is is created on the host system, the docker container can be run as follows:

    docker run -v ~/.mutt:/home/mutt -t -i fstab/mutt
    

Create an alias

If everything works fine, add an alias to the ~/.bashrc so that the container can be run with a simple mutt command:

alias mutt="docker run -v ~/.mutt:/home/mutt -t -i fstab/mutt"
Docker Pull Command
Owner
fstab
Source Repository