aerc-wizard

Easily auto-configure aerc and isync/mpop with safe passwords (IMAP/POP3/SMTP)
git clone https://git.awy.one/aerc-wizard
Log | Files | Refs | README | LICENSE

README.md (9390B) - raw


  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# aerc-wizard

https://git.awy.one/aerc-wizard

Fork of [mutt-wizard](https://github.com/lukesmithxyz/mutt-wizard) with \
some additions:

- `aerc` support (no mutt-related configuration is created)
- better wayland notification handling in `mailsync`
- gmail with sane IMAP folders (for example `Sent` \
instead of `[Gmail]/Sent Mail`) so binds just werk
- `gopass` backend instead of `pass`
- experimental `keepassxc` support

Get this great stuff without effort:

- A full-featured and autoconfigured email client on the terminal with aerc
- Mail stored offline enabling the ability to:
    * view and write emails while you're away from
      the internet
    * make backups
- Provides a `mailsync` script that can be scheduled to run as often as you
  like, which downloads/syncs mail and optionally notifies you when new mail has arrived.

Specifically, this wizard:

- Determines your email server's IMAP and SMTP servers and ports
- Creates dotfiles for `aerc`, `isync`, and `msmtp` appropriate for your
  email address
- Encrypts and locally stores your password for easy remote access, accessible
  only by your GPG key
- Auto-creates bindings to switch between accounts or between mailboxes
- Provides sensible defaults and an attractive appearance for the aerc email
  client
- If aerc-wizard doesn't know your server's IMAP/SMTP info by default, it will
  prompt you for them and will put them in all the right places.

## Install

#### Dependencies

- `aerc` - the email client. (If you're using Gentoo GNU/Linux, you'll need to
  enable the `notmuch` USE flag to use local email.)
- `curl` - tests connections (required at install).
- `isync` - downloads and syncs the mail (required if storing IMAP mail locally).
- `msmtp` - sends the email.
- `gopass` - safely encrypts passwords (required at install).
- `ca-certificates` - required for SSL. Probably installed already.
- `gettext` - writes config files. Probably installed already.

```bash
git clone https://git.awy.one/aerc-wizard
cd aerc-wizard
doas make install
```

A user of Arch-based distros can also install the current aerc-wizard release from the [my arch repo](https://git.awy.one/awy-arch) as
`aerc-wizard`, or build from git master branch using this [PKGBUILD](https://git.awy.one/archpackaging/file/aerc-wizard/PKGBUILD.html).

### Optional Dependencies

- `goimapnotify` - required for push notifications.
  [Check here for reference](https://wiki.archlinux.org/title/Isync#With_imapnotify).
- `pam-gnupg` - 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 the
  repo and directions out [here](https://github.com/cruegge/pam-gnupg).
- `w3m` - view HTML email in aerc.
- `notmuch` - index and search mail. Install it and run `notmuch setup`, tell
  it that your mail is in `~/.local/share/mail/` (although `aew` will do this
  automatically if you haven't set notmuch up before). You can run it in mutt
  with <kbd>ctrl-f</kbd>. Run `notmuch new` to process new mail.
- `abook` - a terminal-based address book. Pressing tab while typing an address
  to send mail to will suggest contacts that are in your abook.
- `urlview` - outputs urls in mail to browser.
- `cronie` - (or any other major cronjob manager) to set up automatic mail
  syncing.
- `mpop` - If you want to use POP protocol instead of IMAP.


## Usage

The aerc-wizard runs via the command `aew`. Once setup is complete, you'll use
`aerc` to access your mail.

- `aew -a you@email.com` -- add a new email account
- `aew -a you@email.com -P <keepassxc entry> -b keepassxc -K <path to db>` \
        -- add a new email account using `KeepassXC`
- `aew -l` -- list existing accounts
- `aew -d` -- choose an account to delete
- `aew -D your@email.com` -- delete account settings without confirmation
- `aew -t 30` -- toggle automatic mailsync to every 30 minutes
- `aew -T` -- toggle mailsync without specifying minutes (default is 10)
- `aew -r` -- reorder account shortcut numbers
- `gopass edit aew-your@email.com` -- revise an account's password
- `mailsync` -- sync all configured email accounts. Also gives notifications of new mail and indexes new mail with notmuch silently.
- `mailsync your@email.com` -- sync a particular (or several) email account(s).

### Options usable when adding an account

#### Providing arguments

- `-u` -- Give an account username if different from the email address.
- `-n` -- A real name to be used by the account. Put in quotations if multiple
  words.
- `-i` -- IMAP server address
- `-I` -- IMAP server port (otherwise assumed to be 993)
- `-s` -- SMTP server address
- `-S` -- SMTP server port (otherwise assumed to be 465)
- `-m` -- Maximum number of emails to be kept offline. No maximum is default
  functionality.
- `-x` -- Account password. You will be prompted for it otherwise.

#### General Settings

- `-f` -- Assume mailbox names and force account configuration without
  connecting online at all.
- `-o` -- Configure mutt for an account, but do not keep mail offline.
- `-p` -- Use POP protocol instead of IMAP (requires `mpop` installed).
- `mailsync` gives visual messages of new mail by default. Or, set
  `MAILSYNC_MUTE=1` as an environmental variable if you prefer not having them.

## Aerc user interface

To give you an example of the interface, here's an idea:

- <kbd>m</kbd> - send mail (uses your default `$EDITOR` to write)
- <kbd>j</kbd>/<kbd>k</kbd> and <kbd>d</kbd>/<kbd>u</kbd> - vim-like bindings to go down and up (or <kbd>d</kbd>/<kbd>u</kbd> to go
  down/up a page).
- <kbd>l</kbd> - open mail, or attachment page or attachment
- <kbd>h</kbd> - the opposite of <kbd>l</kbd>
- <kbd>r</kbd>/<kbd>R</kbd> - reply/reply all to highlighted mail
- <kbd>s</kbd> - save selected mail or selected attachment
- <kbd>gs</kbd>,<kbd>gi</kbd>,<kbd>ga</kbd>,<kbd>gd</kbd>,<kbd>gS</kbd> - Press <kbd>g</kbd> followed by another letter to change
  mailbox: <kbd>s</kbd>ent, <kbd>i</kbd>nbox, <kbd>a</kbd>rchive, <kbd>d</kbd>rafts, <kbd>S</kbd>pam, etc.
- <kbd>M</kbd> and <kbd>C</kbd> - For <kbd>M</kbd>ove and <kbd>C</kbd>opy: follow them with one of the mailbox
  letters above, i.e. <kbd>MS</kbd> means "move to Spam".
- <kbd>i#</kbd> - Press <kbd>i</kbd> followed by a number 1-9 to go to a different account. If you
  add 9 accounts via aerc-wizard, they will each be assigned a number.
- <kbd>a</kbd> to add address/person to abook and <kbd>Tab</kbd> while typing address to complete
  one from abook.
- <kbd>?</kbd> - see all keyboard shortcuts
- <kbd>ctrl-j</kbd>/<kbd>ctrl-k</kbd> - move up and down in sidebar.
- <kbd>ctrl-b</kbd> - open a menu to select a URL you want to open in your browser.
- <kbd>p</kbd> - encrypt/sign your message (in compose view, before sending the email).

## Enable push notifications per mail
**Note**: Replace the `fulladdrs` with your actual email address. You have to do this for each new mail you want to setup instant notifications.
```bash
systemctl enable --user goimapnotify@fulladdrs.service
```

## Additional functionality

- `pam-gnupg` - 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 the
  repo and directions out [here](https://github.com/cruegge/pam-gnupg).
- `lynx` - View HTML email in aerc.
- `notmuch` - Index and search mail. Install it and run `notmuch setup`, tell it
  that your mail is in `~/.local/share/mail/` (although `aew` will do this
  automatically if you haven't set notmuch up before). You can run it in mutt
  with <kbd>ctrl-f</kbd>. Run `notmuch new` to process new mail.
- `abook` - A terminal-based address book. Pressing tab while typing an address
  to send mail to will suggest contacts that are in your abook.
- `urlview` - Outputs URLs in an email to your browser.

## Help the Project!

- Try aerc-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 aerc-wizard.

## Watch out for these things

- Gmail accounts need to create an
  [App Password](https://support.google.com/accounts/answer/185833?hl=en) to
  use with  "less secure" applications. This password is single-use (i.e.
  for setup) and will be stored and encrypted locally. Enabling third-party
  applications requires turning off two-factor authentication and this will
  circumvent that. You might also need to manually "Enable IMAP" in the
  settings.
  To create an App Password for your Google account,
  you can directly visit the [App Passwords](https://myaccount.google.com/apppasswords) page in your Google Account settings.
- 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). `aew` 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.

## License

aerc-wizard is free/libre software. This program is released under the GPLv3
license, which you can find in the file [LICENSE](LICENSE).