diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 59fedfd1bb..f03519d605 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -543,8 +543,14 @@ function filter_nat_rules_generate() { $natrules .= "#SSH Lockout Table\n"; $natrules .= "table persist\n\n"; - $natrules .= "\n# spam table \n"; - $natrules .= "table persist\n\n"; + /* is SPAMD insalled? */ + if (is_package_installed("spamd") == 1) { + $natrules .= "\n# spam table \n"; + $natrules .= "table persist\n"; + $natrules .= "table persist\n"; + $natrules .= "rdr pass on {$wanif} proto tcp from to port smtp -> 127.0.0.1 port spamd\n"; + $natrules .= "rdr pass on {$wanif} proto tcp from ! to port smtp -> 127.0.0.1 port spamd\n"; + } /* load balancer anchor */ $natrules .= "\n# Load balancing anchor - slbd updates\n";