Mu4e: add support for non-@gmail gmail accounts
This commit is contained in:
parent
a8d7d61e44
commit
f3daba3471
2 changed files with 15 additions and 4 deletions
|
@ -127,7 +127,8 @@ sudo apt-get install maildir-utils mu4e # mu and mu4e respectivly
|
||||||
setting ~+org-msg-accent-color~)
|
setting ~+org-msg-accent-color~)
|
||||||
+ Gmail integrations with the =+gmail= flag, which account for the different behaviour.
|
+ Gmail integrations with the =+gmail= flag, which account for the different behaviour.
|
||||||
This is applied when using addresses which contain =@gmail.com= or have =gmail= in
|
This is applied when using addresses which contain =@gmail.com= or have =gmail= in
|
||||||
the maildir name.
|
the maildir name. You can use ~+mu4e-gmail-addresses~ when you want an address
|
||||||
|
to be treated as such but it meets neither conditions (e.g. with Gsuite).
|
||||||
+ Email notifications with =mu4e-alert=, and (on Linux) a customised notification style
|
+ Email notifications with =mu4e-alert=, and (on Linux) a customised notification style
|
||||||
|
|
||||||
* Configuration
|
* Configuration
|
||||||
|
|
|
@ -364,10 +364,18 @@ Must be set before org-msg is loaded to take effect.")
|
||||||
|
|
||||||
(when (featurep! +gmail)
|
(when (featurep! +gmail)
|
||||||
(after! mu4e
|
(after! mu4e
|
||||||
|
(defvar +mu4e-gmail-addresses nil
|
||||||
|
"A list of email addresses which, despite not:
|
||||||
|
- having '@gmail.com' in them, or
|
||||||
|
- being in a maildir where the name includes 'gmail'
|
||||||
|
|
||||||
|
Should be treated as a gmail address.")
|
||||||
|
|
||||||
;; don't save message to Sent Messages, Gmail/IMAP takes care of this
|
;; don't save message to Sent Messages, Gmail/IMAP takes care of this
|
||||||
(setq mu4e-sent-messages-behavior
|
(setq mu4e-sent-messages-behavior
|
||||||
(lambda () ;; TODO make use +mu4e-msg-gmail-p
|
(lambda () ;; TODO make use +mu4e-msg-gmail-p
|
||||||
(if (string-match-p "@gmail.com\\'" (message-sendmail-envelope-from))
|
(if (or (string-match-p "@gmail.com\\'" (message-sendmail-envelope-from))
|
||||||
|
(member (message-sendmail-envelope-from) +mu4e-gmail-addresses))
|
||||||
'delete 'sent))
|
'delete 'sent))
|
||||||
|
|
||||||
;; don't need to run cleanup after indexing for gmail
|
;; don't need to run cleanup after indexing for gmail
|
||||||
|
@ -382,10 +390,12 @@ Must be set before org-msg is loaded to take effect.")
|
||||||
(string-match-p "@gmail.com"
|
(string-match-p "@gmail.com"
|
||||||
(cond
|
(cond
|
||||||
((member (mu4e-message-field msg :to)
|
((member (mu4e-message-field msg :to)
|
||||||
(plist-get mu4e~server-props :personal-addresses))
|
(append (mu4e-personal-addresses)
|
||||||
|
+mu4e-gmail-addresses))
|
||||||
(mu4e-message-field msg :to))
|
(mu4e-message-field msg :to))
|
||||||
((member (mu4e-message-field msg :from)
|
((member (mu4e-message-field msg :from)
|
||||||
(plist-get mu4e~server-props :personal-addresses))
|
(append (mu4e-personal-addresses)
|
||||||
|
+mu4e-gmail-addresses))
|
||||||
(mu4e-message-field msg :from))
|
(mu4e-message-field msg :from))
|
||||||
(t "")))
|
(t "")))
|
||||||
(string-match-p "gmail" (mu4e-message-field msg :maildir))))
|
(string-match-p "gmail" (mu4e-message-field msg :maildir))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue