On 2015-05-25 03:22:36 +0200, Vincent Lefevre wrote:
> One can do better. The code I used in the second test was:
> 
>     $header =~ /^\S+:/ || $header =~ /^From / or die;
>     $header =~ /\n[^:\s]+\s/ and die;
>     $header =~ /^Message-ID:.*^Message-ID:/ims and die;
>     $header =~ /^Message-ID:\s+(<\S+>)( \(added by .*\))?$/im or die;
> 
> where $header is the full header.

In this test, the second line should actually be changed to:

  $header =~ /\n(:|[^:\s]+\s)/ and die;

Otherwise one misses to detect some broken headers.

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to [email protected] 
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: https://lists.debian.org/[email protected]

Reply via email to