diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-05-30 07:34:18 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-05-31 14:32:51 +0200 |
commit | 2551dd1bfa2c68a6ba8644a0c45b24fce8874674 (patch) | |
tree | ed752720e1a08708505fd9574b49629d5df84997 /config/config.go | |
parent | 30d57889741cfa8284eec9b32b29144fe01002a2 (diff) | |
download | aerc-2551dd1bfa2c68a6ba8644a0c45b24fce8874674.tar.gz |
feat: add background mail polling option for all workers
Check for new mail (recent, unseen, exists counts) with an external
command, or for imap with the STATUS command, at start or on
reconnection and every X time duration
IMAP:
The selected folder is skipped, per specification. Additional config
options are included for including/excluding folders explicitly.
Maildir/Notmuch:
An external command will be run in the background to check for new mail.
An optional timeout can be used with maildir/notmuch. Default is 10s
New account options:
check-mail
check-mail-cmd (maildir/notmuch only)
check-mail-timeout (maildir/notmuch only), default 10s
check-mail-include (IMAP only)
check-mail-exclude (IMAP only)
If unset, or set less than or equal to 0, check-mail will be ignored
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config/config.go')
-rw-r--r-- | config/config.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go index 80f7f751..f87649c3 100644 --- a/config/config.go +++ b/config/config.go @@ -105,6 +105,13 @@ type AccountConfig struct { EnableFoldersSort bool `ini:"enable-folders-sort"` FoldersSort []string `ini:"folders-sort" delim:","` + // CheckMail + CheckMail time.Duration `ini:"check-mail"` + CheckMailCmd string `ini:"check-mail-cmd"` + CheckMailTimeout time.Duration `ini:"check-mail-timeout"` + CheckMailInclude []string `ini:"check-mail-include"` + CheckMailExclude []string `ini:"check-mail-exclude"` + // PGP Config PgpKeyId string `ini:"pgp-key-id"` PgpAutoSign bool `ini:"pgp-auto-sign"` @@ -224,6 +231,7 @@ func loadAccountConfig(path string) ([]AccountConfig, error) { Name: _sec, Params: make(map[string]string), EnableFoldersSort: true, + CheckMailTimeout: 10 * time.Second, } if err = sec.MapTo(&account); err != nil { return nil, err |