09-23-2015 08:07 PM
Hi there i need help creating a message filter to check mail for spf and if status = fail, temperror, permerror to send it through to quarantine and send a custom notification template to the sender.
I have created a content policy to do this as well as the custom notification although i would want all spf status's being checked whilst assigning a custom notification against it.
Thanks
Mark
09-23-2015 11:53 PM
Hello Mark,
If you wish to use a message filter (to action the emails earlier than content filters would), the easiest method i would suggest is to create a content filter with the required actions and conditions (of SPF results) with the notification to be used.
You will see the syntax of the rules there as well in the content filter, then copy it out into a message filter format.
Essentially
Filtername:
if (condition1)
{
actionone();
}
.
For example, if SPF fail, send a notification called 'test_notify' and quarantine the email.
Would look like.
SPF_fail:
if (spf-status == "fail")
{
notify ("$EnvelopeSender", "", "", "Test_Notify");
quarantine("CustomQ")
}
.
Regards,
Matthew
09-27-2015 11:36 AM
Hi Matthew appreciate the reply. I'm assuming that (spf-status == "fail") would only be applied to pra not mail from?
My example below. Curious how would i applied this to the inbound listener only?
SPF-pra-mailfrom_fail_temperror_permerror
if (spf-status("pra") == "Fail,temperror,permerror") or (spf-status("mailfrom") == "Fail,temperror,permerror")
{
notify ("$EnvelopeSender", "", "", "custom_template_notification");quarantine("Policy");
}
.
SPF-pra-mailfrom_fail_temperror_permerror
if (recv-listener == "InboundMail") and (spf-status("pra") == "Fail,temperror,permerror") or (spf-status("mailfrom") == "Fail,temperror,permerror")
{
notify ("$EnvelopeSender", "", "", "custom_template_notification");quarantine("Policy");
}
.
??
09-27-2015 03:54 PM
Hello,
Yep those syntax will also work.
However you will need to group the two "OR" conditions together.
Eg:
if (recv-listener == "InboundMail") and ((spf-status("pra") == "Fail,temperror,permerror") or (spf-status("mailfrom") == "Fail,temperror,permerror"))
{
notify ("$EnvelopeSender", "", "", "custom_template_notification");
quarantine("Policy");
}
.
Regards,
Matthew
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide