Filename | /usr/local/lib/perl5/site_perl/Mail/SpamAssassin/Plugin.pm |
Statements | Executed 1591 statements in 11.1ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
192 | 139 | 22 | 3.85ms | 6.32ms | register_eval_rule | Mail::SpamAssassin::Plugin::
501 | 1 | 1 | 3.12ms | 3.12ms | inhibit_further_callbacks | Mail::SpamAssassin::Plugin::
27 | 27 | 27 | 687µs | 687µs | new | Mail::SpamAssassin::Plugin::
1 | 1 | 1 | 33µs | 97µs | BEGIN@103 | Mail::SpamAssassin::Plugin::
1 | 1 | 1 | 28µs | 28µs | BEGIN@97 | Mail::SpamAssassin::Plugin::
1 | 1 | 1 | 26µs | 188µs | BEGIN@98 | Mail::SpamAssassin::Plugin::
1 | 1 | 1 | 25µs | 63µs | BEGIN@101 | Mail::SpamAssassin::Plugin::
1 | 1 | 1 | 23µs | 153µs | BEGIN@105 | Mail::SpamAssassin::Plugin::
1 | 1 | 1 | 22µs | 35µs | BEGIN@100 | Mail::SpamAssassin::Plugin::
1 | 1 | 1 | 22µs | 28µs | BEGIN@102 | Mail::SpamAssassin::Plugin::
0 | 0 | 0 | 0s | 0s | finish | Mail::SpamAssassin::Plugin::
0 | 0 | 0 | 0s | 0s | register_generated_rule_method | Mail::SpamAssassin::Plugin::
0 | 0 | 0 | 0s | 0s | register_method_priority | Mail::SpamAssassin::Plugin::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # <@LICENSE> | ||||
2 | # Licensed to the Apache Software Foundation (ASF) under one or more | ||||
3 | # contributor license agreements. See the NOTICE file distributed with | ||||
4 | # this work for additional information regarding copyright ownership. | ||||
5 | # The ASF licenses this file to you under the Apache License, Version 2.0 | ||||
6 | # (the "License"); you may not use this file except in compliance with | ||||
7 | # the License. You may obtain a copy of the License at: | ||||
8 | # | ||||
9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||||
10 | # | ||||
11 | # Unless required by applicable law or agreed to in writing, software | ||||
12 | # distributed under the License is distributed on an "AS IS" BASIS, | ||||
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
14 | # See the License for the specific language governing permissions and | ||||
15 | # limitations under the License. | ||||
16 | # </@LICENSE> | ||||
17 | |||||
18 | =head1 NAME | ||||
19 | |||||
20 | Mail::SpamAssassin::Plugin - SpamAssassin plugin base class | ||||
21 | |||||
22 | =head1 SYNOPSIS | ||||
23 | |||||
24 | =head2 SpamAssassin configuration: | ||||
25 | |||||
26 | loadplugin MyPlugin /path/to/myplugin.pm | ||||
27 | |||||
28 | =head2 Perl code: | ||||
29 | |||||
30 | package MyPlugin; | ||||
31 | |||||
32 | use Mail::SpamAssassin::Plugin; | ||||
33 | our @ISA = qw(Mail::SpamAssassin::Plugin); | ||||
34 | |||||
35 | sub new { | ||||
36 | my ($class, $mailsa) = @_; | ||||
37 | |||||
38 | # the usual perlobj boilerplate to create a subclass object | ||||
39 | $class = ref($class) || $class; | ||||
40 | my $self = $class->SUPER::new($mailsa); | ||||
41 | bless ($self, $class); | ||||
42 | |||||
43 | # then register an eval rule, if desired... | ||||
44 | $self->register_eval_rule ("check_for_foo"); | ||||
45 | |||||
46 | # and return the new plugin object | ||||
47 | return $self; | ||||
48 | } | ||||
49 | |||||
50 | ...methods... | ||||
51 | |||||
52 | 1; | ||||
53 | |||||
54 | =head1 DESCRIPTION | ||||
55 | |||||
56 | This is the base class for SpamAssassin plugins; all plugins must be objects | ||||
57 | that implement this class. | ||||
58 | |||||
59 | This class provides no-op stub methods for all the callbacks that a plugin | ||||
60 | can receive. It is expected that your plugin will override one or more | ||||
61 | of these stubs to perform its actions. | ||||
62 | |||||
63 | SpamAssassin implements a plugin chain; each callback event is passed to each | ||||
64 | of the registered plugin objects in turn. Any plugin can call | ||||
65 | C<$self-E<gt>inhibit_further_callbacks()> to block delivery of that event to | ||||
66 | later plugins in the chain. This is useful if the plugin has handled the | ||||
67 | event, and there will be no need for later plugins to handle it as well. | ||||
68 | |||||
69 | If you're looking to write a simple eval rule, skip straight to | ||||
70 | C<register_eval_rule()>, below. | ||||
71 | |||||
72 | =head1 INTERFACE | ||||
73 | |||||
74 | In all the plugin APIs below, C<options> refers to a reference to a hash | ||||
75 | containing name-value pairs. This is used to ensure future-compatibility, in | ||||
76 | that we can add new options in future without affecting objects built to an | ||||
77 | earlier version of the API. | ||||
78 | |||||
79 | For example, here would be how to print out the C<line> item in a | ||||
80 | C<parse_config()> method: | ||||
81 | |||||
82 | sub parse_config { | ||||
83 | my ($self, $opts) = @_; | ||||
84 | print "MyPlugin: parse_config got ".$opts->{line}."\n"; | ||||
85 | } | ||||
86 | |||||
87 | =head1 METHODS | ||||
88 | |||||
89 | The following methods can be overridden by subclasses to handle events. | ||||
90 | |||||
91 | =over 4 | ||||
92 | |||||
93 | =cut | ||||
94 | |||||
95 | package Mail::SpamAssassin::Plugin; | ||||
96 | |||||
97 | 2 | 72µs | 1 | 28µs | # spent 28µs within Mail::SpamAssassin::Plugin::BEGIN@97 which was called:
# once (28µs+0s) by Mail::SpamAssassin::PluginHandler::BEGIN@27 at line 97 # spent 28µs making 1 call to Mail::SpamAssassin::Plugin::BEGIN@97 |
98 | 2 | 61µs | 2 | 351µs | # spent 188µs (26+162) within Mail::SpamAssassin::Plugin::BEGIN@98 which was called:
# once (26µs+162µs) by Mail::SpamAssassin::PluginHandler::BEGIN@27 at line 98 # spent 188µs making 1 call to Mail::SpamAssassin::Plugin::BEGIN@98
# spent 162µs making 1 call to Exporter::import |
99 | |||||
100 | 2 | 72µs | 2 | 48µs | # spent 35µs (22+13) within Mail::SpamAssassin::Plugin::BEGIN@100 which was called:
# once (22µs+13µs) by Mail::SpamAssassin::PluginHandler::BEGIN@27 at line 100 # spent 35µs making 1 call to Mail::SpamAssassin::Plugin::BEGIN@100
# spent 13µs making 1 call to strict::import |
101 | 2 | 69µs | 2 | 101µs | # spent 63µs (25+38) within Mail::SpamAssassin::Plugin::BEGIN@101 which was called:
# once (25µs+38µs) by Mail::SpamAssassin::PluginHandler::BEGIN@27 at line 101 # spent 63µs making 1 call to Mail::SpamAssassin::Plugin::BEGIN@101
# spent 38µs making 1 call to warnings::import |
102 | 2 | 70µs | 2 | 35µs | # spent 28µs (22+7) within Mail::SpamAssassin::Plugin::BEGIN@102 which was called:
# once (22µs+7µs) by Mail::SpamAssassin::PluginHandler::BEGIN@27 at line 102 # spent 28µs making 1 call to Mail::SpamAssassin::Plugin::BEGIN@102
# spent 7µs making 1 call to bytes::import |
103 | 2 | 85µs | 2 | 161µs | # spent 97µs (33+64) within Mail::SpamAssassin::Plugin::BEGIN@103 which was called:
# once (33µs+64µs) by Mail::SpamAssassin::PluginHandler::BEGIN@27 at line 103 # spent 97µs making 1 call to Mail::SpamAssassin::Plugin::BEGIN@103
# spent 64µs making 1 call to re::import |
104 | |||||
105 | 1 | 2µs | # spent 153µs (23+130) within Mail::SpamAssassin::Plugin::BEGIN@105 which was called:
# once (23µs+130µs) by Mail::SpamAssassin::PluginHandler::BEGIN@27 at line 107 | ||
106 | @ISA $VERSION | ||||
107 | 1 | 1.76ms | 2 | 282µs | }; # spent 153µs making 1 call to Mail::SpamAssassin::Plugin::BEGIN@105
# spent 130µs making 1 call to vars::import |
108 | |||||
109 | 1 | 9µs | @ISA = qw(); | ||
110 | #Removed $VERSION per BUG 6422 | ||||
111 | #$VERSION = 'bogus'; | ||||
112 | |||||
113 | ########################################################################### | ||||
114 | |||||
115 | =item $plugin = MyPluginClass->new ($mailsaobject) | ||||
116 | |||||
117 | Constructor. Plugins that need to register themselves will need to | ||||
118 | define their own; the default super-class constructor will work fine | ||||
119 | for plugins that just override a method. | ||||
120 | |||||
121 | Note that subclasses must provide the C<$mailsaobject> to the | ||||
122 | superclass constructor, like so: | ||||
123 | |||||
124 | my $self = $class->SUPER::new($mailsaobject); | ||||
125 | |||||
126 | Lifecycle note: plugins that will need to store per-scan state should not store | ||||
127 | that on the Plugin object; instead this should be stored on the PerMsgStatus | ||||
128 | object, see C<check_start()> below. It is also likewise recommended that | ||||
129 | configuration settings be stored on the Conf object; see C<parse_config()>. | ||||
130 | |||||
131 | =cut | ||||
132 | |||||
133 | # spent 687µs within Mail::SpamAssassin::Plugin::new which was called 27 times, avg 25µs/call:
# once (42µs+0s) by Mail::SpamAssassin::Plugin::MIMEHeader::new at line 84 of Mail/SpamAssassin/Plugin/MIMEHeader.pm
# once (34µs+0s) by Mail::SpamAssassin::Plugin::BodyEval::new at line 39 of Mail/SpamAssassin/Plugin/BodyEval.pm
# once (31µs+0s) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 39 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (30µs+0s) by Mail::SpamAssassin::Plugin::ReplaceTags::new at line 68 of Mail/SpamAssassin/Plugin/ReplaceTags.pm
# once (29µs+0s) by Mail::SpamAssassin::Plugin::WhiteListSubject::new at line 61 of Mail/SpamAssassin/Plugin/WhiteListSubject.pm
# once (28µs+0s) by Mail::SpamAssassin::Plugin::ImageInfo::new at line 100 of Mail/SpamAssassin/Plugin/ImageInfo.pm
# once (28µs+0s) by Mail::SpamAssassin::Plugin::URIEval::new at line 38 of Mail/SpamAssassin/Plugin/URIEval.pm
# once (28µs+0s) by Mail::SpamAssassin::Plugin::VBounce::new at line 43 of Mail/SpamAssassin/Plugin/VBounce.pm
# once (28µs+0s) by Mail::SpamAssassin::Plugin::DKIM::new at line 140 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (27µs+0s) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 38 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (26µs+0s) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 41 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (26µs+0s) by Mail::SpamAssassin::Plugin::TxRep::new at line 223 of Mail/SpamAssassin/Plugin/TxRep.pm
# once (26µs+0s) by Mail::SpamAssassin::Plugin::URIDetail::new at line 88 of Mail/SpamAssassin/Plugin/URIDetail.pm
# once (25µs+0s) by Mail::SpamAssassin::Plugin::HTTPSMismatch::new at line 37 of Mail/SpamAssassin/Plugin/HTTPSMismatch.pm
# once (24µs+0s) by Mail::SpamAssassin::Plugin::SpamCop::new at line 63 of Mail/SpamAssassin/Plugin/SpamCop.pm
# once (24µs+0s) by Mail::SpamAssassin::Plugin::Check::new at line 41 of Mail/SpamAssassin/Plugin/Check.pm
# once (24µs+0s) by Mail::SpamAssassin::Plugin::URIDNSBL::new at line 316 of Mail/SpamAssassin/Plugin/URIDNSBL.pm
# once (23µs+0s) by Mail::SpamAssassin::Plugin::AskDNS::new at line 209 of Mail/SpamAssassin/Plugin/AskDNS.pm
# once (23µs+0s) by Mail::SpamAssassin::Plugin::FreeMail::new at line 151 of Mail/SpamAssassin/Plugin/FreeMail.pm
# once (22µs+0s) by Mail::SpamAssassin::Plugin::SPF::new at line 54 of Mail/SpamAssassin/Plugin/SPF.pm
# once (22µs+0s) by Mail::SpamAssassin::Plugin::Hashcash::new at line 117 of Mail/SpamAssassin/Plugin/Hashcash.pm
# once (21µs+0s) by Mail::SpamAssassin::Plugin::RelayEval::new at line 39 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (20µs+0s) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 41 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (20µs+0s) by Mail::SpamAssassin::Plugin::Bayes::new at line 236 of Mail/SpamAssassin/Plugin/Bayes.pm
# once (20µs+0s) by Mail::SpamAssassin::Plugin::Razor2::new at line 59 of Mail/SpamAssassin/Plugin/Razor2.pm
# once (18µs+0s) by Mail::SpamAssassin::Plugin::DNSEval::new at line 47 of Mail/SpamAssassin/Plugin/DNSEval.pm
# once (18µs+0s) by Mail::SpamAssassin::Plugin::AutoLearnThreshold::new at line 69 of Mail/SpamAssassin/Plugin/AutoLearnThreshold.pm | ||||
134 | 27 | 57µs | my $class = shift; | ||
135 | 27 | 57µs | my $mailsaobject = shift; | ||
136 | 27 | 50µs | $class = ref($class) || $class; | ||
137 | |||||
138 | 27 | 69µs | if (!defined $mailsaobject) { | ||
139 | die "plugin: usage: Mail::SpamAssassin::Plugin::new(class,mailsaobject)"; | ||||
140 | } | ||||
141 | |||||
142 | 27 | 223µs | my $self = { | ||
143 | main => $mailsaobject, | ||||
144 | _inhibit_further_callbacks => 0 | ||||
145 | }; | ||||
146 | 27 | 71µs | bless ($self, $class); | ||
147 | 27 | 422µs | $self; | ||
148 | } | ||||
149 | |||||
150 | # --------------------------------------------------------------------------- | ||||
151 | # now list the supported methods we will call into. NOTE: we don't have | ||||
152 | # to implement them here, since the plugin can use "can()" to introspect | ||||
153 | # the object and determine if it's capable of calling the method anyway. | ||||
154 | # Nifty! | ||||
155 | |||||
156 | =item $plugin->parse_config ( { options ... } ) | ||||
157 | |||||
158 | Parse a configuration line that hasn't already been handled. C<options> | ||||
159 | is a reference to a hash containing these options: | ||||
160 | |||||
161 | =over 4 | ||||
162 | |||||
163 | =item line | ||||
164 | |||||
165 | The line of configuration text to parse. This has leading and trailing | ||||
166 | whitespace, and comments, removed. | ||||
167 | |||||
168 | =item key | ||||
169 | |||||
170 | The configuration key; ie. the first "word" on the line. | ||||
171 | |||||
172 | =item value | ||||
173 | |||||
174 | The configuration value; everything after the first "word" and | ||||
175 | any whitespace after that. | ||||
176 | |||||
177 | =item conf | ||||
178 | |||||
179 | The C<Mail::SpamAssassin::Conf> object on which the configuration | ||||
180 | data should be stored. | ||||
181 | |||||
182 | =item user_config | ||||
183 | |||||
184 | A boolean: C<1> if reading a user's configuration, C<0> if reading the | ||||
185 | system-wide configuration files. | ||||
186 | |||||
187 | =back | ||||
188 | |||||
189 | If the configuration line was a setting that is handled by this plugin, the | ||||
190 | method implementation should call C<$self-E<gt>inhibit_further_callbacks()>. | ||||
191 | |||||
192 | If the setting is not handled by this plugin, the method should return C<0> so | ||||
193 | that a later plugin may handle it, or so that SpamAssassin can output a warning | ||||
194 | message to the user if no plugin understands it. | ||||
195 | |||||
196 | Lifecycle note: it is suggested that configuration be stored on the | ||||
197 | C<Mail::SpamAssassin::Conf> object in use, instead of the plugin object itself. | ||||
198 | That can be found as C<$plugin-E<gt>{main}-E<gt>{conf}>, or as "conf" in the | ||||
199 | C<$options> hash reference above. By storing it on C<conf>, this allows | ||||
200 | per-user and system-wide configuration precedence to be dealt with correctly. | ||||
201 | |||||
202 | =item $plugin->finish_parsing_start ( { options ... } ) | ||||
203 | |||||
204 | Signals that the system-wide configuration has been completely read, | ||||
205 | but internal data structures are not yet created. It is possible to | ||||
206 | use this hook to dynamically change the configuration already read in | ||||
207 | or add new config options. | ||||
208 | |||||
209 | C<options> is a reference to a hash containing these options: | ||||
210 | |||||
211 | =over 4 | ||||
212 | |||||
213 | =item conf | ||||
214 | |||||
215 | The C<Mail::SpamAssassin::Conf> object on which the configuration | ||||
216 | data should be stored. | ||||
217 | |||||
218 | =back | ||||
219 | |||||
220 | Note: there are no guarantees that the internal data structures of | ||||
221 | SpamAssassin will not change from release to release. In particular to | ||||
222 | this plugin hook, if you modify the rules data structures in a | ||||
223 | third-party plugin, all bets are off until such time that an API is | ||||
224 | present for modifying that configuration data. | ||||
225 | |||||
226 | =item $plugin->finish_parsing_end ( { options ... } ) | ||||
227 | |||||
228 | Signals that the system-wide configuration parsing has just finished, and | ||||
229 | SpamAssassin is nearly ready to check messages. | ||||
230 | |||||
231 | C<options> is a reference to a hash containing these options: | ||||
232 | |||||
233 | =over 4 | ||||
234 | |||||
235 | =item conf | ||||
236 | |||||
237 | The C<Mail::SpamAssassin::Conf> object on which the configuration | ||||
238 | data should be stored. | ||||
239 | |||||
240 | =back | ||||
241 | |||||
242 | Note: there are no guarantees that the internal data structures of | ||||
243 | SpamAssassin will not change from release to release. In particular to | ||||
244 | this plugin hook, if you modify the rules data structures in a | ||||
245 | third-party plugin, all bets are off until such time that an API is | ||||
246 | present for modifying that configuration data. | ||||
247 | |||||
248 | =item $plugin->user_conf_parsing_start ( { options ... } ) | ||||
249 | |||||
250 | Signals that the per-user configuration has been completely read, but | ||||
251 | not converted to internal data structures. It is possible to use this | ||||
252 | hook to dynamically change the configuration already read in or add | ||||
253 | new config options. | ||||
254 | |||||
255 | If C<allow_user_rules> is enabled in the configuration, it is possible | ||||
256 | that additional rules have been added since the C<finish_parsing_start> | ||||
257 | plugin hook invocation was called. | ||||
258 | |||||
259 | =over 4 | ||||
260 | |||||
261 | =item conf | ||||
262 | |||||
263 | The C<Mail::SpamAssassin::Conf> object on which the configuration | ||||
264 | data should be stored. | ||||
265 | |||||
266 | =back | ||||
267 | |||||
268 | Note: there are no guarantees that the internal data structures of | ||||
269 | SpamAssassin will not change from release to release. In particular to | ||||
270 | this plugin hook, if you modify the rules data structures in a | ||||
271 | third-party plugin, all bets are off until such time that an API is | ||||
272 | present for modifying that configuration data. | ||||
273 | |||||
274 | =item $plugin->user_conf_parsing_end ( { options ... } ) | ||||
275 | |||||
276 | Signals that the per-user configuration parsing has just finished, and | ||||
277 | SpamAssassin is nearly ready to check messages. If C<allow_user_rules> is | ||||
278 | enabled in the configuration, it is possible that additional rules have been | ||||
279 | added since the C<finish_parsing_end> plugin hook invocation was called. | ||||
280 | |||||
281 | C<options> is a reference to a hash containing these options: | ||||
282 | |||||
283 | =over 4 | ||||
284 | |||||
285 | =item conf | ||||
286 | |||||
287 | The C<Mail::SpamAssassin::Conf> object on which the configuration | ||||
288 | data should be stored. | ||||
289 | |||||
290 | =back | ||||
291 | |||||
292 | Note: there are no guarantees that the internal data structures of | ||||
293 | SpamAssassin will not change from release to release. In particular to | ||||
294 | this plugin hook, if you modify the rules data structures in a | ||||
295 | third-party plugin, all bets are off until such time that an API is | ||||
296 | present for modifying that configuration data. | ||||
297 | |||||
298 | =item $plugin->signal_user_changed ( { options ... } ) | ||||
299 | |||||
300 | Signals that the current user has changed for a new one. | ||||
301 | |||||
302 | =over 4 | ||||
303 | |||||
304 | =item username | ||||
305 | |||||
306 | The new user's username. | ||||
307 | |||||
308 | =item user_dir | ||||
309 | |||||
310 | The new user's home directory. (equivalent to C<~>.) | ||||
311 | |||||
312 | =item userstate_dir | ||||
313 | |||||
314 | The new user's storage directory. (equivalent to C<~/.spamassassin>.) | ||||
315 | |||||
316 | =back | ||||
317 | |||||
318 | =item $plugin->services_authorized_for_username ( { options ... } ) | ||||
319 | |||||
320 | Validates that a given username is authorized to use certain services. | ||||
321 | |||||
322 | In order to authorize a user, the plugin should first check that it can | ||||
323 | handle any of the services passed into the method and then set the value | ||||
324 | for each allowed service to true (or any non-negative value). | ||||
325 | |||||
326 | The current supported services are: bayessql | ||||
327 | |||||
328 | =over 4 | ||||
329 | |||||
330 | =item username | ||||
331 | |||||
332 | A username | ||||
333 | |||||
334 | =item services | ||||
335 | |||||
336 | Reference to a hash containing the services you want to check. | ||||
337 | |||||
338 | { | ||||
339 | |||||
340 | 'bayessql' => 0 | ||||
341 | |||||
342 | } | ||||
343 | |||||
344 | =item conf | ||||
345 | |||||
346 | The C<Mail::SpamAssassin::Conf> object on which the configuration | ||||
347 | data should be stored. | ||||
348 | |||||
349 | =back | ||||
350 | |||||
351 | =item $plugin->compile_now_start ( { options ... } ) | ||||
352 | |||||
353 | This is called at the beginning of Mail::SpamAssassin::compile_now() so | ||||
354 | plugins can do any necessary initialization for multi-process | ||||
355 | SpamAssassin (such as spamd or mass-check -j). | ||||
356 | |||||
357 | =over 4 | ||||
358 | |||||
359 | =item use_user_prefs | ||||
360 | |||||
361 | The value of $use_user_prefs option in compile_now(). | ||||
362 | |||||
363 | =item keep_userstate | ||||
364 | |||||
365 | The value of $keep_userstate option in compile_now(). | ||||
366 | |||||
367 | =back | ||||
368 | |||||
369 | =item $plugin->compile_now_finish ( { options ... } ) | ||||
370 | |||||
371 | This is called at the end of Mail::SpamAssassin::compile_now() so | ||||
372 | plugins can do any necessary initialization for multi-process | ||||
373 | SpamAssassin (such as spamd or mass-check -j). | ||||
374 | |||||
375 | =over 4 | ||||
376 | |||||
377 | =item use_user_prefs | ||||
378 | |||||
379 | The value of $use_user_prefs option in compile_now(). | ||||
380 | |||||
381 | =item keep_userstate | ||||
382 | |||||
383 | The value of $keep_userstate option in compile_now(). | ||||
384 | |||||
385 | =back | ||||
386 | |||||
387 | =item $plugin->check_start ( { options ... } ) | ||||
388 | |||||
389 | Signals that a message check operation is starting. | ||||
390 | |||||
391 | =over 4 | ||||
392 | |||||
393 | =item permsgstatus | ||||
394 | |||||
395 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
396 | |||||
397 | Lifecycle note: it is recommended that rules that need to track test state on a | ||||
398 | per-scan basis should store that state on this object, not on the plugin object | ||||
399 | itself, since the plugin object will be shared between all active scanners. | ||||
400 | |||||
401 | The message being scanned is accessible through the | ||||
402 | C<$permsgstatus-E<gt>get_message()> API; there are a number of other public | ||||
403 | APIs on that object, too. See C<Mail::SpamAssassin::PerMsgStatus> perldoc. | ||||
404 | |||||
405 | =back | ||||
406 | |||||
407 | =item $plugin->check_main ( { options ... } ) | ||||
408 | |||||
409 | Signals that a message should be checked. Note that implementations of | ||||
410 | this hook should return C<1>. | ||||
411 | |||||
412 | =over 4 | ||||
413 | |||||
414 | =item permsgstatus | ||||
415 | |||||
416 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
417 | |||||
418 | =back | ||||
419 | |||||
420 | =item $plugin->check_tick ( { options ... } ) | ||||
421 | |||||
422 | Called periodically during a message check operation. A callback set for | ||||
423 | this method is a good place to run through an event loop dealing with | ||||
424 | network events triggered in a C<parse_metadata> method, for example. | ||||
425 | |||||
426 | =over 4 | ||||
427 | |||||
428 | =item permsgstatus | ||||
429 | |||||
430 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
431 | |||||
432 | =back | ||||
433 | |||||
434 | =item $plugin->check_post_dnsbl ( { options ... } ) | ||||
435 | |||||
436 | Called after the DNSBL results have been harvested. This is a good | ||||
437 | place to harvest your own asynchronously-started network lookups. | ||||
438 | |||||
439 | =over 4 | ||||
440 | |||||
441 | =item permsgstatus | ||||
442 | |||||
443 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
444 | |||||
445 | =back | ||||
446 | |||||
447 | =item $plugin->check_post_learn ( { options ... } ) | ||||
448 | |||||
449 | Called after auto-learning may (or may not) have taken place. If you | ||||
450 | wish to perform additional learning, whether or not auto-learning | ||||
451 | happens, this is the place to do it. | ||||
452 | |||||
453 | =over 4 | ||||
454 | |||||
455 | =item permsgstatus | ||||
456 | |||||
457 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
458 | |||||
459 | =back | ||||
460 | |||||
461 | =item $plugin->check_end ( { options ... } ) | ||||
462 | |||||
463 | Signals that a message check operation has just finished, and the | ||||
464 | results are about to be returned to the caller. | ||||
465 | |||||
466 | =over 4 | ||||
467 | |||||
468 | =item permsgstatus | ||||
469 | |||||
470 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
471 | The current score, names of rules that hit, etc. can be retrieved | ||||
472 | using the public APIs on this object. | ||||
473 | |||||
474 | =back | ||||
475 | |||||
476 | =item $plugin->finish_tests ( { options ... } ) | ||||
477 | |||||
478 | Called via C<Mail::SpamAssassin::finish>. This should clear up any tests that | ||||
479 | a plugin has added to the namespace. | ||||
480 | |||||
481 | In certain circumstances, plugins may find it useful to compile | ||||
482 | perl functions from the ruleset, on the fly. It is important to | ||||
483 | remove these once the C<Mail::SpamAssassin> object is deleted, | ||||
484 | however, and this API allows this. | ||||
485 | |||||
486 | Each plugin is responsible for its own generated perl functions. | ||||
487 | |||||
488 | =over 4 | ||||
489 | |||||
490 | =item conf | ||||
491 | |||||
492 | The C<Mail::SpamAssassin::Conf> object on which the configuration | ||||
493 | data should be stored. | ||||
494 | |||||
495 | =back | ||||
496 | |||||
497 | See also the C<register_generated_rule_method> helper API, below. | ||||
498 | |||||
499 | =item $plugin->extract_metadata ( { options ... } ) | ||||
500 | |||||
501 | Signals that a message is being mined for metadata. Some plugins may wish | ||||
502 | to add their own metadata as well. | ||||
503 | |||||
504 | =over 4 | ||||
505 | |||||
506 | =item msg | ||||
507 | |||||
508 | The C<Mail::SpamAssassin::Message> object for this message. | ||||
509 | |||||
510 | =item permsgstatus | ||||
511 | |||||
512 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
513 | |||||
514 | =back | ||||
515 | |||||
516 | =item $plugin->parsed_metadata ( { options ... } ) | ||||
517 | |||||
518 | Signals that a message's metadata has been parsed, and can now be | ||||
519 | accessed by the plugin. | ||||
520 | |||||
521 | =over 4 | ||||
522 | |||||
523 | =item permsgstatus | ||||
524 | |||||
525 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
526 | |||||
527 | =back | ||||
528 | |||||
529 | =item $plugin->start_rules ( { options ... } ) | ||||
530 | |||||
531 | Called before testing a set of rules of a given type and priority. | ||||
532 | |||||
533 | =over 4 | ||||
534 | |||||
535 | =item permsgstatus | ||||
536 | |||||
537 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
538 | |||||
539 | =item ruletype | ||||
540 | |||||
541 | The type of the rules about to be performed. | ||||
542 | |||||
543 | =item priority | ||||
544 | |||||
545 | The priority level of the rules about to be performed. | ||||
546 | |||||
547 | =back | ||||
548 | |||||
549 | =item $plugin->hit_rule ( { options ... } ) | ||||
550 | |||||
551 | Called when a rule fires. | ||||
552 | |||||
553 | =over 4 | ||||
554 | |||||
555 | =item permsgstatus | ||||
556 | |||||
557 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
558 | |||||
559 | =item ruletype | ||||
560 | |||||
561 | The type of the rule that fired. | ||||
562 | |||||
563 | =item rulename | ||||
564 | |||||
565 | The name of the rule that fired. | ||||
566 | |||||
567 | =item score | ||||
568 | |||||
569 | The rule's score in the active scoreset. | ||||
570 | |||||
571 | =back | ||||
572 | |||||
573 | =item $plugin->ran_rule ( { options ... } ) | ||||
574 | |||||
575 | Called after a rule has been tested, whether or not it fired. When the | ||||
576 | rule fires, the hit_rule callback is always called before this. | ||||
577 | |||||
578 | =over 4 | ||||
579 | |||||
580 | =item permsgstatus | ||||
581 | |||||
582 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
583 | |||||
584 | =item ruletype | ||||
585 | |||||
586 | The type of the rule that was tested. | ||||
587 | |||||
588 | =item rulename | ||||
589 | |||||
590 | The name of the rule that was tested. | ||||
591 | |||||
592 | =back | ||||
593 | |||||
594 | =item $plugin->autolearn_discriminator ( { options ... } ) | ||||
595 | |||||
596 | Control whether a just-scanned message should be learned as either | ||||
597 | spam or ham. This method should return one of C<1> to learn | ||||
598 | the message as spam, C<0> to learn as ham, or C<undef> to not | ||||
599 | learn from the message at all. | ||||
600 | |||||
601 | =over 4 | ||||
602 | |||||
603 | =item permsgstatus | ||||
604 | |||||
605 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
606 | |||||
607 | =back | ||||
608 | |||||
609 | =item $plugin->autolearn ( { options ... } ) | ||||
610 | |||||
611 | Signals that a message is about to be auto-learned as either ham or spam. | ||||
612 | |||||
613 | =over 4 | ||||
614 | |||||
615 | =item permsgstatus | ||||
616 | |||||
617 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
618 | |||||
619 | =item isspam | ||||
620 | |||||
621 | C<1> if the message is spam, C<0> if ham. | ||||
622 | |||||
623 | =back | ||||
624 | |||||
625 | =item $plugin->per_msg_finish ( { options ... } ) | ||||
626 | |||||
627 | Signals that a C<Mail::SpamAssassin::PerMsgStatus> object is being | ||||
628 | destroyed, and any per-scan context held on that object by this | ||||
629 | plugin should be destroyed as well. | ||||
630 | |||||
631 | Normally, any member variables on the C<PerMsgStatus> object will be cleaned up | ||||
632 | automatically -- but if your plugin has made a circular reference on that | ||||
633 | object, this is the place to break them so that garbage collection can operate | ||||
634 | correctly. | ||||
635 | |||||
636 | =over 4 | ||||
637 | |||||
638 | =item permsgstatus | ||||
639 | |||||
640 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
641 | |||||
642 | =back | ||||
643 | |||||
644 | |||||
645 | =item $plugin->have_shortcircuited ( { options ... } ) | ||||
646 | |||||
647 | Has the current scan operation 'short-circuited'? In other words, can | ||||
648 | further scanning be skipped, since the message is already definitively | ||||
649 | classified as either spam or ham? | ||||
650 | |||||
651 | Plugins should return C<0> to indicate that scanning should continue, | ||||
652 | or C<1> to indicate that short-circuiting has taken effect. | ||||
653 | |||||
654 | =over 4 | ||||
655 | |||||
656 | =item permsgstatus | ||||
657 | |||||
658 | The C<Mail::SpamAssassin::PerMsgStatus> context object for this scan. | ||||
659 | |||||
660 | =back | ||||
661 | |||||
662 | =item $plugin->bayes_learn ( { options ... } ) | ||||
663 | |||||
664 | Called at the end of a bayes learn operation. | ||||
665 | |||||
666 | This phase is the best place to map the raw (original) token value | ||||
667 | to the SHA1 hashed value. | ||||
668 | |||||
669 | =over 4 | ||||
670 | |||||
671 | =item toksref | ||||
672 | |||||
673 | Reference to hash returned by call to tokenize. The hash takes the | ||||
674 | format of: | ||||
675 | |||||
676 | { | ||||
677 | 'SHA1 Hash Value' => 'raw (original) value', | ||||
678 | ... | ||||
679 | } | ||||
680 | |||||
681 | NOTE: This data structure has changed since it was originally introduced | ||||
682 | in version 3.0.0. The values are no longer perl anonymous hashes, they | ||||
683 | are a single string containing the raw token value. You can test for | ||||
684 | backward compatibility by checking to see if the value for a key is a | ||||
685 | reference to a perl HASH, for instance: | ||||
686 | |||||
687 | if (ref($toksref->{$sometokenkey}) eq 'HASH') {... | ||||
688 | |||||
689 | If it is, then you are using the old interface, otherwise you are using | ||||
690 | the current interface. | ||||
691 | |||||
692 | =item isspam | ||||
693 | |||||
694 | Boolean value stating what flavor of message the tokens represent, if | ||||
695 | true then message was specified as spam, false is nonspam. Note, when | ||||
696 | function is scan then isspam value is not valid. | ||||
697 | |||||
698 | =item msgid | ||||
699 | |||||
700 | Generated message id of the message just learned. | ||||
701 | |||||
702 | =item msgatime | ||||
703 | |||||
704 | Received date of the current message or current time if received date | ||||
705 | could not be determined. In addition, if the receive date is more than | ||||
706 | 24 hrs into the future it will be reset to current datetime. | ||||
707 | |||||
708 | =back | ||||
709 | |||||
710 | =item $plugin->bayes_forget ( { options ... } ) | ||||
711 | |||||
712 | Called at the end of a bayes forget operation. | ||||
713 | |||||
714 | =over 4 | ||||
715 | |||||
716 | =item toksref | ||||
717 | |||||
718 | Reference to hash returned by call to tokenize. See bayes_learn | ||||
719 | documentation for additional information on the format. | ||||
720 | |||||
721 | =item isspam | ||||
722 | |||||
723 | Boolean value stating what flavor of message the tokens represent, if | ||||
724 | true then message was specified as spam, false is nonspam. Note, when | ||||
725 | function is scan then isspam value is not valid. | ||||
726 | |||||
727 | =item msgid | ||||
728 | |||||
729 | Generated message id of the message just forgotten. | ||||
730 | |||||
731 | =back | ||||
732 | |||||
733 | =item $plugin->bayes_scan ( { options ... } ) | ||||
734 | |||||
735 | Called at the end of a bayes scan operation. NOTE: Will not be | ||||
736 | called in case of error or if the message is otherwise skipped. | ||||
737 | |||||
738 | =over 4 | ||||
739 | |||||
740 | =item toksref | ||||
741 | |||||
742 | Reference to hash returned by call to tokenize. See bayes_learn | ||||
743 | documentation for additional information on the format. | ||||
744 | |||||
745 | =item probsref | ||||
746 | |||||
747 | Reference to hash of calculated probabilities for tokens found in | ||||
748 | the database. | ||||
749 | |||||
750 | { | ||||
751 | 'SHA1 Hash Value' => { | ||||
752 | 'prob' => 'calculated probability', | ||||
753 | 'spam_count' => 'Total number of spam msgs w/ token', | ||||
754 | 'ham_count' => 'Total number of ham msgs w/ token', | ||||
755 | 'atime' => 'Atime value for token in database' | ||||
756 | } | ||||
757 | } | ||||
758 | |||||
759 | =item score | ||||
760 | |||||
761 | Score calculated for this particular message. | ||||
762 | |||||
763 | =item msgatime | ||||
764 | |||||
765 | Calculated atime of the message just learned, note it may have been adjusted | ||||
766 | if it was determined to be too far into the future. | ||||
767 | |||||
768 | =item significant_tokens | ||||
769 | |||||
770 | Array ref of the tokens found to be significant in determining the score for | ||||
771 | this message. | ||||
772 | |||||
773 | =back | ||||
774 | |||||
775 | =item $plugin->plugin_report ( { options ... } ) | ||||
776 | |||||
777 | Called if the message is to be reported as spam. If the reporting system is | ||||
778 | available, the variable C<$options-E<gt>{report}-E<gt>report_available}> should | ||||
779 | be set to C<1>; if the reporting system successfully reported the message, the | ||||
780 | variable C<$options-E<gt>{report}-E<gt>report_return}> should be set to C<1>. | ||||
781 | |||||
782 | =over 4 | ||||
783 | |||||
784 | =item report | ||||
785 | |||||
786 | Reference to the Reporter object (C<$options-E<gt>{report}> in the | ||||
787 | paragraph above.) | ||||
788 | |||||
789 | =item text | ||||
790 | |||||
791 | Reference to a markup removed copy of the message in scalar string format. | ||||
792 | |||||
793 | =item msg | ||||
794 | |||||
795 | Reference to the original message object. | ||||
796 | |||||
797 | =back | ||||
798 | |||||
799 | =item $plugin->plugin_revoke ( { options ... } ) | ||||
800 | |||||
801 | Called if the message is to be reported as ham (revokes a spam report). If the | ||||
802 | reporting system is available, the variable | ||||
803 | C<$options-E<gt>{revoke}-E<gt>revoke_available}> should be set to C<1>; if the | ||||
804 | reporting system successfully revoked the message, the variable | ||||
805 | C<$options-E<gt>{revoke}-E<gt>revoke_return}> should be set to C<1>. | ||||
806 | |||||
807 | =over 4 | ||||
808 | |||||
809 | =item revoke | ||||
810 | |||||
811 | Reference to the Reporter object (C<$options-E<gt>{revoke}> in the | ||||
812 | paragraph above.) | ||||
813 | |||||
814 | =item text | ||||
815 | |||||
816 | Reference to a markup removed copy of the message in scalar string format. | ||||
817 | |||||
818 | =item msg | ||||
819 | |||||
820 | Reference to the original message object. | ||||
821 | |||||
822 | =back | ||||
823 | |||||
824 | =item $plugin->whitelist_address( { options ... } ) | ||||
825 | |||||
826 | Called when a request is made to add an address to a | ||||
827 | persistent address list. | ||||
828 | |||||
829 | =over 4 | ||||
830 | |||||
831 | =item address | ||||
832 | |||||
833 | Address you wish to add. | ||||
834 | |||||
835 | =item cli_p | ||||
836 | |||||
837 | Indicate if the call is being made from a command line interface. | ||||
838 | |||||
839 | =back | ||||
840 | |||||
841 | =item $plugin->blacklist_address( { options ... } ) | ||||
842 | |||||
843 | Called when a request is made to add an address to a | ||||
844 | persistent address list. | ||||
845 | |||||
846 | =over 4 | ||||
847 | |||||
848 | =item address | ||||
849 | |||||
850 | Address you wish to add. | ||||
851 | |||||
852 | =item cli_p | ||||
853 | |||||
854 | Indicate if the call is being made from a command line interface. | ||||
855 | |||||
856 | =back | ||||
857 | |||||
858 | =item $plugin->remove_address( { options ... } ) | ||||
859 | |||||
860 | Called when a request is made to remove an address to a | ||||
861 | persistent address list. | ||||
862 | |||||
863 | =over 4 | ||||
864 | |||||
865 | =item address | ||||
866 | |||||
867 | Address you wish to remove. | ||||
868 | |||||
869 | =item cli_p | ||||
870 | |||||
871 | Indicate if the call is being made from a command line interface. | ||||
872 | |||||
873 | =back | ||||
874 | |||||
875 | =item $plugin->spamd_child_init () | ||||
876 | |||||
877 | Called in each new child process when it starts up under spamd. | ||||
878 | |||||
879 | =item $plugin->log_scan_result ( { options ... } ) | ||||
880 | |||||
881 | Called when spamd has completed scanning a message. Currently, | ||||
882 | only spamd calls this API. | ||||
883 | |||||
884 | =over 4 | ||||
885 | |||||
886 | =item result | ||||
887 | |||||
888 | The C<'result: ...'> line for this scan. Format is as described | ||||
889 | at B<http://wiki.apache.org/spamassassin/SpamdSyslogFormat>. | ||||
890 | |||||
891 | =back | ||||
892 | |||||
893 | =item $plugin->spamd_child_post_connection_close () | ||||
894 | |||||
895 | Called when child returns from handling a connection. | ||||
896 | |||||
897 | If there was an accept failure, the child will die and this code will | ||||
898 | not be called. | ||||
899 | |||||
900 | =item $plugin->finish () | ||||
901 | |||||
902 | Called when the C<Mail::SpamAssassin> object is destroyed. | ||||
903 | |||||
904 | =cut | ||||
905 | |||||
906 | sub finish { | ||||
907 | my ($self) = @_; | ||||
908 | %{$self} = (); | ||||
909 | } | ||||
910 | |||||
911 | =item $plugin->learner_new () | ||||
912 | |||||
913 | Used to support human-trained probabilistic classifiers like the BAYES_* ruleset. | ||||
914 | Called when a new C<Mail::SpamAssassin::Bayes> object has been created; typically | ||||
915 | when a new user's scan is about to start. | ||||
916 | |||||
917 | =item $plugin->learn_message () | ||||
918 | |||||
919 | Train the classifier with a training message. | ||||
920 | |||||
921 | =over 4 | ||||
922 | |||||
923 | =item isspam | ||||
924 | |||||
925 | 1 if the message is spam, 0 if it's non-spam. | ||||
926 | |||||
927 | =item msg | ||||
928 | |||||
929 | The message's C<Mail::SpamAssassin::Message> object. | ||||
930 | |||||
931 | =item id | ||||
932 | |||||
933 | An optional message-identification string, used internally to tag the message. | ||||
934 | If it is C<undef>, one will be generated. It should be unique to that message. | ||||
935 | |||||
936 | =back | ||||
937 | |||||
938 | =item $plugin->forget_message () | ||||
939 | |||||
940 | Tell the classifier to 'forget' its training about a specific message. | ||||
941 | |||||
942 | =over 4 | ||||
943 | |||||
944 | =item msg | ||||
945 | |||||
946 | The message's C<Mail::SpamAssassin::Message> object. | ||||
947 | |||||
948 | =item id | ||||
949 | |||||
950 | An optional message-identification string, used internally to tag the message. | ||||
951 | If it is C<undef>, one will be generated. It should be unique to that message. | ||||
952 | |||||
953 | =back | ||||
954 | |||||
955 | =item $plugin->learner_sync () | ||||
956 | |||||
957 | Tell the classifier to 'sync' any pending changes against the current | ||||
958 | user's training database. This is called by C<sa-learn --sync>. | ||||
959 | |||||
960 | If you do not need to implement these for your classifier, create an | ||||
961 | implementation that just contains C<return 1>. | ||||
962 | |||||
963 | =item $plugin->learner_expire_old_training () | ||||
964 | |||||
965 | Tell the classifier to perform infrequent, time-consuming cleanup of | ||||
966 | the current user's training database. This is called by C<sa-learn | ||||
967 | --force-expire>. | ||||
968 | |||||
969 | If you do not need to implement these for your classifier, create an | ||||
970 | implementation that just contains C<return 1>. | ||||
971 | |||||
972 | =item $plugin->learner_is_scan_available () | ||||
973 | |||||
974 | Should return 1 if it is possible to use the current user's training data for | ||||
975 | a message-scan operation, or 0 otherwise. | ||||
976 | |||||
977 | =item $plugin->learner_dump_database () | ||||
978 | |||||
979 | Dump information about the current user's training data to C<stdout>. | ||||
980 | This is called by C<sa-learn --dump>. | ||||
981 | |||||
982 | =over 4 | ||||
983 | |||||
984 | =item magic | ||||
985 | |||||
986 | Set to 1 if "magic" name-value metadata should be dumped. | ||||
987 | |||||
988 | =item toks | ||||
989 | |||||
990 | Set to 1 if the database of tokens should be dumped. | ||||
991 | |||||
992 | =item regex | ||||
993 | |||||
994 | Either C<undef> to dump all tokens, or a value which specifies a regular expression | ||||
995 | subset of the tokens to dump. | ||||
996 | |||||
997 | =back | ||||
998 | |||||
999 | =item $plugin->learner_close () | ||||
1000 | |||||
1001 | Close any open databases. | ||||
1002 | |||||
1003 | =over 4 | ||||
1004 | |||||
1005 | =item quiet | ||||
1006 | |||||
1007 | Set to 1 if warning messages should be suppressed. | ||||
1008 | |||||
1009 | =back | ||||
1010 | |||||
1011 | =back | ||||
1012 | |||||
1013 | =head1 HELPER APIS | ||||
1014 | |||||
1015 | These methods provide an API for plugins to register themselves | ||||
1016 | to receive specific events, or control the callback chain behaviour. | ||||
1017 | |||||
1018 | =over 4 | ||||
1019 | |||||
1020 | =item $plugin->register_eval_rule ($nameofevalsub) | ||||
1021 | |||||
1022 | Plugins that implement an eval test will need to call this, so that | ||||
1023 | SpamAssassin calls into the object when that eval test is encountered. | ||||
1024 | See the B<REGISTERING EVAL RULES> section for full details. | ||||
1025 | |||||
1026 | =cut | ||||
1027 | |||||
1028 | # spent 6.32ms (3.85+2.48) within Mail::SpamAssassin::Plugin::register_eval_rule which was called 192 times, avg 33µs/call:
# 46 times (1.24ms+716µs) by Mail::SpamAssassin::Plugin::MIMEHeader::__ANON__[/usr/local/lib/perl5/site_perl/Mail/SpamAssassin/Plugin/MIMEHeader.pm:160] at line 157 of Mail/SpamAssassin/Plugin/MIMEHeader.pm, avg 43µs/call
# 9 times (143µs+101µs) by Mail::SpamAssassin::Plugin::DNSEval::new at line 65 of Mail/SpamAssassin/Plugin/DNSEval.pm, avg 27µs/call
# once (37µs+20µs) by Mail::SpamAssassin::Plugin::URIDetail::new at line 91 of Mail/SpamAssassin/Plugin/URIDetail.pm
# once (12µs+45µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 51 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (38µs+16µs) by Mail::SpamAssassin::Plugin::Hashcash::new at line 121 of Mail/SpamAssassin/Plugin/Hashcash.pm
# once (33µs+20µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 43 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (31µs+19µs) by Mail::SpamAssassin::Plugin::URIEval::new at line 42 of Mail/SpamAssassin/Plugin/URIEval.pm
# once (26µs+24µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 47 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (21µs+28µs) by Mail::SpamAssassin::Plugin::DKIM::new at line 155 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (36µs+13µs) by Mail::SpamAssassin::Plugin::BodyEval::new at line 43 of Mail/SpamAssassin/Plugin/BodyEval.pm
# once (12µs+30µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 53 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (27µs+13µs) by Mail::SpamAssassin::Plugin::VBounce::new at line 46 of Mail/SpamAssassin/Plugin/VBounce.pm
# once (25µs+15µs) by Mail::SpamAssassin::Plugin::WhiteListSubject::new at line 65 of Mail/SpamAssassin/Plugin/WhiteListSubject.pm
# once (22µs+17µs) by Mail::SpamAssassin::Plugin::URIEval::new at line 43 of Mail/SpamAssassin/Plugin/URIEval.pm
# once (27µs+12µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 62 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (23µs+15µs) by Mail::SpamAssassin::Plugin::DKIM::new at line 146 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (32µs+6µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 48 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (23µs+15µs) by Mail::SpamAssassin::Plugin::WhiteListSubject::new at line 64 of Mail/SpamAssassin/Plugin/WhiteListSubject.pm
# once (20µs+18µs) by Mail::SpamAssassin::Plugin::Bayes::new at line 243 of Mail/SpamAssassin/Plugin/Bayes.pm
# once (25µs+12µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 45 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (24µs+13µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 61 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (22µs+15µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 46 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (30µs+7µs) by Mail::SpamAssassin::Plugin::DKIM::new at line 158 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (24µs+13µs) by Mail::SpamAssassin::Plugin::Razor2::new at line 77 of Mail/SpamAssassin/Plugin/Razor2.pm
# once (30µs+6µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 65 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (12µs+24µs) by Mail::SpamAssassin::Plugin::RelayEval::new at line 51 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (22µs+14µs) by Mail::SpamAssassin::Plugin::FreeMail::new at line 156 of Mail/SpamAssassin/Plugin/FreeMail.pm
# once (25µs+11µs) by Mail::SpamAssassin::Plugin::Hashcash::new at line 120 of Mail/SpamAssassin/Plugin/Hashcash.pm
# once (21µs+15µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 56 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (24µs+11µs) by Mail::SpamAssassin::Plugin::DKIM::new at line 144 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (18µs+18µs) by Mail::SpamAssassin::Plugin::SPF::new at line 64 of Mail/SpamAssassin/Plugin/SPF.pm
# once (24µs+12µs) by Mail::SpamAssassin::Plugin::HTTPSMismatch::new at line 41 of Mail/SpamAssassin/Plugin/HTTPSMismatch.pm
# once (28µs+7µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 59 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (23µs+11µs) by Mail::SpamAssassin::Plugin::RelayEval::new at line 43 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (22µs+12µs) by Mail::SpamAssassin::Plugin::URIDNSBL::new at line 323 of Mail/SpamAssassin/Plugin/URIDNSBL.pm
# once (21µs+12µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 68 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (12µs+21µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 44 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (23µs+9µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 45 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (20µs+13µs) by Mail::SpamAssassin::Plugin::TxRep::new at line 231 of Mail/SpamAssassin/Plugin/TxRep.pm
# once (22µs+10µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 58 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (11µs+21µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 47 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (13µs+19µs) by Mail::SpamAssassin::Plugin::RelayEval::new at line 44 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (16µs+16µs) by Mail::SpamAssassin::Plugin::Razor2::new at line 78 of Mail/SpamAssassin/Plugin/Razor2.pm
# once (25µs+7µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 60 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (16µs+16µs) by Mail::SpamAssassin::Plugin::RelayEval::new at line 45 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (15µs+16µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 52 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (15µs+16µs) by Mail::SpamAssassin::Plugin::SPF::new at line 72 of Mail/SpamAssassin/Plugin/SPF.pm
# once (12µs+19µs) by Mail::SpamAssassin::Plugin::SPF::new at line 61 of Mail/SpamAssassin/Plugin/SPF.pm
# once (16µs+15µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 47 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (15µs+15µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 58 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (15µs+16µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 56 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (15µs+15µs) by Mail::SpamAssassin::Plugin::BodyEval::new at line 45 of Mail/SpamAssassin/Plugin/BodyEval.pm
# once (20µs+11µs) by Mail::SpamAssassin::Plugin::ImageInfo::new at line 103 of Mail/SpamAssassin/Plugin/ImageInfo.pm
# once (20µs+10µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 70 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (24µs+6µs) by Mail::SpamAssassin::Plugin::SPF::new at line 65 of Mail/SpamAssassin/Plugin/SPF.pm
# once (14µs+16µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 56 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (14µs+16µs) by Mail::SpamAssassin::Plugin::SPF::new at line 68 of Mail/SpamAssassin/Plugin/SPF.pm
# once (15µs+16µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 55 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (15µs+15µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 52 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (15µs+15µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 50 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (14µs+16µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 53 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (20µs+9µs) by Mail::SpamAssassin::Plugin::SPF::new at line 57 of Mail/SpamAssassin/Plugin/SPF.pm
# once (14µs+16µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 55 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (14µs+16µs) by Mail::SpamAssassin::Plugin::DKIM::new at line 151 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (23µs+6µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 71 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (20µs+10µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 42 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (22µs+7µs) by Mail::SpamAssassin::Plugin::VBounce::new at line 47 of Mail/SpamAssassin/Plugin/VBounce.pm
# once (12µs+17µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 43 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (23µs+6µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 53 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (12µs+16µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 44 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (18µs+11µs) by Mail::SpamAssassin::Plugin::FreeMail::new at line 157 of Mail/SpamAssassin/Plugin/FreeMail.pm
# once (12µs+17µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 46 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (12µs+16µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 50 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (21µs+7µs) by Mail::SpamAssassin::Plugin::SPF::new at line 69 of Mail/SpamAssassin/Plugin/SPF.pm
# once (21µs+7µs) by Mail::SpamAssassin::Plugin::SPF::new at line 58 of Mail/SpamAssassin/Plugin/SPF.pm
# once (12µs+16µs) by Mail::SpamAssassin::Plugin::DKIM::new at line 145 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (11µs+17µs) by Mail::SpamAssassin::Plugin::RelayEval::new at line 53 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (16µs+13µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 64 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (12µs+16µs) by Mail::SpamAssassin::Plugin::RelayEval::new at line 47 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (12µs+16µs) by Mail::SpamAssassin::Plugin::BodyEval::new at line 47 of Mail/SpamAssassin/Plugin/BodyEval.pm
# once (11µs+16µs) by Mail::SpamAssassin::Plugin::BodyEval::new at line 48 of Mail/SpamAssassin/Plugin/BodyEval.pm
# once (21µs+7µs) by Mail::SpamAssassin::Plugin::SPF::new at line 71 of Mail/SpamAssassin/Plugin/SPF.pm
# once (11µs+16µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 45 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (12µs+16µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 53 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (11µs+17µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 47 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (11µs+17µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 51 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (21µs+7µs) by Mail::SpamAssassin::Plugin::ImageInfo::new at line 105 of Mail/SpamAssassin/Plugin/ImageInfo.pm
# once (12µs+16µs) by Mail::SpamAssassin::Plugin::ImageInfo::new at line 109 of Mail/SpamAssassin/Plugin/ImageInfo.pm
# once (22µs+6µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 45 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (12µs+16µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 49 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::SPF::new at line 67 of Mail/SpamAssassin/Plugin/SPF.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::URIEval::new at line 44 of Mail/SpamAssassin/Plugin/URIEval.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 49 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (11µs+16µs) by Mail::SpamAssassin::Plugin::FreeMail::new at line 159 of Mail/SpamAssassin/Plugin/FreeMail.pm
# once (21µs+7µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 54 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (11µs+16µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 46 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (15µs+12µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 67 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::DKIM::new at line 147 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (20µs+7µs) by Mail::SpamAssassin::Plugin::SPF::new at line 70 of Mail/SpamAssassin/Plugin/SPF.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::SPF::new at line 66 of Mail/SpamAssassin/Plugin/SPF.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 51 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::DKIM::new at line 159 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (11µs+16µs) by Mail::SpamAssassin::Plugin::RelayEval::new at line 48 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::FreeMail::new at line 158 of Mail/SpamAssassin/Plugin/FreeMail.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::ImageInfo::new at line 108 of Mail/SpamAssassin/Plugin/ImageInfo.pm
# once (20µs+7µs) by Mail::SpamAssassin::Plugin::RelayEval::new at line 50 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 49 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 48 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (12µs+15µs) by Mail::SpamAssassin::Plugin::DKIM::new at line 154 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (21µs+6µs) by Mail::SpamAssassin::Plugin::SPF::new at line 60 of Mail/SpamAssassin/Plugin/SPF.pm
# once (11µs+16µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 50 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (20µs+6µs) by Mail::SpamAssassin::Plugin::ImageInfo::new at line 106 of Mail/SpamAssassin/Plugin/ImageInfo.pm
# once (20µs+6µs) by Mail::SpamAssassin::Plugin::SPF::new at line 62 of Mail/SpamAssassin/Plugin/SPF.pm
# once (19µs+6µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 63 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (19µs+6µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 54 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (12µs+13µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 48 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (18µs+6µs) by Mail::SpamAssassin::Plugin::ImageInfo::new at line 107 of Mail/SpamAssassin/Plugin/ImageInfo.pm
# once (12µs+12µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 46 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (11µs+12µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 57 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (11µs+10µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 50 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (15µs+6µs) by Mail::SpamAssassin::Plugin::RelayEval::new at line 52 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (15µs+6µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 54 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (15µs+6µs) by Mail::SpamAssassin::Plugin::WLBLEval::new at line 52 of Mail/SpamAssassin/Plugin/WLBLEval.pm
# once (12µs+9µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 51 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (14µs+6µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 52 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (11µs+8µs) by Mail::SpamAssassin::Plugin::DKIM::new at line 150 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (12µs+7µs) by Mail::SpamAssassin::Plugin::MIMEEval::new at line 48 of Mail/SpamAssassin/Plugin/MIMEEval.pm
# once (12µs+7µs) by Mail::SpamAssassin::Plugin::ImageInfo::new at line 104 of Mail/SpamAssassin/Plugin/ImageInfo.pm
# once (12µs+6µs) by Mail::SpamAssassin::Plugin::BodyEval::new at line 44 of Mail/SpamAssassin/Plugin/BodyEval.pm
# once (12µs+7µs) by Mail::SpamAssassin::Plugin::HTMLEval::new at line 54 of Mail/SpamAssassin/Plugin/HTMLEval.pm
# once (12µs+7µs) by Mail::SpamAssassin::Plugin::SPF::new at line 59 of Mail/SpamAssassin/Plugin/SPF.pm
# once (12µs+7µs) by Mail::SpamAssassin::Plugin::SPF::new at line 63 of Mail/SpamAssassin/Plugin/SPF.pm
# once (12µs+6µs) by Mail::SpamAssassin::Plugin::RelayEval::new at line 49 of Mail/SpamAssassin/Plugin/RelayEval.pm
# once (11µs+7µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 49 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (12µs+6µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 66 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (11µs+7µs) by Mail::SpamAssassin::Plugin::DKIM::new at line 160 of Mail/SpamAssassin/Plugin/DKIM.pm
# once (12µs+6µs) by Mail::SpamAssassin::Plugin::HeaderEval::new at line 69 of Mail/SpamAssassin/Plugin/HeaderEval.pm
# once (12µs+6µs) by Mail::SpamAssassin::Plugin::BodyEval::new at line 46 of Mail/SpamAssassin/Plugin/BodyEval.pm
# once (11µs+6µs) by Mail::SpamAssassin::Plugin::RelayEval::new at line 46 of Mail/SpamAssassin/Plugin/RelayEval.pm | ||||
1029 | 192 | 501µs | my ($self, $nameofsub) = @_; | ||
1030 | 192 | 3.67ms | 192 | 2.48ms | $self->{main}->{conf}->register_eval_rule ($self, $nameofsub); # spent 2.48ms making 192 calls to Mail::SpamAssassin::Conf::register_eval_rule, avg 13µs/call |
1031 | } | ||||
1032 | |||||
1033 | =item $plugin->register_generated_rule_method ($nameofsub) | ||||
1034 | |||||
1035 | In certain circumstances, plugins may find it useful to compile | ||||
1036 | perl functions from the ruleset, on the fly. It is important to | ||||
1037 | remove these once the C<Mail::SpamAssassin> object is deleted, | ||||
1038 | however, and this API allows this. | ||||
1039 | |||||
1040 | Once the method C<$nameofsub> has been generated, call this API | ||||
1041 | with the name of the method (including full package scope). | ||||
1042 | This indicates that it's a temporary piece of generated code, | ||||
1043 | built from the SpamAssassin ruleset, and when | ||||
1044 | C<Mail::SpamAssassin::finish()> is called, the method will | ||||
1045 | be destroyed. | ||||
1046 | |||||
1047 | This API was added in SpamAssassin 3.2.0. | ||||
1048 | |||||
1049 | =cut | ||||
1050 | |||||
1051 | sub register_generated_rule_method { | ||||
1052 | my ($self, $nameofsub) = @_; | ||||
1053 | push @Mail::SpamAssassin::PerMsgStatus::TEMPORARY_METHODS, | ||||
1054 | $nameofsub; | ||||
1055 | } | ||||
1056 | |||||
1057 | =item $plugin->register_method_priority($methodname, $priority) | ||||
1058 | |||||
1059 | Indicate that the method named C<$methodname> on the current object | ||||
1060 | has a callback priority of C<$priority>. | ||||
1061 | |||||
1062 | This is used by the plugin handler to determine the relative order of | ||||
1063 | callbacks; plugins with lower-numbered priorities are called before plugins | ||||
1064 | with higher-numbered priorities. Each method can have a different priority | ||||
1065 | value. The default value is C<0>. The ordering of callbacks to methods with | ||||
1066 | equal priority is undefined. | ||||
1067 | |||||
1068 | Typically, you only need to worry about this if you need to ensure your | ||||
1069 | plugin's method is called before another plugin's implementation of that | ||||
1070 | method. It should be called from your plugin's constructor. | ||||
1071 | |||||
1072 | This API was added in SpamAssassin 3.2.0. | ||||
1073 | |||||
1074 | =cut | ||||
1075 | |||||
1076 | sub register_method_priority { | ||||
1077 | my ($self, $methname, $pri) = @_; | ||||
1078 | $self->{method_priority}->{$methname} = $pri; | ||||
1079 | } | ||||
1080 | |||||
1081 | =item $plugin->inhibit_further_callbacks() | ||||
1082 | |||||
1083 | Tells the plugin handler to inhibit calling into other plugins in the plugin | ||||
1084 | chain for the current callback. Frequently used when parsing configuration | ||||
1085 | settings using C<parse_config()>. | ||||
1086 | |||||
1087 | =back | ||||
1088 | |||||
1089 | =cut | ||||
1090 | |||||
1091 | # spent 3.12ms within Mail::SpamAssassin::Plugin::inhibit_further_callbacks which was called 501 times, avg 6µs/call:
# 501 times (3.12ms+0s) by Mail::SpamAssassin::Plugin::FreeMail::parse_config at line 234 of Mail/SpamAssassin/Plugin/FreeMail.pm, avg 6µs/call | ||||
1092 | 501 | 846µs | my ($self) = @_; | ||
1093 | 501 | 2.93ms | $self->{_inhibit_further_callbacks} = 1; | ||
1094 | } | ||||
1095 | |||||
1096 | 1 | 14µs | 1; | ||
1097 | __END__ |