summaryrefslogtreecommitdiff
path: root/init.org
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2017-02-21 16:38:21 +0100
committerRicardo Wurmus <rekado@elephly.net>2017-02-21 16:38:21 +0100
commit33c1a88aa885f9f5c6a6128a62ad20266febc277 (patch)
tree25e99d2bdf32253f0ffc076d27e649243bdc9096 /init.org
parent6fedc1126a7bc02a18c7a071397517fb957d9bc3 (diff)
mail: Split contexts; load only work context at work.
Diffstat (limited to 'init.org')
-rw-r--r--init.org186
1 files changed, 111 insertions, 75 deletions
diff --git a/init.org b/init.org
index 9741da7..bb361d6 100644
--- a/init.org
+++ b/init.org
@@ -1267,85 +1267,110 @@ TODO: this is a big blob of email configuration. Document this properly!
'("git am" . mu4e-action-git-apply-mbox))
(add-to-list 'mu4e-headers-actions
'("git am" . mu4e-action-git-apply-mbox))
+#+END_SRC
-(setq mu4e-contexts
- (list (make-mu4e-context
- :name "Private"
- :enter-func (lambda ()
- (mu4e-message "Switch to the Private context")
- (my/set-mu4e-bookmarks "private"))
- :match-func (lambda (msg)
- (when msg
- (or (mu4e-message-contact-field-matches
- msg :to (rot13 "erxnqb@ryrcuyl.arg"))
- (mu4e-message-contact-field-matches
- msg :from (rot13 "erxnqb@ryrcuyl.arg"))
- ;; Additional check if this is a mailing list email.
- (and (mu4e-message-field msg :mailing-list)
- (zerop (call-process "grep" nil nil nil
- "-E" "^Delivered-To: .*elephly.net"
- (mu4e-message-field msg :path)))))))
- :vars `((user-mail-address . ,(rot13 "erxnqb@ryrcuyl.arg"))
- (mu4e-user-mail-address-list . ,(list (rot13 "erxnqb@ryrcuyl.arg")))
- (user-full-name . ,(rot13 "Evpneqb Jhezhf"))
- (mu4e-sent-folder . "/private/Sent")
- (mu4e-trash-folder . "/private/Trash")
- (mu4e-refile-folder . "/private/Archives")
- (mu4e-drafts-folder . "/private/Drafts")
- (mu4e-compose-signature . "Ricardo
+I read and write email in different contexts. This is my context for private email:
+
+#+BEGIN_SRC elisp
+(setq my/mu4e-context-private
+ (make-mu4e-context
+ :name "Private"
+ :enter-func
+ (lambda ()
+ (mu4e-message "Switch to the Private context")
+ (my/set-mu4e-bookmarks "private"))
+ :match-func
+ (lambda (msg)
+ (when msg
+ (or (mu4e-message-contact-field-matches
+ msg :to (rot13 "erxnqb@ryrcuyl.arg"))
+ (mu4e-message-contact-field-matches
+ msg :from (rot13 "erxnqb@ryrcuyl.arg"))
+ ;; Additional check if this is a mailing list email.
+ (and (mu4e-message-field msg :mailing-list)
+ (zerop (call-process "grep" nil nil nil
+ "-E" "^Delivered-To: .*elephly.net"
+ (mu4e-message-field msg :path)))))))
+ :vars
+ `((user-mail-address . ,(rot13 "erxnqb@ryrcuyl.arg"))
+ (mu4e-user-mail-address-list . ,(list (rot13 "erxnqb@ryrcuyl.arg")))
+ (user-full-name . ,(rot13 "Evpneqb Jhezhf"))
+ (mu4e-sent-folder . "/private/Sent")
+ (mu4e-trash-folder . "/private/Trash")
+ (mu4e-refile-folder . "/private/Archives")
+ (mu4e-drafts-folder . "/private/Drafts")
+ (mu4e-compose-signature . "Ricardo
GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
-https://elephly.net")))
- (make-mu4e-context
- :name "CoderDojo"
- :enter-func (lambda ()
- (mu4e-message "Switch to the CoderDojo context")
- (my/set-mu4e-bookmarks "fhaindojo"))
- :match-func (lambda (msg)
- (when msg
- (or (mu4e-message-contact-field-matches
- msg :to (rot13 "erxnqb@sunva.pbqreqbwb.oreyva"))
- (mu4e-message-contact-field-matches
- msg :from (rot13 "erxnqb@sunva.pbqreqbwb.oreyva"))
- (mu4e-message-contact-field-matches
- msg :to (rot13 "uryyb@sunva.pbqreqbwb.oreyva"))
- (mu4e-message-contact-field-matches
- msg :from (rot13 "uryyb@sunva.pbqreqbwb.oreyva")))))
- :vars `((user-mail-address . ,(rot13 "erxnqb@sunva.pbqreqbwb.oreyva"))
- (mu4e-user-mail-address-list . ,(list (rot13 "erxnqb@sunva.pbqreqbwb.oreyva")))
- (user-full-name . ,(rot13 "Evpneqb Jhezhf"))
- (mu4e-sent-folder . "/fhaindojo/Sent")
- (mu4e-trash-folder . "/fhaindojo/Trash")
- (mu4e-refile-folder . "/fhaindojo/Archive")
- (mu4e-drafts-folder . "/fhaindojo/Drafts")
- (mu4e-compose-signature . "Ricardo
+https://elephly.net"))))
+#+END_SRC
+
+Here’s one exclusively for handling CoderDojo email:
+
+#+BEGIN_SRC elisp
+(setq my/mu4e-context-coderdojo
+ (make-mu4e-context
+ :name "CoderDojo"
+ :enter-func
+ (lambda ()
+ (mu4e-message "Switch to the CoderDojo context")
+ (my/set-mu4e-bookmarks "fhaindojo"))
+ :match-func
+ (lambda (msg)
+ (when msg
+ (or (mu4e-message-contact-field-matches
+ msg :to (rot13 "erxnqb@sunva.pbqreqbwb.oreyva"))
+ (mu4e-message-contact-field-matches
+ msg :from (rot13 "erxnqb@sunva.pbqreqbwb.oreyva"))
+ (mu4e-message-contact-field-matches
+ msg :to (rot13 "uryyb@sunva.pbqreqbwb.oreyva"))
+ (mu4e-message-contact-field-matches
+ msg :from (rot13 "uryyb@sunva.pbqreqbwb.oreyva")))))
+ :vars
+ `((user-mail-address . ,(rot13 "erxnqb@sunva.pbqreqbwb.oreyva"))
+ (mu4e-user-mail-address-list . ,(list (rot13 "erxnqb@sunva.pbqreqbwb.oreyva")))
+ (user-full-name . ,(rot13 "Evpneqb Jhezhf"))
+ (mu4e-sent-folder . "/fhaindojo/Sent")
+ (mu4e-trash-folder . "/fhaindojo/Trash")
+ (mu4e-refile-folder . "/fhaindojo/Archive")
+ (mu4e-drafts-folder . "/fhaindojo/Drafts")
+ (mu4e-compose-signature . "Ricardo
GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
-https://elephly.net")))
- (make-mu4e-context
- :name "Work"
- :enter-func (lambda ()
- (mu4e-message "Switch to the Work context")
- (my/set-mu4e-bookmarks "mdc-personal"))
- :match-func (lambda (msg)
- (when msg
- (or (mu4e-message-contact-field-matches
- msg :to (rot13 "evpneqb.jhezhf@zqp-oreyva.qr"))
- (mu4e-message-contact-field-matches
- msg :from (rot13 "evpneqb.jhezhf@zqp-oreyva.qr"))
- ;; Additional check if this is a mailing list email.
- (and (mu4e-message-field msg :mailing-list)
- (zerop (call-process "grep" nil nil nil
- "-E" "^Received: from .*mdc-berlin.de"
- (mu4e-message-field msg :path)))))))
- :vars `((user-mail-address . ,(rot13 "evpneqb.jhezhf@zqp-oreyva.qr"))
- (mu4e-user-mail-address-list . ,(list (rot13 "evpneqb.jhezhf@zqp-oreyva.qr")))
- (user-full-name . ,(rot13 "Evpneqb Jhezhf"))
- (mu4e-sent-folder . "/mdc-personal/Sent Items")
- (mu4e-trash-folder . "/mdc-personal/Deleted Items")
- (mu4e-refile-folder . "/mdc-personal/Archive")
- (mu4e-drafts-folder . "/mdc-personal/Drafts")
- (mu4e-compose-signature . ,(rot13 (concat "\
+https://elephly.net"))))
+#+END_SRC
+
+And here’s the context for work email:
+
+#+BEGIN_SRC elisp
+(setq my/mu4e-context-work
+ (make-mu4e-context
+ :name "Work"
+ :enter-func
+ (lambda ()
+ (mu4e-message "Switch to the Work context")
+ (my/set-mu4e-bookmarks "mdc-personal"))
+ :match-func
+ (lambda (msg)
+ (when msg
+ (or (mu4e-message-contact-field-matches
+ msg :to (rot13 "evpneqb.jhezhf@zqp-oreyva.qr"))
+ (mu4e-message-contact-field-matches
+ msg :from (rot13 "evpneqb.jhezhf@zqp-oreyva.qr"))
+ ;; Additional check if this is a mailing list email.
+ (and (mu4e-message-field msg :mailing-list)
+ (zerop (call-process "grep" nil nil nil
+ "-E" "^Received: from .*mdc-berlin.de"
+ (mu4e-message-field msg :path)))))))
+ :vars
+ `((user-mail-address . ,(rot13 "evpneqb.jhezhf@zqp-oreyva.qr"))
+ (mu4e-user-mail-address-list . ,(list (rot13 "evpneqb.jhezhf@zqp-oreyva.qr")))
+ (user-full-name . ,(rot13 "Evpneqb Jhezhf"))
+ (mu4e-sent-folder . "/mdc-personal/Sent Items")
+ (mu4e-trash-folder . "/mdc-personal/Deleted Items")
+ (mu4e-refile-folder . "/mdc-personal/Archive")
+ (mu4e-drafts-folder . "/mdc-personal/Drafts")
+ (mu4e-compose-signature . ,(rot13 (concat "\
Evpneqb Jhezhf
Flfgrz nqzvavfgengbe
@@ -1356,7 +1381,18 @@ Eboreg-Eöffyr-Fge. 10, 13125, Oreyva, Treznal
Ohvyqvat 89, Ebbz 1.08
rznvy: evpneqb.jhezhf@zqp-oreyva.qr
-gry: +49 30 9406 " (number-to-string (+ (* 1 2 2 3 4 5 6) (expt 2 8) 100)))))))))
+gry: +49 30 9406 " (number-to-string (+ (* 1 2 2 3 4 5 6) (expt 2 8) 100))))))))
+#+END_SRC
+
+When I’m using the workstation in the office, all I want is the work context.
+
+#+BEGIN_SRC elisp
+(setq mu4e-contexts
+ (if (string= system-name (rot13 "ovzfo-flf02.zqp-oreyva.arg"))
+ (list my/mu4e-context-work)
+ (list my/mu4e-context-private
+ my/mu4e-context-coderdojo
+ my/mu4e-context-work)))
#+END_SRC
Load all of this email configuration code only when I start =mu4e=.