diff options
author | Jason Cox <me@jasoncarloscox.com> | 2023-10-29 17:40:48 -0400 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-11-02 11:59:39 +0100 |
commit | faa879f9a84d44f9b251410fc923a827a44df1a7 (patch) | |
tree | 91f0a718e58b88d41a9a2c0720389bfcc137516a /config | |
parent | 31b50f24d51fd429f30e20fb42a5681149e5bfe7 (diff) | |
download | aerc-faa879f9a84d44f9b251410fc923a827a44df1a7.tar.gz |
hooks: add mail-added hook
The mail-added hook runs whenever a message is added to a folder.
Note that the hook does not run when a new message is received (the
mail-received hook already covers that) but instead runs whenever aerc
itself adds a message to a folder, e.g. when moving or copying a
message.
Changelog-added: `mail-added` hook that triggers when a message is added
to a folder.
References: https://todo.sr.ht/~rjarry/aerc/136
Signed-off-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config')
-rw-r--r-- | config/aerc.conf | 4 | ||||
-rw-r--r-- | config/hooks.go | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/config/aerc.conf b/config/aerc.conf index cf9aafa2..d8142197 100644 --- a/config/aerc.conf +++ b/config/aerc.conf @@ -585,6 +585,10 @@ message/rfc822=colorize #mail-deleted=mbsync "$AERC_ACCOUNT:$AERC_FOLDER" & # +# Executed when aerc adds mail to a folder +#mail-added=mbsync "$AERC_ACCOUNT:$AERC_FOLDER" & + +# # Executed when aerc starts #aerc-startup=aerc :terminal calcurse && aerc :next-tab diff --git a/config/hooks.go b/config/hooks.go index 7a6047c1..b1b71a25 100644 --- a/config/hooks.go +++ b/config/hooks.go @@ -12,6 +12,7 @@ type HooksConfig struct { AercShutdown string `ini:"aerc-shutdown"` MailReceived string `ini:"mail-received"` MailDeleted string `ini:"mail-deleted"` + MailAdded string `ini:"mail-added"` } var Hooks HooksConfig |