You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Chris <cp...@embarqmail.com> on 2014/06/09 03:56:00 UTC

add_header all Date of Scan _DATE_

In my etc/mail/spamassassin/local.cf I have the above line. I just
upgraded to 3.4.0 today and I notice that the 'date of scan' is showing
something like this:

X-spam-date: of Scan Sat, 21 Feb 1976 13:57:28 -0500

Does this add header line not work anymore? Previous to the upgrade it
was working correctly:

X-spam-date: of Scan Sun, 08 Jun 2014 12:35:11 -0500

Thanks
Chris

-- 
Chris
KeyID 0xE372A7DA98E6705C
31.11°N 97.89°W (Elev. 1092 ft)
20:51:45 up 6 days, 5:21, 1 user, load average: 0.75, 0.89, 0.69
Mandriva Linux 2010.2, kernel 2.6.33.7-desktop586-2mnb


Re: add_header all Date of Scan _DATE_

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Mon, 2014-06-09 at 05:49 +0200, Karsten Bräckelmann wrote:
> Found the culprit after some digging. Bug 6915 [1], revision 1453407. As
> a band-aid, the following trivial one-line patch fixes it. Can easily be
> applied manually.
> 
> Since it is kind of way past "getting late" here, and there may be other
> Template Tags affected, I'll defer proper bug handling and committing
> code changes for tomorrow.

Bug 7050 [1]. Fixed in trunk, to be committed to 3.4 branch after RTC
mode review and voting.

While the quick fix I posted yesterday does work, it does so only
because all occurrences want the current time formatted. It will not
work in general for other dates than now (which SA does not use with
that function).

A proper M::SA::PerMsgStatus.pm fix can be found in bug 7050 comment 1,
linked to the svn revision.


[1] https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7050

-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}


Re: add_header all Date of Scan _DATE_

Posted by Chris <cp...@embarqmail.com>.
On Mon, 2014-06-09 at 05:49 +0200, Karsten Bräckelmann wrote:
> On Sun, 2014-06-08 at 20:56 -0500, Chris wrote:
> > In my etc/mail/spamassassin/local.cf I have the above line. I just
> 
> For completeness: That add_header option does work, although there are
> actually exactly 3 arguments.
> 
>   add_header { spam | ham | all } header_name string
> 
> Just like stock configuration shows, the string argument should be
> enclosed by double quotes.
> 
>   add_header all Date "of Scan _DATE_"
> 
> > upgraded to 3.4.0 today and I notice that the 'date of scan' is showing
> > something like this:
> 
> Sic, it's the (X-Spam-) Date header, not "Date of Scan" header. ;)
> 
> 
> > X-spam-date: of Scan Sat, 21 Feb 1976 13:57:28 -0500
> > 
> > Does this add header line not work anymore? Previous to the upgrade it
> > was working correctly:
> > 
> > X-spam-date: of Scan Sun, 08 Jun 2014 12:35:11 -0500
> 
> Interesting. Unrelated to the number of arguments, though...
> 
> Found the culprit after some digging. Bug 6915 [1], revision 1453407. As
> a band-aid, the following trivial one-line patch fixes it. Can easily be
> applied manually.
> 
> Since it is kind of way past "getting late" here, and there may be other
> Template Tags affected, I'll defer proper bug handling and committing
> code changes for tomorrow.
> 
> 
> --- lib/Mail/SpamAssassin/Util.pm       (revision 1601300)
> +++ lib/Mail/SpamAssassin/Util.pm       (working copy)
> @@ -582,6 +582,7 @@
>  }
>  
>  sub time_to_rfc822_date {
> +  my $pms = shift;
>    my($time) = @_;
>  
>    my @days = qw/Sun Mon Tue Wed Thu Fri Sat/;
> 
> 
> [1] https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6915
> 

Thanks Karsten, that did the trick. Much appreciated.

Chris

-- 
Chris
KeyID 0xE372A7DA98E6705C
31.11°N 97.89°W (Elev. 1092 ft)
08:31:32 up 6 days, 17:01, 2 users, load average: 0.28, 0.30, 0.26
Mandriva Linux 2010.2, kernel 2.6.33.7-desktop586-2mnb


Re: add_header all Date of Scan _DATE_

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Tue, 2014-06-10 at 02:03 +0200, Karsten Bräckelmann wrote:
> On Mon, 2014-06-09 at 09:23 +0200, Matus UHLAR - fantomas wrote:

> > can that by any chance fix problem with Date: in mail received by SSL ?
> > That one behaves similarly...
> > 
> > http://mail-archives.apache.org/mod_mbox/spamassassin-users/201401.mbox/<20140131144406.GA28818%40fantomas.sk>
> 
> No, these are unrelated. The code change mentioned above affects
> Templates Tags only.  [...]

Moreover, that sample shows SA 3.3.2. The bad Date Template Tag is
strictly 3.4 and trunk.

I've run the headers (after manually fixing that horribly mis-formatted
paste) through a 3.3 test environment and could not reproduce
DATE_IN_FUTURE rules firing. We will need a proper sample.

