Re: [dmarc-ietf] Reporting DMARC policy in A-R header fields

Alessandro Vesely <vesely@tana.it> Thu, 01 August 2019 07:40 UTC

Return-Path: <vesely@tana.it>
X-Original-To: dmarc@ietfa.amsl.com
Delivered-To: dmarc@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7B2D6120052 for <dmarc@ietfa.amsl.com>; Thu, 1 Aug 2019 00:40:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.301
X-Spam-Level:
X-Spam-Status: No, score=-4.301 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1152-bit key) header.d=tana.it
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3Rx1kC-sMnpG for <dmarc@ietfa.amsl.com>; Thu, 1 Aug 2019 00:40:01 -0700 (PDT)
Received: from wmail.tana.it (wmail.tana.it [62.94.243.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8B0E012004C for <dmarc@ietf.org>; Thu, 1 Aug 2019 00:40:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tana.it; s=delta; t=1564645199; bh=KvbquqasqIHBLLI7VDAjOuz3571Cw73SuxYaT1bPdLM=; l=1710; h=To:References:From:Date:In-Reply-To; b=Asc8kRxbRzMu/Mnq/vWPOrHLFUOogRSZfIo/dayYHLi/OcZnS3RO3Yxx6IgPOpulH +MLcFDnqYDQnLXm1cuaHa4meGMVFteowFs4Yja69PJsX2gQPHCCLj9pvXppXwoD4qV c/qjTkhOWtSiUs0ArXIUH8HbCvBYF5ac51w+00yK9kDh1KiErmXmTiWQHxmQn
Authentication-Results: tana.it; auth=pass (details omitted)
Received: from [172.25.197.111] (pcale.tana [172.25.197.111]) (AUTH: CRAM-MD5 uXDGrn@SYT0/k) by wmail.tana.it with ESMTPA id 00000000005DC042.000000005D42974F.000039BB; Thu, 01 Aug 2019 09:39:59 +0200
To: dmarc@ietf.org
References: <2577720.3ZthdXZjm2@l5580> <4600949.rz9u5RyGOV@l5580> <ad404895f272ede4a9d0fb7cfb142a65414318d3.camel@aegee.org> <60001A26-503E-4DB0-B164-2AADD47CFE06@kitterman.com> <a94b0dda-11ea-7342-d835-fb2cbe82d507@tana.it> <DC53F22F-A005-4CFB-B6CA-06E76AF02ACE@kitterman.com>
From: Alessandro Vesely <vesely@tana.it>
Openpgp: id=0A5B4BB141A53F7F55FC8CBCB6ACF44490D17C00
Message-ID: <1209de12-5571-327c-53b1-568e8342a465@tana.it>
Date: Thu, 01 Aug 2019 09:39:59 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0
MIME-Version: 1.0
In-Reply-To: <DC53F22F-A005-4CFB-B6CA-06E76AF02ACE@kitterman.com>
Content-Type: text/plain; charset="us-ascii"
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/dmarc/5il80QHrrKRfZNPn1cs1XAVn0_A>
Subject: Re: [dmarc-ietf] Reporting DMARC policy in A-R header fields
X-BeenThere: dmarc@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Domain-based Message Authentication, Reporting, and Compliance \(DMARC\)" <dmarc.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dmarc>, <mailto:dmarc-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dmarc/>
List-Post: <mailto:dmarc@ietf.org>
List-Help: <mailto:dmarc-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dmarc>, <mailto:dmarc-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 01 Aug 2019 07:40:04 -0000

On Wed 31/Jul/2019 12:46:00 +0200 Scott Kitterman wrote:

>> Would it be possible to add a result of "quarantine"?  Having dmarc=fail
>> and dns.policy=quarantine leaves a good deal of interpretation to the MDA.
>>  If one could write dmarc=quarantine, a simple string search or regular 
>> expression would do.
> That's a great example of why dns.policy= isn't the way to go.  It's too
> generic.  If it's dmarc.policy=quarantine, there's no ambiguity.


"dmarc" is already found in the methodspec.  See below.


> You can't put quarantine as the DMARC result, because that's not what it is.
> The DMARC result is pass/fail/none. 


A tentative regex (assuming untrusted ones removed, and no deceptive comments) can be:

if (/^Authentication-Results:.*dmarc\s*=\s*fail[^;]*dmarc\.policy\s*=\s*quarantine/)
	to "./Maildir/.Junk";

You can see that spelling the ptype is redundant.  While it is important to report which published policy was applied, the choice of ptype boils down to a question of taste.  At any rate, the code exemplified above is still too complicate to beat a well crafted comment.  Consider:

Authentication-Results: example.com;
   dmarc=fail dmarc.policy=quarantine (dmarc=quarantine);

and

if (/^Authentication-Results:.*dmarc\s*=\s*quarantine/)
	to "./Maildir/.Junk";


Since you mentioned that conveying the outcome of the method in a comment is not cool, I proposed to convey it in the result.  I understand that the semantics of results aspired to be boolean, pass and non-pass.  The existing flavors of non-pass, none, temperror, permerror and fail, exist in order to suggest the appropriate action.  To quarantine is one appropriate action.


Best
Ale
--