Skip to content

Commit b243895

Browse files
authored
Merge pull request #39 from dyne/account-wizard
feat(account): add interactive account wizard command
2 parents 1018c34 + 907ec09 commit b243895

17 files changed

Lines changed: 2500 additions & 16 deletions

File tree

.github/workflows/pr-tests.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ jobs:
2020
sudo apt-get install --no-install-recommends -y \
2121
zsh make gcc \
2222
fetchmail msmtp neomutt notmuch pinentry-curses \
23-
abook wipe mblaze gnupg
23+
abook wipe mblaze gnupg pandoc
2424
2525
- name: Ensure test scripts are executable
2626
run: |
2727
chmod +x extras/test/run-source.sh
2828
chmod +x extras/test/test-addressbook-parse.sh
29+
chmod +x extras/test/test-account-wizard.sh
30+
chmod +x extras/test/test-group-modes.sh
2931
chmod +x extras/test/test-filtering.sh
3032
chmod +x extras/test/test-sieve-import.sh
3133
chmod +x extras/test/test-helpers.sh
@@ -39,6 +41,12 @@ jobs:
3941
- name: Addressbook and parsing tests
4042
run: extras/test/test-addressbook-parse.sh
4143

44+
- name: Account wizard tests
45+
run: extras/test/test-account-wizard.sh
46+
47+
- name: Group delivery mode tests
48+
run: extras/test/test-group-modes.sh
49+
4250
- name: Filtering tests
4351
run: extras/test/test-filtering.sh
4452

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Jaromail is a terminal mail workflow built mostly from Zsh scripts plus small C
1010
- `make clean`: removes generated helper binaries and object files from `src/`.
1111
- `sudo make install`: installs Jaromail under `/usr/local/share/jaromail` and creates `/usr/local/bin/jaro`.
1212
- `extras/test/run-source.sh`: smoke test for the checked-out code; runs `src/jaro` with a local staged install in a temp path.
13+
- `extras/test/test-account-wizard.sh`: validates the interactive `wizard` account flow using scripted stdin.
1314
- `./extras/test/inittest.sh`: runs the installed smoke test using `/tmp/jaromail-test`.
1415
- `PREFIX=/tmp/jaro make install`: checks install layout without touching `/usr/local`; adjust the smoke test paths if using this.
1516

@@ -19,7 +20,7 @@ Prefer minimal, readable changes. Keep Zsh functions lowercase, shell modules gr
1920

2021
## Testing Guidelines
2122

22-
There is no broad unit-test suite. Use `extras/test/run-source.sh` for checkout-level validation and `extras/test/inittest.sh` for installed-path validation. The tests depend on external mail tools (`fetchmail`, `msmtp`, `mutt`/`neomutt`, `notmuch`, `pinentry-curses`, `abook`, `wipe`, `mblaze`/`maddr`) plus build tools from `.travis.yml`. For narrow C helper changes, rebuild with `make` and add a focused command-line check where practical.
23+
There is no broad unit-test suite. Use `extras/test/run-source.sh` for checkout-level validation, `extras/test/test-account-wizard.sh` for account onboarding behavior, and `extras/test/inittest.sh` for installed-path validation. The tests depend on external mail tools (`fetchmail`, `msmtp`, `mutt`/`neomutt`, `notmuch`, `pinentry-curses`, `abook`, `wipe`, `mblaze`/`maddr`) plus build tools from `.travis.yml`. For narrow C helper changes, rebuild with `make` and add a focused command-line check where practical.
2324

2425
## Commit & Pull Request Guidelines
2526

Makefile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,35 @@
11
PREFIX ?= /usr/local
22
JARO_LIBEXEC := ${PREFIX}/share/jaromail
33
JARO_SHARE := ${PREFIX}/share/jaromail
4+
MAN1DIR := ${PREFIX}/share/man/man1
45
srcdir := $(shell pwd)
56

67
all:
78
./build/auto build
89

