• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

contrib/H19-Nov-2006-306270

READMEH A D19-Nov-20067.9 KiB212162

README.dspamH A D06-Oct-2005637 2012

README.policydH A D01-Nov-2006570 1711

TODOH A D01-Nov-200668 32

bayes_stats.inc.phpH A D08-Nov-20061.7 KiB5544

divider.inc.phpH A D31-Mar-200475 54

dspam.inc.phpH A D14-Mar-20057.2 KiB222181

dspam_conf.phpH A D06-Apr-2004817 299

dspam_primer.inc.phpH A D06-Apr-200410 KiB234212

end_section.inc.phpH A D31-Mar-200410 11

index.phpH A D11-Mar-200660 44

move_to.phpH A D13-Dec-20042.9 KiB10872

policyd.inc.phpH A D02-Nov-20065.6 KiB214155

policyd_conf-dist.phpH A D19-Nov-2006779 224

policyd_docs.inc.phpH A D01-Nov-20061.3 KiB3026

process-spam.plH A D07-Oct-20048.2 KiB342198

purge.inc.phpH A D28-Sep-20051.2 KiB4336

sa_abooksync.inc.phpH A D19-Mar-2004809 3124

sa_opts-dist.phpH A D01-Nov-200612.9 KiB273202

sa_settings.inc.phpH A D02-Nov-20065.2 KiB177141

sa_whitelist.inc.phpH A D14-Mar-20056.7 KiB263240

sasql.potH A D19-Nov-200620.7 KiB1,035822

sasql_api.phpH A D22-Aug-20064.5 KiB17683

sasql_conf.php.distH A D19-Nov-20066.8 KiB182156

sasql_db.phpH A D08-Nov-200615.3 KiB556448

sasql_hooks.phpH A D03-May-202215.6 KiB486351

sasql_options.phpH A D14-Mar-20051.9 KiB8654

sasql_wblist.phpH A D19-Mar-20042.2 KiB7658

setup.phpH A D19-Nov-20061.9 KiB7446

start_section.inc.phpH A D31-Mar-200462 32

versionH A D19-Nov-200622 22

README

