aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2024-02-13 13:49:26 +0100
committerRobin Jarry <robin@jarry.cc>2024-02-14 23:06:36 +0100
commitb68b15c3726730d160235571c531209bcf902b5f (patch)
treec7e155bf9aa0926bbc2aa3de3a123976881320d8
parent22254f7532034d6b8561913e7fa7280800711fca (diff)
downloadaerc-b68b15c3726730d160235571c531209bcf902b5f.tar.gz
hooks: add Message-ID to variables for mail-received
When scripting for the mail-received hook, it can be useful to identify a mail in a maildir. In that case the Message-ID might be one of the most useful parameters to go for identifying the file of a message. Changelog-changed: Add Message-ID to the variables of `[hooks].mail-received`. Suggested-by: Kirill Chibisov <contact@kchibisov.com> Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--doc/aerc-config.5.scd1
-rw-r--r--lib/hooks/mail-received.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index 770a23de..b13d6e89 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -1129,6 +1129,7 @@ They are configured in the *[hooks]* section of aerc.conf.
- *AERC_FROM_NAME*
- *AERC_FROM_ADDRESS*
- *AERC_SUBJECT*
+ - *AERC_MESSAGE_ID*
Example:
diff --git a/lib/hooks/mail-received.go b/lib/hooks/mail-received.go
index 8f62be50..99d3ceef 100644
--- a/lib/hooks/mail-received.go
+++ b/lib/hooks/mail-received.go
@@ -25,5 +25,6 @@ func (m *MailReceived) Env() []string {
fmt.Sprintf("AERC_FROM_NAME=%s", from.Name),
fmt.Sprintf("AERC_FROM_ADDRESS=%s", from.Address),
fmt.Sprintf("AERC_SUBJECT=%s", m.MsgInfo.Envelope.Subject),
+ fmt.Sprintf("AERC_MESSAGE_ID=%s", m.MsgInfo.Envelope.MessageId),
}
}