Skip to content

cemkeylan/mu-wizard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mu-wizard

mu-wizard is a shell script to auto-configure email accounts for mu4e similar in function to mutt-wizard. It uses isync to synchronize mail accounts, msmtp to send mail and creates individual Lisp profiles for each account. It is still WIP. Expect breaking changes until the first release.

Table of Contents

Dependencies

  • isync (for offline mail storage)
  • mu (or maildir-utils depending on your distribution)
  • msmtp (for sending mails)
  • Password manager (pass, pash, and pm is supported)

Installation

In order to install mu-wizard, clone this repository and build mu-wizard.

git clone https://github.com/cemkeylan/mu-wizard.git
cd mu-wizard
make install

Users of Arch Linux based distributions can install mu-wizard through the AUR package mu-wizard-git. This package is not maintained by me.

yay -S mu-wizard-git

Initiating password managers

All of the password managers require some sort of initializing before you can store your passwords. This must be done before you run muw for the first time. You will need to have a GnuPG key for all of the password managers supported by muw. You can create a GPG key by running gpg --gen-key, or gpg --full-gen-key.

See the documentation of your password manager for more information on setting up your password manager, below are simple instructions enough to get you going.

pass

In order to initiate pass, do the following:

pass init yourgpgmail@example.com

pash

In order to use pash, add the following to your .bashrc (or what have you):

export PASH_KEYID=yourgpgmail@example.com

pm

In order to use pm, add the following to your .bashrc (or what have you):

export PM_GPG_USER=yourgpgmail@example.com

Usage

The wizard is called by running muw. The commands below are available to use:

add
Add and autoconfigure an email address
delete
Pick an account to delete
list
List configured accounts
purge
Purge all configuration
sync
Sync mail for accounts
mu-init
Run ‘mu init’ with the configured accounts
data
Output system data directory and exit

You can run muw COMMAND --help for learning more about the usage of the command. The entire documentation can be found on manual pages.

Emacs Configuration

Emacs will not be loading the configurations, you will need to set it manually. In your init file, you may choose to load the configuration in the following ways.

(load-file "~/.config/mu4e/mu4e-config.el")
(add-to-list 'load-path "~/.config/mu4e")
(require 'mu4e-config)
(use-package mu4e-config
  :after mu4e
  :load-path "~/.config/mu4e")

Domains file

mu-wizard doesn’t come with a predefined domains.csv file, but it can use one if it is found on /usr/share/mu-wizard/domains.csv (or whatever your share directory is, see muw data). mu-wizard also saves the domain information that you when creating an account on your configuration directory, so you don’t have to retype every detail when creating a second account with the same domain.

Overrides

Domain-level overrides are possible by adding a shell file to either the share directory or the user configuration directory. See overrides/protonmail.com for an example override.

Configuration

mu-wizard is mostly configured through environment variables. You can set these variables on your .bashrc (or other relevant shell configuration file).

Forcing a password manager

Using the $MUW_PWM environment variable, you can specify which password manager to use. If you don’t specify a password manager, muw will use it with the following order:

  1. pass
  2. pash
  3. pm

Setting notification program

mu-wizard supports notify-send (from libnotify) and herbe for sending mail notifications. You can set the $MUW_NOTIFY environment variables to the following:

  1. libnotify
  2. herbe
  3. disabled (self-explanatory)

Notes

Isync Deprecation Notice

isync version 1.4.0 outputs the following deprecation notice for the mbsync configuration.

Notice: Master/Slave are deprecated; use Far/Near instead.

You can fix this by running the command:

sed -i 's|^Slave |Near |;s|^Master |Far |' "$HOME/.mbsyncrc"

Protonmail

mu-wizard supports protonmail. If you are using one of the default domains, you don’t have to do anything. If you are using an alternative domain, you can link the protonmail.com override to your personal domain. Here is an example:

ln -sf /usr/share/mu-wizard/overrides/protonmail.com $HOME/.config/mu4e/overrides/example.com

Keep in mind that you will need protonmail bridge in order to send mails.

Google

Google requires you to enable less-secure access in order to receive mail. See here for more information.