Skip to content

Instantly share code, notes, and snippets.

@webframp
Created January 8, 2014 07:20
Show Gist options
  • Select an option

  • Save webframp/8313021 to your computer and use it in GitHub Desktop.

Select an option

Save webframp/8313021 to your computer and use it in GitHub Desktop.
;;;; Custom settings for notmuch and mail handling
;; this configured both notmuch and message-mode
(autoload 'mailto-compose-mail "mailto-compose-mail" nil t)
;; mail sending
(setq message-send-mail-function 'message-send-mail-with-sendmail)
(setq sendmail-program "/usr/local/bin/msmtp")
(setq mail-specify-envelope-from 't)
(setq message-sendmail-envelope-from 'header)
(setq mail-envelope-from 'header)
(setq message-kill-buffer-on-exit 't)
(setq mail-host-address "webframp.com")
(setq message-default-mail-headers "Cc: \nBcc: \n")
;; mail contacts
(require 'notmuch-address)
(setq notmuch-address-command "~/bin/notmuch-contacts.sh")
(notmuch-address-message-insinuate)
;; mail folders
;;not sure if this does anything anymore
(setq notmuch-saved-searches '(("unread" . "tag:unread")
("chef" . "tag:chef and tag:unread and not tag:github")
("chef-dev" . "tag:chef-dev and tag:unread and not tag:github")
("to-me" . "tag:to-me and tag:unread")
("pdxruby" . "tag:pdxruby and tag:unread")
("pdxdevops" . "tag:pdxdevops and tag:unread")
("pdxfunc" . "tag:pdxfunc and tag:unread")
("ptp" . "tag:ptp-general and tag:unread")
("xmonad" . "tag:xmonad and tag:unread")))
(setq notmuch-archive-tags '("-unread" "+archive"))
(setq message-directory "~/.mail")
;;(setq notmuch-fcc-dirs "seanescriva-gmail.com/sent/")
(setq notmuch-fcc-dirs '(("sean@hw\-ops.com" . "sean-hw-ops.com/sent")
("sean.escriva@gmail.com" . "seanescriva-gmail.com/sent")
(".*" . "sent")))
;; mail viewing and composing
;; fix for possible weirdness with notmuch-show-mode and emacs 24.x
(require 'gnus-art)
;; support multiple email accounts
(autoload 'gnus-alias-determine-identity "gnus-alias" "" t)
;; Define Identities
;; Define two identities, "home" and "work"
(setq gnus-alias-identity-alist
'(("personal"
nil ;; Does not refer to any other identity
"Sean Escriva <sean.escriva@gmail.com>" ;; Sender address
nil ;; No organization header
nil ;; No extra headers
nil ;; No extra body text
nil ;; No Signature
)
("hw"
nil ;; Not referencing another identity
"Sean Escriva <sean@hw-ops.com>"
"heavywater"
nil ;; No extra headers
nil ;; No extra body text
"~/.signature.hw")))
;; Use "personal" identity by default
(setq gnus-alias-default-identity "personal")
;; Define rules to match work identity
(setq gnus-alias-identity-rules
'(
("hw"
("any" "<\\(.+\\)\\@hw-ops\\.com" both) "hw")
)
)
(add-hook 'message-setup-hook 'gnus-alias-determine-identity)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment