Changes relating to mu4e setup on mac

This commit is contained in:
Random936 2023-09-24 20:02:39 -07:00
parent 5c2afc59ae
commit eeb1f21ad0
2 changed files with 21 additions and 6 deletions

View File

@ -22,6 +22,16 @@ rm ~/.passwords/gmail # Remove the plaintext password file.
If you are using two factor authentication, this will not work. In this case, you will need to create an /app password/. A guide on how to do this can be found [[https://support.google.com/accounts/answer/185833][here]]. From here, I can just replace this value with what used to be my normal password. If you are using two factor authentication, this will not work. In this case, you will need to create an /app password/. A guide on how to do this can be found [[https://support.google.com/accounts/answer/185833][here]]. From here, I can just replace this value with what used to be my normal password.
** Installation for MacOS
MacOS doesn't include a certificate file in the typical ~/etc/ssl/certs~ directory. Due to this, you have to create a file using the ~Keychain Access~ app.
#+begin_src bash
Open the Application Keychain Access.app
Select System Roots in the sidebar
Select all items listen here ⌘ + a
Export the items with ⇧ + ⌘ + e to the file ~/.mail/certificates/root-certificates.pem
#+end_src
* Mu4e * Mu4e
In this section, I'm setting up ~mu4e~ to give emacs the capability to send emails using my gmail account. To start, you need to install the ~mu4e~ package outside of emacs. In this section, I'm setting up ~mu4e~ to give emacs the capability to send emails using my gmail account. To start, you need to install the ~mu4e~ package outside of emacs.
@ -41,7 +51,7 @@ From here, I can continue onto configuring the ~mu4e~ emacs package.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package mu4e (use-package mu4e
:ensure nil :ensure nil
:load-path "/usr/share/emacs/site-lisp/mu4e/" :load-path "/opt/homebrew/share/emacs/site-lisp/mu/mu4e/"
:bind ("C-x m" . mu4e) :bind ("C-x m" . mu4e)
:config :config
;; Avoids syncing issues. ;; Avoids syncing issues.
@ -86,11 +96,13 @@ In order to send mail with ~mu4e~, you must also configure an SMTP client. Base
(setq smtpmail-stream-type 'ssl) (setq smtpmail-stream-type 'ssl)
(setq smtpmail-smtp-server "smtp.gmail.com") (setq smtpmail-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-service 465)) (setq smtpmail-smtp-service 465))
(setq send-mail-function 'smtpmail-send-it)
#+end_src #+end_src
When running this however, you need to authenticate by creating an ~~/.authinfo~ file. This file is formatted as follows: When running this however, you need to authenticate by creating an ~~/.authinfo~ file. This file is formatted as follows:
#+begin_src text #+begin_src text
machine mail.example.org port 25 login myuser password mypassword machine smtp.gmail.com port 465 login myuser password mypassword
#+end_src #+end_src
Similarly to the password configured above for the IMAP server, you can also pass an ~authinfo.gpg~ file for some added security. Similarly to the password configured above for the IMAP server, you can also pass an ~authinfo.gpg~ file for some added security.

View File

@ -3,19 +3,22 @@ Host imap.gmail.com
User jadenprovost@gmail.com User jadenprovost@gmail.com
PassCmd "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.passwords/gmail.gpg" PassCmd "gpg --quiet --for-your-eyes-only --no-tty --decrypt ~/.passwords/gmail.gpg"
SSLType IMAPS SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt SSLVersions TLSv1.2
AuthMechs PLAIN
SystemCertificates no
CertificateFile ~/.mail/certificates/ca-certificates.pem
IMAPStore gmail-remote IMAPStore gmail-remote
Account gmail Account gmail
MaildirStore gmail-local MaildirStore gmail-local
Subfolders Verbatim Subfolders Verbatim
Path ~/Mail/ Path ~/.mail/
Inbox ~/Mail/Inbox Inbox ~/.mail/Inbox
Channel gmail Channel gmail
Far :gmail-remote: Far :gmail-remote:
Near :gmail-local: Near :gmail-local:
Patterns * ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" "[Gmail]/Trash" Patterns * ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" "[Gmail]/Trash"
Create Both Create Both
SyncState * SyncState *