[Extra] Sieve addheader

Ken Murchison <murch@fastmail.com> Wed, 08 April 2020 19:21 UTC

Return-Path: <murch@fastmail.com>
X-Original-To: extra@ietfa.amsl.com
Delivered-To: extra@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1E1303A15FD for <extra@ietfa.amsl.com>; Wed, 8 Apr 2020 12:21:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fastmail.com header.b=0NgiCt7f; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=NuHk/FD6
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 PzEh-52hmEbe for <extra@ietfa.amsl.com>; Wed, 8 Apr 2020 12:21:41 -0700 (PDT)
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E75C13A16E7 for <extra@ietf.org>; Wed, 8 Apr 2020 12:21:28 -0700 (PDT)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 03F745C02CC for <extra@ietf.org>; Wed, 8 Apr 2020 15:21:28 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 08 Apr 2020 15:21:28 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= to:from:subject:message-id:date:mime-version:content-type; s= fm2; bh=c69rrA61VfMf3WU2Ab/8rmjcP1T+aayCOmXyySvUyAE=; b=0NgiCt7f yX4VxztBxvYvSfF1VnW7t5Nff0J3PSFcaheXpk4CluBksOaqR+NVLHXPpNqYB6zl Lba7PTXJ2mZeDobGFaDT2LsjRqFJqkaHJBh2G2y/wgZ/9ZNaP1FfIs0SVKW4MIK4 lHOSmYaYSaNp8+aRQDq5ez7aVnM/fx7vXVFjHmpitSCB9eKwmu6oMvrLD3L6zs8X 1MRy099jIyKpKKBUz61mh4o/TkzLscDxKJ2wVD9iBXIIoExm1EO76Xt3Vq3d2md2 DvW3icMuJfflgNFycHTNOPJ8Dj02OCstB9/3kU7TJwaW3LCJ9xhVN2KBtM74h5W4 oTtUj/swlad/gQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=c69rrA61VfMf3WU2Ab/8rmjcP1T+a ayCOmXyySvUyAE=; b=NuHk/FD6DdnTw8cFEve5o0tIlkp0kn2fSqaThfWHWJtAy 6azz1PJn0jfwybPB9oiqJY89GBJ+FS9lHK1+1ZPfgJJuWEGyEubRRSeRy4OCvAFz HpI93XLue+yJsSwiPNN2k0SD9PliSY/Ktx0c3YGY2n9Nwip6YXsqpujuhN+I2o4o E1OiOKYxT2LmJeaEYG5Pl7tkJ9gVSgTQEWEQprbs7FAklqoDI/0XEX1/jGR9BdRW DhF8SLN8UTP1Uk+ZWvrQxyusvl0dPfzg5QAZqMRUAunHy2nCmXTL6nvUDjb4lGyJ YUK4uSnO+gr3deM4hw/nj7zyCpc98OxJXJ1J8cEyA==
X-ME-Sender: <xms:NySOXgjeeprbVC0OKmPHrlLtcb6JE2SP611SG790TtK_fw-c8Z07BQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudejgddufeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefvhffuohfkffgfgggtsegrtderre dtfeejnecuhfhrohhmpefmvghnucfouhhrtghhihhsohhnuceomhhurhgthhesfhgrshht mhgrihhlrdgtohhmqeenucfkphepjeegrdejjedrkeehrddvhedtnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhurhgthhesfhgrshhtmhgr ihhlrdgtohhm
X-ME-Proxy: <xmx:NySOXtCpvgvaUyNd1NmD7ika5azFxQceTXKQhFuzMfJ8cDKUFmzKkg> <xmx:NySOXotiLwyVT5TskxoqC2_YnlmxKrWSsw4FkumH-RtLyV3FKZPjoQ> <xmx:NySOXhIl3bk3FUoS0_jHhkIfIJWPGnsac62F2A9ryPnac2LBDv6TwA> <xmx:OCSOXrUhRYqaAsLDLQ_jEbiHgICUI3T0kv9p4OV5zYBcyIXWZ_Nlxg>
Received: from localhost.localdomain (cpe-74-77-85-250.buffalo.res.rr.com [74.77.85.250]) by mail.messagingengine.com (Postfix) with ESMTPA id B2F4D3060062 for <extra@ietf.org>; Wed, 8 Apr 2020 15:21:27 -0400 (EDT)
To: extra@ietf.org
From: Ken Murchison <murch@fastmail.com>
Organization: FastMail US LLC
Message-ID: <5934b654-b045-d630-e34e-d52dbe469e20@fastmail.com>
Date: Wed, 8 Apr 2020 15:21:27 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="------------220F297C7718ABA0E9DCBF85"
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/extra/R8qAOsKtGaHmMAAMCm46iFEfXgw>
Subject: [Extra] Sieve addheader
X-BeenThere: extra@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email mailstore and eXtensions To Revise or Amend <extra.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/extra>, <mailto:extra-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/extra/>
List-Post: <mailto:extra@ietf.org>
List-Help: <mailto:extra-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/extra>, <mailto:extra-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 08 Apr 2020 19:21:46 -0000

All,

Had an interesting Sieve failure recently.  A user had an addheader 
action similar to this:

addheader "X-Foo" text:
bar
.
;


My implementation simply (mistakenly?) took the value string as-is and 
appended CRLF when inserting it into the message.  This obviously breaks 
the message because

"The CRLF before the final period is considered part of the value."

per Section 2.4.2 of RFC 5228, which when followed by the CRLF that I 
add results in a blank line between the X-Foo header and any subsequent 
header.

My question is, should implementations strip any trailing CRLF from the 
header value, or reject the script as invalid because the header value 
(with the trailing CRLF) isn't a valid "unstructured" element per 
Section 4 of RFC 5293?

-- 
Ken Murchison
Cyrus Development Team
Fastmail US LLC