1sasql - SpamAssassin+SQL DB plugin for SquirrelMail
2
3Author: Randy Smith <perlstalker@vuser.org>
4Home page: http://www.sourceforge.net/projects/sasql
5
6The sasql SquirrelMail plugin lets users change a pre-defined set of
7SpamAssassin settings when those settings are stored in a SQL DB
8rather than a config file.
9
10INSTALLATION
11
12o sasql requires Pear DB.
13o Unpack in the plugins directory of your SM installation.
14o Copy sasql_conf.php.dist to sasql_conf.php.
15o Edit sasql_conf.php and change the DSN and table name to suit
16  your database. (The schema used by SA is defined in
17  http://www.spamassassin.org/dist/sql/README.)
18o Enable the sasql plugin.
19
20NOTE: sasql requires PEAR-DB. PEAR-DB is also required by SquirrelMail
21when preferences are stored in SQL so you may already have this. If you
22get errors about PHP being unable to find DB.php, that means that
23PEAR-DB is not installed.
24
25SUPPORTED SPAMASSASSIN SETTINGS
26
27This is an incomplete list. See sa_opts-dist.php for the complete list
28of supported settings.
29
30o [un]whitelist_from / [un]blacklist_from / whitelist_to
31o required_hits / required_score
32o use_terse_report
33o rewrite_subject
34o use_dcc
35o use_razor1
36o use_razor2
37o always_add_headers
38o ok_languages
39o use_bayes
40o auto_learn
41o report_safe
42
43Settings removed from SpamAssassin 2.50. Set $useSA2_43 to enable,
44or add to $allowed_params.
45o report_header
46o defang_mime
47
48ADDING ADDITIONAL SETTINGS
49
50Additional settings can be added very easily in sa_opts.php.
51To do so, add a new entry to $sa_params with the following fields:
52- title: A short title for the setting. This is not the name of
53the setting that SpamAssassin uses.
54- descr: A description of the setting. HTML formatting is ok here.
55- type: The type of widget to use for input. Currently allowed are:
56	select: Creates drop-down box for input.
57	checkbox: Creates a simple checkbox for input.
58	text: Create a plain text box.
59- multiple: Allow multiple selections. Only useful with the 'select' type.
60- size: The size of the widget. If omitted, then the default size for that
61	widget is used. Not used for 'checkbox' types.
62- values: This varies depending on the type chosen above.
63	select: This is an associative array of values and descriptions.
64		See the 'required_score' setting for an example.
65	checkbox: This is the value for a selected checkbox.
66	text: not used
67- default: This is the default value for the setting. For settings
68           with the 'select' type, the default should be one of the keys
69           of the array.
70- delete: Generally used on 'text' type settings to remove them from the
71          database if the value is set to ''. Note: Setting the default
72          value to some non-empty value for options with the 'delete' flag
73          will probably fail in interesting ways. Most likely, the user
74          will never be able to turn it off.
75
76Example:
77Let's say we wanted to add a setting named 'use_foo'. We need to
78create 'title', 'descr', 'type', 'values' and 'default' fields.
79Note: The first index MUST be the name of the setting as SpamAssassin
80uses it.
81
82$sa_params['use_foo']['title'] = "Use Foo";
83$sa_params['use_foo']['descr'] = "Use Foo to check messages for spam.";
84
85This will be a simple on/off switch so we will make it a checkbox.
86
87$sa_params['use_foo']['type'] = 'checkbox';
88
89SpamAssassin sees things as on if they have value of 1 and off if the
90value is 0. So we'll set 'values' to 1 and the 'default' to 0;
91
92$sa_params['use_foo']['values'] = 1;
93$sa_params['use_foo']['default'] = 0;
94
95The last thing we need to do is enable the setting in $allowed_params.
96
97$allowed_params = array('required_score', ..., 'use_foo');
98
99If you create a settings entry for a standard SpamAssassin setting
100that is not already included, please email me the entry and I'll see
101about adding it to the standard package. Thanks!
102
103ADDING ADDITIONAL SECTIONS
104
105You can reorder, remove or add sections to the main options page by
106changing $allowed_sections in sasql_conf.php. This will allow you to
107easily add additional, local features to your setup. Included is an example
108for adding a dspam opt-in/opt-out page.
109
110To add a custom section, create a file called <section_name>.inc.php where
111<section_name> is the name of the section (without <>'s). Then add
112<section_name> to $allowed_sections.
113
114ADDITIONAL FEATURES
115
116o Read-only support for '@GLOBAL' (and '!GLOBAL') settings. Users' settings
117will default to value of the setting for the '@GLOBAL' user. '@GLOBAL'
118settings must be set in the database "by hand." There is no way to
119edit them through the plugin. Note: Global settings that are not in
120the $allowed_params list are not shown by the plugin.
121
122o The included process-spam.pl Perl script can be used with the 'x-spam-days'
123setting to clean out users' spam folders. It should be reasonably easy to
124modify to fit your server setup. Run 'pod2text process-spam.pl' for the
125script's documentation. See the FAQ about sa-learn for more details.
126
127o Add the from address to the white/blacklist from the message view.
128
129FAQ
130
131Q: How can I make sasql store the user name as 'foo@domain' instead
132of 'foo'?
133A: sasql gets the user name from SquirrelMail which, generally,
134doesn't include the domain. You can use the 'vlogin' plugin to append
135a default domain to the user name. You can also set a default domain
136in sasql_conf.php.
137
138Q: Why is SA ignoring my users' whitelist/blacklist preferences?
139A: Make sure that spamd is invoked with '-q', otherwise, it will not even
140attempt to connect to your database and will not retrieve any user
141preferences, even if you have the correct dsn settings in your local.cf
142SA configuration file. You can use the '-x' option to tell spamd to ignore
143settings users' .spamassassin directories.
144
145Q: Why do you have a dspam section in a SpamAssassin plugin?
146A: The short answer is that I used to use both at the ISP I work at and
147wanted a unified place to configure both. (My setup is doc'd at
148http://perlstalker.vuser.org/tiki/tiki-index.php?page=CourierDspam)
149It also provides a good example of a way to include local spam filter
150customizations that may or may not interact with SpamAssassin.
151
152Q: Why can't I see the value of 'rewrite_header Subject'?
153A: Basically, there are two ways of storing this option in the database.
154
155Option 1)
156Preference: rewrite_header
157Value: Subject ****SPAM****
158
159Option 2)
160Preference: rewrite_header Subject
161Value: ****SPAM****
162
163sasql only supports Option 2 for now. I want to add support for
164Option 1) at some point but haven't had the time to do it. (Patches
165welcome :-)) I think that Option 2 makes more sense but I know
166there are some that disagree.
167
168Q: How can I feed my mail to sa-learn?
169A: There a couple of ways to use sa-learn with sasql.
170
171Option 1a: You can use the included process-spam.pl perl script. I use
172process-spam.pl on the servers at Amigo.Net and it works well, but it
173may not be flexible enough to handle your setup and it will almost
174guarantee that you'll have to modify the code a little to support your
175system.
176
177Option 1b: Rather than use process-spam.pl, you can use some other tool
178to read the messages from the Learn folders. There are many such tools
179out there. The SpamAssassin wiki lists several.
180
181Option 2: You can use the Spam Buttons plugin.
182(http://www.squirrelmail.org/plugin_view.php?id=242) If you choose to
183use Spam Buttons, you should set $sasql_use_learn = false; in
184sasql_conf.php. Try this if you are having problems with process-spam.pl.
185
186TRANSLATIONS
187
188An empty gettext .pot files (sasql.pot) is included in this package. The
189script contrib/xgetpot may be used to create a new .pot file. e.g.
190
191	cd SM_PATH/plugins/sasql
192	contrib/xgetpot
193
194Note: sasql requires that you use a version of gettext that supports the
195'-L php' option.
196
197BUGS
198
199Reports bugs at http://sourceforge.net/tracker/?group_id=102673&atid=632496.
200
201ACKNOWLEDGMENTS
202
203This plugin was originally based on php-sa-mysql-0.5.tar.gz by
204Justin England which can be downloaded from
205http://www.spamassassin.org/devel/.
206
207Thanks to the SquirrelMail team for builing such a great app and
208for all the work they do to keep it running.
209
210Thanks to all those who have sent in patches and suggested
211improvements.
212

README.dspam

1USING THE DSPAM SECTIONS
2
3The dspam section (dspam.inc.php) is included as an example of how to
4add your own options sections to sasql.
5
6NOTE: I am no longer maintaining the dspam sections. It is my belief that
7they still work as of 6 Oct 2005. They will remain part of sasql as an
8example of how the section feature works but may not always work.
9
10CONFIGURATION
11
121) Make dspam configuration changes to dspam_conf.php.
13
142) Add 'dspam' to $allowed_sections in sasql_conf.php.
15
16TROUBLESHOOTING TIPS
17
18o The dspam user dir defined is ($dspam_userdir) must be writable by the
19web server. If it isn't, you will not be able to opt-in to dspam.
20

README.policyd

1USING THE POLICYD SECTIONS
2
3Policyd (http://policyd.sourceforge.net/) is an anti-spam plugin for
4postfix that supports Greylisting, spamtraps, sender throttling, etc.
5
6Greylisting in policyd is provided as an opt-in/opt-out option on a
7per-recipient basis. This section allows users to enable or disable
8Greylisting for their account.
9
10CONFIGURATION
11
121) Copy policyd_conf-dist.php to policyd_conf.php and make any changes
13   needed for your system. You will, at least, need to change the database
14   information.
15
162) Add 'policyd' to $allowed_sections is sasql_conf.php
17