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