SA Bugzilla – Bug 5449
[review] allow_user_rules produces errors with active Rule2XSBody Plugin
Last modified: 2007-07-23 03:23:20 UTC
If Rule2XSBody Plugin is active and "allow_user_rules" is true spamd reports errors like... [10778] error: Can't locate Mail/SpamAssassin/CompiledRegexps/body_neg950.pm in @INC (@INC contains: ...) at (eval 931) line 1. ... for all of body_1000.pm body_500.pm body_900.pm body_neg1000.pm body_neg400.pm body_neg900.pm body_neg950.pm spamd starts without error and reports errors for every submission afterwards. In SpamAssassin.pm the function finish_parsing() is called if allow_user_rules is true. This way Mail::SpamAssassin::Plugin::Rule2XSBody::finish_parsing_end() get's called again. Since Logger.pm does $SIG{__DIE__} = sub { log_message("error", $_[0]) if $_[0] !~ /\bin eval\b/; }; the failing "eval" there get's logged. I don't know exactly if it's only a duplicate of big #5445 or if it's more complicated. So I'm filing a new bug.
Moving items off the 3.2.1 queue to 3.2.2 to facilitate a quick release. If you can get this in Review status right away feel free to move it back
Created attachment 4028 [details] fix This patch fixes it, I think -- please try it and confirm. It also fixes a number of other bugs with allow_user_rules, I think. Now, there's an architectural question here; basically, there are a number of bugs that require that finish_parsing() be called both after parsing the system-wide config *and* the user configs, instead of just after the user configs (which is what was previously done). There's a side effect in terms of the plugin API, though, which is that "finish_parsing_end" is now called multiple times too. I had to modify Rule2XSBody.pm to take this into account, for example. So, committers -- should we: 1. apply this patch and change the semantics of "finish_parsing_end" as noted above; 2. add a new plugin API "user_rules_parsing_end", and preserve the old "finish_parsing_end" semantics, or; 3. add a boolean flag to the "finish_parsing_end" API indicating if it's user-rules or system rules that have finished parsing?
*** Bug 5542 has been marked as a duplicate of this bug. ***
For me #1 is out, I've yet to decide between #2 or #3.
I think I'm leaning towards #2...
My vote is #2.
Yeah, #2 is good, #3 has the same consequences as #1 for anyone who doesn't check for a new flag.
Created attachment 4045 [details] redone fix here's a new patch that takes option #2, adding a new plugin API, "user_conf_parsing_end", which is now called after the user config file is read (allow_user_rules or not). I also added an implementation in the REplaceTags plugin, since it may need to be called in the user-rules case.
moving back to 3.2.2, in case we can get it reviewed in time. checked into trunk: : jm 182...; svn commit -m "bug 5449: allow_user_rules causes Rule2XSBody plugin to emit spurious warnings; fix. also, add a new 'user_conf_parsing_end' plugin hook, which is called after the per-user configuration is parsed" Sending lib/Mail/SpamAssassin/Conf/Parser.pm Sending lib/Mail/SpamAssassin/Conf.pm Sending lib/Mail/SpamAssassin/Plugin/Check.pm Sending lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm Sending lib/Mail/SpamAssassin/Plugin.pm Sending lib/Mail/SpamAssassin.pm Transmitting file data ...... Committed revision 555664.
+1
btw, if anyone wants to put out a 3.2.2, this can be deferred for 3.2.3 no problem...
sure, +1
thanks - applied to 3.2.2. Sending lib/Mail/SpamAssassin/Conf/Parser.pm Sending lib/Mail/SpamAssassin/Conf.pm Sending lib/Mail/SpamAssassin/Plugin/Check.pm Sending lib/Mail/SpamAssassin/Plugin/ReplaceTags.pm Sending lib/Mail/SpamAssassin/Plugin.pm Sending lib/Mail/SpamAssassin.pm Transmitting file data ...... Committed revision 558682.