cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1456
Views
5
Helpful
2
Replies

SPF result to headers

k.schlotmann
Level 1
Level 1

I want to add SPF scan result to the headers.

How can I realize this?

Thanks, 

Best regards

Kai

2 Replies 2

Libin Varghese
Cisco Employee
Cisco Employee

SPF enabled on mail flow policies will start logging SPF lookup results in headers and tracking/logs.

 

Mail Policies -> Mail Flow Policies -> Click on the policy SPF needs to be enabled for.

 

https://www.cisco.com/c/dam/en/us/products/collateral/security/esa-spf-dkim-dmarc.pdf

 

Regards,

Libin

Philippe Boeij
Level 1
Level 1

Hi,

 

I do this with a message filter.

 

Something like:


insert-all-spf-results:

if (recv-listener == "InboundMail") {

# based on http://en.wikipedia.org/wiki/Sender_Policy_Framework

if (spf-status("mailfrom") == "Pass") { insert-header("X-IronPort-SPF-Result", "SPF-PASS"); }
if (spf-status("mailfrom") == "None") { insert-header("X-IronPort-SPF-Result", "SPF-NONE"); }
if (spf-status("mailfrom") == "Neutral") { insert-header("X-IronPort-SPF-Result", "SPF-NEUTRAL"); }
if (spf-status("mailfrom") == "Fail") { insert-header("X-IronPort-SPF-Result", "SPF-FAIL"); }
if (spf-status("mailfrom") == "SoftFail") { insert-header("X-IronPort-SPF-Result", "SPF-SOFTFAIL"); }
if (spf-status("mailfrom") == "TempError") { insert-header("X-IronPort-SPF-Result", "SPF-TEMPERROR"); }
if (spf-status("mailfrom") == "PermError") { insert-header("X-IronPort-SPF-Result", "SPF-PERMERROR"); }

}

 

or

insert-spf-results:

if (recv-listener == "IncomingMail") {

if ((spf-status("pra") == "SoftFail") OR (spf-status("mailfrom") == "SoftFail") OR (spf-status("helo") == "SoftFail")) {

insert-header("X-IP-SPF-Result", "SPF-SOFTFAIL");

}

if ((spf-status("pra") == "Fail") OR (spf-status("mailfrom") == "Fail") OR (spf-status("helo") == "Fail")) {

insert-header("X-IP-SPF-Result", "SPF-FAIL");

}

}

 

depending the needs...

regards,

Philippe