summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.config/emacs/jd/jd-mu4e.el64
-rw-r--r--Mail.org124
2 files changed, 188 insertions, 0 deletions
diff --git a/.config/emacs/jd/jd-mu4e.el b/.config/emacs/jd/jd-mu4e.el
new file mode 100644
index 0000000..bd9043c
--- /dev/null
+++ b/.config/emacs/jd/jd-mu4e.el
@@ -0,0 +1,64 @@
1(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e")
2
3
4(use-package org-msg
5 :ensure t)
6
7(use-package mu4e
8 :defer 20
9 :ensure nil
10 :config
11 (require 'org-mu4e)
12
13 (setq mu4e-update-interval (* 10 60))
14 (setq mu4e-get-mail-command "mbsync -a")
15 (setq mu4e-maildir "~/Mail")
16
17 (setq mu4e-completing-read-function #'ivy-completing-read)
18
19 (setq mu4e-change-filenames-when-moving t)
20
21 (setq mu4e-contexts
22 `(,(make-mu4e-context
23 :name "Abaks"
24 :match-func (lambda (msg) (when msg
25 (string-prefix-p "/abaks" (mu4e-message-field msg :maildir))))
26 :vars '(
27 (user-full-name . "Jakub Dlugosz")
28 (user-mail-address . "jakub@abaks.pl")
29 (mu4e-sent-folder . "/abaks/Sent Items")
30 (mu4e-trash-folder . "/abaks/Trash")
31 (mu4e-drafts-folder . "/abaks/Drafts")
32 (mu4e-refile-folder . "/abaks/Archive")
33 (mu4e-sent-messages-behavior . sent)
34 ))
35 ,(make-mu4e-context
36 :name "Gmail"
37 :match-func (lambda (msg) (when msg
38 (string-prefix-p "/gmail" (mu4e-message-field msg :maildir))))
39 :vars '(
40 (user-full-name . "Jakub Dlugosz")
41 (user-mail-address . "jdlugosz963@gmail.pl")
42 (mu4e-sent-folder . "/gmail/\[Gmail\]/Wys\&AUI-ane")
43 (mu4e-trash-folder . "/gmail/\[Gmail\]/Kosz")
44 (mu4e-drafts-folder . "/gmail/\[Gmail\]/Wersje\ robocze")
45 (mu4e-refile-folder . "/gmail/Archive")
46 (mu4e-sent-messages-behavior . sent)
47 ))))
48
49 (setq mail-user-agent 'mu4e-user-agent
50 message-send-mail-function 'smtpmail-send-it
51 smtpmail-smtp-server "smtp.abaks.pl"
52 smtpmail-local-domain "pl"
53 smtpmail-smtp-service 465
54 smtpmail-stream-type 'ssl)
55
56 (mu4e t))
57
58(jd/leader-key-def
59 "m" '(:ignore t :which-key "mail")
60 "mm" 'mu4e
61 "mc" 'mu4e-compose-new)
62
63
64(provide 'jd-mu4e)
diff --git a/Mail.org b/Mail.org
new file mode 100644
index 0000000..21ad1b7
--- /dev/null
+++ b/Mail.org
@@ -0,0 +1,124 @@
1#+TITLE: MU4E Configuration
2#+PROPERTY: header-args:emacs-lisp :tangle .config/emacs/jd/jd-mu4e.el
3
4* jd-mu4e.el
5#+begin_src emacs-lisp
6
7 (add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e")
8
9
10 (use-package org-msg
11 :ensure t)
12
13 (use-package mu4e
14 :defer 20
15 :ensure nil
16 :config
17 (require 'org-mu4e)
18
19 (setq mu4e-update-interval (* 10 60))
20 (setq mu4e-get-mail-command "mbsync -a")
21 (setq mu4e-maildir "~/Mail")
22
23 (setq mu4e-completing-read-function #'ivy-completing-read)
24
25 (setq mu4e-change-filenames-when-moving t)
26
27 (setq mu4e-contexts
28 `(,(make-mu4e-context
29 :name "Abaks"
30 :match-func (lambda (msg) (when msg
31 (string-prefix-p "/abaks" (mu4e-message-field msg :maildir))))
32 :vars '(
33 (user-full-name . "Jakub Dlugosz")
34 (user-mail-address . "jakub@abaks.pl")
35 (mu4e-sent-folder . "/abaks/Sent Items")
36 (mu4e-trash-folder . "/abaks/Trash")
37 (mu4e-drafts-folder . "/abaks/Drafts")
38 (mu4e-refile-folder . "/abaks/Archive")
39 (mu4e-sent-messages-behavior . sent)
40 ))
41 ,(make-mu4e-context
42 :name "Gmail"
43 :match-func (lambda (msg) (when msg
44 (string-prefix-p "/gmail" (mu4e-message-field msg :maildir))))
45 :vars '(
46 (user-full-name . "Jakub Dlugosz")
47 (user-mail-address . "jdlugosz963@gmail.pl")
48 (mu4e-sent-folder . "/gmail/\[Gmail\]/Wys\&AUI-ane")
49 (mu4e-trash-folder . "/gmail/\[Gmail\]/Kosz")
50 (mu4e-drafts-folder . "/gmail/\[Gmail\]/Wersje\ robocze")
51 (mu4e-refile-folder . "/gmail/Archive")
52 (mu4e-sent-messages-behavior . sent)
53 ))))
54
55 (setq mail-user-agent 'mu4e-user-agent
56 message-send-mail-function 'smtpmail-send-it
57 smtpmail-smtp-server "smtp.abaks.pl"
58 smtpmail-local-domain "pl"
59 smtpmail-smtp-service 465
60 smtpmail-stream-type 'ssl)
61
62 (mu4e t))
63
64 (jd/leader-key-def
65 "m" '(:ignore t :which-key "mail")
66 "mm" 'mu4e
67 "mc" 'mu4e-compose-new)
68
69
70 (provide 'jd-mu4e)
71
72#+end_src
73
74* mbsyncrc
75
76#+begin_src conf :tangle .mbsyncrc
77IMAPStore abaks-remote
78Host imap.abaks.pl
79Port 143
80SSLType None
81AuthMechs LOGIN
82User jakub@abaks.pl
83PassCmd "pass email/jakub@abaks.pl"
84CertificateFile /etc/ssl/certs/ca-certificates.crt
85
86MaildirStore abaks-local
87Path ~/Mail/abaks/
88Inbox ~/Mail/abaks/INBOX
89Subfolders Verbatim
90
91Channel abaks
92Far :abaks-remote:
93Near :abaks-local:
94Patterns INBOX * !Sync*
95Expunge None
96CopyArrivalDate yes
97Sync All
98Create Near
99SyncState *
100
101IMAPStore gmail-remote
102Host imap.gmail.com
103Port 993
104SSLType IMAPS
105AuthMechs LOGIN
106User jdlugosz963@gmail.com
107PassCmd "pass email/jdlugosz963@gmail.com"
108CertificateFile /etc/ssl/certs/ca-certificates.crt
109
110MaildirStore gmail-local
111Path ~/Mail/gmail/
112Inbox ~/Mail/gmail/INBOX
113Subfolders Verbatim
114
115Channel gmail
116Far :gmail-remote:
117Near :gmail-local:
118Patterns INBOX * !Sync*
119Expunge None
120CopyArrivalDate yes
121Sync All
122Create Near
123SyncState *
124#+end_src