1Mail::SpamAssassin::BayUesseSrtoCroen(t3r)ibuted Perl DoMcauimle:n:tSaptaimoAnssassin::BayesStore(3)
2
3
4

NAME

6       Mail::SpamAssassin::BayesStore - Storage Module for default Bayes
7       classifier
8

DESCRIPTION

10       This is the public API for the Bayesian store methods.  Any
11       implementation of the storage module for the default Bayes classifier
12       must implement these methods.
13

METHODS

15       new public class (Mail::SpamAssassin::BayesStore) new
16           (Mail::SpamAssassin::Plugin::Bayes $bayes)
17
18           Description: This method creates a new instance of the
19           Mail::SpamAssassin::BayesStore object.  You must pass in an
20           instance of the Mail::SpamAssassin::Plugin::Bayes object, which is
21           stashed for use throughout the module.
22
23       DB_VERSION
24           public instance (Integer) DB_VERSION ()
25
26           Description: This method returns the currently supported database
27           version for the implementation.
28
29       read_db_configs
30           public instance () read_db_configs ()
31
32           Description: This method reads any needed config variables from the
33           configuration object and then calls the
34           Mail::SpamAssassin::Plugin::Bayes read_db_configs method.
35
36       prefork_init
37           public instance (Boolean) prefork_init ()
38
39           Description: This optional method is called in the parent process
40           shortly before forking off child processes.
41
42       spamd_child_init
43           public instance (Boolean) spamd_child_init ()
44
45           Description: This optional method is called in a child process
46           shortly after being spawned.
47
48       tie_db_readonly
49           public instance (Boolean) tie_db_readonly ()
50
51           Description: This method opens up the database in readonly mode.
52
53       tie_db_writable
54           public instance (Boolean) tie_db_writable ()
55
56           Description: This method opens up the database in writable mode.
57
58           Any callers of this methods should ensure that they call untie_db()
59           afterwards.
60
61       untie_db
62           public instance () untie_db ()
63
64           Description: This method unties the database.
65
66       calculate_expire_delta
67           public instance (%) calculate_expire_delta (Integer $newest_atime,
68                                                        Integer $start,
69                                                        Integer
70           $max_expire_mult)
71
72           Description: This method performs a calculation on the data to
73           determine the optimum atime for token expiration.
74
75       token_expiration
76           public instance (Integer, Integer,
77                            Integer, Integer) token_expiration(\% $opts,
78                                                               Integer
79           $newest_atime,
80                                                               Integer
81           $newdelta)
82
83           Description: This method performs the database specific expiration
84           of tokens based on the passed in $newest_atime and $newdelta.
85
86       expire_old_tokens
87           public instance (Boolean) expire_old_tokens (\% hashref)
88
89           Description: This method expires old tokens from the database.
90
91       expire_old_tokens_trapped
92           public instance (Boolean) expire_old_tokens_trapped (\% $opts)
93
94           Description: This methods does the actual token expiration.
95
96           XXX More docs here about the methodology and what not
97
98       sync_due
99           public instance (Boolean) sync_due ()
100
101           Description: This methods determines if a sync is due.
102
103       expiry_due
104           public instance (Boolean) expiry_due ()
105
106           Description: This methods determines if an expire is due.
107
108       seen_get
109           public instance (Char) seen_get (String $msgid)
110
111           Description: This method retrieves the stored value, if any, for
112           $msgid.  The return value is the stored string ('s' for spam and
113           'h' for ham) or undef if $msgid is not found.
114
115       seen_put
116           public instance (Boolean) seen_put (String $msgid, Char $flag)
117
118           Description: This method records $msgid as the type given by $flag.
119           $flag is one of two values 's' for spam and 'h' for ham.
120
121       seen_delete
122           public instance (Boolean) seen_delete (String $msgid)
123
124           Description: This method removes $msgid from storage.
125
126       get_storage_variables
127           public instance (@) get_storage_variables ()
128
129           Description: This method retrieves the various administrative
130           variables used by the Bayes storage implementation.
131
132           The values returned in the array are in the following order:
133
134           0: scan count base
135
136           1: number of spam
137
138           2: number of ham
139
140           3: number of tokens in db
141
142           4: last expire atime
143
144           5: oldest token in db atime
145
146           6: db version value
147
148           7: last journal sync
149
150           8: last atime delta
151
152           9: last expire reduction count
153
154           10: newest token in db atime
155
156       dump_db_toks
157           public instance () dump_db_toks (String $template, String $regex, @
158           @vars)
159
160           Description: This method loops over all tokens, computing the
161           probability for the token and then printing it out according to the
162           passed in template.
163
164       set_last_expire
165           public instance (Boolean) _set_last_expire (Integer $time)
166
167           Description: This method sets the last expire time.
168
169       get_running_expire_tok
170           public instance (Time) get_running_expire_tok ()
171
172           Description: This method determines if an expire is currently
173           running and returns the time the expire started.
174
175       set_running_expire_tok
176           public instance (Time) set_running_expire_tok ()
177
178           Description: This method sets the running expire time to the
179           current time.
180
181       remove_running_expire_tok
182           public instance (Boolean) remove_running_expire_tok ()
183
184           Description: This method removes a currently set running expire
185           time.
186
187       tok_get
188           public instance (Integer, Integer, Time) tok_get (String $token)
189
190           Description: This method retrieves the specified token ($token)
191           from storage and returns it's spam count, ham count and last access
192           time.
193
194       tok_get_all
195           public instance (\@) tok_get_all (@ @tokens)
196
197           Description: This method retrieves the specified tokens (@tokens)
198           from storage and returns an array ref of arrays spam count, ham
199           count and last access time.
200
201       tok_count_change
202           public instance (Boolean) tok_count_change (Integer $spam_count,
203                                                       Integer $ham_count,
204                                                       String $token,
205                                                       Time $atime)
206
207           Description: This method takes a $spam_count and $ham_count and
208           adds it to $token along with updating $tokens atime with $atime.
209
210       multi_tok_count_change
211           public instance (Boolean) multi_tok_count_change (Integer
212           $spam_count,
213                                              Integer $ham_count,
214                                               \% $tokens,
215                                              String $atime)
216
217           Description: This method takes a $spam_count and $ham_count and
218           adds it to all of the tokens in the $tokens hash ref along with
219           updating each tokens atime with $atime.
220
221       nspam_nham_get
222           public instance (Integer, Integer) nspam_nham_get ()
223
224           Description: This method retrieves the total number of spam and the
225           total number of ham currently under storage.
226
227       nspam_nham_change
228           public instance (Boolean) nspam_nham_change (Integer $num_spam,
229                                                        Integer $num_ham)
230
231           Description: This method updates the number of spam and the number
232           of ham in the database.
233
234       tok_touch
235           public instance (Boolean) tok_touch (String $token,
236                                                Time $atime)
237
238           Description: This method updates the given tokens ($token) access
239           time.
240
241       tok_touch_all
242           public instance (Boolean) tok_touch_all (\@ $tokens,
243                                                    Time $atime)
244
245           Description: This method does a mass update of the given list of
246           tokens $tokens, if the existing token atime is < $atime.
247
248       cleanup
249           public instance (Boolean) cleanup ()
250
251           Description: This method performs any cleanup necessary before
252           moving onto the next operation.
253
254       get_magic_re
255           public instance get_magic_re (String)
256
257           Description: This method returns a regexp which indicates a magic
258           token.
259
260       sync
261           public instance (Boolean) sync (\% $opts)
262
263           Description: This method performs a sync of the database.
264
265       perform_upgrade
266           public instance (Boolean) perform_upgrade (\% $opts)
267
268           Description: This method is a utility method that performs any
269           necessary upgrades between versions.  It should know how to handle
270           previous versions and what needs to happen to upgrade them.
271
272           A true return value indicates success.
273
274       clear_database
275           public instance (Boolean) clear_database ()
276
277           Description: This method deletes all records for a particular user.
278
279           Callers should be aware that any errors returned by this method
280           could causes the database to be inconsistent for the given user.
281
282       backup_database
283           public instance (Boolean) backup_database ()
284
285           Description: This method will dump the users database in a machine
286           readable format.
287
288       restore_database
289           public instance (Boolean) restore_database (String $filename,
290           Boolean $showdots)
291
292           Description: This method restores a database from the given
293           filename, $filename.
294
295           Callers should be aware that any errors returned by this method
296           could causes the database to be inconsistent for the given user.
297
298       db_readable
299           public instance (Boolean) db_readable ()
300
301           Description: This method returns whether or not the Bayes DB is
302           available in a readable state.
303
304       db_writable
305           public instance (Boolean) db_writable ()
306
307           Description: This method returns whether or not the Bayes DB is
308           available in a writable state.
309
310
311
312perl v5.30.1                      2020-02-03 Mail::SpamAssassin::BayesStore(3)
Impressum