<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:media="http://search.yahoo.com/mrss/" 
	>
<channel>
	<title>
	Comments on: DMARC / Spamassassin / Qmail	</title>
	<atom:link href="https://random.sphere.ro/dmarc-on-spamassassin/feed/" rel="self" type="application/rss+xml" />
	<link>https://random.sphere.ro/dmarc-on-spamassassin/</link>
	<description>for when you get older and memory does&#039;t help you further</description>
	<lastBuildDate>Wed, 19 Oct 2022 08:37:17 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.5</generator>
	<item>
		<title>
		By: iulian		</title>
		<link>https://random.sphere.ro/dmarc-on-spamassassin/#comment-767</link>

		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Wed, 19 Oct 2022 08:37:17 +0000</pubDate>
		<guid isPermaLink="false">https://random.sphere.ro/?p=93#comment-767</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://random.sphere.ro/dmarc-on-spamassassin/#comment-499&quot;&gt;Chris&lt;/a&gt;.

Sorry but i don&#039;t get your point. This post is not about what is visible to end-user but more about combining different technologies ( SPF, DKIM and DMARC) in such way to add more value to Spammassassin. 
Since DMARC was not present in  Spammassasin  by default trough a plugin this was/is a technique to bring also DMARC in equation. It doesn&#039;t mean that you don&#039;t check anymore anything else.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://random.sphere.ro/dmarc-on-spamassassin/#comment-499">Chris</a>.</p>
<p>Sorry but i don&#8217;t get your point. This post is not about what is visible to end-user but more about combining different technologies ( SPF, DKIM and DMARC) in such way to add more value to Spammassassin.<br />
Since DMARC was not present in  Spammassasin  by default trough a plugin this was/is a technique to bring also DMARC in equation. It doesn&#8217;t mean that you don&#8217;t check anymore anything else.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Chris		</title>
		<link>https://random.sphere.ro/dmarc-on-spamassassin/#comment-499</link>

		<dc:creator><![CDATA[Chris]]></dc:creator>
		<pubDate>Fri, 25 Feb 2022 12:59:47 +0000</pubDate>
		<guid isPermaLink="false">https://random.sphere.ro/?p=93#comment-499</guid>

					<description><![CDATA[Am I right that these rules don&#039;t work correctly (and might be quite easy to avoid by spammers) when it comes to mails that use different domains in the &quot;From&quot; header address and the envelope sender?

Ordinary SPF (and therefore the spamassassin SPF_PASS test) only works with the envelope sender, which is often not visible to users. DKIM and DMARC are supposed to check the &quot;From&quot; header address, however the rules in this blog post will ignore this address if only the envelope sender address passes the SPF checks.]]></description>
			<content:encoded><![CDATA[<p>Am I right that these rules don&#8217;t work correctly (and might be quite easy to avoid by spammers) when it comes to mails that use different domains in the &#8220;From&#8221; header address and the envelope sender?</p>
<p>Ordinary SPF (and therefore the spamassassin SPF_PASS test) only works with the envelope sender, which is often not visible to users. DKIM and DMARC are supposed to check the &#8220;From&#8221; header address, however the rules in this blog post will ignore this address if only the envelope sender address passes the SPF checks.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: iulian		</title>
		<link>https://random.sphere.ro/dmarc-on-spamassassin/#comment-113</link>

		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Fri, 04 Sep 2020 06:53:51 +0000</pubDate>
		<guid isPermaLink="false">https://random.sphere.ro/?p=93#comment-113</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://random.sphere.ro/dmarc-on-spamassassin/#comment-112&quot;&gt;A&lt;/a&gt;.

It was never about the math. 
You math is fine and i understand your point but you started your investigation from the fact that in order for DMARC to pass you should have DKIM OR(and not AND) SPF to pass.

Actually the DMARC specs ( if you read &lt;a href=&quot;https://tools.ietf.org/html/rfc7489&quot; rel=&quot;nofollow ugc&quot;&gt;RFC7489&lt;/a&gt;) is leaving a lot of space for interpretation. Plus this is not a standard but an informational RFC.

Just two examples:
&lt;strong&gt;1)&lt;/strong&gt; is actually is enforcing that DMARC  should not replace local policy.
I quote: &quot;&lt;em&gt;Mail Receivers MAY choose to reject or quarantine email even if email passes the DMARC mechanism check.  The DMARC mechanism does not inform Mail Receivers whether an email stream is &quot;good&quot;.  Mail Receivers are encouraged to maintain anti-abuse technologies to combat the possibility of DMARC-enabled criminal campaigns.&lt;/em&gt;&quot;
&lt;strong&gt;2)&lt;/strong&gt; is saying that &quot;&lt;em&gt;different treatment of messages that are not authenticated versus those that fail authentication&lt;/em&gt;&quot; is not in the scope of this RFC.

It was never about &quot;&#038;&#038; &#124;&#124;&quot; but about how sure i am when i want to reject. Since both DKIM and SPF have their own flows which can be exploited in the benefit of a rogue actor i want to be very sure when i REJECT that message. Moreover my approach(which you might think is more relaxed) is also covering the situation when you don&#039;t have the correct information about a DKIM/SPF due to a DNS issue at that time.

Long story short i prefer to build on a scoring mechanism and double check the info(in my case DKIM and SPF must fail for a DMARC rejection) rather than immediately rejecting based on only one of them.
In an ideal world where all the e-mail/domain administrator will correctly cover DKIM/SPF/DMARC than you might think to put &#038;&#038; instead &#124;&#124;. In this world where false positive can be easily created due to unmaintained/incorrectly configuration i prefer to double check. Hope that make more sense now.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://random.sphere.ro/dmarc-on-spamassassin/#comment-112">A</a>.</p>
<p>It was never about the math.<br />
You math is fine and i understand your point but you started your investigation from the fact that in order for DMARC to pass you should have DKIM OR(and not AND) SPF to pass.</p>
<p>Actually the DMARC specs ( if you read <a href="https://tools.ietf.org/html/rfc7489" rel="nofollow ugc">RFC7489</a>) is leaving a lot of space for interpretation. Plus this is not a standard but an informational RFC.</p>
<p>Just two examples:<br />
<strong>1)</strong> is actually is enforcing that DMARC  should not replace local policy.<br />
I quote: &#8220;<em>Mail Receivers MAY choose to reject or quarantine email even if email passes the DMARC mechanism check.  The DMARC mechanism does not inform Mail Receivers whether an email stream is &#8220;good&#8221;.  Mail Receivers are encouraged to maintain anti-abuse technologies to combat the possibility of DMARC-enabled criminal campaigns.</em>&#8221;<br />
<strong>2)</strong> is saying that &#8220;<em>different treatment of messages that are not authenticated versus those that fail authentication</em>&#8221; is not in the scope of this RFC.</p>
<p>It was never about &#8220;&amp;&amp; ||&#8221; but about how sure i am when i want to reject. Since both DKIM and SPF have their own flows which can be exploited in the benefit of a rogue actor i want to be very sure when i REJECT that message. Moreover my approach(which you might think is more relaxed) is also covering the situation when you don&#8217;t have the correct information about a DKIM/SPF due to a DNS issue at that time.</p>
<p>Long story short i prefer to build on a scoring mechanism and double check the info(in my case DKIM and SPF must fail for a DMARC rejection) rather than immediately rejecting based on only one of them.<br />
In an ideal world where all the e-mail/domain administrator will correctly cover DKIM/SPF/DMARC than you might think to put &amp;&amp; instead ||. In this world where false positive can be easily created due to unmaintained/incorrectly configuration i prefer to double check. Hope that make more sense now.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: A		</title>
		<link>https://random.sphere.ro/dmarc-on-spamassassin/#comment-112</link>

		<dc:creator><![CDATA[A]]></dc:creator>
		<pubDate>Wed, 02 Sep 2020 17:21:58 +0000</pubDate>
		<guid isPermaLink="false">https://random.sphere.ro/?p=93#comment-112</guid>

					<description><![CDATA[Well setting p=none is your outbound policy, what you expect others to do. What we are talking about here is what you will do with email you&#039;re receiving given another domains policy instruction. The DMARC spec reads if EITHER fails you should do what the domain instructs you to do. but if you&#039;d like to make it so BOTH must fail you can, the beauty of the comment above is the explanation of the logic and therefor choice, but to be compliant with what should be happening it should be if either one fails. so the &#038;&#038; logic. If you want to take into account the domain alignment and such this method wont work, but it&#039;s quick and dirty and will work for most email.]]></description>
			<content:encoded><![CDATA[<p>Well setting p=none is your outbound policy, what you expect others to do. What we are talking about here is what you will do with email you&#8217;re receiving given another domains policy instruction. The DMARC spec reads if EITHER fails you should do what the domain instructs you to do. but if you&#8217;d like to make it so BOTH must fail you can, the beauty of the comment above is the explanation of the logic and therefor choice, but to be compliant with what should be happening it should be if either one fails. so the &amp;&amp; logic. If you want to take into account the domain alignment and such this method wont work, but it&#8217;s quick and dirty and will work for most email.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: iulian		</title>
		<link>https://random.sphere.ro/dmarc-on-spamassassin/#comment-111</link>

		<dc:creator><![CDATA[iulian]]></dc:creator>
		<pubDate>Wed, 02 Sep 2020 10:55:24 +0000</pubDate>
		<guid isPermaLink="false">https://random.sphere.ro/?p=93#comment-111</guid>

					<description><![CDATA[Unfortunately you started from the assumption that you need to configure either DKIM or SPF in order to have DMARC working properly.
I want that both SPF and DKIM to fail especially when it&#039;s about such a punitive action as REJECT. Moreover SPF and DKIM may be altered during transit(forward for example) and we don&#039;t want to discard a perfect valid email because of that.
For the above reasons when you start to deploy DMARC you start with &quot;p=none&quot;. In this way no punitive action will be made when errors are occurring in SPF or DKIM.

Please see other details on: https://dmarc.org/wiki/FAQ#How_does_DMARC_work.2C_briefly.2C_and_in_non-technical_terms.3F]]></description>
			<content:encoded><![CDATA[<p>Unfortunately you started from the assumption that you need to configure either DKIM or SPF in order to have DMARC working properly.<br />
I want that both SPF and DKIM to fail especially when it&#8217;s about such a punitive action as REJECT. Moreover SPF and DKIM may be altered during transit(forward for example) and we don&#8217;t want to discard a perfect valid email because of that.<br />
For the above reasons when you start to deploy DMARC you start with &#8220;p=none&#8221;. In this way no punitive action will be made when errors are occurring in SPF or DKIM.</p>
<p>Please see other details on: <a href="https://dmarc.org/wiki/FAQ#How_does_DMARC_work.2C_briefly.2C_and_in_non-technical_terms.3F" rel="nofollow ugc">https://dmarc.org/wiki/FAQ#How_does_DMARC_work.2C_briefly.2C_and_in_non-technical_terms.3F</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Server Bug Fix: SpamAssassin local.cf DMARC configuration recognizes reject and none, but not quarantine - TECHPRPR		</title>
		<link>https://random.sphere.ro/dmarc-on-spamassassin/#comment-110</link>

		<dc:creator><![CDATA[Server Bug Fix: SpamAssassin local.cf DMARC configuration recognizes reject and none, but not quarantine - TECHPRPR]]></dc:creator>
		<pubDate>Wed, 02 Sep 2020 01:07:45 +0000</pubDate>
		<guid isPermaLink="false">https://random.sphere.ro/?p=93#comment-110</guid>

					<description><![CDATA[[&#8230;] configuration you refer to is copied from Random Thoughts blog on DMARC / Spamassassin / Qmail. This blog post gives AskDNS as a third option if you can&#8217;t use OpenDMARC for some reason. As [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] configuration you refer to is copied from Random Thoughts blog on DMARC / Spamassassin / Qmail. This blog post gives AskDNS as a third option if you can&#8217;t use OpenDMARC for some reason. As [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: A		</title>
		<link>https://random.sphere.ro/dmarc-on-spamassassin/#comment-109</link>

		<dc:creator><![CDATA[A]]></dc:creator>
		<pubDate>Tue, 01 Sep 2020 22:11:31 +0000</pubDate>
		<guid isPermaLink="false">https://random.sphere.ro/?p=93#comment-109</guid>

					<description><![CDATA[meta DMARC_REJECT !(DKIM_VALID_AU &#124;&#124; SPF_PASS) &#038;&#038; __DMARC_POLICY_REJECT

this check is invalid, this -OR- logic in the () reads:
if not (DKIM_VALID_AU -OR- SPF_PASS) AND theres a policy for the domain then reject
which means an email with assuming a policy exists (1):

!DKIM_VALID_AU and !SPF_PASS == if !(0 &#124;&#124; 0) &#038;&#038; 1 == 1 &#038;&#038; 1 == 1 == ACTION (GOOD)
DKIM_VALID_AU and !SPF_PASS == if !(1 &#124;&#124; 0) &#038;&#038; 1 == 0 &#038;&#038; 1 == 0 == NO ACTION (BAD)
!DKIM_VALID_AU and SPF_PASS == if !(0 &#124;&#124; 1) &#038;&#038; 1 == 0 &#038;&#038; 1 == 0 == NO ACTION (BAD)
DKIM_VALID_AU and SPF_PASS == if !(1 &#124;&#124; 1) &#038;&#038; 1 == 0 &#038;&#038; 1 == 0 == NO ACTION (GOOD)

if no policy exists (0) we are always NO ACTION (GOOD)
Basically its not failing out and runing the domain&#039;s policy for a failure of individual parts.

Test with a quick perl script (play with the 3 variables up top):



#!/usr/bin/perl
$DKIM_VALID_AU = 1;
$SPF_PASS = 1;
$POLICY = 1;

$PRES = int( !($DKIM_VALID_AU &#124;&#124; $SPF_PASS) );
$RES = int ( !($DKIM_VALID_AU &#124;&#124; $SPF_PASS) &#038;&#038; $POLICY );

print &quot;DKIM_VALID_AU=$DKIM_VALID_AU SPF_PASS=$SPF_PASS PAREN RESULT=$PRES RESULT=$RES AKA: &quot;;

if ($RES) {
print &quot;ACTION\n&quot;;
} else {
print &quot;NO ACTION\n&quot;;
}





POLICY=1 DKIM_VALID_AU=0 SPF_PASS=0 PAREN RESULT=1 RESULT=1 AKA: ACTION
POLICY=1 DKIM_VALID_AU=0 SPF_PASS=1 PAREN RESULT=0 RESULT=0 AKA: NO ACTION
POLICY=1 DKIM_VALID_AU=1 SPF_PASS=0 PAREN RESULT=0 RESULT=0 AKA: NO ACTION
POLICY=1 DKIM_VALID_AU=1 SPF_PASS=1 PAREN RESULT=0 RESULT=0 AKA: NO ACTION

The following will actually work (tested for all cases):

meta DMARC_REJECT !(DKIM_VALID_AU &#038;&#038; SPF_PASS) &#038;&#038; __DMARC_POLICY_REJECT

if not (DKIM_VALID_AU -AND- SPF_PASS) AND theres a policy for the domain then REJECT

Validate by changing that perl script logic to match:

#!/usr/bin/perl
$DKIM_VALID_AU = 1;
$SPF_PASS = 1;
$POLICY = 1;

$PRES = int( !($DKIM_VALID_AU &#038;&#038; $SPF_PASS) );
$RES = int ( !($DKIM_VALID_AU &#038;&#038; $SPF_PASS) &#038;&#038; $POLICY );

print &quot;DKIM_VALID_AU=$DKIM_VALID_AU SPF_PASS=$SPF_PASS PAREN RESULT=$PRES RESULT=$RES AKA: &quot;;

if ($RES) {
print &quot;ACTION\n&quot;;
} else {
print &quot;NO ACTION\n&quot;;
}


POLICY=1 DKIM_VALID_AU=1 SPF_PASS=1 PAREN RESULT=0 RESULT=0 AKA: NO ACTION
POLICY=1 DKIM_VALID_AU=0 SPF_PASS=1 PAREN RESULT=1 RESULT=1 AKA: ACTION
POLICY=1 DKIM_VALID_AU=1 SPF_PASS=0 PAREN RESULT=1 RESULT=1 AKA: ACTION
POLICY=1 DKIM_VALID_AU=0 SPF_PASS=0 PAREN RESULT=1 RESULT=1 AKA: ACTION

POLICY=0 DKIM_VALID_AU=1 SPF_PASS=1 PAREN RESULT=0 RESULT=0 AKA: NO ACTION
POLICY=0 DKIM_VALID_AU=0 SPF_PASS=0 PAREN RESULT=1 RESULT=0 AKA: NO ACTION

If any of the conditions are 0 (fail) then the policy is enforced. If everything checks out its ignored. No policy means no action.

Thanks so much for the information about how to set the DMARC check up via AskDNS. Hopefully this correction helps make this method even better.]]></description>
			<content:encoded><![CDATA[<p>meta DMARC_REJECT !(DKIM_VALID_AU || SPF_PASS) &amp;&amp; __DMARC_POLICY_REJECT</p>
<p>this check is invalid, this -OR- logic in the () reads:<br />
if not (DKIM_VALID_AU -OR- SPF_PASS) AND theres a policy for the domain then reject<br />
which means an email with assuming a policy exists (1):</p>
<p>!DKIM_VALID_AU and !SPF_PASS == if !(0 || 0) &amp;&amp; 1 == 1 &amp;&amp; 1 == 1 == ACTION (GOOD)<br />
DKIM_VALID_AU and !SPF_PASS == if !(1 || 0) &amp;&amp; 1 == 0 &amp;&amp; 1 == 0 == NO ACTION (BAD)<br />
!DKIM_VALID_AU and SPF_PASS == if !(0 || 1) &amp;&amp; 1 == 0 &amp;&amp; 1 == 0 == NO ACTION (BAD)<br />
DKIM_VALID_AU and SPF_PASS == if !(1 || 1) &amp;&amp; 1 == 0 &amp;&amp; 1 == 0 == NO ACTION (GOOD)</p>
<p>if no policy exists (0) we are always NO ACTION (GOOD)<br />
Basically its not failing out and runing the domain&#8217;s policy for a failure of individual parts.</p>
<p>Test with a quick perl script (play with the 3 variables up top):</p>
<p>#!/usr/bin/perl<br />
$DKIM_VALID_AU = 1;<br />
$SPF_PASS = 1;<br />
$POLICY = 1;</p>
<p>$PRES = int( !($DKIM_VALID_AU || $SPF_PASS) );<br />
$RES = int ( !($DKIM_VALID_AU || $SPF_PASS) &amp;&amp; $POLICY );</p>
<p>print &#8220;DKIM_VALID_AU=$DKIM_VALID_AU SPF_PASS=$SPF_PASS PAREN RESULT=$PRES RESULT=$RES AKA: &#8220;;</p>
<p>if ($RES) {<br />
print &#8220;ACTION\n&#8221;;<br />
} else {<br />
print &#8220;NO ACTION\n&#8221;;<br />
}</p>
<p>POLICY=1 DKIM_VALID_AU=0 SPF_PASS=0 PAREN RESULT=1 RESULT=1 AKA: ACTION<br />
POLICY=1 DKIM_VALID_AU=0 SPF_PASS=1 PAREN RESULT=0 RESULT=0 AKA: NO ACTION<br />
POLICY=1 DKIM_VALID_AU=1 SPF_PASS=0 PAREN RESULT=0 RESULT=0 AKA: NO ACTION<br />
POLICY=1 DKIM_VALID_AU=1 SPF_PASS=1 PAREN RESULT=0 RESULT=0 AKA: NO ACTION</p>
<p>The following will actually work (tested for all cases):</p>
<p>meta DMARC_REJECT !(DKIM_VALID_AU &amp;&amp; SPF_PASS) &amp;&amp; __DMARC_POLICY_REJECT</p>
<p>if not (DKIM_VALID_AU -AND- SPF_PASS) AND theres a policy for the domain then REJECT</p>
<p>Validate by changing that perl script logic to match:</p>
<p>#!/usr/bin/perl<br />
$DKIM_VALID_AU = 1;<br />
$SPF_PASS = 1;<br />
$POLICY = 1;</p>
<p>$PRES = int( !($DKIM_VALID_AU &amp;&amp; $SPF_PASS) );<br />
$RES = int ( !($DKIM_VALID_AU &amp;&amp; $SPF_PASS) &amp;&amp; $POLICY );</p>
<p>print &#8220;DKIM_VALID_AU=$DKIM_VALID_AU SPF_PASS=$SPF_PASS PAREN RESULT=$PRES RESULT=$RES AKA: &#8220;;</p>
<p>if ($RES) {<br />
print &#8220;ACTION\n&#8221;;<br />
} else {<br />
print &#8220;NO ACTION\n&#8221;;<br />
}</p>
<p>POLICY=1 DKIM_VALID_AU=1 SPF_PASS=1 PAREN RESULT=0 RESULT=0 AKA: NO ACTION<br />
POLICY=1 DKIM_VALID_AU=0 SPF_PASS=1 PAREN RESULT=1 RESULT=1 AKA: ACTION<br />
POLICY=1 DKIM_VALID_AU=1 SPF_PASS=0 PAREN RESULT=1 RESULT=1 AKA: ACTION<br />
POLICY=1 DKIM_VALID_AU=0 SPF_PASS=0 PAREN RESULT=1 RESULT=1 AKA: ACTION</p>
<p>POLICY=0 DKIM_VALID_AU=1 SPF_PASS=1 PAREN RESULT=0 RESULT=0 AKA: NO ACTION<br />
POLICY=0 DKIM_VALID_AU=0 SPF_PASS=0 PAREN RESULT=1 RESULT=0 AKA: NO ACTION</p>
<p>If any of the conditions are 0 (fail) then the policy is enforced. If everything checks out its ignored. No policy means no action.</p>
<p>Thanks so much for the information about how to set the DMARC check up via AskDNS. Hopefully this correction helps make this method even better.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Roberto		</title>
		<link>https://random.sphere.ro/dmarc-on-spamassassin/#comment-1</link>

		<dc:creator><![CDATA[Roberto]]></dc:creator>
		<pubDate>Wed, 14 Aug 2019 10:22:53 +0000</pubDate>
		<guid isPermaLink="false">https://random.sphere.ro/?p=93#comment-1</guid>

					<description><![CDATA[Hi, I&#039;ve just tested askDNS as recommended above and it just works! Thank you, I think I&#039;m going to add a note about it on my blog as well and refer to this page for additional info]]></description>
			<content:encoded><![CDATA[<p>Hi, I&#8217;ve just tested askDNS as recommended above and it just works! Thank you, I think I&#8217;m going to add a note about it on my blog as well and refer to this page for additional info</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
