diff options
-rw-r--r-- | packages/spamd.inc | 18 | ||||
-rw-r--r-- | packages/spamd_rules.php | 7 |
2 files changed, 13 insertions, 12 deletions
diff --git a/packages/spamd.inc b/packages/spamd.inc index 61c5cc74..070ff5f4 100644 --- a/packages/spamd.inc +++ b/packages/spamd.inc @@ -29,7 +29,7 @@ function sync_package_spamd() { } } fclose($fd); - $fd = fopen("/var/mail/whitelist.txt","w"); + $fd = fopen("/var/db/whitelist.txt","w"); if($config['installedpackages']['spamdwhitelist']['config'] != "") foreach($config['installedpackages']['spamdwhitelist']['config'] as $spamd) { fwrite($fd, $spamd['ip'] . "\n"); @@ -42,18 +42,18 @@ function sync_package_spamd() { function custom_php_install_command() { global $config, $g; - system("touch /var/mail/whitelist.txt"); + system("touch /var/db/whitelist.txt"); system("/usr/local/libexec/spamd -G 25:4:864"); - system("/usr/libexec/spamlogd 2>/dev/null &"); - $start = "/usr/local/sbin/spamd-setup &\n" . - "/sbin/pflogd" . - "/sbin/mount_fdescfs fdescfs /dev/fd" . - "/usr/local/libexec/spamlogd &"; + system("/usr/libexec/spamlogd 2>/dev/null &"); + $start = "/usr/local/sbin/spamd-setup &\n" . + "/sbin/pflogd\n" . + "/sbin/mount_fdescfs fdescfs /dev/fd\n" . + "/usr/local/libexec/spamlogd\n"; "/usr/local/libexec/spamd -G 5:4:864 -g -d -b 127.0.0.1\n" . $stop = "/usr/bin/killall spamd-setup\n" . "/usr/bin/killall spamd\n" . - "/usr/bin/killall mount_fdescfs" . - "/usr/bin/killall spamlogd"; + "/usr/bin/killall mount_fdescfs\n" . + "/usr/bin/killall spamlogd\n"; write_rcfile(array( "file" => "spamd.sh", "start" => $start, diff --git a/packages/spamd_rules.php b/packages/spamd_rules.php index 4d2b2de6..27ac850a 100644 --- a/packages/spamd_rules.php +++ b/packages/spamd_rules.php @@ -26,8 +26,9 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - +$wanif = get_real_wan_interface(); $anchor = "natearly"; -$rule = "rdr pass inet proto tcp from <spamd> to any port smtp -> 127.0.0.1 port 8025"; +$natrules .= "rdr pass on {$wanif} proto tcp from <spamd> to port smtp -> 127.0.0.1 port spamd\n"; +$natrules .= "rdr pass on {$wanif} proto tcp from !<spamd-white> to port smtp -> 127.0.0.1 port spamd\n"; $label = "spamd"; -add_rule_to_anchor($anchor, $rule, $label);
\ No newline at end of file +add_rule_to_anchor($anchor, $rule, $label); |