Update mu4e README, add mbsync config section

This commit is contained in:
Alexander Graul 2020-04-24 12:09:38 +02:00
parent 9fe35c5fa4
commit 842283ec10

View file

@ -12,11 +12,12 @@
- [[#arch-linux][Arch Linux]] - [[#arch-linux][Arch Linux]]
- [[#nixos][NixOS]] - [[#nixos][NixOS]]
- [[#opensuse][openSUSE]] - [[#opensuse][openSUSE]]
- [[Debian/Ubuntu]] - [[#debianubuntu][Debian/Ubuntu]]
- [[#features][Features]] - [[#features][Features]]
- [[#configuration][Configuration]] - [[#configuration][Configuration]]
- [[#offlineimap][offlineimap]] - [[#offlineimap][offlineimap]]
- [[#mbsync][mbsync]] - [[#mbsync][mbsync]]
- [[#mu-and-mu4e][mu and mu4e]]
- [[#troubleshooting][Troubleshooting]] - [[#troubleshooting][Troubleshooting]]
- [[#no-such-file-or-directory-mu4e][=No such file or directory, mu4e=]] - [[#no-such-file-or-directory-mu4e][=No such file or directory, mu4e=]]
- [[#void-function-org-time-add-error-on-gentoo][~(void-function org-time-add)~ error on Gentoo]] - [[#void-function-org-time-add-error-on-gentoo][~(void-function org-time-add)~ error on Gentoo]]
@ -105,20 +106,53 @@ sudo apt-get install maildir-utils # mu
* Configuration * Configuration
** offlineimap ** offlineimap
This module uses =mbsync= by default. To change this, change ~+mu4e-backend~: This module uses =mbsync= by default. To use =offlineimap=, change ~+mu4e-backend~:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq +mu4e-backend 'offlineimap) (setq +mu4e-backend 'offlineimap)
#+END_SRC #+END_SRC
Then you must set up offlineimap and index your mail: Next, you need to write a configuration file for =offlineimap=. Mine can be found
[[https://github.com/hlissner/dotfiles/tree/master/shell/mu][in my dotfiles repository]]. It is configured to download mail to ~\~/.mail~. I
use [[https://www.passwordstore.org/][unix pass]] to securely store my login credentials. You can find a *very*
detailed configuration [[https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf][here]].
1. Write a ~\~/.offlineimaprc~. Mine can be found [[https://github.com/hlissner/dotfiles/tree/master/shell/mu][in my dotfiles repository]]. It Next you can download your email with ~offlineimap -o~. This may take a while,
is configured to download mail to ~\~/.mail~. I use [[https://www.passwordstore.org/][unix pass]] to securely especially if you have thousands of mails.
store my login credentials. You can find a *very* detailed configuration
[[https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf][here]]. You can now proceed with the [[*mu and mu4e][mu and mu4e]] section.
2. Download your email: ~offlineimap -o~ (may take a while)
3. Index it with mu: ~mu index --maildir ~/.mail~ ** mbsync
The steps needed to set up =mu4e= with =mbsync= are very similar to the ones for
[[*offlineimap][offlineimap]].
Start with writing a ~\~/.mbsyncrc~. An example for GMAIL can be found on
[[http://pragmaticemacs.com/emacs/migrating-from-offlineimap-to-mbsync-for-mu4e/][pragmaticemacs.com]]. A non-GMAIL example is available as a gist [[https://gist.github.com/agraul/60977cc497c3aec44e10591f94f49ef0][here]]. The [[http://isync.sourceforge.net/mbsync.html][manual
page]] contains all needed information to set up your own.
Next you can download your email with ~mbsync --all~. This may take a while, but
should be quicker than =offlineimap= ;).
You can now proceed with the [[*mu and mu4e][mu and mu4e]] section.
** mu and mu4e
You should have your email downloaded already. If you have not, you need to set
=offlineimap= or =mbsync= up before you proceed.
Before you can use =mu4e= or the cli program =mu=, you need to index your email
initially. How to do that differs a little depending on the version of =mu= you
use. You can check your version with ~mu --version~.
For =mu= *>=1.4* you need to run two commands:
#+BEGIN_SRC sh
mu init --maildir ~/.mail --my-address email@example.com
mu index
#+END_SRC
=mu= *<1.4* only requires one command:
#+BEGIN_SRC sh
mu index --maildir ~/.mail
#+END_SRC
Then configure Emacs to use your email address: Then configure Emacs to use your email address:
@ -130,12 +164,11 @@ Then configure Emacs to use your email address:
(mu4e-trash-folder . "/Lissner.net/Trash") (mu4e-trash-folder . "/Lissner.net/Trash")
(mu4e-refile-folder . "/Lissner.net/All Mail") (mu4e-refile-folder . "/Lissner.net/All Mail")
(smtpmail-smtp-user . "henrik@lissner.net") (smtpmail-smtp-user . "henrik@lissner.net")
(user-mail-address . "henrik@lissner.net") (user-mail-address . "henrik@lissner.net") ;; only needed for mu < 1.4
(mu4e-compose-signature . "---\nHenrik Lissner")) (mu4e-compose-signature . "---\nHenrik Lissner"))
t) t)
#+END_SRC #+END_SRC
** TODO mbsync
* Troubleshooting * Troubleshooting
** =No such file or directory, mu4e= ** =No such file or directory, mu4e=
You will get =No such file or directory, mu4e= errors if you don't run ~doom You will get =No such file or directory, mu4e= errors if you don't run ~doom