|
SA Bugzilla – Full Text Bug Listing |
Summary: | [review] update to support Mail::DomainKeys API change | ||
---|---|---|---|
Product: | Spamassassin | Reporter: | Chris <cpollock> |
Component: | Plugins | Assignee: | Justin Mason <jm> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dev, matthew.van.eerde, PoMec |
Priority: | P5 | ||
Version: | 3.1.0 | ||
Target Milestone: | 3.1.1 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: | ready | ||
Attachments: |
Patch for DomainKeys plugin
backwards-compatible fix |
Description
Chris
2005-10-09 11:10:02 UTC
Subject: Re: New: Domain Keys plugin not functioning correctly On Sun, Oct 09, 2005 at 11:10:02AM -0700, bugzilla-daemon@bugzilla.spamassassin.org wrote: > Can't locate object method "header" via package "Mail::DomainKeys::Message" at > This is with Mail::DomainKeys module V0.80 and SA 3.1 It looks like they changed the API a bit between 0.18 (when the plugin was written) and 0.80... <grrr> I have two Red Hat 8.0 systems that have the same bug Mail::DomainKeys module V0.80 and SA 3.1 with perl 5.8.0 are installed on each one. simply confirming the prob ... i've: SA cvs r321518 Mail::DomainKeys v0.80 perl v5.8.7 on OSX 10.4.2 with the same issue/symptoms "Can't locate object method ..." cheers, richard Created attachment 3210 [details]
Patch for DomainKeys plugin
This patch adds directly into the SA plugin code a simplified version of the
old Mail::DomainKeys::Message::header() method. This method seems to have been
removed while making Mail::DomainKeys compatible with draft 3 of the spec
(which deprecated the DomainKey-Status header).
This allows the plugin to work with Mail::DomainKeys 0.80 and above, though it
should be backward compatible with earlier versions. The patch is against the
SVN trunk, though it should apply OK to recent releases too.
just built up a new instance (r328930), applying Richard's patch from comment #4. testing with "-lint", i can confirm i no longer see the "Can't locate object method ..." error. thx richard. cheers, richard How do i apply the patch? If you have the gnu patch utility available or have a patch utility that acts the same, do the following. Save the patch to a file. Put the file into the base directory of the SpamAssassin distribution. Give the following command: patch -p0 < name_of_patch_file_here The other way is to edit the DomainKeys.pm file and make the changes by hand. +1 Has anyone confirmed that the patch is in fact backwards compatible? hmm, I suppose we do need backwards compat. It sounds like the module has gone through a large change, better to just enforce the use of the new API version In which case should there be a version check? unless ($Mail::DomainKeys::VERSION >= 0.8) { die("Mail::SpamAssassin::Plugin::DomainKeys requires Mail::DomainKeys version 0.8 or higher"); } The patch just puts code into DomainKeys.pm that is in the older versions of Mail::DomainKeys. For older versions of Mail::DomainKeys, running the code in DomainKeys.pm instead of in Mail::DomainKeys should not matter. On the other hand, it may be that old versions of Mail::DomainKeys are too broken to be usefull. Requiring a newer version may be good for that reason. 'It sounds like the module has gone through a large change, better to just enforce the use of the new API version' unless there were essential bugfixes, I'd prefer to just support both APIs. Created attachment 3312 [details]
backwards-compatible fix
here's a redo of that patch that uses the new API if it exists, but will fall
back to header() if it doesn't, to support the pre-0.80 case.
trunk: Committed revision 357663. +1 -- confirmed to work with both Mail::DomainKeys 0.23 and 0.80 I vote the biggest offender patches bugzilla to automatically add the previous bug owner to the CC: list when someone takes a bug. ;) +1 +1 |