Adam Richardson's Site

Mail Program Notes

Table of Contents

<2022-05-01 Sun>

Mail

isync

Gmail

  • For gmail the ArchWiki has a good example ~/.mbsyncrc
IMAPAccount gmail
# Address to connect to
Host imap.gmail.com
User username@gmail.com
Pass ***************
# To store the password in an encrypted file use PassCmd instead of Pass
# PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.mailpass.gpg"
#
# Use SSL
SSLType IMAPS
# The following line should work. If you get certificate errors, uncomment the two following lines and read the "Troubleshooting" section.
CertificateFile /etc/ssl/certs/ca-certificates.crt
#CertificateFile ~/.cert/imap.gmail.com.pem
#CertificateFile ~/.cert/Equifax_Secure_CA.pem

IMAPStore gmail-remote
Account gmail

MaildirStore gmail-local
SubFolders Verbatim
# The trailing "/" is important
Path ~/.mail/gmail/
Inbox ~/.mail/gmail/Inbox

Channel gmail
Far :gmail-remote:
Near :gmail-local:
# Exclude everything under the internal [Gmail] folder, except the interesting folders
Patterns * ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail"
# Or include everything
#Patterns *
# Automatically create missing mailboxes, both locally and on the server
Create Both
# Sync the movement of messages between folders and deletions, add after making sure the sync works
Expunge Both
# Save the synchronization state files in the relevant directory
SyncState *
  • Once you have set it up use the command mbsync gmail to sync your mail

Protonmail

TODO

notmuch

  • Install notmuch with sudo pacman -Sy notmuch
  • Once installed setup notmuch with notmuch setup
  • After it has been setup you can run notmuch new for it to index your mail
  • Install the emacs package (straight-use-package notmuch)
  • After that you should be able to read you email in emacs with M-x notmuch

Emacs smtpmail

  • Emacs uses you ~/.authinfo.gpg file to auth with the server
  • The format for authinfo is like this machine example.org login <LOGIN_NAME> password <PASSWORD>
  • If you add .gpg to the end emacs will encrypt the file
  • Once you setup your smtp server you can send messages with C-x m, or pressing m inside notmuch mode.

Gmail

(require 'smtpmail)
(setq smtpmail-smtp-server "smtp.gmail.com"
      smtpmail-smtp-service 465
      smtpmail-stream-type 'ssl
      message-send-mail-function 'message-smtpmail-send-it)

Protonmail Bridge