1Mail::SpamAssassin::BayUesseSrtoCroen:t:rMiybSuQtLe(d3M)Paeirll::DSopcaummAesnstaastsiionn::BayesStore::MySQL(3)
2
3
4
6 Mail::SpamAssassin::BayesStore::MySQL - MySQL Specific Bayesian Storage
7 Module Implementation
8
10 This module implements a MySQL specific based bayesian storage module.
11 It requires that you are running at least version 4.1 of MySQL, if you
12 are running a version of MySQL < 4.1 then several aspects of this
13 module will fail and possibly corrupt your bayes database data.
14
15 In addition, this module will support rollback on error, if you are
16 using the InnoDB database table type in MySQL. For more information
17 please review the instructions in sql/README.bayes.
18
20 token_expiration
21 public instance (Integer, Integer,
22 Integer, Integer) token_expiration(\% $opts,
23 Integer $newdelta,
24 @ @vars)
25
26 Description: This method performs the database specific expiration of
27 tokens based on the passed in $newdelta and @vars.
28
29 seen_put
30 public (Boolean) seen_put (string $msgid, char $flag)
31
32 Description: This method records $msgid as the type given by $flag.
33 $flag is one of two values 's' for spam and 'h' for ham.
34
35 seen_delete
36 public instance (Boolean) seen_delete (string $msgid)
37
38 Description: This method removes $msgid from the database.
39
40 set_last_expire
41 public instance (Boolean) set_last_expire (Integer $time)
42
43 Description: This method sets the last expire time.
44
45 set_running_expire_tok
46 public instance (String $time) set_running_expire_tok ()
47
48 Description: This method sets the time that an expire starts running.
49
50 remove_running_expire_tok
51 public instance (Boolean) remove_running_expire_tok ()
52
53 Description: This method removes the row in the database that indicates
54 that and expire is currently running.
55
56 nspam_nham_change
57 public instance (Boolean) nspam_nham_change (Integer $num_spam,
58 Integer $num_ham)
59
60 Description: This method updates the number of spam and the number of
61 ham in the database.
62
63 tok_touch
64 public instance (Boolean) tok_touch (String $token,
65 String $atime)
66
67 Description: This method updates the given tokens ($token) atime.
68
69 The assumption is that the token already exists in the database.
70
71 tok_touch_all
72 public instance (Boolean) tok_touch (\@ $tokens
73 String $atime)
74
75 Description: This method does a mass update of the given list of tokens
76 $tokens, if the existing token atime is < $atime.
77
78 The assumption is that the tokens already exist in the database.
79
80 We should never be touching more than N_SIGNIFICANT_TOKENS, so we can
81 make some assumptions about how to handle the data (ie no need to batch
82 like we do in tok_get_all)
83
84 cleanup
85 public instance (Boolean) cleanup ()
86
87 Description: This method performs any cleanup necessary before moving
88 onto the next operation.
89
90 clear_database
91 public instance (Boolean) clear_database ()
92
93 Description: This method deletes all records for a particular user.
94
95 Callers should be aware that any errors returned by this method could
96 causes the database to be inconsistent for the given user.
97
99 _connect_db
100 private instance (Boolean) _connect_db ()
101
102 Description: This method connects to the SQL database.
103
104 _initialize_db
105 private instance (Boolean) _initialize_db ()
106
107 Description: This method will check to see if a user has had their
108 bayes variables initialized. If not then it will perform this
109 initialization.
110
111 _put_token
112 private instance (Boolean) _put_token (string $token,
113 integer $spam_count,
114 integer $ham_count,
115 string $atime)
116
117 Description: This method performs the work of either inserting or
118 updating a token in the database.
119
120 _put_tokens
121 private instance (Boolean) _put_tokens (\% $tokens,
122 integer $spam_count,
123 integer $ham_count,
124 string $atime)
125
126 Description: This method performs the work of either inserting or
127 updating tokens in the database.
128
129
130
131perl v5.34.0 2021-M0a7i-l2:3:SpamAssassin::BayesStore::MySQL(3)