aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hooks/mail-received.go
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-05-30 11:30:18 +0200
committerRobin Jarry <robin@jarry.cc>2024-06-05 08:41:13 +0200
commitfd35044023b3b6cae4eb95c4f4b997873739b153 (patch)
treea46e7e7b0bb279d281bd785e9d0c259e8894ca20 /lib/hooks/mail-received.go
parent47c226687265ff29969fd73cdc69a938fae20d4c (diff)
downloadaerc-fd35044023b3b6cae4eb95c4f4b997873739b153.tar.gz
hooks: add AERC_ACCOUNT_BACKEND to hooks with AERC_ACCOUNT
It can be good to know the backend used for an account in a hook. Add this information to all hooks that already pass the account name along. Changelog-added: Added `AERC_ACCOUNT_BACKEND` to hooks with `AERC_ACCOUNT`. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/hooks/mail-received.go')
-rw-r--r--lib/hooks/mail-received.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/hooks/mail-received.go b/lib/hooks/mail-received.go
index 67457883..fa8247df 100644
--- a/lib/hooks/mail-received.go
+++ b/lib/hooks/mail-received.go
@@ -9,6 +9,7 @@ import (
type MailReceived struct {
Account string
+ Backend string
Folder string
Role string
MsgInfo *models.MessageInfo
@@ -22,6 +23,7 @@ func (m *MailReceived) Env() []string {
from := m.MsgInfo.Envelope.From[0]
return []string{
fmt.Sprintf("AERC_ACCOUNT=%s", m.Account),
+ fmt.Sprintf("AERC_ACCOUNT_BACKEND=%s", m.Backend),
fmt.Sprintf("AERC_FOLDER=%s", m.Folder),
fmt.Sprintf("AERC_FROM_NAME=%s", from.Name),
fmt.Sprintf("AERC_FROM_ADDRESS=%s", from.Address),