https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6703

--- Comment #18 from Thomas Arend <tho...@arend-rhb.de> ---
Thanks to the hint to ArchiveIterator.pm I found two regex for checking the
From_ line in Mail::SpamAssassin::ArchiveIterator and replaced them with
following regex: (I am running Version 3.3.1)

/From \S+  ?(Mon|Tue|Wed|Thu|Fri|Sat|Sun)(, \d\d
(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:\d\d:\d\d
[+-]\d{4}| (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [ 1-3]\d [
0-2]\d:\d\d:\d\d \d{4})/ )

This replacement works fine for me and it is compatible with both mbox date
formats. My pattern checks the date stricter than the old pattern which may be
an advantage or an disadvantage.

diff (orig) (new)
399c399
<     last if (substr($_,0,5) eq "From " && @msg && /^From \S+  ?\S\S\S \S\S\S
.\d .\d:\d\d:\d\d \d{4}/);
---
>     last if (substr($_,0,5) eq "From " && @msg && /^From \S+  
> ?(Mon|Tue|Wed|Thu|Fri|Sat|Sun)(, \d\d 
> (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:\d\d:\d\d 
> [+-]\d{4}| (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [ 1-3]\d [ 
> 0-2]\d:\d\d:\d\d \d{4})/ );
912c912,913
<             /^From \S+  ?\S\S\S \S\S\S .\d .\d:\d\d:\d\d \d{4}/) {
---
>             /From \S+  ?(Mon|Tue|Wed|Thu|Fri|Sat|Sun)(, \d\d 
> (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} [0-2]\d:\d\d:\d\d 
> [+-]\d{4}| (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [ 1-3]\d [ 
> 0-2]\d:\d\d:\d\d \d{4})/ ) {

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to