Since the check_for_shifted_date() eval works with the actual Date and
Received headers, I suspect the glue to result in that rule's misfiring.


-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}


Re: add_header all Date of Scan _DATE_

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Mon, 2014-06-09 at 09:23 +0200, Matus UHLAR - fantomas wrote:
> On 09.06.14 05:49, Karsten Bräckelmann wrote:
> > Found the culprit after some digging. Bug 6915 [1], revision 1453407. As
> > a band-aid, the following trivial one-line patch fixes it. Can easily be
> > applied manually.
> 
> can that by any chance fix problem with Date: in mail received by SSL ?
> That one behaves similarly...
> 
> http://mail-archives.apache.org/mod_mbox/spamassassin-users/201401.mbox/<20140131144406.GA28818%40fantomas.sk>

No, these are unrelated. The code change mentioned above affects
Templates Tags only.

And while a date-string related function is involved in this issue, the
underlying bug is calling that function with a bad argument. Besides,
all instances of calling that function are now correct.


-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}


Re: add_header all Date of Scan _DATE_

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 09.06.14 05:49, Karsten Bräckelmann wrote:
>Found the culprit after some digging. Bug 6915 [1], revision 1453407. As
>a band-aid, the following trivial one-line patch fixes it. Can easily be
>applied manually.

can that by any chance fix problem with Date: in mail received by SSL ?
That one behaves similarly...

http://mail-archives.apache.org/mod_mbox/spamassassin-users/201401.mbox/<20140131144406.GA28818%40fantomas.sk>

>Since it is kind of way past "getting late" here, and there may be other
>Template Tags affected, I'll defer proper bug handling and committing
>code changes for tomorrow.
>
>
>--- lib/Mail/SpamAssassin/Util.pm       (revision 1601300)
>+++ lib/Mail/SpamAssassin/Util.pm       (working copy)
>@@ -582,6 +582,7 @@
> }
>
> sub time_to_rfc822_date {
>+  my $pms = shift;
>   my($time) = @_;
>
>   my @days = qw/Sun Mon Tue Wed Thu Fri Sat/;

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Despite the cost of living, have you noticed how popular it remains? 

Re: add_header all Date of Scan _DATE_

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Sun, 2014-06-08 at 20:56 -0500, Chris wrote:
> In my etc/mail/spamassassin/local.cf I have the above line. I just

For completeness: That add_header option does work, although there are
actually exactly 3 arguments.

  add_header { spam | ham | all } header_name string

Just like stock configuration shows, the string argument should be
enclosed by double quotes.

  add_header all Date "of Scan _DATE_"

> upgraded to 3.4.0 today and I notice that the 'date of scan' is showing
> something like this:

Sic, it's the (X-Spam-) Date header, not "Date of Scan" header. ;)


> X-spam-date: of Scan Sat, 21 Feb 1976 13:57:28 -0500
> 
> Does this add header line not work anymore? Previous to the upgrade it
> was working correctly:
> 
> X-spam-date: of Scan Sun, 08 Jun 2014 12:35:11 -0500

Interesting. Unrelated to the number of arguments, though...

Found the culprit after some digging. Bug 6915 [1], revision 1453407. As
a band-aid, the following trivial one-line patch fixes it. Can easily be
applied manually.

Since it is kind of way past "getting late" here, and there may be other
Template Tags affected, I'll defer proper bug handling and committing
code changes for tomorrow.


--- lib/Mail/SpamAssassin/Util.pm       (revision 1601300)
+++ lib/Mail/SpamAssassin/Util.pm       (working copy)
@@ -582,6 +582,7 @@
 }
 
 sub time_to_rfc822_date {
+  my $pms = shift;
   my($time) = @_;
 
   my @days = qw/Sun Mon Tue Wed Thu Fri Sat/;


[1] https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6915

-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}