SA Bugzilla – Bug 4218
PerMsgStatus $status->finish() not getting registered
Last modified: 2005-04-11 11:59:51 UTC
http://spamassassin.apache.org/full/3.0.x/dist/doc/Mail_SpamAssassin_PerMsgStatus.html says that $status->finish() should get called when the PerMsgStatus object is destroyed. However, the finish() function in my plug-in is not getting registered or called.
The plugin function name needs to be per_msg_finish().
doesn't work for me. perhaps there is a version comment that would be appropriate. perhaps the docs are wrong, and the bug needs to be changed. ?
Created attachment 2783 [details] fix argh, this looked easy and then wasn't ;) sure enough, there was a bug. Basically, a temporary PerMsgStatus object is created *very* early on -- in lib/Mail/SpamAssassin/Message/Metadata/Received -- before the plugin was loaded, resulting in the 'per_msg_finish' callbacks being cached without the plugin's method in the list. fix was to get that object created *once* in Mail::SpamAssassin -- not every time a message is parsed. (it's much more efficient this way anyway.) long-term fix would be to get some of the DNS-lookup code out of Dns.pm, since having it there means it unnecessarily relies on a PerMsgStatus object being in existence... which is really not necessary for lookups in the Received header parsing code. couple of other minor fixes: added some doco to Plugin::per_msg_finish() to note that only circular refs need to be cleaned up normally. and added a test to the test suite.
applied; r161011