aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/spamd.inc39
-rw-r--r--packages/spamd.xml8
-rw-r--r--packages/spamd_settings.xml91
-rw-r--r--packages/spamd_whitelist.xml6
4 files changed, 135 insertions, 9 deletions
diff --git a/packages/spamd.inc b/packages/spamd.inc
index 43b1d905..84c61c43 100644
--- a/packages/spamd.inc
+++ b/packages/spamd.inc
@@ -39,16 +39,36 @@ function sync_package_spamd() {
fclose($fd);
conf_mount_ro();
config_unlock();
- restart_service("spamd");
-}
+
+ $passtime = "5:4:864";
+ $identifier = "";
+ $greylisting = " -g";
+ $maxcon = "";
+ $maxblack = "";
+ $stuttersecs = "";
+ $delaysecs = "";
+ $pkg = get_pkg_id("spamd");
+ $pkg_i = $config['installedpackages']['spamdsettings']['config'];
+ if($pkg_i['passtime'] <> "")
+ $passtime = $pkg_i['passtime'];
+ if($pkg_i['identifier'] <> "")
+ $identifier = " -n \"" . $pkg_i['identifier'] . "\"";
+ if(isset($pkg_i['greylisting']) <> "")
+ $greylisting = $pkg_i['greylisting'];
+ if($pkg_i['maxblack'] <> "")
+ $maxblack = " -B " . $pkg_i['maxblack'];
+ if($pkg_i['maxcon'] <> "")
+ $maxcon = " -c " . $pkg_i['maxcon'];
+
+ if($pkg_i['stuttersecs'] <> "")
+ $stuttersecs = " -S " . $pkg_i['stuttersecs'];
+ if($pkg_i['delaysecs'] <> "")
+ $delaysecs = " -s " . $pkg_i['delaysecs'];
-function custom_php_install_command() {
- global $config, $g;
- system("touch /var/db/whitelist.txt");
$start = "/usr/local/sbin/spamd-setup &\n" .
"/sbin/pflogd &\n" .
"/sbin/mount_fdescfs fdescfs /dev/fd\n" .
- "/usr/local/libexec/spamd -G 5:4:864 -g -b 127.0.0.1 &\n";
+ "/usr/local/libexec/spamd -G {$passtime}{$identifier}{$greylisting}{$maxcon}{$maxblack} -b 127.0.0.1 &\n";
"/usr/local/libexec/spamlogd &\n" .
$stop = "/usr/bin/killall spamd-setup\n" .
"/usr/bin/killall spamd\n" .
@@ -60,6 +80,13 @@ function custom_php_install_command() {
"stop" => $stop
)
);
+ restart_service("spamd");
+}
+
+function custom_php_install_command() {
+ global $config, $g;
+ system("touch /var/db/whitelist.txt");
+
sync_package_spamd();
}
diff --git a/packages/spamd.xml b/packages/spamd.xml
index 743179ee..227747da 100644
--- a/packages/spamd.xml
+++ b/packages/spamd.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<packagegui>
- <name>spamd</name>
+ <name>spamdsources</name>
<version>0.1.0</version>
<include_file>/usr/local/pkg/spamd.inc</include_file>
<title></title>
@@ -17,7 +17,7 @@
</service>
<tabs>
<tab>
- <text>SpamD Settings</text>
+ <text>SpamD Sources</text>
<url>/pkg.php?xml=spamd.xml</url>
<active/>
</tab>
@@ -25,6 +25,10 @@
<text>SpamD Whitelist</text>
<url>/pkg.php?xml=spamd_whitelist.xml</url>
</tab>
+ <tab>
+ <text>SpamD Settings</text>
+ <url>/pkg.php?xml=spamd_whitelist.xml</url>
+ </tab>
</tabs>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
diff --git a/packages/spamd_settings.xml b/packages/spamd_settings.xml
new file mode 100644
index 00000000..438fb23f
--- /dev/null
+++ b/packages/spamd_settings.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<packagegui>
+ <name>spamdsettings</name>
+ <version>0.1.0</version>
+ <include_file>/usr/local/pkg/spamd.inc</include_file>
+ <title></title>
+ <!-- Menu is where this packages menu will appear -->
+ <menu>
+ <name>SpamD</name>
+ <section>Services</section>
+ <configfile>spamd.xml</configfile>
+ </menu>
+ <service>
+ <name>spamd</name>
+ <rcfile>spamd.sh</rcfile>
+ <executable>spamlogd</executable>
+ </service>
+ <tabs>
+ <tab>
+ <text>SpamD Sources</text>
+ <url>/pkg.php?xml=spamd.xml</url>
+ </tab>
+ <tab>
+ <text>SpamD Whitelist</text>
+ <url>/pkg.php?xml=spamd_whitelist.xml</url>
+ </tab>
+ <tab>
+ <text>SpamD Settings</text>
+ <url>/pkg.php?xml=spamd_whitelist.xml</url>
+ <active/>
+ </tab>
+ </tabs>
+ <!-- configpath gets expanded out automatically and config items will be
+ stored in that location -->
+ <configpath>['installedpackages']['spamd']['config']</configpath>
+ <!-- fields gets invoked when the user adds or edits a item. the following items
+ will be parsed and rendered for the user as a gui with input, and selectboxes. -->
+ <fields>
+ <field>
+ <fielddescr>Identifer</fielddescr>
+ <fieldname>intentifer</fieldname>
+ <description>The SMTP version banner that is reported upon initial connection.</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>MaxBlack</fielddescr>
+ <fieldname>maxblack</fieldname>
+ <description>The maximum number of concurrent blacklisted connections to allow in greylisting mode. This value may not be greater than maxcon (see below). The default is maxcon - 100.</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>MaxCon</fielddescr>
+ <fieldname>maxcon</fieldname>
+ <description>The maximum number of concurrent connections to allow. The default is 800.</description>
+ <type>input</type>
+ <value>800</value>
+ </field>
+ <field>
+ <fielddescr>Greylisting</fielddescr>
+ <fieldname>greylisting</fieldname>
+ <description>Connections from addresses not blacklisted on the black lists tab will be considered for greylisting. Such connections will not be stuttered at (though see the stutter secs option) or delayed, and will receive the pleasantly innocuous temporary failure. After passtime if the host returns it will be added to the white list.</description>
+ <type>checkox</type>
+ <value>yes</value>
+ </field>
+ <field>
+ <fielddescr>passtime:greyexp:whiteexp</fielddescr>
+ <fieldname>greylistingparms</fieldname>
+ <description>Adjust the three time parameters for greylisting; see GREYLISTING. passtime defaults to 25 (minutes), greyexp to 4 (hours), and whiteexp to 864 (hours, approximately 36 days).</description>
+ <type>input</type>
+ <size>30</size>
+ <value>25:4:864</value>
+ </field>
+ <field>
+ <fielddescr>StutterSecs</fielddescr>
+ <fieldname>stuttersecs</fieldname>
+ <description>Stutter at greylisted connections for the specified amount of seconds, after which the connection is not stuttered at. Defaults to 10.</description>
+ <type>input</type>
+ <value>10</value>
+ </field>
+ <field>
+ <fielddescr>DelaySecs</fielddescr>
+ <fieldname>delaysecs</fieldname>
+ <description>Delay each character sent to the client by the specified amount of seconds. Defaults to 1.</description>
+ <type>input</type>
+ <value>1</value>
+ </field>
+ </fields>
+ <custom_php_resync_config_command>
+ sync_package_spamd();
+ </custom_php_resync_config_command>
+</packagegui> \ No newline at end of file
diff --git a/packages/spamd_whitelist.xml b/packages/spamd_whitelist.xml
index 1fb463cf..79fc12e6 100644
--- a/packages/spamd_whitelist.xml
+++ b/packages/spamd_whitelist.xml
@@ -12,7 +12,7 @@
</menu>
<tabs>
<tab>
- <text>SpamD Settings</text>
+ <text>SpamD Sources</text>
<url>/pkg.php?xml=spamd.xml</url>
</tab>
<tab>
@@ -20,6 +20,10 @@
<url>/pkg.php?xml=spamd_whitelist.xml</url>
<active/>
</tab>
+ <tab>
+ <text>SpamD Settings</text>
+ <url>/pkg.php?xml=spamd_whitelist.xml</url>
+ </tab>
</tabs>
<!-- configpath gets expanded out automatically and config items will be
stored in that location -->