From 97b095c2c8b4a5d37bd3f4112dff0b906038edcf Mon Sep 17 00:00:00 2001 From: Fernando Lemos Date: Fri, 2 Jun 2006 13:45:55 +0000 Subject: This was the first package I wrote, don't know how well it complies to the new pkg_edit.php, but it should do fine. Blacklist + whitelist + simple configuration. --- packages/sassassin.inc | 63 +++++++++++++++++++++++++ packages/sassassin.xml | 117 ++++++++++++++++++++++++++++++++++++++++++++++ packages/sassassin_bl.xml | 49 +++++++++++++++++++ packages/sassassin_wl.xml | 49 +++++++++++++++++++ 4 files changed, 278 insertions(+) create mode 100644 packages/sassassin.inc create mode 100644 packages/sassassin.xml create mode 100644 packages/sassassin_bl.xml create mode 100644 packages/sassassin_wl.xml diff --git a/packages/sassassin.inc b/packages/sassassin.inc new file mode 100644 index 00000000..040f12ab --- /dev/null +++ b/packages/sassassin.inc @@ -0,0 +1,63 @@ + 0, 'attachment' => 1, 'plaintext' => 2); + $report_safe = $report_safe_array[$settings['send_spam']]; + + $local_cf = << 'wl', 'blacklist' => 'bl') as $list => $key) { + foreach ($config['installedpackages']["sassassin{$key}"]['config'] as $item) { + if (!empty($item)) + $local_cf .= "{$list}_from {$item['address']}\n"; + } + } + + file_put_contents('/usr/local/etc/mail/spamassassin/local.cf', $local_cf); + + restart_service('spamassassin'); + + if (get_pkg_id('p3scan') != -1) { + require_once('p3scan.inc'); + p3scan_resync(); + } +} + +function sassassin_validate_input($post, $input_errors) { + if (!is_numeric($post['threshold'])) + $input_errors[] = 'The field \'Spam threshold\' should contain a numeric value.'; +} +?> diff --git a/packages/sassassin.xml b/packages/sassassin.xml new file mode 100644 index 00000000..adc04951 --- /dev/null +++ b/packages/sassassin.xml @@ -0,0 +1,117 @@ + + + sassassin.inc + + + + http://www.pfsense.org/packages/config/sassassin_wl.xml + + + http://www.pfsense.org/packages/config/sassassin_bl.xml + + + http://www.pfsense.org/packages/config/sassassin.inc + + + sassassin_install_command(); + + + Antispam + Configure the Antispam service. +
Services
+ /pkg_edit.php?xml=sassassin.xml&id=0 +
+ + SpamAssassin + The SpamAssassin spam detection software. + spamd.sh + spamd + + + + spamassassin + Antispam: Configuration + + + Configuration + /pkg_edit.php?xml=sassassin.xml&id=0 + + + + Whitelist + /pkg.php?xml=sassassin_wl.xml + + + Blacklist + /pkg.php?xml=sassassin_bl.xml + + + + + enable + Enable antispam + Check to enable the antispam protection. + + checkbox + bayes,bayes_learn,threshold,subject,send_spam + + + bayes + Bayesian classifier + Check this to enable the Bayesian classifier. + on + + checkbox + + + bayes_learn + Bayesian auto-learning + Check this to enable the Bayesian auto-learning system. + on + + checkbox + + + threshold + Spam threshold + Set the threshold at which a message is considered spam. + 5.0 + + input + + + subject + Rewrite subject + This is the string that will be added to the subject of spam emails. + *** SPAM *** + input + + + send_spam + How to send spam messages + Choose between not sending spam messages, sending them as an RFC-822 MIME attachment (recommended) or as plain text. + select + + + + + + attachment + + + + sassassin_validate_input($_POST, &$input_errors); + + + sassassin_resync(); + +
diff --git a/packages/sassassin_bl.xml b/packages/sassassin_bl.xml new file mode 100644 index 00000000..b03827a0 --- /dev/null +++ b/packages/sassassin_bl.xml @@ -0,0 +1,49 @@ + + + sassassinbl + AntiSPAM: Blacklist + sassassin.inc + + + Configuration + /pkg_edit.php?xml=sassassin.xml&id=0 + + + Whitelist + /pkg.php?xml=sassassin_wl.xml + + + Blacklist + /pkg.php?xml=sassassin_bl.xml + + + + + + address + Address + + + description + Description + + + + + address + Address + This is the email address that will be added to the blacklist (valid wildcards: *, ?). + + input + + + description + Description + You may enter a description here for your reference (not parsed). + input + + + + sassassin_resync(); + + diff --git a/packages/sassassin_wl.xml b/packages/sassassin_wl.xml new file mode 100644 index 00000000..fef5036e --- /dev/null +++ b/packages/sassassin_wl.xml @@ -0,0 +1,49 @@ + + + sassassinwl + AntiSPAM: Whitelist + sassassin.inc + + + Configuration + /pkg_edit.php?xml=sassassin.xml&id=0 + + + Whitelist + /pkg.php?xml=sassassin_wl.xml + + + + Blacklist + /pkg.php?xml=sassassin_bl.xml + + + + + address + Address + + + description + Description + + + + + address + Address + This is the email address that will be added to the whitelist (valid wildcards: *, ?). + + input + + + description + Description + You may enter a description here for your reference (not parsed). + input + + + + sassassin_resync(); + + -- cgit v1.2.3