Browse Source

Remove APHP email config and add contexts for local email server

master
Maxime Wack 6 months ago
parent
commit
7019978e05
1 changed files with 50 additions and 29 deletions
  1. +50
    -29
      .config/emacs/init.el

+ 50
- 29
.config/emacs/init.el View File

@@ -2383,7 +2383,8 @@ If SELECT is non-nil, select the target window."

(setq mu4e-sent-folder "/Inbox" ; Folders
mu4e-drafts-folder "/Drafts"
mu4e-trash-folder "/Trash")
mu4e-trash-folder "/Trash"
mu4e-refile-folder "/Archives")

(setq mu4e-maildir-shortcuts ; and their shortcuts
'(("/Inbox" . ?i)
@@ -2391,24 +2392,11 @@ If SELECT is non-nil, select the target window."
("/Trash" . ?t)
("/Junk" . ?j)
("/Sent" . ?s)
("/Drafts" . ?d)))

(cond ((equal (system-name) "hegp") ; Mail accounts
(setq mu4e-get-mail-command "mbsync aphp"
mu4e-refile-folder "/Local_archive"
mu4e-maildir-shortcuts '(("/Inbox" . ?i)
("/Local_archive" . ?a)
("/Trash" . ?t)
("/Junk" . ?j)
("/Sent" . ?s)
("/Drafts" . ?d))))
((or (equal (system-name) "tablet")
(equal (system-name) "hegp-laptop")
(equal (system-name) "hnv-laptop"))
(setq mu4e-get-mail-command "mbsync free"
mu4e-refile-folder "/Archives")))
("/Drafts" . ?d)))


(setq mu4e-view-prefer-html t ; Display html by default
mu4e-get-mail-command "mbsync free"
mu4e-update-interval 300 ; Fetch emails every 5 minutes
mu4e-headers-auto-update t ; Auto update list of emails after update
mu4e-compose-signature-auto-include nil ; org-msg has its own signature
@@ -2528,18 +2516,51 @@ ALL-EMAILS are all the unread emails"
message-send-mail-function 'smtpmail-send-it
send-mail-function 'smtpmail-send-it)

(cond ((or (equal (system-name) "tablet") ; smtp accounts
(equal (system-name) "hegp-laptop")
(equal (system-name) "hnv-laptop"))
(setq smtpmail-smtp-server "smtp.free.fr"
user-mail-address "maximewack@free.fr"
auth-sources '("~/.authinfo.gpg")
smtpmail-smtp-service 587))
((equal (system-name) "hegp")
(setq smtpmail-smtp-server "smtp.aphp.fr"
user-mail-address "maxime.wack@aphp.fr"
auth-sources '(password-store)
smtpmail-smtp-service 25))))
(setq smtpmail-smtp-server "smtp.free.fr"
user-mail-address "maximewack@free.fr"
auth-sources '("~/.authinfo.gpg")
smtpmail-smtp-service 587)

(setq mu4e-main-hide-personal-addresses t
mu4e-context-policy 'pick-first
mu4e-compose-context-policy 'ask-if-none)

(setq mu4e-contexts
`( ,(make-mu4e-context
:name "free"
:enter-func (lambda () (mu4e-message "Entering free context"))
:leave-func (lambda () (mu4e-message "Leaving free context"))
;; we match based on the contact-fields of the message
:match-func (lambda (msg)
(when msg
(mu4e-message-contact-field-matches msg :to "maximewack@free.fr")))
:vars '((user-mail-address . "maximewack@free.fr")
(smtpmail-smtp-server . "smtp.free.fr")
(user-full-name . "Maxime Wack")
(org-msg-signature . "--\nMaxime Wack\n")))
,(make-mu4e-context
:name "maximewack.com"
:enter-func (lambda () (mu4e-message "Switch to the home context"))
:leave-func (lambda () (mu4e-message "Leaving home context"))
:match-func (lambda (msg)
(when msg
(mu4e-message-contact-field-matches msg :to "@maximewack.com")))
:vars '((user-mail-address . "@maximewack.com")
(smtpmail-smtp-server . "drykiss.me")
(user-full-name . "Maxime Wack")
(org-msg-signature . "--\nMaxime Wack\n")))

,(make-mu4e-context
:name "drykiss.me"
:enter-func (lambda () (mu4e-message "Switch to the drykiss context"))
:leave-func (lambda () (mu4e-message "Leaving drykiss context"))
:match-func (lambda (msg)
(when msg
(mu4e-message-contact-field-matches msg :to "@drykiss.me")))
:vars '((user-mail-address . "@drykiss.me")
(smtpmail-smtp-server . "drykiss.me")
(user-full-name . "" )
(org-msg-signature . nil))))))

;;;;; Org-mime



Loading…
Cancel
Save