mu-wizard

shell script to easily configure mu4e accounts on Emacs
git clone git://git.ckyln.com/mu-wizard
Log | Files | Refs | LICENSE

README.org (6208B)


      1 #+TITLE: mu-wizard
      2 #+AUTHOR: Cem Keylan
      3 #+STARTUP: indent
      4 
      5 =mu-wizard= is a shell script to auto-configure email accounts for =mu4e=
      6 similar in function to =mutt-wizard=. It uses =isync= to synchronize mail
      7 accounts, =msmtp= to send mail and creates individual Lisp profiles for each
      8 account. It is still WIP. Expect breaking changes until the first release.
      9 
     10 * Table of Contents                                            :TOC:noexport:
     11 - [[#dependencies][Dependencies]]
     12 - [[#installation][Installation]]
     13   - [[#initiating-password-managers][Initiating password managers]]
     14 - [[#usage][Usage]]
     15   - [[#emacs-configuration][Emacs Configuration]]
     16   - [[#domains-file][Domains file]]
     17   - [[#overrides][Overrides]]
     18 - [[#configuration][Configuration]]
     19   - [[#forcing-a-password-manager][Forcing a password manager]]
     20   - [[#setting-notification-program][Setting notification program]]
     21 - [[#notes][Notes]]
     22   - [[#isync-deprecation-notice][Isync Deprecation Notice]]
     23   - [[#protonmail][Protonmail]]
     24   - [[#google][Google]]
     25 
     26 * Dependencies
     27 
     28 - =isync= (for offline mail storage)
     29 - =mu=    (or =maildir-utils= depending on your distribution)
     30 - =msmtp= (for sending mails)
     31 - Password manager (=pass=, [[https://github.com/dylanaraps/pash][pash]], and [[https://github.com/cemkeylan/pm][pm]] is supported)
     32 
     33 * Installation
     34 
     35 In order to install =mu-wizard=, clone this repository and build =mu-wizard=.
     36 
     37 #+BEGIN_SRC sh
     38   git clone https://github.com/cemkeylan/mu-wizard.git
     39   cd mu-wizard
     40   make install
     41 #+END_SRC
     42 
     43 Users of Arch Linux based distributions can install =mu-wizard= through the AUR
     44 package [[https://aur.archlinux.org/packages/mu-wizard-git][mu-wizard-git]]. This package is not maintained by me.
     45 
     46 #+BEGIN_SRC sh
     47   yay -S mu-wizard-git
     48 #+END_SRC
     49 
     50 ** Initiating password managers
     51 
     52 All of the password managers require some sort of initializing before you can
     53 store your passwords. This must be done *before* you run ~muw~ for the first
     54 time. You will need to have a GnuPG key for all of the password managers
     55 supported by ~muw~. You can create a GPG key by running ~gpg --gen-key~, or
     56 ~gpg --full-gen-key~.
     57 
     58 See the documentation of your password manager for more information on setting
     59 up your password manager, below are simple instructions enough to get you going.
     60 
     61 *** pass
     62 
     63 In order to initiate pass, do the following:
     64 
     65 #+BEGIN_SRC sh
     66   pass init yourgpgmail@example.com
     67 #+END_SRC
     68 
     69 *** pash
     70 
     71 In order to use pash, add the following to your =.bashrc= (or what have you):
     72 
     73 #+BEGIN_SRC sh
     74   export PASH_KEYID=yourgpgmail@example.com
     75 #+END_SRC
     76 
     77 *** pm
     78 
     79 In order to use pm, add the following to your =.bashrc= (or what have you):
     80 
     81 #+BEGIN_SRC sh
     82   export PM_GPG_USER=yourgpgmail@example.com
     83 #+END_SRC
     84 
     85 * Usage
     86 
     87 The wizard is called by running ~muw~. The commands below are available to use:
     88 
     89 #+BEGIN_SRC sh :results raw :exports results
     90 ./bin/muw --help | sed -E '/^Commands:/,/^$/!d;/Commands:/d;/^$/d;s|^ *([a-zA-Z-]*) *(.*)$|- =\1= :: \2|'
     91 #+END_SRC
     92 
     93 #+RESULTS:
     94 - =add= :: Add and autoconfigure an email address
     95 - =delete= :: Pick an account to delete
     96 - =list= :: List configured accounts
     97 - =purge= :: Purge all configuration
     98 - =sync= :: Sync mail for accounts
     99 - =mu-init= :: Run 'mu init' with the configured accounts
    100 - =data= :: Output system data directory and exit
    101 
    102 You can run ~muw COMMAND --help~ for learning more about the usage of the
    103 command. The entire documentation can be found on manual pages.
    104 
    105 ** Emacs Configuration
    106 
    107 Emacs will not be loading the configurations, you will need to set it manually.
    108 In your init file, you may choose to load the configuration in the following
    109 ways.
    110 
    111 #+BEGIN_SRC emacs-lisp
    112   (load-file "~/.config/mu4e/mu4e-config.el")
    113 #+END_SRC
    114 
    115 #+BEGIN_SRC emacs-lisp
    116   (add-to-list 'load-path "~/.config/mu4e")
    117   (require 'mu4e-config)
    118 #+END_SRC
    119 
    120 #+BEGIN_SRC emacs-lisp
    121   (use-package mu4e-config
    122     :after mu4e
    123     :load-path "~/.config/mu4e")
    124 #+END_SRC
    125 
    126 ** Domains file
    127 
    128 =mu-wizard= doesn't come with a predefined =domains.csv= file, but it can use
    129 one if it is found on =/usr/share/mu-wizard/domains.csv= (or whatever your share
    130 directory is, see ~muw data~). =mu-wizard= also saves the domain information
    131 that you when creating an account on your configuration directory, so you don't
    132 have to retype every detail when creating a second account with the same domain.
    133 
    134 ** Overrides
    135 
    136 Domain-level overrides are possible by adding a shell file to either the share
    137 directory or the user configuration directory. See [[file:overrides/protonmail.com][overrides/protonmail.com]]
    138 for an example override.
    139 
    140 * Configuration
    141 
    142 =mu-wizard= is mostly configured through environment variables. You can set
    143 these variables on your =.bashrc= (or other relevant shell configuration file).
    144 
    145 ** Forcing a password manager
    146 
    147 Using the =$MUW_PWM= environment variable, you can specify which password
    148 manager to use. If you don't specify a password manager, ~muw~ will use it with
    149 the following order:
    150 
    151 1. ~pass~
    152 2. ~pash~
    153 3. ~pm~
    154 
    155 ** Setting notification program
    156 
    157 =mu-wizard= supports ~notify-send~ (from =libnotify=) and [[https://github.com/dudik/herbe][herbe]] for sending
    158 mail notifications. You can set the =$MUW_NOTIFY= environment variables to the
    159 following:
    160 
    161 1. ~libnotify~
    162 2. ~herbe~
    163 3. ~disabled~ (self-explanatory)
    164 
    165 * Notes
    166 
    167 ** Isync Deprecation Notice
    168 
    169 =isync= version 1.4.0 outputs the following deprecation notice for the mbsync
    170 configuration.
    171 
    172 #+BEGIN_QUOTE
    173 Notice: Master/Slave are deprecated; use Far/Near instead.
    174 #+END_QUOTE
    175 
    176 You can fix this by running the command:
    177 
    178 #+begin_src sh
    179 sed -i 's|^Slave |Near |;s|^Master |Far |' "$HOME/.mbsyncrc"
    180 #+end_src
    181 
    182 ** Protonmail
    183 
    184 =mu-wizard= supports protonmail. If you are using one of the default domains,
    185 you don't have to do anything. If you are using an alternative domain, you can
    186 link the protonmail.com override to your personal domain. Here is an example:
    187 
    188 #+BEGIN_SRC sh
    189   ln -sf /usr/share/mu-wizard/overrides/protonmail.com $HOME/.config/mu4e/overrides/example.com
    190 #+END_SRC
    191 
    192 Keep in mind that you will need protonmail bridge in order to send mails.
    193 
    194 ** Google
    195 
    196 Google requires you to enable less-secure access in order to receive mail. See
    197 [[https://support.google.com/accounts/answer/6010255][here]] for more information.