SA Bugzilla – Bug 5786
[review] SpamAssassin 3.2.4 introduces nasty new warnings with Mail::DKIM 0.30
Last modified: 2009-09-27 17:40:13 UTC
These are SA 3.2.4 test results: t/spf.............................97/106 [27086] warn: Use of uninitialized value in substitution (s///) at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 338. [27086] warn: Use of uninitialized value in substitution (s///) at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 338. [27086] warn: Use of uninitialized value in string ne at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 339. t/spf.............................99/106 [27090] warn: Use of uninitialized value in substitution (s///) at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 338. [27090] warn: Use of uninitialized value in substitution (s///) at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 338. [27090] warn: Use of uninitialized value in string ne at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 339. t/spf.............................101/106 [27094] warn: Use of uninitialized value in substitution (s///) at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 338. [27094] warn: Use of uninitialized value in substitution (s///) at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 338. [27094] warn: Use of uninitialized value in string ne at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 339. t/spf.............................103/106 [27098] warn: Use of uninitialized value in substitution (s///) at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 338. [27098] warn: Use of uninitialized value in substitution (s///) at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 338. [27098] warn: Use of uninitialized value in string ne at ../blib/lib/Mail/SpamAssassin/Plugin/DKIM.pm line 339. t/spf.............................ok Ironically, this bug was introduced by Mark Martinec's Mail::DKIM 0.30-support patch, which failed to note the effects of this change to Mail::DKIM: 2007-11-14: Jason Long <jlong@messiah.edu> * lib/Mail/DKIM/Verifier.pm, Signer.pm: update documentation for message_sender() and message_originator() methods, which are now guaranteed to return an object * lib/Mail/DKIM/Common.pm (message_sender, message_originator): always return a Mail::Address object, even if the relevant headers were not found Patch attached.
Created attachment 4236 [details] Patch to fix breakage with Mail::DKIM 0.30 A trivial patch to cater for the verifier's message_originator method in Mail::DKIM 0.30 always returning an address which may be empty if there is no originator, rather than returning undef in that case.
> A trivial patch to cater for the verifier's message_originator method in > Mail::DKIM 0.30 always returning an address which may be empty if there is no > originator, rather than returning undef in that case. Thanks, applied to trunk: svn -m 'DKIM: avoid a "Use of uninitialized value" warning when a From header field is missing in a message, Bug 5786' ci Sending lib/Mail/SpamAssassin/Plugin/DKIM.pm Committed revision 612071. Messages without a From header field are rarely seen, so the warning does not occur often in practice. This leaves a question why the SPF test file t/data/nice/spf3-received-spf contains two empty lines in the middle of a header, pushing the last couple of header fields (along with a From) into a body. Same in 3.2.4 and in trunk.
Isn't it obvious? To find bugs like this one! Seriously, buggy MTAs, buggy milters, and buggy procmail recipes can all dump extra linefeeds into headers, and while SA can hardly operate perfectly with the headers truncated like that, it shouldn't give out uninitialized variable errors. (Agreed that this is an unlikely bug, though.)
Any plans for 3.2.5? Or why is this bug still open? ;)
I presume the plans are to apply this to 3.2.5 as well
> I presume the plans are to apply this to 3.2.5 as well Sure, can't hurt. Will there be a 3.2.5? > This leaves a question why the SPF test file t/data/nice/spf3-received-spf > contains two empty lines in the middle of a header, pushing the last > couple of header fields (along with a From) into a body. Same in 3.2.4 > and in trunk. Can I assume this is a bug and the test message should be fixed too? If so, I'll prepare a (trivial) combined patch to get both changes to 3.2.
> > This leaves a question why the SPF test file t/data/nice/spf3-received-spf > > contains two empty lines in the middle of a header, pushing the last > > couple of header fields (along with a From) into a body. Same in 3.2.4 > > and in trunk. > > Can I assume this is a bug and the test message should be fixed too? > If so, I'll prepare a (trivial) combined patch to get both changes to 3.2. Yes. I have no idea how those empty lines showed up in r487146.
(In reply to comment #6) > > I presume the plans are to apply this to 3.2.5 as well > > Sure, can't hurt. Will there be a 3.2.5? IMO, yes, we should do one -- bug 5769 at least is ugly enough. > > This leaves a question why the SPF test file t/data/nice/spf3-received-spf > > contains two empty lines in the middle of a header, pushing the last > > couple of header fields (along with a From) into a body. Same in 3.2.4 > > and in trunk. > > Can I assume this is a bug and the test message should be fixed too? > If so, I'll prepare a (trivial) combined patch to get both changes to 3.2. +1
Created attachment 4251 [details] fix for a missing From with DKIM, and a fix to a SPF test mail combined fix, trivial
+1
$ svn -m 'bug 5786: fix for missing From with DKIM; remove empty lines from SPF test mail header' ci Sending lib/Mail/SpamAssassin/Plugin/DKIM.pm Sending t/data/nice/spf3-received-spf Committed revision 619403.