I've created a sieve script that filters for particular words in Subject, drops the body and sends notification to the recipient and sender.
Everything works well but the only thing I can't figure out is how to change response email not to be from POSTMASTER.
I've changed 15-lda.conf in /etc/dovecot/conf.d
#Address to use when sending rejection mails.
#Default is no-reply@%d. %d expands to recipient domain.
postmaster_address = no-reply@my-domain.com.
but still getting From: Postmaster Just heads up: dovecot, postfix restarted.
Would you be able to point me what I need to do to change it to something else or get rid of it at all?
This is my script
require ["enotify", "mailbox", "reject", "variables"];
if header :matches "to" ["*", "*", "*"] {
set "r1" "${1}";
set "r2" "${2}";
set "r3" "${3}";
}
if header :matches "from" "*" {
set "sender" "${1}";
}
#sets variables for position in the address and it works for CC and BC aswell.
#This is the way sieve works by setting position in the line for TO or FROM.
if header :matches "Subject" "SEC=SECRET" {
notify :importance "1"
:message "SEC=SECRET Email Received"
"mailto:${r1}${r2}${r3}";
}
if header :matches "Subject" "SEC=TOP SECRET" {
notify :importance "1"
:message "You have received an email with a SECRET or TOP SECRET classification from ${sender}. The message exceeds the classification of company's email system and has been discarded. The sender of the message has also been informed"
"mailto:${r1}${r2}${r3}";
}
if header :matches "Subject" "SEC=TOP-SECRET" {
notify :importance "1"
:message "You have received an email with a SECRET or TOP SECRET classification from ${sender}. The message exceeds the classification of company's email system and has been discarded. The sender of the message has also been informed"
"mailto:${r1}${r2}${r3}";
}
#matches the Subject and if it containes SECRET or TOP SECRET
#sends notification to receivers specified in mailto:
#doesn't include the body of email
if anyof (header :contains "Subject" "SEC=SECRET",
header :contains "Subject" "SEC=TOP SECRET",
header :contains "Subject" "SEC=TOP-SECRET")
{
reject "Our systems have not been certified to accept emails classified as SECRET or TOP-SECRET. Your message has been deleted and the recipients have been informed.";
}
#matches the Subject, drops the body and sends notification to the sender with the message specified.