Linux :: Email

Email

Mutt

muttrc

# set up GnPG pair
gpg --full-gen-key

# create pass file
vi /tmp/pass
set my_pass="secrectkey"

# create encrypted file
gpg -e -a --default-recipient-self /tmp/pass

# add to muttrc file
source "gpg -dq $HOME/.mutt/key.asc |"

# use extermal browser to open html
~/.config/mutt/mailcap
text/html; qutebrowser --temp-basedir \
    -s content.proxy http://localhost:9999 \
    -s content.javascript.enabled false \
    -s tabs.last_close close \
    -s zoom.default 130 \
    -s tabs.show never \
    -s statusbar.show never \
    --desktop-file-name html-email %s; \
    nametemplate=%s.html; copiousoutput

encrypt and sign emails

# first copy gpg.rc
cp /usr/share/doc/mutt/samples/gpg.rc ~/.mutt/.

# end of muttrc
source ~/.mutt/gpg.rc

# use p to select sign, encrypt or both, and choose inline or MIME type

iSync (mbsync)

Config

## default ~/.mbsyncrc
## or `mbsync -c /path/to/rc`
CopyArrivalDate yes  # Don't mess up message timestamps when moving them between folders.
Sync Pull            # Download changes only, don't sync local changes up to the server.
Create Near         # Automatically create new folders in the local copy.
Remove Near         # Automatically remove deleted folders from the local copy.
Expunge Near        # Expunge deleted messages from the local copy.

IMAPAccount mymail
Host imap.mymail.com
User YOUR_USERNAME@mymail.com
PassCmd "gpg -dq /path/to/pwd"
SSLType IMAPS

IMAPStore mymail-remote
Account mymail

MaildirStore mymail-local
Path ~/Mail/Mymail/ # need to manually mkdir; need trailing /
Inbox ~/Mail/Mymail/Inbox   # manually create dir
SubFolders Verbatim

Channel mymail
Far :mymail-remote:
Near :mymail-local:
Patterns *
SyncState *

Usage

mbsync -a   # sync all
mbsync mymail   # sync one channel

## use mutt to load maildir
mutt -f /path/to/maildir/Inbox

autostart

## ~/.config/systemd/user/mbsync.service

[Unit]
Description=Mailbox synchronization service

[Service]
Type=oneshot
ExecStart=/usr/bin/mbsync -Va

[Install]
WantedBy=default.target

## ~/.config/systemd/user/mbsync.timer

[Unit]
Description=Mailbox synchronization timer

[Timer]
OnBootSec=2m
OnUnitActiveSec=5m
Unit=mbsync.service

[Install]
WantedBy=timers.target