would it be possible to include a "In-Reply-To" and/or "References"
header in the messages send on failed/succesful triggerd encryption?
Is it maybe possible by altering the template?
This would be useful as it possible to automatically associate the error
with the trigger mail.
Yes that's possible. You have to edit the "failed encryption" template
and add the following header:
In-Reply-To: ${(mail.message.messageID)!""}
You can edit the "failed encryption" template for only one specific
sender or for the domain of the sender or for the global level.
My advice is to first try to change the template for just one specific
sender because the template should not contain template errors
(otherwise the failed encryption notification cannot be sent)
Here is an complete example template that works for me (the template is
between STRAT end END template):
===== START TEMPLATE ====
<#if to??>
</#if></#list>
</#if>
<#if replyTo??>
</#if>
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0
In-Reply-To: ${(mail.message.messageID)!""}
The message with Subject
${subject!""}
has not been sent to the following recipients because the message could
not be encrypted.
<#-- we need to show the recipients of the source message -->
<#list mail.recipients as recipient>
${recipient}
</#list>
<#if body??>
${body}
</#if>
···
From: <${from!""}>
To: <#list to as recipient><${recipient}><#if recipient_has_next>,
Reply-To: <${replyTo}>
Subject: The message could not be encrypted.
---
Djigzo open source email encryption
===== START TEMPLATE ====
Kind regards,
Martijn