Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.emacs
README.org
emacs-lite.org
org-notmuch.el
profile-dotemacs.el

README.org

Emacs config notes

Email

Some mu4e configuration is kept in ./mu4e.el.gpg.

Software

Overview

Stolen from the mu4e manual.

+---------+
| emacs   |
|    +------+
+----| mu4e | --> send mail (smtpmail)
      +------+
      |  A
      V  |  ---/ search, view, move mail
+---------+    \
|   mu    |
+---------+
  |    A
  V    |
+---------+
| Maildir |  <--- receive mail (fetchmail,
+---------+                     offlineimap, ...)

mu and mu4e

brew install mu --with-emacs

mu index --maildir=~/Mail

set simpson-mail-update-command in mu4e.el.gpg to a string that will be run to check for mail on the CLI to update the mail icon, e.g. (setq simpson-mail-update-command "mu find flag:unread maildir:/service/Inbox 2>/dev/null")

One issue to work around here: http://pragmaticemacs.com/emacs/fixing-duplicate-uid-errors-when-using-mbsync-and-mu4e/

After a lot of digging around I found the solution was in the mbsync and mu4e manuals (of course). The problem is caused because mu4e does not by default rename files when moving them to a new directory and this then causes problems for mbsync. This is easily fixed by setting

(setq mu4e-change-filenames-when-moving t)

mbsync or offlineimap

mbsync

brew install isync

IMAPAccount service
Host imap.service.com
User user@service.com
PassCmd "gpg -q --for-your-eyes-only --no-tty -d ~/.mailpass.gpg"
SSLType IMAPS

IMAPStore service-remote
Account service

MaildirStore service-local
Path ~/Mail/service/
Inbox ~/Mail/service/Inbox

Channel service
Master :service-remote:
Slave :service-local:
Patterns *
# Automatically create missing mailboxes, both locally and on the server
Create Slave
SyncState *
  • the brew services setup for isync doesn’t work. I rolled my own launchd plist plus a small shell script to sync messages every couple minutes.
offlineimap

brew install offlineimap brew services start offlineimap

[general]
accounts = name

[Account name]
localrepository = local
remoterepository = remote
postsynchook = mu index --maildir=~/Mail

[Repository local]
type = Maildir
localfolders = ~/Mail/name

[Repository remote]
type = IMAP
remotehost = imap.name.com
remoteuser = loginUser
remotepass = puppies
ssl=true
sslcacertfile = /usr/local/etc/openssl/cert.pem

Bookmark

(add-to-list 'mu4e-bookmarks
             (make-mu4e-bookmark
              :name  "name"
              :query "maildir:/path/path/INBOX OR maildir:/otherpath/otherpath/INBOX"
              :key ?c))

Contexts

  • These variables in context can also be set outside of a context if there aren’t multiple accounts.
(setq mu4e-contexts `(
                      ,(make-mu4e-context
                        :name "First context"
                        :match-func (lambda (msg)
                                      (when msg
                                        (mu4e-message-contact-field-matches msg :to "adam@adamsimpson.net")))
                        :vars '((user-mail-address . "adam@adamsimpson.net")
                                (mu4e-sent-folder . "/path/path/Sent Items")
                                (mu4e-drafts-folder . "/path/path/Drafts")
                                (mu4e-trash-folder . "/path/path/Trash")
                                (mu4e-refile-folder . "/path/path/Archive")
                                (smtpmail-user . "fastmail_user@fastmail.com")
                                (smtpmail-smtp-server . "fastmail smtp")))
                      ,(make-mu4e-context
                        :name "Work"
                        :match-func (lambda (msg)
                                      (when msg
                                        (or (mu4e-message-contact-field-matches msg :to "work email")
                                            (mu4e-message-contact-field-matches msg :to "other email like a list account or alias"))))
                        :vars '((user-mail-address . "email@work.com")
                                (mu4e-sent-folder . "/path/path/Sent Mail")
                                (mu4e-drafts-folder . "/path/path/Drafts")
                                (mu4e-trash-folder . "/path/path/Trash")
                                (mu4e-refile-folder . "/path/path/All Mail")
                                (smtpmail-smtp-server . "other smtp" )
                                (smtpmail-user . "smtp user")
                                (mu4e-sent-messages-behavior . delete)))))

Note that mu4e-sent-messages-behavior is set to delete which is ideal for Gmail.

SMTP

  • authinfo.gpg needs to be setup with the smtp host(s).

machine smtp.host.com port 57 login servicelogin@service.com password puppies

Modeline

http://asimpson.github.io/dotfiles/mode-line.png

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.