Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758004AbdCUSec (ORCPT ); Tue, 21 Mar 2017 14:34:32 -0400 Received: from smtprelay0072.hostedemail.com ([216.40.44.72]:57278 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757351AbdCUSeC (ORCPT ); Tue, 21 Mar 2017 14:34:02 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2895:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3871:3872:3874:4321:4605:5007:6119:7653:7903:8531:10004:10400:10848:11026:11232:11658:11783:11914:12043:12530:12740:12895:13069:13255:13311:13357:13439:13894:14659:14721:14777:21080:21433:30022:30026:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: beds98_a963eb53bd17 X-Filterd-Recvd-Size: 1907 Message-ID: <1490121068.2041.13.camel@perches.com> Subject: Re: [PATCH] checkpatch: Flag spam header (X-Spam-Report) to prevent spurious warnings From: Joe Perches To: "John 'Warthog9' Hawley (VMware)" , linux-kernel@vger.kernel.org Cc: Andy Whitcroft , "Darren Hart (VMware)" Date: Tue, 21 Mar 2017 11:31:08 -0700 In-Reply-To: <1490113805-9295-1-git-send-email-warthog9@eaglescrag.net> References: <1490113805-9295-1-git-send-email-warthog9@eaglescrag.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.3-0ubuntu0.1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 973 Lines: 33 On Tue, 2017-03-21 at 09:30 -0700, John 'Warthog9' Hawley (VMware) wrote: > Spamassassin sticks a long (~79 character) long string after a > line that has a single space in it. The line with space causes > checkpatch to erroniously think that it's in the content body, as > opposed to headers and thus flag a mail header as an unwrapped long > comment line. If the spammassassin header is like email-header-n: foo email-header-m: bar X-Spam-Report: bar Does that form follow rfc 5322? If it does then any email header could have that form and the header wrapping test should be updated from if ($in_header_lines && $realfile =~ /^$/ && ????!($rawline =~ /^\s+\S/ || ??????$rawline =~ /^(commit\b|from\b|[\w-]+:).*$/i)) { $in_header_lines = 0; $in_commit_log = 1; $has_commit_log = 1; } to something like if ($in_header_lines && $realfile =~ /^$/ && ????!($rawline =~ /^ (?:\s*\S|$)/ || $rawline =~ /^(commit\b|from\b|[\w-]+:).*$/i)) {