aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/account.go6
-rw-r--r--commands/compose/send.go1
-rw-r--r--doc/aerc-config.5.scd6
-rw-r--r--lib/hooks/flag-changed.go2
-rw-r--r--lib/hooks/mail-added.go2
-rw-r--r--lib/hooks/mail-deleted.go2
-rw-r--r--lib/hooks/mail-received.go2
-rw-r--r--lib/hooks/mail-sent.go2
-rw-r--r--lib/hooks/tag-modified.go1
9 files changed, 24 insertions, 0 deletions
diff --git a/app/account.go b/app/account.go
index 20e64e74..7ce10f0f 100644
--- a/app/account.go
+++ b/app/account.go
@@ -247,6 +247,7 @@ func (acct *AccountView) newStore(name string) *lib.MessageStore {
if dir != nil {
role = string(dir.Role)
}
+ backend := acct.AccountConfig().Backend
store := lib.NewMessageStore(acct.worker,
acct.sortCriteria(uiConf),
uiConf.ThreadingEnabled,
@@ -259,6 +260,7 @@ func (acct *AccountView) newStore(name string) *lib.MessageStore {
func(msg *models.MessageInfo) {
err := hooks.RunHook(&hooks.MailReceived{
Account: acct.Name(),
+ Backend: backend,
Folder: name,
Role: role,
MsgInfo: msg,
@@ -274,6 +276,7 @@ func (acct *AccountView) newStore(name string) *lib.MessageStore {
}, func() {
err := hooks.RunHook(&hooks.MailDeleted{
Account: acct.Name(),
+ Backend: backend,
Folder: name,
Role: role,
})
@@ -284,6 +287,7 @@ func (acct *AccountView) newStore(name string) *lib.MessageStore {
}, func(dest string) {
err := hooks.RunHook(&hooks.MailAdded{
Account: acct.Name(),
+ Backend: backend,
Folder: dest,
Role: role,
})
@@ -294,6 +298,7 @@ func (acct *AccountView) newStore(name string) *lib.MessageStore {
}, func(add []string, remove []string) {
err := hooks.RunHook(&hooks.TagModified{
Account: acct.Name(),
+ Backend: backend,
Add: add,
Remove: remove,
})
@@ -304,6 +309,7 @@ func (acct *AccountView) newStore(name string) *lib.MessageStore {
}, func(flagname string) {
err := hooks.RunHook(&hooks.FlagChanged{
Account: acct.Name(),
+ Backend: backend,
Folder: acct.SelectedDirectory(),
Role: role,
FlagName: flagname,
diff --git a/commands/compose/send.go b/commands/compose/send.go
index fd39b48c..d8930056 100644
--- a/commands/compose/send.go
+++ b/commands/compose/send.go
@@ -223,6 +223,7 @@ func sendHelper(composer *app.Composer, header *mail.Header, uri *url.URL, domai
composer.SetSent(archive)
err = hooks.RunHook(&hooks.MailSent{
Account: composer.Account().Name(),
+ Backend: composer.Account().AccountConfig().Backend,
Header: header,
})
if err != nil {
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index b7a1f120..7655737e 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -1197,6 +1197,7 @@ They are configured in the *[hooks]* section of aerc.conf.
Variables:
- *AERC_ACCOUNT*
+ - *AERC_ACCOUNT_BACKEND*
- *AERC_FOLDER*
- *AERC_FOLDER_ROLE*
- *AERC_FROM_NAME*
@@ -1215,6 +1216,7 @@ They are configured in the *[hooks]* section of aerc.conf.
Variables:
- *AERC_ACCOUNT*
+ - *AERC_ACCOUNT_BACKEND*
- *AERC_FOLDER*
- *AERC_FOLDER_ROLE*
@@ -1231,6 +1233,7 @@ They are configured in the *[hooks]* section of aerc.conf.
Variables:
- *AERC_ACCOUNT*
+ - *AERC_ACCOUNT_BACKEND*
- *AERC_FOLDER*
- *AERC_FOLDER_ROLE*
@@ -1245,6 +1248,7 @@ They are configured in the *[hooks]* section of aerc.conf.
Variables:
- *AERC_ACCOUNT*
+ - *AERC_ACCOUNT_BACKEND*
- *AERC_FROM_NAME*
- *AERC_FROM_ADDRESS*
- *AERC_SUBJECT*
@@ -1271,6 +1275,7 @@ They are configured in the *[hooks]* section of aerc.conf.
Variables:
- *AERC_ACCOUNT*
+ - *AERC_ACCOUNT_BACKEND*
- *AERC_TAG_ADDED*
- *AERC_TAG_REMOVED*
@@ -1280,6 +1285,7 @@ They are configured in the *[hooks]* section of aerc.conf.
Variables:
- *AERC_ACCOUNT*
+ - *AERC_ACCOUNT_BACKEND*
- *AERC_FOLDER*
- *AERC_FOLDER_ROLE*
- *AERC_FLAG*
diff --git a/lib/hooks/flag-changed.go b/lib/hooks/flag-changed.go
index e70b67c0..2e4574c8 100644
--- a/lib/hooks/flag-changed.go
+++ b/lib/hooks/flag-changed.go
@@ -8,6 +8,7 @@ import (
type FlagChanged struct {
Account string
+ Backend string
Folder string
Role string
FlagName string
@@ -20,6 +21,7 @@ func (m *FlagChanged) Cmd() string {
func (m *FlagChanged) Env() []string {
env := []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_FOLDER_ROLE=%s", m.Role),
fmt.Sprintf("AERC_FLAG=%s", m.FlagName),
diff --git a/lib/hooks/mail-added.go b/lib/hooks/mail-added.go
index 0fa72747..efb3a7dc 100644
--- a/lib/hooks/mail-added.go
+++ b/lib/hooks/mail-added.go
@@ -8,6 +8,7 @@ import (
type MailAdded struct {
Account string
+ Backend string
Folder string
Role string
}
@@ -19,6 +20,7 @@ func (m *MailAdded) Cmd() string {
func (m *MailAdded) Env() []string {
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_FOLDER_ROLE=%s", m.Role),
}
diff --git a/lib/hooks/mail-deleted.go b/lib/hooks/mail-deleted.go
index ca190ee0..ce36e2f9 100644
--- a/lib/hooks/mail-deleted.go
+++ b/lib/hooks/mail-deleted.go
@@ -8,6 +8,7 @@ import (
type MailDeleted struct {
Account string
+ Backend string
Folder string
Role string
}
@@ -19,6 +20,7 @@ func (m *MailDeleted) Cmd() string {
func (m *MailDeleted) Env() []string {
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_FOLDER_ROLE=%s", m.Role),
}
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),
diff --git a/lib/hooks/mail-sent.go b/lib/hooks/mail-sent.go
index 59edafa2..393670a6 100644
--- a/lib/hooks/mail-sent.go
+++ b/lib/hooks/mail-sent.go
@@ -9,6 +9,7 @@ import (
type MailSent struct {
Account string
+ Backend string
Header *mail.Header
}
@@ -20,6 +21,7 @@ func (m *MailSent) Env() []string {
from, _ := mail.ParseAddress(m.Header.Get("From"))
env := []string{
fmt.Sprintf("AERC_ACCOUNT=%s", m.Account),
+ fmt.Sprintf("AERC_ACCOUNT_BACKEND=%s", m.Backend),
fmt.Sprintf("AERC_FROM_NAME=%s", from.Name),
fmt.Sprintf("AERC_FROM_ADDRESS=%s", from.Address),
fmt.Sprintf("AERC_SUBJECT=%s", m.Header.Get("Subject")),
diff --git a/lib/hooks/tag-modified.go b/lib/hooks/tag-modified.go
index 44af9471..21852803 100644
--- a/lib/hooks/tag-modified.go
+++ b/lib/hooks/tag-modified.go
@@ -8,6 +8,7 @@ import (
type TagModified struct {
Account string
+ Backend string
Add []string
Remove []string
}