@@ -1,22 +1,157 @@ | |||
# mutt-wizard | |||
% mw(1) Version 1.0 | mutt-wizard man page | |||
Get this great stuff without effort: | |||
<!--- | |||
Before | |||
- A full-featured and autoconfigured email client on the terminal with neomutt | |||
- Mail stored offline so you can view and write email while away from internet and keep backups. | |||
This is via the "offline" option, but you want this. | |||
To test man page: | |||
Specifically, this wizard: | |||
pandoc README.md -s -t man | /usr/bin/man -l - | |||
- Has a database of IMAP4/POP3 and SMTP servers and ports. If mutt-wizard doesn't know your server's IMAP4/POP3/SMTP, it will prompt. | |||
- Creates dotfiles for `neomutt`, `isync`, `msmtp` and `getmail` | |||
- Encrypts and stores locally your password using [pass](https://www.passwordstore.org/), accessible only by your GPG key | |||
- Handles as many as nine separate email accounts automatically | |||
- Auto-creates bindings to switch between accounts or between mailboxes | |||
- Can automatically set mail updates using `crontab` | |||
- Provides sensible defaults and an attractive appearance for the neomutt email client | |||
The generate: | |||
## Install and Use | |||
pandoc README.md -s -t man -o mw.1 | |||
---> | |||
NAME | |||
==== | |||
**mw** — mutt-wizard - add, list, remove email configurations for mbsync, getmail and mutt. Sync email without mutt. | |||
SYNOPSIS | |||
======== | |||
**mw** \[\<command\>\|\<email\>\] | |||
| *mw* Same as *mw sync* | |||
| *mw add* Add and configure an email address (9 max.) | |||
| *mw list* List configured accounts | |||
| *mw remove* Pick an account to remove | |||
| *mw purge* Remove all accounts and settings | |||
| *mw cron* Enable or disable an autosync via cronjob | |||
| *mw sync* Sync mail based on config in *.config/isync/mbsyncrc* and *.config/getmail/\** | |||
| *mw --help|-h* Print this message | |||
| *mw --version|-v* Print version | |||
DESCRIPTION | |||
=========== | |||
**mw** configures **mbsync**, **getmail**, **msmtp** and **mutt** in one go, or just **mutt**. | |||
Note, **mutt** stands for **mutt** or **neomutt**, but **mw** settings was only tested with **neomutt**. | |||
COMMANDS | |||
======== | |||
Without command parameter **sync** is assumed. | |||
If a parameter contains *@* an email is assumed and synced. | |||
*add* | |||
: Add new email. | |||
- First you decide, whether you want to configure | |||
- **mbsync**, **getmail**, **msmtp** to sync emails independently from **mutt** using **mw**, | |||
- or just **mutt**. | |||
For an IMAP server **mutt** becomes very slow. | |||
Normally you enter **y**. | |||
- It asks you the **email address**. | |||
- It has a **database** of IMAP4/POP3 and SMTP servers and ports. | |||
If you are lucky, your email server is there. | |||
Else it will prompt you. | |||
*ls|list* | |||
: List all email accounts configured by mutt-wizard | |||
*rm|remove* | |||
: Remove the configuration files for an already configured email | |||
*purge* | |||
: Removes all mw generated mutt settings and | |||
*.config/mutt/accounts/1-\*** | |||
*.config/isync/mbsyncrc* | |||
*.config/getmail/** | |||
*.config/msmtp/config* | |||
*cron* | |||
: toggle a cronjob that periodically syncs mail | |||
*sync* | |||
: syncs mail for all email accounts managed by *mw* (whose paths end in the email). | |||
This is the default, if no parameter is given. | |||
If an email address is given, only that email is synced. | |||
- Every **mw** sync run will re-generate the **mutt** configuration | |||
from the configuration files for **mbsync**, **getmail** and **msmtp**. | |||
So you could edit them after or not use *mw add* at all. | |||
Just keep the *Path*, *path* and *account* ending in the email address. | |||
Files are under *.config* or *$XDG_CONFIG_HOME*: | |||
``` | |||
~/.config/isync/mbsync (since not mbsync's default, you would need a -c option. Use mw, instead). | |||
~/.config/msmtp/config | |||
~/.config/getmail/<email> | |||
~/.config/mutt/mw_generated.muttrc | |||
``` | |||
- The generated **mutt** configuration has these bindings | |||
- *ixy/Mxy/Cxy* bindings to switch/move/copy to mailbox (x and y stand for other letters) | |||
- *i[1-9]* bindings to switch account | |||
- */usr/share/mutt-wizard/mutt-wizard.muttrc* is linked in your *muttrc*. | |||
Have this line there, if you prefer your own settings: | |||
``` | |||
# source /usr/share/mutt-wizard/mutt-wizard.muttrc | |||
``` | |||
You will need to keep the binding of *i,g,C,M* to *noop*, though, | |||
because of the generated bindings in the account muttrc. | |||
Else you can overwrite certain things after the uncommented sourcing line. | |||
DEPENDENCIES | |||
============ | |||
- *pass* - [pass](https://www.passwordstore.org/) safely encrypts passwords (**required for email setup**) | |||
- *gnupg* - needed by *pass* | |||
- *mutt/neomutt* - the email client (*mutt* untested). | |||
- *isync's mbsync* - syncs the mail | |||
- *getmail* - used for POP3 | |||
- *msmtp* - sends the email | |||
Optional: | |||
- *w3m* - view HTML email and images in **mutt**. | |||
- *notmuch* - index and search mail. | |||
If the configuration file in *$NOTMUCH_CONFIG* is not there, *mw add* will create it. | |||
- *libnotify* - allows notifications when syncing mail with *mw* | |||
- *abook* - a terminal-based address book. | |||
- A cron manager (e.g. *cronie*) - if you want to enable the auto-sync feature. | |||
- *pam-gnupg* - To provide your GPG key at login and never after. | |||
See [directions](https://github.com/cruegge/pam-gnupg). | |||
Alternatively increasing *default-cache-ttl* and | |||
*max-cache-ttl* in *gpg-agent.conf* avoid constant password requests. | |||
- *urlscan* - outputs urls in mail | |||
INSTALLATION | |||
============ | |||
``` | |||
git clone https://github.com/rpuntaie/mutt-wizard | |||
@@ -26,130 +161,186 @@ sudo make install | |||
User of Arch-based distros can also install mutt-wizard from the AUR as [mw-git](https://aur.archlinux.org/packages/mw-git/). | |||
The mutt-wizard is run with the command `mw`. | |||
Once everything is setup, you'll use `neomutt` to access your mail. | |||
- `mw add` -- add a new email account | |||
- `mw ls` -- list existing accounts | |||
- `mw pass` -- revise an account's password | |||
- `mw delete` -- deleted an added account | |||
- `mw purge` -- delete all accounts and settings (**DANGER**) | |||
- `mw cron` -- toggle/configure a cronjob to sync mail | |||
- `mw sync` or `mw` -- sync all your emails. Optionally add the email address, to sync only one. | |||
## Dependencies | |||
- `neomutt` - the email client | |||
- `isync` - downloads and syncs the mail | |||
- `msmtp` - sends the email | |||
- `pass` - safely encrypts passwords (required at install) | |||
There's a chance of errors if you use a slow-release distro like Ubuntu, Debian or Mint. | |||
If you get errors in `neomutt`, install the most recent version manually or manually remove the offending lines in the config in `/usr/share/mutt-wizard/mutt-wizard.muttrc`. | |||
### Optional | |||
- `w3m` - view HTML email and images in neomutt. | |||
- `notmuch` - index and search mail. | |||
Install it and run `notmuch setup`. | |||
Tell it where your mail is (`$MAILDIR` or `~/Mail`). | |||
Although, `mw` will do this automatically, if you haven't set notmuch up before. | |||
You can run it in mutt with `S`. | |||
Run `notmuch new` to process new mail. | |||
Although, `mw sync` does this for you. | |||
- `libnotify`/`libnotify-bin` - allows notifications when syncing mail with `mw sync` | |||
- `abook` - a terminal-based address book. | |||
Pressing tab while typing an address to send mail to will suggest contacts that are in your abook. | |||
- A cron manager - if you want to enable the auto-sync feature. | |||
- `pam-gnupg` - this is a more general program that I use. | |||
It automatically logs you into your GPG key on login so you will never need to input your password once logged on to your system. | |||
Check out the repo and directions [here](https://github.com/cruegge/pam-gnupg). | |||
- `urlscan` - outputs urls in mail to browser. | |||
## Neomutt user interface | |||
To give you an example of the interface, here's an idea: | |||
- `m` - send mail (uses your default `$EDITOR` to write) | |||
- `j`/`k` - next/previous mail, `J/K` same, without skipping deleted, and also when viewing mails | |||
- `ctrl-d/f`/`ctrl-u/b` - down and up a half page / full page | |||
- `l` - open mail, or attachment page or attachment | |||
- `h` - the opposite of `l` | |||
- `dd` - delete mail, `u` undelete | |||
- `r`/`gr` - reply/reply all to highlighted mail | |||
- `s` - save selected mail or selected attachment | |||
- `ixy` - Press `i` followed by the two initial mailbox letters to go there | |||
- `Mxy` and `Cxy` - For `M`ove and `C`opy to the according mailbox, e.g. `Msp` means "move to Spam". | |||
- `i#` - Press `i` followed by a number 1-9 to go to a different account. | |||
If you add 9 accounts via mutt-wizard, they will each be assigned a number. | |||
- `ga` to add address/person to abook and `Tab` while typing address to complete one from book. | |||
- `?` - see all keyboard shortcuts | |||
- `ctrl-j`/`ctrl-k` - move up and down in sidebar, `ctrl-l` opens mailbox. | |||
- `gu` - open a menu to select a url you want to open in you browser (needs urlscan). | |||
- `S` - search for a mail | |||
- `gl` - limit by substring of subject | |||
- `gL` - undo limit | |||
- `gm / gM` - call mutt-wizard's `mw sync` for one / all mail accounts | |||
- `^u` within input field / command line, will clear it, `^a` and `^e` go to beginning or end, `^g` aborts | |||
Look into `/usr/share/mutt-wizard.muttrc` to see all bindings. | |||
## New stuff and improvements since the original release | |||
- honors `$MAILDIR`, `$XDG_CONFIG_HOME`, `$XDG_CACHE_HOME`, if defined. | |||
- `gm/gM` to sync mail inside `mutt`, as `o/O` has a `mutt` assignment already. | |||
- Make channel name equal to email address to avoid choosing a new name for the same thing. | |||
- `isync`/`mbsync` has replaced `offlineimap` as the backend. | |||
Offlineimap was error-prone, bloated, used obsolete Python 2 modules and required separate steps to install the system. | |||
- `mw` is now an installed program instead of just a script needed to be kept in your mutt folder. | |||
- `dialog` is no longer used (le bloat) and the interface is simply text commands. | |||
- More autogenerated shortcuts that allow quickly moving and copying mail between boxes. | |||
- More elegant attachment handling. | |||
Image/video/pdf attachments without relying on the neomutt instance. | |||
- abook integration by default. | |||
- The messy template files and other directories have been moved or removed, leaving a clean config folder. | |||
- msmtp configs moved to `~/.config/` and mail default location moved to `~/Mail`, reducing mess in `~`. | |||
- `pass` is used as a password manager instead of separately saving passwords. | |||
- Script is POSIX sh compliant. | |||
- Error handling for the many people who don't read or follow directions. | |||
Less errors generally. | |||
- Addition of a manual `man mw`. | |||
## Help the Project! | |||
- Try mutt-wizard out on weird machines and weird email addresses and report any errors. | |||
- Open a PR to add new server information into `domains.csv` so their users can more easily use mutt-wizard. | |||
mutt-wizard is free/libre software, licensed under the GPLv3. | |||
## Details for Tinkerers | |||
- The critical `mutt`/`neomutt` files are in `~/.config/mutt/` (or `$XDG_CONFIG_HOME/mutt`) | |||
- Put whatever global settings you want into `muttrc`. | |||
`mutt-wizard` will add some lines to this file which you shouldn't remove unless you know what you're doing. | |||
But you can move them up/down over your personal config lines if you need to. | |||
If you get binding conflict errors in mutt, you might need to do this. | |||
- Each of the accounts that `mutt-wizard` generates will have custom settings set in a separate file in `accounts/`. | |||
You can edit these freely if you want to tinker with settings specific to an account. | |||
- In `/usr/share/mutt-wizard` are several global config files, including `mutt-wizard`'s default settings. | |||
You can overwride this in your `muttrc` if you wish. | |||
To avoid insertion of the line sourcing the default settings, | |||
have a commented `# source /usr/share/mutt-wizard/mutt-wizard.muttrc` in your muttrc. | |||
## Watch out for these things: | |||
- For Gmail accounts, remember also to enable third-party ("""less secure""") applications before attempting installation. | |||
You might also need to manually "Enable IMAP" in the settings. | |||
- Protonmail accounts will require you to set up "Protonmail Bridge" to access PM's IMAP and SMTP servers. | |||
Configure that before running mutt-wizard. | |||
- If you have a university email, or enterprise-hosted email for work, there might be other hurdles or two-factor authentication you have to jump through. | |||
Some, for example, will want you to create a separate IMAP password, etc. | |||
- `isync` is not fully UTF-8 compatible, so non-Latin characters may be garbled (although sync should succeed). | |||
`mw` will also not autocreate mailbox shortcuts since it is looking for English mailbox names. | |||
MUTT-WIZARD\'S NEOMUTT CONFIGURATION | |||
==================================== | |||
Once everything is setup, you'll use **mutt** to access your mail. | |||
Mutt usage with the accompanied */usr/share/mutt-wizard.muttrc*: | |||
- *?* - see all keyboard shortcuts | |||
**syncing** | |||
- *gm / gM* - call mutt-wizard's *mw sync* for one / all mail accounts | |||
**mailboxes,accounts** | |||
- *ixy* - To go to **mailbox**. | |||
- *Mxy*, *Cxy* - For *M*ove and *C*opy to the according mailbox, e.g. *Msp* means "move to Spam". | |||
- *i#* - Press *i* followed by a number 1-9 to go to a **different account**. | |||
*xy* are | |||
- two first letters of mailbox letters or | |||
- first letter of first path entry + second letter of second path entries | |||
**searching** | |||
- *S* - search for a mail using *notmuch* | |||
- *gl* - limit by substring of subject | |||
- *gL* - undo limit | |||
**composing** | |||
- *ga* - to add address/person to *abook* and *Tab* while typing address to complete one from book. | |||
- *m/r/gr/f* - new/reply/group reply/forward **message**, using your default *$EDITOR* to write. | |||
Then you enter the **compose screen**. | |||
- *a* - to add attachments | |||
- *s/t/c/b/d* - to change the subject/to/CC/BCC/description. | |||
- *S* - to change the signature/encryption | |||
- *y* - to send the mail. | |||
**delete,undelete,save** | |||
- *dd* - delete mail | |||
- *u* - undelete | |||
- *$* - apply the mailbox changes | |||
*set trash* is set per default. Deleted mails will land there. | |||
- *s* - save selected mail or selected attachment | |||
**moving around** | |||
- *gu* - open a menu to select a url you want to open in you browser (needs urlscan). | |||
- *j*/*k* - next/previous mail, *J/K* same, without skipping deleted, and also when viewing mails | |||
- *ctrl-d/f*/*ctrl-u/b* - down and up a half page / full page | |||
- *l* - open mail, or attachment page or attachment | |||
- *h* - the opposite of *l* | |||
**sidebar** | |||
- *B* - toggles | |||
- *ctrl-j*/*ctrl-k* - move up and down | |||
- *ctrl-l/o* - opens mailbox | |||
**input field/command line** | |||
- *ctrl-u* will clear it | |||
- *ctrl-a*, *ctrl-e* go to beginning or end, *ctrl-g* aborts | |||
Look into */usr/share/mutt-wizard.muttrc* to see all bindings. | |||
DETAILS | |||
======= | |||
**Encoding** | |||
*isync* is not fully UTF-8 compatible. | |||
Non-Latin characters may be garbled (although sync should succeed). | |||
*mw* will also not auto-create mailbox shortcuts since it is looking for English mailbox names. | |||
I strongly recommend you to set your email language to English on your mail server to avoid these problems. | |||
## To-do | |||
**Mail location** | |||
: Mail is downloaded to a folder named after your email | |||
in *\$MAILDIR*, which defaults to *\$HOME/Mail/*, the default for mutt. | |||
Neither **mw remove** nor **mw purge** will delete downloaded mail. | |||
Do that manually. | |||
**Gmail accounts** | |||
: Google will require you to allow \"less-secure\" (third party) | |||
applications or use two-factor authentication in order to access | |||
their IMAP servers to download your mail. | |||
If you use Gmail, be sure to handle this before running mutt-wizard | |||
\<https://support.google.com/accounts/answer/6010255\>. | |||
**Protonmail accounts** | |||
: Protonmail users must use the Protonmail Bridge | |||
\<https://protonmail.com/bridge/\> to access their IMAP and SMTP | |||
servers. This too should be configured before running mutt-wizard. | |||
**Enterprise and university accounts** | |||
: Many universities and businesses might host their domain\'s email | |||
via Google or another service. | |||
This often requires a special IMAP/SMTP-specific password | |||
that you must generate and use. Again, mutt-wizard can handle these | |||
systems, but only once they have been set up. | |||
FILES | |||
===== | |||
*/user/bin/mw* | |||
: The main script to manage and sync emails. | |||
*/user/bin/mwimage*, */user/bin/mwopen* | |||
: Used by the mailcap file that comes with mutt-wizard. | |||
*/usr/share/mutt-wizard/mutt-wizard.muttrc* | |||
: Default mutt settings. | |||
*/usr/share/mutt-wizard/mailcap* | |||
: Default mailcap file. | |||
*/usr/share/mutt-wizard/domains.csv* | |||
: Email server database. | |||
BUGS | |||
==== | |||
GitHub Issues: <https://github.com/rpuntaie/mutt-wizard/issues> | |||
AUTHORS | |||
======= | |||
*Luke Smith \<foo@example.org\>* | |||
: Original author, started in 2018. | |||
Github \<https://github.com/lukesmithxyz/mutt-wizard\> | |||
Gitlab \<https://gitlab.com/lukesmithxyz/mutt-wizard\> | |||
*Roland Puntaier \<roland.puntaier\@gmail.com\>* | |||
: Bugfixes, Improvements in 2019. | |||
GitHub: \<https://github.com/rpuntaie/mutt-wizard\> | |||
- Honors *$MAILDIR*, *$XDG_CONFIG_HOME*, *$XDG_CACHE_HOME*, if defined. | |||
- *gm/gM* to sync mail inside *mutt*, as *o/O* has a *mutt* assignment already. | |||
- Other more vim-like shortcut changes | |||
- Make channel name equal to email address to avoid choosing a new name for the same thing. | |||
- *remove|rm* instead of *delete*, *list|ls* instead of only *ls* | |||
- *wm* integrates *mailsync*, not to overload the system namespace and because of code reuse | |||
- *wm* generates *mutt* config on every full sync, | |||
- to reflect changes in mailboxes in the shortcuts | |||
- to reflect changes in *mbsync/getmail* config in *mutt* config | |||
- *urlscan* instead of *urlview* | |||
- Added tests and made bug fixes | |||
- Generate man page from readme, to avoid duplicate descriptions | |||
LICENSE | |||
======= | |||
GPLv3 | |||
SEE ALSO | |||
======== | |||
**neomutt**(1), **neomuttrc**(1) **mbsync**(1), **msmtp**(1), | |||
**notmuch**(1), **abook**(1) | |||
- Add ~~Mac OS~~/BSD compatibility (the script should work for Mac OS now) | |||
- ~~Out-of-the-box compatibility with Protonmail Bridge~~ (I believe this is done, but more bug-testing is welcome since I don't have PM) | |||
- Option to keep configuration for accounts that failed to connect (maybe) |
@@ -7,6 +7,11 @@ if [ -z "$prefix" ]; then | |||
esac | |||
fi | |||
VERSION="2.0" | |||
_MW_="mutt-wizard" | |||
_MW_generated="mutt-wizard-generated" | |||
mwconfigdir=${XDG_CONFIG_HOME:-$HOME/.config} | |||
# Main mutt config location | |||
mwmuttdir="$mwconfigdir/mutt" | |||
@@ -14,17 +19,17 @@ mwmuttrc="$mwmuttdir/muttrc" | |||
# Directory for account settings | |||
mwaccmuttdir="$mwmuttdir/accounts" | |||
# Generated at every full sync | |||
mwgenmuttaccs=$mwmuttdir/mw_accounts.muttrc | |||
mwgenmuttaccs=$mwmuttdir/mw_generated.muttrc | |||
# Location of mail storage | |||
mwmaildir="${MAILDIR:-$HOME/mail}" | |||
# Regex to confirm valid email address | |||
mwemailre=".\+@.\+\\..\+" | |||
mwshare="$prefix/share/mutt-wizard" | |||
mwshare="$prefix/share/$_MW_" | |||
mwmbsyncrc="$mwconfigdir/isync/mbsyncrc" | |||
mwgetmaildir=$mwconfigdir/getmail # POP3 | |||
mwmsmtprc="$mwconfigdir/msmtp/config" | |||
mwsharerc="$mwshare/mutt-wizard.muttrc" | |||
mwcachedir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard" | |||
mwsharerc="$mwshare/$_MW_.muttrc" | |||
mwcachedir="${XDG_CACHE_HOME:-$HOME/.cache}/$_MW_" | |||
mwmbsyncbin="$prefix/bin/mbsync -c $mwmbsyncrc" | |||
mwgetmailbin="$prefix/bin/getmail" | |||
msmtpbin="$prefix/bin/msmtp" | |||
@@ -32,7 +37,7 @@ msmtpbin="$prefix/bin/msmtp" | |||
_mwtakeaddr(){ | |||
mwaccmaildir="$mwmaildir/$mwaddr" # mail dir is $MAILDIR/email | |||
mwacccachedir=$mwcachedir/${mwaddr//[.@]/_} # @ cannot stay because of mutt, . could | |||
[ -z "$mwpass" ] || mwpass=mutt-wizard-$mwaddr | |||
[ -z "$mwpass" ] || mwpass=$_MW_-$mwaddr | |||
[ -n "$mwidnum" ] && mwaccmuttrc="$mwaccmuttdir/$mwidnum-$mwaddr.mwonofftype.$mwtype.muttrc" | |||
} | |||
@@ -45,6 +50,14 @@ _mwlist() { | |||
} | |||
_mwadd() { | |||
type gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" | |||
[ -z "$PASSWORD_STORE_DIR" ] && PASSWORD_STORE_DIR="$HOME/.password-store" | |||
[ -r "$PASSWORD_STORE_DIR/.gpg-id" ] && | |||
"$GPG" --list-secret-keys $(cat "$PASSWORD_STORE_DIR/.gpg-id") >/dev/null 2>&1 || { | |||
printf "\`pass\` must be installed and initialized to encrypt passwords.\\nBe sure it is installed and run \`pass init <yourgpgemail>\`.\\n" | |||
printf "If you don't have a GPG public private key pair, run \`$GPG --full-gen-key\` first.\\n" | |||
return 1 | |||
} | |||
_mwcheckcert && _mwcheckinternet && _mwasktype && _mwaskinfo && _mwprofiles && _mwtryconnect && _mwfinalize || _mwdelete | |||
} | |||
@@ -68,7 +81,7 @@ _mwaskinfo() { | |||
printf "\\nSearching for \033[32m%s\033[0m in \033[34m\`domains.csv\`\033[0m..." "$mwdomain" | |||
mwserverinfo="$(grep "^$mwdomain" "$mwshare/domains.csv" 2>/dev/null)" | |||
if [ -z "$mwserverinfo" ]; then | |||
printf "Your email domain is not known to mutt-wizard.\\nType in your settings.\\n" | |||
printf "Your email domain is not known to $_MW_.\\nType in your settings.\\n" | |||
printf "Usually you find them by an internet search.\\n" | |||
printf "Type the IMAP/POP3 server (excluding the port number)\\n\033[36m\t" | |||
read -r mwurl | |||
@@ -105,7 +118,7 @@ EOF | |||
fi | |||
# if the user has a pass entry he could provide it via mwpass | |||
if [ -z "$mwpass" ]; then | |||
mwpass=mutt-wizard-$mwaddr | |||
mwpass=$_MW_-$mwaddr | |||
_mwgetpass | |||
fi | |||
_mwtakeaddr | |||
@@ -154,7 +167,7 @@ _mwprotonfinger() { | |||
_mwmbsync() { | |||
mkdir -p "${mwmbsyncrc%/*}" | |||
[ -f "$mwmbsyncrc" ] && sed -i "/IMAPStore $mwaddr-remote$/,/# End mw profile/d" "$mwmbsyncrc" | |||
[ -f "$mwmbsyncrc" ] && sed -i "/IMAPStore $mwaddr-remote$/,/# End $_MW_ profile/d" "$mwmbsyncrc" | |||
cat >> "$mwmbsyncrc" <<EOF | |||
IMAPStore $mwaddr-remote | |||
Host $mwurl | |||
@@ -177,7 +190,7 @@ Patterns * !"[Gmail]" !"[Gmail]/All Mail" | |||
Create Both | |||
SyncState * | |||
MaxMessages 0 | |||
# End mw profile | |||
# End $_MW_ profile | |||
EOF | |||
} | |||
@@ -211,8 +224,10 @@ _mwprofiles() { | |||
if [ "$mwtype" = "offline" ]; then # not online, actually outside mutt | |||
if [ "${mwkind::3}" = "pop" ]; then | |||
! type "$prefix/bin/getmail" >/dev/null && printf "\033[31mFor POP3 \`getmail\` must be installed to use \`mw\`. You can do that afterwards.\\n\033[0m" | |||
_mwpop | |||
else | |||
! type "$prefix/bin/mbsync" >/dev/null && printf "\033[31mFor IMAP \`mbsync\` must be installed to use \`mw\`. You can do that afterwards.\\n\033[0m" | |||
_mwmbsync | |||
fi | |||
_mwsmtp | |||
@@ -241,14 +256,19 @@ _mwtryconnect() { | |||
fi | |||
if [ -n "$mwmailboxes" ]; then | |||
mwspoolfile=$(echo "$mwmailboxes" | grep -i -m 1 inbox | sed -ne 's/.*/+\0/p') | |||
[ -z "$mwspoolfile" ] && printf "\033[31m\033[31mNo spoolfile.\033[0m\\n" && return 1 | |||
[ -z "$mwspoolfile" ] && printf "\033[31mNo spoolfile.\033[0m\\n" && return 1 | |||
printf "\033[32mMailboxes detected.\033[0m\\n" | |||
if [ -z "$mwserverinfo" ]; then | |||
printf "\033[32mPlease add the line below at https://github.com/rpuntaie/mutt-wizard/issues/1\033[0m\\n\\n" | |||
printf "\033[31m$mwservice,$mwurl,$mwport,$mwsurl,$mwsport\0330m\\n\\n" | |||
fi | |||
echo "$mwmailboxes" | xargs -I {} mkdir -p "$mwaccmaildir/{}/"{cur,new,tmp} | |||
return 0 | |||
else | |||
printf "\033[31m\033[31mLog-on not successful.\033[0m\\n" | |||
printf "It seems that either you inputted the wrong password or server settings, or there are other requirements for your account out of the control of mutt-wizard.\\n" | |||
printf "\033[31mLog-on not successful.\033[0m\\n" | |||
printf "It seems that either you entered the wrong password or server settings, or there are other requirements for your account out of the control of $_MW_.\\n" | |||
return 1 | |||
fi | |||
} | |||
@@ -300,7 +320,7 @@ _mwdelete() { | |||
if [ -f "$mwgetmaildir/$mwaddr" ]; then | |||
rm -f "$mwgetmaildir/$mwaddr" &>/dev/null | |||
else | |||
sed -i "/IMAPStore $mwaddr-remote$/,/# End mw profile/d" "$mwmbsyncrc" &>/dev/null | |||
sed -i "/IMAPStore $mwaddr-remote$/,/# End $_MW_ profile/d" "$mwmbsyncrc" &>/dev/null | |||
fi | |||
else | |||
sed -i "/${mwaccmuttrc//\//\\\/}/d" "$mwmuttrc" &>/dev/null | |||
@@ -346,10 +366,17 @@ _mwasktype() { | |||
esac | |||
done | |||
fi | |||
if [ "$mwtype" == "offline" ]; then | |||
! type "$prefix/bin/msmtp" >/dev/null && printf "\033[31m\`msmtp\` must be installed. You can do that afterwards.\\n\033[0m" | |||
else | |||
! ( type mutt >/dev/null || type neomutt >/dev/null ) && printf "\033[31m\`mutt\` must be installed. You can do that afterwards.\\n\033[0m" | |||
fi | |||
return 0 | |||
} | |||
_mwpurge() { | |||
_mwconfirm "delete all mutt-wizard data" || exit | |||
_mwconfirm "Remove all $_MW_ data" || exit | |||
mwaddrs="$(find "$mwaccmuttdir" -type f | grep -o "[1-9]-.*.muttrc" | sed "s/\.muttrc//")" | |||
for mwaddrsentry in $mwaddrs; do | |||
mwtype="$(echo "$mwaddrsentry" | sed "s/\.mwonofftype\./ /" | awk '{print $2}')" | |||
@@ -360,7 +387,7 @@ _mwpurge() { | |||
_mwdelete | |||
done | |||
rm -rf "$mwaccmuttdir"/[1-9]-*.muttrc "$mwcachedir" "$mwgenmuttaccs" | |||
sed -i "/\# mw-autogenerated/d" "$mwmuttrc" | |||
sed -i "/\# $_MW_generated/d" "$mwmuttrc" | |||
crontab -l | sed '/mw sync/d' | crontab - >/dev/null | |||
echo "All configs and account settings have been purged." | |||
} | |||
@@ -417,14 +444,14 @@ _mwgenmwaccmuttrc() { | |||
if [ "$mwtype" = "offline" ]; then | |||
! grep "source $mwaccmuttrc" "$mwgenmuttaccs" &>/dev/null && echo "source $mwaccmuttrc" >> $mwgenmuttaccs | |||
else #online | |||
! grep "source $mwaccmuttrc" "$mwmuttrc" &>/dev/null && echo "source $mwaccmuttrc # mw-autogenerated" >> $mwmuttrc | |||
! grep "source $mwaccmuttrc" "$mwmuttrc" &>/dev/null && echo "source $mwaccmuttrc # $_MW_generated" >> $mwmuttrc | |||
fi | |||
# (re-)generate mwaccmuttrc ... | |||
mwmuttsync=$(printf '<sync-mailbox><enter-command>source %s<enter><change-folder>!<enter>;<check-stats>' $mwaccmuttrc) | |||
cat > "$mwaccmuttrc" <<EOF | |||
# vim: filetype=muttrc | |||
# muttrc file for account $mwaddr | |||
# generated by mw | |||
# generated by $_MW_ | |||
set from = "$mwaddr" | |||
EOF | |||
@@ -522,9 +549,9 @@ if [ "$(uname)" = "Darwin" ]; then | |||
_mwnotify() { osascript -e "display notification \"$2 in $1\" with title \"You've got Mail\" subtitle \"Account: $1\"" ;} | |||
else | |||
if type notify-send >/dev/null; then | |||
_mwnotify() { notify-send "mutt-wizard" "📬 $2 new mail(s) in \`$1\` account." ;} | |||
_mwnotify() { notify-send "mw" "📬 $2 new mail(s) in \`$1\` account." ;} | |||
else | |||
_mwnotify() { echo "mutt-wizard: 📬 $2 new mail(s) in \`$1\` account." ;} | |||
_mwnotify() { echo "mw: 📬 $2 new mail(s) in \`$1\` account." ;} | |||
fi | |||
fi | |||
@@ -539,11 +566,11 @@ _mwaddr() { | |||
_mwgenmuttaccs(){ | |||
mkdir -p "$mwmuttdir" "$mwaccmuttdir" | |||
[ ! -f "$mwmuttrc" ] && echo "# vim: filetype=muttrc" > "$mwmuttrc" && echo "muttrc created." | |||
! grep "source $mwsharerc" "$mwmuttrc" >/dev/null && echo "source $mwsharerc # mw-autogenerated" >> "$mwmuttrc" | |||
! grep "source $mwgenmuttaccs" "$mwmuttrc" >/dev/null && echo "source $mwgenmuttaccs # mw-autogenerated" >> "$mwmuttrc" | |||
! grep "source $mwsharerc" "$mwmuttrc" >/dev/null && echo "source $mwsharerc # $_MW_generated" >> "$mwmuttrc" | |||
! grep "source $mwgenmuttaccs" "$mwmuttrc" >/dev/null && echo "source $mwgenmuttaccs # $_MW_generated" >> "$mwmuttrc" | |||
cat > "$mwgenmuttaccs" <<EOF | |||
# vim: filetype=muttrc | |||
# generated by mw | |||
# generated by $_MW_ | |||
macro index gM '<shell-escape>mw<enter>' "sync all mail" | |||
@@ -672,43 +699,32 @@ if [ "$#" -gt 1 ]; then | |||
return 1 | |||
fi | |||
type gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2" | |||
[ -z "$PASSWORD_STORE_DIR" ] && PASSWORD_STORE_DIR="$HOME/.password-store" | |||
[ -r "$PASSWORD_STORE_DIR/.gpg-id" ] && | |||
"$GPG" --list-secret-keys $(cat "$PASSWORD_STORE_DIR/.gpg-id") >/dev/null 2>&1 || { | |||
printf "\`pass\` must be installed and initialized to encrypt passwords.\\nBe sure it is installed and run \`pass init <yourgpgemail>\`.\\n" | |||
printf "If you don't have a GPG public private key pair, run \`$GPG --full-gen-key\` first.\\n" | |||
exit | |||
} | |||
! type "$prefix/bin/mbsync" >/dev/null && printf "\`mbsync\` must be installed to run mutt-wizard.\\n" && exit | |||
! type "$prefix/bin/msmtp" >/dev/null && printf "\`msmtp\` must be installed.\\n" && exit | |||
! ( type mutt >/dev/null || type neomutt >/dev/null ) && printf "\`mutt\` must be installed.\\n" && exit | |||
if [ "$1" = "" ]; then | |||
_mwsync | |||
else | |||
case "$1" in | |||
ls) _mwlist ;; | |||
list|ls) _mwlist ;; | |||
add) _mwadd ;; | |||
pass) _mwpick "change the password of" && _mwgetpass ;; | |||
delete) _mwpick delete && _mwconfirm "delete the \`$mwaddr\` profile" && _mwdelete ;; | |||
remove|rm) _mwpick remove && _mwconfirm "remove the \`$mwaddr\` profile" && _mwdelete ;; | |||
purge) _mwpurge ;; | |||
cron) _mwcron ;; | |||
sync) _mwsync ;; | |||
*@*) _mwsync $1 ;; | |||
--version|-v) echo "mutt-wizard version 0.9" ;; | |||
--version|-v) echo "$_MW_ $VERSION" ;; | |||
--help|-h) cat <<EOF | |||
mw: mutt-wizard, auto-configure and sync email accounts for mutt, | |||
mw: $_MW_ $VERSION, auto-configure and sync email accounts for mutt, | |||
including mutt-independent sync of mail with \`isync\` or download of POP3 mail with \`getmail\`. | |||
Commands: | |||
add Add and autoconfigure an email address (9 max.) | |||
ls List configured accounts | |||
delete Pick an account to delete | |||
purge Delete all accounts and settings | |||
cron Enable or disable an autosync via cronjob | |||
sync sync/download mail based on config in $mwmbsyncrc and $mwgetmaildir | |||
--help|-h Print this message | |||
add Add and configure an email address (9 max.) | |||
list List configured accounts | |||
remove Pick an account to remove | |||
purge Remove all accounts and settings | |||
cron Enable or disable an autosync via cronjob | |||
sync sync/download mail based on config in $mwmbsyncrc and $mwgetmaildir | |||
--help|-h Print this message | |||
--version|-v Prints version | |||
With no parameter all configured emails are synced and all account muttrc's are created. | |||
With a parameter containing a @, an mail is assumed and that account is synced. | |||
@@ -1,265 +1,414 @@ | |||
.TH MW 1 mutt-wizard | |||
.\" Automatically generated by Pandoc 2.7.3 | |||
.\" | |||
.TH "mw" "1" "" "Version 1.0" "mutt-wizard man page" | |||
.hy | |||
.SH NAME | |||
mw \- mutt-wizard \- autoconfigure email accounts for neomutt and isync | |||
.PP | |||
\f[B]mw\f[R] \[em] mutt-wizard - add, list, remove email configurations | |||
for mbsync, getmail and mutt. | |||
Sync email without mutt. | |||
.SH SYNOPSIS | |||
.B mw | |||
<command> | |||
.PP | |||
\f[B]mw\f[R] [<command>|<email>] | |||
.PP | |||
\ \ \ \f[I]mw\f[R] Same as \f[I]mw sync\f[R] | |||
.PD 0 | |||
.P | |||
.PD | |||
\ \ \ \f[I]mw add\f[R] Add and configure an email address (9 max.) | |||
.PD 0 | |||
.P | |||
.PD | |||
\ \ \ \f[I]mw list\f[R] List configured accounts | |||
.PD 0 | |||
.P | |||
.PD | |||
\ \ \ \f[I]mw remove\f[R] Pick an account to remove | |||
.PD 0 | |||
.P | |||
.PD | |||
\ \ \ \f[I]mw purge\f[R] Remove all accounts and settings | |||
.PD 0 | |||
.P | |||
.PD | |||
\ \ \ \f[I]mw cron\f[R] Enable or disable an autosync via cronjob | |||
.PD 0 | |||
.P | |||
.PD | |||
\ \ \ \f[I]mw sync\f[R] Sync mail based on config in | |||
\f[I].config/isync/mbsyncrc\f[R] and \f[I].config/getmail/*\f[R] | |||
.PD 0 | |||
.P | |||
.PD | |||
\ \ \ \f[I]mw \[en]help|-h\f[R] Print this message | |||
.PD 0 | |||
.P | |||
.PD | |||
\ \ \ \f[I]mw \[en]version|-v\f[R] Print version | |||
.SH DESCRIPTION | |||
.B mw | |||
takes a user email account and sets up a terminal-based email interface with it for | |||
.B neomutt. | |||
This can include offline email with | |||
.B mbsync | |||
or | |||
.B getmail | |||
and configs for | |||
.B msmtp | |||
for sending mail, and passwords automatically encrypted and stored with | |||
.B pass. | |||
.PP | |||
\f[B]mw\f[R] configures \f[B]mbsync\f[R], \f[B]getmail\f[R], | |||
\f[B]msmtp\f[R] and \f[B]mutt\f[R] in one go, or just \f[B]mutt\f[R]. | |||
Note, \f[B]mutt\f[R] stands for \f[B]mutt\f[R] or \f[B]neomutt\f[R], but | |||
\f[B]mw\f[R] settings was only tested with \f[B]neomutt\f[R]. | |||
.SH COMMANDS | |||
Without command parameter | |||
.I sync | |||
is assumed. | |||
If a parameter contains | |||
.I @ | |||
an email is assumed and synced. | |||
.PP | |||
Without command parameter \f[B]sync\f[R] is assumed. | |||
If a parameter contains *\[at]* an email is assumed and synced. | |||
.TP | |||
.B add | |||
configure an email account | |||
.B \f[I]add\f[R] | |||
Add new email. | |||
.RS | |||
.IP \[bu] 2 | |||
First you decide, whether you want to configure | |||
.RS 2 | |||
.IP \[bu] 2 | |||
\f[B]mbsync\f[R], \f[B]getmail\f[R], \f[B]msmtp\f[R] to sync emails | |||
independently from \f[B]mutt\f[R] using \f[B]mw\f[R], | |||
.IP \[bu] 2 | |||
or just \f[B]mutt\f[R]. | |||
For an IMAP server \f[B]mutt\f[R] becomes very slow. | |||
Normally you enter \f[B]y\f[R]. | |||
.RE | |||
.IP \[bu] 2 | |||
It asks you the \f[B]email address\f[R]. | |||
.IP \[bu] 2 | |||
It has a \f[B]database\f[R] of IMAP4/POP3 and SMTP servers and ports. | |||
If you are lucky, your email server is there. | |||
Else it will prompt you. | |||
.RE | |||
.TP | |||
.B ls | |||
list all email accounts configured by mutt-wizard | |||
.B \f[I]ls|list\f[R] | |||
List all email accounts configured by mutt-wizard | |||
.TP | |||
.B delete | |||
delete the configuration files for an already configured email account | |||
.B \f[I]rm|remove\f[R] | |||
Remove the configuration files for an already configured email | |||
.TP | |||
.B purge | |||
.I totally | |||
purges all local | |||
.I .config/mutt/accounts/1-* | |||
.I mbsyncrc | |||
and | |||
.I .config/msmtp/config | |||
settings. | |||
.B \f[I]purge\f[R] | |||
Removes all mw generated mutt settings and *.config/mutt/accounts/1-*** | |||
\f[I].config/isync/mbsyncrc\f[R] *.config/getmail/** | |||
\f[I].config/msmtp/config\f[R] | |||
.TP | |||
.B cron | |||
toggle a cronjob that will periodically sync mail with | |||
.B \f[I]cron\f[R] | |||
toggle a cronjob that periodically syncs mail | |||
.TP | |||
.B sync | |||
syncs all emails. | |||
.B \f[I]sync\f[R] | |||
syncs mail for all email accounts managed by \f[I]mw\f[R] (whose paths | |||
end in the email). | |||
This is the default, if no parameter is given. | |||
If an email address is given, only that email is synced. | |||
.RS | |||
.IP \[bu] 2 | |||
Every \f[B]mw\f[R] sync run will re-generate the \f[B]mutt\f[R] | |||
configuration from the configuration files for \f[B]mbsync\f[R], | |||
\f[B]getmail\f[R] and \f[B]msmtp\f[R]. | |||
So you could edit them after or not use \f[I]mw add\f[R] at all. | |||
.RS 2 | |||
.PP | |||
Just keep the \f[I]Path\f[R], \f[I]path\f[R] and \f[I]account\f[R] | |||
ending in the email address. | |||
.PP | |||
Files are under \f[I].config\f[R] or \f[I]$XDG_CONFIG_HOME\f[R]: | |||
.IP | |||
.nf | |||
\f[C] | |||
\[ti]/.config/isync/mbsync (since not mbsync\[aq]s default, you would need a -c option. Use mw, instead). | |||
\[ti]/.config/msmtp/config | |||
\[ti]/.config/getmail/<email> | |||
\[ti]/.config/mutt/mw_generated.muttrc | |||
\f[R] | |||
.fi | |||
.RE | |||
.IP \[bu] 2 | |||
The generated \f[B]mutt\f[R] configuration has these bindings | |||
.RS 2 | |||
.IP \[bu] 2 | |||
\f[I]ixy/Mxy/Cxy\f[R] bindings to switch/move/copy to mailbox (x and y | |||
stand for other letters) | |||
.IP \[bu] 2 | |||
\f[I]i[1-9]\f[R] bindings to switch account | |||
.RE | |||
.IP \[bu] 2 | |||
\f[I]/usr/share/mutt-wizard/mutt-wizard.muttrc\f[R] is linked in your | |||
\f[I]muttrc\f[R]. | |||
Have this line there, if you prefer your own settings: | |||
.RS 2 | |||
.IP | |||
.nf | |||
\f[C] | |||
# source /usr/share/mutt-wizard/mutt-wizard.muttrc | |||
\f[R] | |||
.fi | |||
.PP | |||
You will need to keep the binding of \f[I]i,g,C,M\f[R] to | |||
\f[I]noop\f[R], though, because of the generated bindings in the account | |||
muttrc. | |||
Else you can overwrite certain things after the uncommented sourcing | |||
line. | |||
.RE | |||
.RE | |||
.SH DEPENDENCIES | |||
.IP \[bu] 2 | |||
\f[I]pass\f[R] - pass (https://www.passwordstore.org/) safely encrypts | |||
passwords (\f[B]required for email setup\f[R]) | |||
.IP \[bu] 2 | |||
\f[I]gnupg\f[R] - needed by \f[I]pass\f[R] | |||
.IP \[bu] 2 | |||
\f[I]mutt/neomutt\f[R] - the email client (\f[I]mutt\f[R] untested). | |||
.IP \[bu] 2 | |||
\f[I]isync\[cq]s mbsync\f[R] - syncs the mail | |||
.IP \[bu] 2 | |||
\f[I]getmail\f[R] - used for POP3 | |||
.IP \[bu] 2 | |||
\f[I]msmtp\f[R] - sends the email | |||
.PP | |||
Optional: | |||
.IP \[bu] 2 | |||
\f[I]w3m\f[R] - view HTML email and images in \f[B]mutt\f[R]. | |||
.IP \[bu] 2 | |||
\f[I]notmuch\f[R] - index and search mail. | |||
If the configuration file in \f[I]$NOTMUCH_CONFIG\f[R] is not there, | |||
\f[I]mw add\f[R] will create it. | |||
.IP \[bu] 2 | |||
\f[I]libnotify\f[R] - allows notifications when syncing mail with | |||
\f[I]mw\f[R] | |||
.IP \[bu] 2 | |||
\f[I]abook\f[R] - a terminal-based address book. | |||
.IP \[bu] 2 | |||
A cron manager (e.g.\ \f[I]cronie\f[R]) - if you want to enable the | |||
auto-sync feature. | |||
.IP \[bu] 2 | |||
\f[I]pam-gnupg\f[R] - To provide your GPG key at login and never after. | |||
See directions (https://github.com/cruegge/pam-gnupg). | |||
.RS 2 | |||
.PP | |||
Alternatively increasing \f[I]default-cache-ttl\f[R] and | |||
\f[I]max-cache-ttl\f[R] in \f[I]gpg-agent.conf\f[R] avoid constant | |||
password requests. | |||
.RE | |||
.IP \[bu] 2 | |||
\f[I]urlscan\f[R] - outputs urls in mail | |||
.SH INSTALLATION | |||
.IP | |||
.nf | |||
\f[C] | |||
git clone https://github.com/rpuntaie/mutt-wizard | |||
cd mutt-wizard | |||
sudo make install | |||
\f[R] | |||
.fi | |||
.PP | |||
User of Arch-based distros can also install mutt-wizard from the AUR as | |||
mw-git (https://aur.archlinux.org/packages/mw-git/). | |||
.SH MUTT-WIZARD\[aq]S NEOMUTT CONFIGURATION | |||
.PP | |||
Once everything is setup, you\[cq]ll use \f[B]mutt\f[R] to access your | |||
mail. | |||
.PP | |||
Mutt usage with the accompanied \f[I]/usr/share/mutt-wizard.muttrc\f[R]: | |||
.IP \[bu] 2 | |||
\f[I]?\f[R] - see all keyboard shortcuts | |||
.PP | |||
\f[B]syncing\f[R] | |||
.IP \[bu] 2 | |||
\f[I]gm / gM\f[R] - call mutt-wizard\[cq]s \f[I]mw sync\f[R] for one / | |||
all mail accounts | |||
.PP | |||
\f[B]mailboxes,accounts\f[R] | |||
.IP \[bu] 2 | |||
\f[I]ixy\f[R] - To go to \f[B]mailbox\f[R]. | |||
.IP \[bu] 2 | |||
\f[I]Mxy\f[R], \f[I]Cxy\f[R] - For \f[I]M\f[R]ove and \f[I]C\f[R]opy to | |||
the according mailbox, e.g.\ \f[I]Msp\f[R] means \[lq]move to Spam\[rq]. | |||
.IP \[bu] 2 | |||
\f[I]i#\f[R] - Press \f[I]i\f[R] followed by a number 1-9 to go to a | |||
\f[B]different account\f[R]. | |||
.PP | |||
\f[I]xy\f[R] are | |||
.IP \[bu] 2 | |||
two first letters of mailbox letters or | |||
.IP \[bu] 2 | |||
first letter of first path entry + second letter of second path entries | |||
.PP | |||
\f[B]searching\f[R] | |||
.IP \[bu] 2 | |||
\f[I]S\f[R] - search for a mail using \f[I]notmuch\f[R] | |||
.IP \[bu] 2 | |||
\f[I]gl\f[R] - limit by substring of subject | |||
.IP \[bu] 2 | |||
\f[I]gL\f[R] - undo limit | |||
.PP | |||
\f[B]composing\f[R] | |||
.IP \[bu] 2 | |||
\f[I]ga\f[R] - to add address/person to \f[I]abook\f[R] and | |||
\f[I]Tab\f[R] while typing address to complete one from book. | |||
.IP \[bu] 2 | |||
\f[I]m/r/gr/f\f[R] - new/reply/group reply/forward \f[B]message\f[R], | |||
using your default \f[I]$EDITOR\f[R] to write. | |||
Then you enter the \f[B]compose screen\f[R]. | |||
.IP \[bu] 2 | |||
\f[I]a\f[R] - to add attachments | |||
.IP \[bu] 2 | |||
\f[I]s/t/c/b/d\f[R] - to change the subject/to/CC/BCC/description. | |||
.IP \[bu] 2 | |||
\f[I]S\f[R] - to change the signature/encryption | |||
.IP \[bu] 2 | |||
\f[I]y\f[R] - to send the mail. | |||
.PP | |||
\f[B]delete,undelete,save\f[R] | |||
.IP \[bu] 2 | |||
\f[I]dd\f[R] - delete mail | |||
.IP \[bu] 2 | |||
\f[I]u\f[R] - undelete | |||
.IP \[bu] 2 | |||
\f[I]$\f[R] - apply the mailbox changes \f[I]set trash\f[R] is set per | |||
default. | |||
Deleted mails will land there. | |||
.IP \[bu] 2 | |||
\f[I]s\f[R] - save selected mail or selected attachment | |||
.PP | |||
\f[B]moving around\f[R] | |||
.IP \[bu] 2 | |||
\f[I]gu\f[R] - open a menu to select a url you want to open in you | |||
browser (needs urlscan). | |||
.IP \[bu] 2 | |||
\f[I]j\f[R]/\f[I]k\f[R] - next/previous mail, \f[I]J/K\f[R] same, | |||
without skipping deleted, and also when viewing mails | |||
.IP \[bu] 2 | |||
\f[I]ctrl-d/f\f[R]/\f[I]ctrl-u/b\f[R] - down and up a half page / full | |||
page | |||
.IP \[bu] 2 | |||
\f[I]l\f[R] - open mail, or attachment page or attachment | |||
.IP \[bu] 2 | |||
\f[I]h\f[R] - the opposite of \f[I]l\f[R] | |||
.PP | |||
\f[B]sidebar\f[R] | |||
.IP \[bu] 2 | |||
\f[I]B\f[R] - toggles | |||
.IP \[bu] 2 | |||
\f[I]ctrl-j\f[R]/\f[I]ctrl-k\f[R] - move up and down | |||
.IP \[bu] 2 | |||
\f[I]ctrl-l/o\f[R] - opens mailbox | |||
.PP | |||
\f[B]input field/command line\f[R] | |||
.IP \[bu] 2 | |||
\f[I]ctrl-u\f[R] will clear it | |||
.IP \[bu] 2 | |||
\f[I]ctrl-a\f[R], \f[I]ctrl-e\f[R] go to beginning or end, | |||
\f[I]ctrl-g\f[R] aborts | |||
.PP | |||
Look into \f[I]/usr/share/mutt-wizard.muttrc\f[R] to see all bindings. | |||
.SH DETAILS | |||
.PP | |||
\f[B]Encoding\f[R] | |||
.PP | |||
\f[I]isync\f[R] is not fully UTF-8 compatible. | |||
Non-Latin characters may be garbled (although sync should succeed). | |||
\f[I]mw\f[R] will also not auto-create mailbox shortcuts since it is | |||
looking for English mailbox names. | |||
I strongly recommend you to set your email language to English on your | |||
mail server to avoid these problems. | |||
.TP | |||
.B Mail location | |||
If the user chooses to keep offline email with | |||
.B isync, | |||
it will be kept in | |||
.I $MAILDIR | |||
which defaults to | |||
.I $HOME/Mail/ | |||
, the default for mutt. | |||
.B notmuch | |||
can be used to index and search this mail by giving this directory when first running | |||
.B notmuch setup. | |||
If you have not set up notmuch before, mutt-wizard will automatically set it up in the background the first time you add an account. | |||
.B \f[B]Mail location\f[R] | |||
Mail is downloaded to a folder named after your email in | |||
\f[I]$MAILDIR\f[R], which defaults to \f[I]$HOME/Mail/\f[R], the default | |||
for mutt. | |||
Neither \f[B]mw remove\f[R] nor \f[B]mw purge\f[R] will delete | |||
downloaded mail. | |||
Do that manually. | |||
.TP | |||
.B muttrc files | |||
mutt-wizard will create a muttrc file for each created account holding account-specific details. These will appear in | |||
.I $XDG_CONFIG_HOME/mutt/accounts/. | |||
$XGD_CONFIG_HOME defaults to ~/.config. | |||
Note that mutt-wizard will also source these files and create the bindings to switch between them, and these will appear in your default | |||
.I $XDG_CONFIG_HOME/mutt/muttrc | |||
file. | |||
.B \f[B]Gmail accounts\f[R] | |||
Google will require you to allow \[dq]less-secure\[dq] (third party) | |||
applications or use two-factor authentication in order to access their | |||
IMAP servers to download your mail. | |||
If you use Gmail, be sure to handle this before running mutt-wizard | |||
<https://support.google.com/accounts/answer/6010255>. | |||
.TP | |||
.B Mail deletion | |||
Neither | |||
.B delete | |||
or | |||
.B purge | |||
will delete downloaded mail for for safety (and time)'s sake. If you want to delete downloaded mail, do so manually by removing it from the directory above. | |||
.TP | |||
.B Default settings | |||
mutt-wizard has many default settings that focus on making it aesthetically pleasing and supplying more vim-like bindings. These can be found in | |||
.I /usr/share/mutt-wizard/mutt-wizard.muttrc | |||
and the default mailcap file can be found in | |||
.I /usr/share/mutt-wizard/mailcap. | |||
After the line sourcing the mutt-wizard default, you can overwrite settings in your | |||
.I $XDG_CONFIG_HOME/mutt/muttrc, | |||
Else you can keep mutt-wizard from adding a sourcing line, if you have the following comment in your muttrc: | |||
.B # source /usr/share/mutt-wizard/mutt-wizard.muttrc | |||
.TP | |||
.B Detecting server settings | |||
mutt-wizard has a repository of email services and their server information kept in | |||
.I /usr/share/mutt-wizard/domains.csv | |||
which is used to automatically configure email settings. | |||
If your email provider is not found there, it will prompt you to input your email service's IMAP and SMTP server information which can usually be found by searching online. | |||
If you would like to help develop mutt-wizard for others, you are invited to add this service information to | |||
.I domains.csv | |||
on mutt-wizard's Github <https://github.com/lukesmithxyz/mutt-wizard> or Gitlab <https://gitlab.com/lukesmithxyz/mutt-wizard> pages. | |||
.TP | |||
.B Gmail accounts | |||
Google will require you to allow "less-secure" (third party) applications or use two-factor authentication in order to access their IMAP servers to download your mail. | |||
If you use Gmail, be sure to handle this before running mutt-wizard <https://support.google.com/accounts/answer/6010255>. | |||
.B Protonmail accounts | |||
Protonmail users must use the Protonmail Bridge <https://protonmail.com/bridge/> to access their IMAP and SMTP servers. | |||
.B \f[B]Protonmail accounts\f[R] | |||
Protonmail users must use the Protonmail Bridge | |||
<https://protonmail.com/bridge/> to access their IMAP and SMTP servers. | |||
This too should be configured before running mutt-wizard. | |||
.B Enterprise and university accounts | |||
Many universities and businesses might host their domain's email via Google or another service. | |||
This often requires a special IMAP/SMTP-specific password that you must generate and use. | |||
Again, mutt-wizard can handle these systems, but only once they've been set up. | |||
.TP | |||
.B Password decryption | |||
mutt-wizard uses | |||
.I pass | |||
and therefore | |||
.I gpg | |||
to decrypt your passwords. | |||
Provided your GPG key has a password, this might mean that you will be prompted for your GPG password the first time you sync or send mail in a session. | |||
Once your password is cached, it might also expire later as well. | |||
Because of this I strongly recommend the program | |||
.I pam-gnupg | |||
<https://github.com/cruegge/pam-gnupg> which automatically unlocks your GPG password on login and keeps it active. | |||
This gives you secure access to all your email accounts on your system without ever having to input a password. | |||
If you don't want to use this program, you can also increase the cache time of an inputted GPG password with the | |||
.I default-cache-ttl | |||
and | |||
.I max-cache-ttl | |||
variables in your | |||
.I | |||
gpg-agent.conf. | |||
.SH MUTT-WIZARD'S NEOMUTT CONFIGURATION | |||
Here is a list of not only mutt-wizard's particular defaults, but what you need, to get the most out of email accounts configured with mutt-wizard. | |||
.TP | |||
.B Color | |||
mutt-wizard's default settings add color to messages in the index and color mail details to make them easier to see. | |||
New mail, in addition to being marked by the typical N, will also be bold. | |||
.TP | |||
.B Movement with h/j/k/l | |||
Use vim-like keys to go down with | |||
.I j | |||
or up with | |||
.I k | |||
in index and open mail. | |||
.I J | |||
and | |||
.I K. | |||
do not skip deleted mails and go to next/previous mail, when in open mail. | |||
.I l | |||
opens mail, then the attachment view, then an attachment, while | |||
.I h | |||
is the reverse. | |||
In the mail index, | |||
.I ctrl-d/f | |||
and | |||
.I ctrl-u/b | |||
go down and up by a half / full page and | |||
.I gg | |||
and | |||
.I G | |||
go to the very top and very bottom. | |||
.B \f[B]Enterprise and university accounts\f[R] | |||
Many universities and businesses might host their domain\[aq]s email via | |||
Google or another service. | |||
This often requires a special IMAP/SMTP-specific password that you must | |||
generate and use. | |||
Again, mutt-wizard can handle these systems, but only once they have | |||
been set up. | |||
.SH FILES | |||
.TP | |||
.B Search mail | |||
If you have | |||
.B notmuch | |||
configured with your proper mail directory (see above), you may run | |||
.I S | |||
to search for mail containing any given sequence. | |||
Even without notmuch, | |||
.I gl | |||
limits mail, showing only those with the given sequence in the subject while | |||
.I gL | |||
shows all mail (same as limiting to "all"). | |||
.B \f[I]/user/bin/mw\f[R] | |||
The main script to manage and sync emails. | |||
.TP | |||
.B Deleting mail | |||
.I dd | |||
deletes mail, while | |||
.I u | |||
undeletes it. | |||
.I $ | |||
saves your mailbox, finalizing deletion. If you have a | |||
.I Trash | |||
box, deleted mail is moved there. If you want it to skip that and simply be deleted, comment out or remove the | |||
.I set trash | |||
line in that account's muttrc. | |||
.B \f[I]/user/bin/mwimage\f[R], \f[I]/user/bin/mwopen\f[R] | |||
Used by the mailcap file that comes with mutt-wizard. | |||
.TP | |||
.B Send mail | |||
.I m | |||
creates a new mail message; | |||
.I r | |||
replies to the selected message; | |||
.I gr | |||
replies all to the selected message and | |||
.I f | |||
fowards the selected message. | |||
.B \f[I]/usr/share/mutt-wizard/mutt-wizard.muttrc\f[R] | |||
Default mutt settings. | |||
.TP | |||
.B Compose mail screen | |||
Once you write mail and save the buffer you will be brought to the compose screen. Press | |||
.I a | |||
to add attachments, use | |||
.I s/t/c/b/d | |||
to change the subject/to/CC/BCC/description. Press | |||
.I S | |||
to change the signature/encryption. Press | |||
.I y | |||
to send the mail. | |||
.B \f[I]/usr/share/mutt-wizard/mailcap\f[R] | |||
Default mailcap file. | |||
.TP | |||
.B Saving and autocompleting email addresses with abook | |||
Install the optional dependency abook and you will be able to save the sender's email address with | |||
.I ga. | |||
Once this is done, when you are typing in any email/contact prompt, you may press | |||
.I Tab | |||
to find contacts matching your input. Although abook is often used with mutt, it is also a useful program in its own right. | |||
.TP | |||
.B Switching and moving mail between mailboxes | |||
The | |||
.I i | |||
key is paired with the two inital letters of a mailbox, isp: go to spam, ... | |||
Similar | |||
.I Cxy | |||
will copy mail and | |||
.I Mxy | |||
will move mail to the according boxe. | |||
.TP | |||
.B Switching between accounts | |||
mutt-wizard can configure as many as nine accounts each numbered by the lowest available number when configured. Press | |||
.I i | |||
followed by an account's number to change to that account: i2, i5, etc. | |||
.I gu | |||
to open a menu to select a url you want to open in you browser. | |||
.TP | |||
.B Sidebar | |||
mutt-wizard enables the sidebar by default which displays your account's boxes with mail tallies. | |||
.I B | |||
will toggle the sidebar. Move up and down in it with | |||
.I ctrl-k/j. | |||
Open a box with | |||
.I ctrl-o | |||
or | |||
.I ctrl-l | |||
.B \f[I]/usr/share/mutt-wizard/domains.csv\f[R] | |||
Email server database. | |||
.SH BUGS | |||
.PP | |||
GitHub Issues: <https://github.com/rpuntaie/mutt-wizard/issues> | |||
.SH AUTHORS | |||
.TP | |||
.B Input field / command line | |||
.I ctrl-u | |||
within input field / command line, will clear it | |||
.I ctrl-a / ctl-e | |||
go to beginning or end. | |||
.I ctrl-g | |||
aborts. | |||
.B \f[I]Luke Smith <foo\[at]example.org>\f[R] | |||
Original author, started in 2018. | |||
.RS | |||
.PP | |||
Github <https://github.com/lukesmithxyz/mutt-wizard> | |||
.PP | |||
Gitlab <https://gitlab.com/lukesmithxyz/mutt-wizard> | |||
.RE | |||
.TP | |||
.B More information | |||
Remember that you can press | |||
.I ? | |||
at any time in neomutt to get a list of all key-bindings and functions. This list can also vary for different context menus. | |||
.SH AUTHORS | |||
Written by Luke Smith <luke@lukesmith.xyz> originally in 2018. | |||
Tests, Bugfixes, Improvements by Roland Puntaier <roland.puntaier@gmail.com> in 2019. | |||
.B \f[I]Roland Puntaier <roland.puntaier\[at]gmail.com>\f[R] | |||
Bugfixes, Improvements in 2019. | |||
.RS | |||
.PP | |||
GitHub: <https://github.com/rpuntaie/mutt-wizard> | |||
.IP \[bu] 2 | |||
Honors | |||
\f[I]\f[R]M\f[I]\f[R]A\f[I]\f[R]I\f[I]\f[R]L\f[I]\f[R]D\f[I]\f[R]I\f[I]\f[R]R\f[I]*,*XDG_CONFIG_HOME\f[R], | |||
\f[I]$XDG_CACHE_HOME\f[R], if defined. | |||
.IP \[bu] 2 | |||
\f[I]gm/gM\f[R] to sync mail inside \f[I]mutt\f[R], as \f[I]o/O\f[R] has | |||
a \f[I]mutt\f[R] assignment already. | |||
.IP \[bu] 2 | |||
Other more vim-like shortcut changes | |||
.IP \[bu] 2 | |||
Make channel name equal to email address to avoid choosing a new name | |||
for the same thing. | |||
.IP \[bu] 2 | |||
\f[I]remove|rm\f[R] instead of \f[I]delete\f[R], \f[I]list|ls\f[R] | |||
instead of only \f[I]ls\f[R] | |||
.IP \[bu] 2 | |||
\f[I]wm\f[R] integrates \f[I]mailsync\f[R], not to overload the system | |||
namespace and because of code reuse | |||
.IP \[bu] 2 | |||
\f[I]wm\f[R] generates \f[I]mutt\f[R] config on every full sync, | |||
.RS 2 | |||
.IP \[bu] 2 | |||
to reflect changes in mailboxes in the shortcuts | |||
.IP \[bu] 2 | |||
to reflect changes in \f[I]mbsync/getmail\f[R] config in \f[I]mutt\f[R] | |||
config | |||
.RE | |||
.IP \[bu] 2 | |||
\f[I]urlscan\f[R] instead of \f[I]urlview\f[R] | |||
.IP \[bu] 2 | |||
Added tests and made bug fixes | |||
.IP \[bu] 2 | |||
Generate man page from readme, to avoid duplicate descriptions | |||
.RE | |||
.SH LICENSE | |||
.PP | |||
GPLv3 | |||
.SH SEE ALSO | |||
.BR neomutt (1), | |||
.BR neomuttrc (1) | |||
.BR mbsync (1), | |||
.BR msmtp (1), | |||
.BR notmuch (1), | |||
.BR abook (1) | |||
.PP | |||
\f[B]neomutt\f[R](1), \f[B]neomuttrc\f[R](1) \f[B]mbsync\f[R](1), | |||
\f[B]msmtp\f[R](1), \f[B]notmuch\f[R](1), \f[B]abook\f[R](1) |