From 236967bfc5cc3f10842d16ccd3f238e61287b652 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 30 Aug 2022 21:05:52 +0800 Subject: mail: try to make mu4e work --- mail.el | 131 +++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 67 insertions(+), 64 deletions(-) diff --git a/mail.el b/mail.el index a99a4bf..e238fb2 100644 --- a/mail.el +++ b/mail.el @@ -43,71 +43,74 @@ :query "date:7d..now AND maildir:/suivis" :key ?s)) - (setq mu4e-maildir-shortcuts - '(("/INBOX" . ?i) - ("/archive" . ?a) - ("/suivis" . ?s) - ("/drafts" . ?d))) + ;; (setq mu4e-maildir-shortcuts + ;; '(("/INBOX" . ?i) + ;; ("/archive" . ?a) + ;; ("/suivis" . ?s) + ;; ("/drafts" . ?d))) + + (setq mu4e-sent-folder "/mymail/Sent") - (setq mu4e-contexts - (list - (make-mu4e-context - :name "Student" - :enter-func (lambda () (mu4e-message "Entering Student context")) - :leave-func (lambda () (mu4e-message "Leaving Student context")) - ;; we match based on the contact-fields of the message - :match-func - (lambda (msg) - (when msg - (or - (mu4e-message-contact-field-matches msg :from "tan\\|mlh\\|hsialc\\|tingyu.lee\\|tingyulee") - (mu4e-message-contact-field-matches msg :to "tan\\|mlh\\|hsialc\\|tingyu.lee\\|tingyulee")))) - :vars '((user-mail-address . "mmemmew@gmail.com") - (user-full-name . "李俊緯") - (mu4e-compose-signature . "生 俊緯") - (mu4e-sent-folder . "/gmail/sent") - (smtpmail-smtp-user . "mmemmew@gmail.com") - (smtpmail-local-domain . "gmail.com") - (smtpmail-default-smtp-server . "smtp.gmail.com") - (smtpmail-smtp-server . "smtp.gmail.com") - (smtpmail-smtp-service . 587))) - (make-mu4e-context - :name "NCTS" - :enter-func (lambda () (mu4e-message "Switch to the NCTS context")) - :leave-func (lambda () (mu4e-message "Leave NCTS context")) - ;; no leave-func - ;; we match based on the maildir of the message - ;; this matches maildir /Arkham and its sub-directories - :match-func (lambda (msg) - (when msg - (or - (mu4e-message-contact-field-matches msg :to "chunweilee@ncts.ntu.edu.tw") - (mu4e-message-contact-field-matches msg :from "chunweilee@ncts.ntu.edu.tw")))) - :vars '((user-mail-address . "chunweilee@ncts.ntu.edu.tw") - (user-full-name . "李俊緯") - (mu4e-compose-signature . - (concat - "Sincerely Yours,\n" - "俊緯")))) - (make-mu4e-context - :name "Durand" - :enter-func (lambda () (mu4e-message "Entering Durand context")) - :leave-func (lambda () (mu4e-message "Leaving Durand context")) - ;; we match based on the contact-fields of the message - :match-func (lambda (msg) - (when msg - (or - (mu4e-message-contact-field-matches msg :to "mmemmew@gmail.com") - (mu4e-message-contact-field-matches msg :from "mmemmew@gmail.com")))) - :vars '((user-mail-address . "durand@jsdurand.xyz") - (user-full-name . "Durand") - (mu4e-compose-signature . "Sévère Durand") - (mu4e-sent-folder . "/gmail/sent") - (smtpmail-smtp-user . "mmemmew@gmail.com") - (smtpmail-local-domain . "gmail.com") - (smtpmail-default-smtp-server . "smtp.gmail.com") - (smtpmail-smtp-server . "smtp.gmail.com") - (smtpmail-smtp-service . 587)))))) + ;; (setq mu4e-contexts + ;; (list + ;; (make-mu4e-context + ;; :name "Student" + ;; :enter-func (lambda () (mu4e-message "Entering Student context")) + ;; :leave-func (lambda () (mu4e-message "Leaving Student context")) + ;; ;; we match based on the contact-fields of the message + ;; :match-func + ;; (lambda (msg) + ;; (when msg + ;; (or + ;; (mu4e-message-contact-field-matches msg :from "tan\\|mlh\\|hsialc\\|tingyu.lee\\|tingyulee") + ;; (mu4e-message-contact-field-matches msg :to "tan\\|mlh\\|hsialc\\|tingyu.lee\\|tingyulee")))) + ;; :vars '((user-mail-address . "mmemmew@gmail.com") + ;; (user-full-name . "李俊緯") + ;; (mu4e-compose-signature . "生 俊緯") + ;; (mu4e-sent-folder . "/gmail/sent") + ;; (smtpmail-smtp-user . "mmemmew@gmail.com") + ;; (smtpmail-local-domain . "gmail.com") + ;; (smtpmail-default-smtp-server . "smtp.gmail.com") + ;; (smtpmail-smtp-server . "smtp.gmail.com") + ;; (smtpmail-smtp-service . 587))) + ;; (make-mu4e-context + ;; :name "NCTS" + ;; :enter-func (lambda () (mu4e-message "Switch to the NCTS context")) + ;; :leave-func (lambda () (mu4e-message "Leave NCTS context")) + ;; ;; no leave-func + ;; ;; we match based on the maildir of the message + ;; ;; this matches maildir /Arkham and its sub-directories + ;; :match-func (lambda (msg) + ;; (when msg + ;; (or + ;; (mu4e-message-contact-field-matches msg :to "chunweilee@ncts.ntu.edu.tw") + ;; (mu4e-message-contact-field-matches msg :from "chunweilee@ncts.ntu.edu.tw")))) + ;; :vars '((user-mail-address . "chunweilee@ncts.ntu.edu.tw") + ;; (user-full-name . "李俊緯") + ;; (mu4e-compose-signature . + ;; (concat + ;; "Sincerely Yours,\n" + ;; "俊緯")))) + ;; (make-mu4e-context + ;; :name "Durand" + ;; :enter-func (lambda () (mu4e-message "Entering Durand context")) + ;; :leave-func (lambda () (mu4e-message "Leaving Durand context")) + ;; ;; we match based on the contact-fields of the message + ;; :match-func (lambda (msg) + ;; (when msg + ;; (or + ;; (mu4e-message-contact-field-matches msg :to "mmemmew@gmail.com") + ;; (mu4e-message-contact-field-matches msg :from "mmemmew@gmail.com")))) + ;; :vars '((user-mail-address . "durand@jsdurand.xyz") + ;; (user-full-name . "Durand") + ;; (mu4e-compose-signature . "Sévère Durand") + ;; (mu4e-sent-folder . "/gmail/sent") + ;; (smtpmail-smtp-user . "mmemmew@gmail.com") + ;; (smtpmail-local-domain . "gmail.com") + ;; (smtpmail-default-smtp-server . "smtp.gmail.com") + ;; (smtpmail-smtp-server . "smtp.gmail.com") + ;; (smtpmail-smtp-service . 587))))) + ) ;; (setq smtpmail-debug-info t) ;; (setq smtpmail-debug-verb t) -- cgit v1.2.3-18-g5258