aboutsummaryrefslogtreecommitdiffstats
path: root/config/spamd/spamd.inc
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2014-09-29 00:03:20 +0200
committerPiBa-NL <pba_2k3@yahoo.comm>2015-02-24 21:09:49 +0100
commit7eb458b55f1185e85d0c3e495d00aa65cfc6beca (patch)
tree86f77558295d97d6adf6b9b0829cdf131d036e98 /config/spamd/spamd.inc
parent252cc3f596616a30f225849024c33b9e81052134 (diff)
downloadpfsense-packages-7eb458b55f1185e85d0c3e495d00aa65cfc6beca.tar.gz
pfsense-packages-7eb458b55f1185e85d0c3e495d00aa65cfc6beca.tar.bz2
pfsense-packages-7eb458b55f1185e85d0c3e495d00aa65cfc6beca.zip
spamd, fix spamtrap and blacklist buttons, fix startup on pfSense 2.2
Diffstat (limited to 'config/spamd/spamd.inc')
-rw-r--r--config/spamd/spamd.inc16
1 files changed, 12 insertions, 4 deletions
diff --git a/config/spamd/spamd.inc b/config/spamd/spamd.inc
index 0bd29bd8..d55dc132 100644
--- a/config/spamd/spamd.inc
+++ b/config/spamd/spamd.inc
@@ -34,6 +34,13 @@ if(!function_exists("filter_configure"))
function sync_package_spamd() {
global $config, $g;
+ $pf_version = substr(trim(file_get_contents("/etc/version")),0,3);
+ if ($pf_version < 2.2) {
+ $localpath = "/usr/local";
+ } else {
+ $ARCH = php_uname("m");
+ $localpath = "/usr/pbi/spamd-$ARCH/local";
+ }
conf_mount_rw();
config_lock();
@@ -130,8 +137,8 @@ function sync_package_spamd() {
"fi\n" .
"/usr/local/sbin/spamd-setup -d &\n" .
"/sbin/pflogd &\n" .
- "/usr/local/libexec/spamd {$greyparms}{$identifier}{$greylisting}{$maxcon}{$maxblack}{$window}{$replysmtperror} 127.0.0.1 &\n" .
- "/usr/local/libexec/spamlogd\n";
+ "$localpath/libexec/spamd {$greyparms}{$identifier}{$greylisting}{$maxcon}{$maxblack}{$window}{$replysmtperror} 127.0.0.1 &\n" .
+ "$localpath/libexec/spamlogd\n";
$stop = "/usr/bin/killall spamd-setup\n" .
"/usr/bin/killall spamlogd\n" .
"/usr/bin/killall spamd\n" .
@@ -153,8 +160,9 @@ function sync_package_spamd() {
log_error("Restart cron");
mwexec("killall -HUP cron");
log_error("Setting up spamd.conf symlink");
- mwexec("rm -f /usr/local/etc/spamd/spamd.conf");
- mwexec("ln -s /etc/spamd.conf /usr/local/etc/spamd/spamd.conf");
+ mwexec("rm -f $localpath/etc/spamd/spamd.conf");
+ mwexec("ln -s /etc/spamd.conf $localpath/etc/spamd/spamd.conf");
+
log_error("Stopping spamd");
mwexec("/usr/local/etc/rc.d/spamd.sh stop");
sleep(1);