10+
man:
11+
@pandoc -s -t man \
12+
--metadata title="jaromail" --metadata section="1" \
13+
--metadata date="$$(date +%Y-%m-%d)" \
14+
${srcdir}/doc/jaromail-manual.md -o ${srcdir}/doc/jaromail.1
15+
@pandoc -s -t man \
16+
--metadata title="jaro" --metadata section="1" \
17+
--metadata date="$$(date +%Y-%m-%d)" \
18+
${srcdir}/doc/jaro.1.md -o ${srcdir}/doc/jaro.1
19+
920
# { test -r $srcdir/src/fetchaddr } || {
1021
# print "Error: first build, then install."; return 1 }
11-
install:
22+
install: man
1223
$(info Installing JaroMail in ${JARO_SHARE})
1324
@mkdir -p ${JARO_SHARE}/mutt ${JARO_SHARE}/stats
1425
@mkdir -p ${JARO_LIBEXEC}/bin ${JARO_LIBEXEC}/zlibs
26+
@mkdir -p ${MAN1DIR}
1527
@chmod -R a+rX ${JARO_SHARE}
1628
@cp -r ${srcdir}/doc/* ${JARO_SHARE}/
1729
@cp -r ${srcdir}/src/mutt/* ${JARO_SHARE}/mutt/
1830
@cp -r ${srcdir}/src/stats/* ${JARO_SHARE}/stats/
31+
@cp ${srcdir}/doc/jaromail.1 ${MAN1DIR}/jaromail.1
32+
@cp ${srcdir}/doc/jaro.1 ${MAN1DIR}/jaro.1
1933
@cp ${srcdir}/src/jaro ${JARO_LIBEXEC}/bin
2034
@cp -r ${srcdir}/build/gnu/* ${JARO_LIBEXEC}/bin
2135
@cp -r ${srcdir}/src/zlibs/* ${JARO_LIBEXEC}/zlibs/
@@ -36,5 +50,3 @@ clean:
3650
rm -f src/parsedate
3751
rm -f src/dotlock
3852

39-
40-

doc/jaro.1

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
.\" Automatically generated by Pandoc 3.1.3
2+
.\"
3+
.\" Define V font for inline verbatim, using C font in formats
4+
.\" that render this, and otherwise B font.
5+
.ie "\f[CB]x\f[]"x" \{\
6+
. ftr V B
7+
. ftr VI BI
8+
. ftr VB B
9+
. ftr VBI BI
10+
.\}
11+
.el \{\
12+
. ftr V CR
13+
. ftr VI CI
14+
. ftr VB CB
15+
. ftr VBI CBI
16+
.\}
17+
.TH "jaro" "1" "2026-04-30" "" ""
18+
.hy
19+
.SH jaro(1)
20+
.SS Name
21+
.PP
22+
jaro - command line interface for Jaromail workflows
23+
.SS Synopsis
24+
.PP
25+
\f[V]jaro [options] [command] [command-options]\f[R]
26+
.SS Description
27+
.PP
28+
\f[V]jaro\f[R] is the operational CLI for Jaromail.
29+
It orchestrates account configuration, local maildir operations,
30+
addressbooks, filtering, indexing and SMTP/IMAP actions.
31+
.SS Options
32+
.PP
33+
\f[V]-a ACCOUNT\f[R] use a specific account instead of
34+
\f[V]default\f[R].
35+
.PP
36+
\f[V]-l LIST\f[R] use a specific addressbook/list (default:
37+
\f[V]whitelist\f[R]).
38+
.PP
39+
\f[V]-n\f[R] dry-run mode where supported.
40+
.PP
41+
\f[V]-q\f[R] quiet mode.
42+
.PP
43+
\f[V]-D\f[R] debug mode.
44+
.PP
45+
\f[V]-h\f[R] show help.
46+
.PP
47+
\f[V]-v\f[R] show version.
48+
.PP
49+
\f[V]-f\f[R] force mode for selected operations.
50+
.SS Commands
51+
.SS Core mail flow
52+
.PP
53+
\f[V]wizard\f[R] interactive account setup.
54+
.PP
55+
\f[V]fetch\f[R] fetch unread messages for an account.
56+
.PP
57+
\f[V]send\f[R] send queued messages from \f[V]outbox/\f[R].
58+
.PP
59+
\f[V]queue\f[R] read a full message from stdin and queue it.
60+
.PP
61+
\f[V]smtp\f[R] read a full message from stdin and send via SMTP.
62+
.PP
63+
\f[V]peek\f[R] open remote IMAP mailbox view.
64+
.PP
65+
\f[V]open\f[R] open a local maildir folder.
66+
.SS Account and secrets
67+
.PP
68+
\f[V]passwd\f[R] set or update account password in the configured
69+
keyring.
70+
.PP
71+
\f[V]askpass\f[R] print account password resolved from keyring/prompt.
72+
.PP
73+
\f[V]isonline\f[R] check network reachability.
74+
.SS Search and indexing
75+
.PP
76+
\f[V]index\f[R] update the search index.
77+
.PP
78+
\f[V]search\f[R] run search queries over local mail archives.
79+
.PP
80+
\f[V]header\f[R], \f[V]headers\f[R] print mail headers.
81+
.SS Addressbook and contacts
82+
.PP
83+
\f[V]abook\f[R] edit addressbook.
84+
.PP
85+
\f[V]addr\f[R], \f[V]list\f[R] list addresses from addressbook.
86+
.PP
87+
\f[V]extract\f[R], \f[V]parse\f[R] extract addresses from supported
88+
inputs.
89+
.PP
90+
\f[V]import\f[R] import addresses from stdin.
91+
.PP
92+
\f[V]export\f[R] export addresses to another format.
93+
.PP
94+
\f[V]learn\f[R], \f[V]isknown\f[R], \f[V]complete\f[R] contact
95+
learning/query/completion helpers.
96+
.SS Filtering and Sieve
97+
.PP
98+
\f[V]update\f[R] rebuild local filtering cache and regenerate Sieve.
99+
.PP
100+
\f[V]filter\f[R] apply filters to a maildir.
101+
.PP
102+
\f[V]sieve\f[R] regenerate \f[V]Filters.sieve\f[R] only.
103+
.PP
104+
\f[V]sieve-import FILE\f[R] import a Jaromail-generated Sieve file into
105+
local filter/addressbook files.
106+
.SS Maildir and utility commands
107+
.PP
108+
\f[V]backup\f[R] move search results between maildirs.
109+
.PP
110+
\f[V]merge\f[R] merge one maildir into another.
111+
.PP
112+
\f[V]deliver\f[R] deliver a message from stdin into a maildir.
113+
.PP
114+
\f[V]rmdupes\f[R] remove duplicate messages.
115+
.PP
116+
\f[V]remember\f[R], \f[V]replay\f[R], \f[V]preview\f[R], \f[V]edit\f[R],
117+
\f[V]vim\f[R], \f[V]publish\f[R], \f[V]imap\f[R], \f[V]alot\f[R],
118+
\f[V]alot-config\f[R], \f[V]notmuch\f[R], \f[V]notmuch-config\f[R],
119+
\f[V]isml\f[R], \f[V]ismd\f[R].
120+
.SS Files
121+
.PP
122+
\f[V]$JAROMAILDIR\f[R] mail root (default usually \f[V]$HOME/Mail\f[R]).
123+
.PP
124+
\f[V]$JAROMAILDIR/Accounts/\f[R] account configuration files.
125+
.PP
126+
\f[V]$JAROMAILDIR/Filters.txt\f[R] filtering rules.
127+
.PP
128+
\f[V]$JAROMAILDIR/Filters.sieve\f[R] generated Sieve rules.
129+
.SS See Also
130+
.PP
131+
\f[V]jaromail(1)\f[R]

doc/jaro.1.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
jaro(1)
2+
=======
3+
4+
## Name
5+
6+
jaro - command line interface for Jaromail workflows
7+
8+
## Synopsis
9+
10+
`jaro [options] [command] [command-options]`
11+
12+
## Description
13+
14+
`jaro` is the operational CLI for Jaromail. It orchestrates account
15+
configuration, local maildir operations, addressbooks, filtering,
16+
indexing and SMTP/IMAP actions.
17+
18+
## Options
19+
20+
`-a ACCOUNT` use a specific account instead of `default`.
21+
22+
`-l LIST` use a specific addressbook/list (default: `whitelist`).
23+
24+
`-n` dry-run mode where supported.
25+
26+
`-q` quiet mode.
27+
28+
`-D` debug mode.
29+
30+
`-h` show help.
31+
32+
`-v` show version.
33+
34+
`-f` force mode for selected operations.
35+
36+
## Commands
37+
38+
### Core mail flow
39+
40+
`wizard` interactive account setup.
41+
42+
`fetch` fetch unread messages for an account.
43+
44+
`send` send queued messages from `outbox/`.
45+
46+
`queue` read a full message from stdin and queue it.
47+
48+
`smtp` read a full message from stdin and send via SMTP.
49+
50+
`peek` open remote IMAP mailbox view.
51+
52+
`open` open a local maildir folder.
53+
54+
### Account and secrets
55+
56+
`passwd` set or update account password in the configured keyring.
57+
58+
`askpass` print account password resolved from keyring/prompt.
59+
60+
`isonline` check network reachability.
61+
62+
### Search and indexing
63+
64+
`index` update the search index.
65+
66+
`search` run search queries over local mail archives.
67+
68+
`header`, `headers` print mail headers.
69+
70+
### Addressbook and contacts
71+
72+
`abook` edit addressbook.
73+
74+
`addr`, `list` list addresses from addressbook.
75+
76+
`extract`, `parse` extract addresses from supported inputs.
77+
78+
`import` import addresses from stdin.
79+
80+
`export` export addresses to another format.
81+
82+
`learn`, `isknown`, `complete` contact learning/query/completion helpers.
83+
84+
### Filtering and Sieve
85+
86+
`update` rebuild local filtering cache and regenerate Sieve.
87+
88+
`filter` apply filters to a maildir.
89+
90+
`sieve` regenerate `Filters.sieve` only.
91+
92+
`sieve-import FILE` import a Jaromail-generated Sieve file into local
93+
filter/addressbook files.
94+
95+
### Maildir and utility commands
96+
97+
`backup` move search results between maildirs.
98+
99+
`merge` merge one maildir into another.
100+
101+
`deliver` deliver a message from stdin into a maildir.
102+
103+
`rmdupes` remove duplicate messages.
104+
105+
`remember`, `replay`, `preview`, `edit`, `vim`, `publish`, `imap`,
106+
`alot`, `alot-config`, `notmuch`, `notmuch-config`, `isml`, `ismd`.
107+
108+
## Files
109+
110+
`$JAROMAILDIR` mail root (default usually `$HOME/Mail`).
111+
112+
`$JAROMAILDIR/Accounts/` account configuration files.
113+
114+
`$JAROMAILDIR/Filters.txt` filtering rules.
115+
116+
`$JAROMAILDIR/Filters.sieve` generated Sieve rules.
117+
118+
## See Also
119+
120+
`jaromail(1)`
121+

doc/jaromail-manual.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,37 @@ Will extract all addresses found in unsorted (the maildir collecting all
970970
non-mailinglist emails in which we are not an explicit recipient) and
971971
put them into our blacklist.
972972

973+
### Private recipient groups
974+
975+
You can define reusable recipient groups in `Mail/Groups/` and send to
976+
them by using the pseudo-address `groupname@jaromail.group`.
977+
978+
Create a group file, for example `Mail/Groups/team`:
979+
980+
``` example
981+
#mode individual
982+
Alice <alice@example.org>
983+
Bob <bob@example.org>
984+
```
985+
986+
Then compose to the group:
987+
988+
``` example
989+
jaro compose team@jaromail.group
990+
```
991+
992+
Group delivery modes are controlled by the first line:
993+
994+
- `#mode individual` (default): one message per recipient, recipients do
995+
not see each other.
996+
- `#mode carboncopy` or `#mode cc`: one message with all recipients in
997+
`To:` and `Reply-To:` set to sender address.
998+
- `#mode bcc`: one message with hidden recipients (`To:
999+
undisclosed-recipients:;`) and all recipients in `Bcc:`.
1000+
1001+
This behavior is implemented in the queueing path, so it also applies
1002+
when messages are piped and queued from stdin.
1003+
9731004
### Export to VCard and other formats
9741005

9751006
VCard is an exchange format useful to interface with other addressbook

0 commit comments

Comments
 (0)