Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    SPAMD & MultiWAN

    Scheduled Pinned Locked Moved 2.0-RC Snapshot Feedback and Problems - RETIRED
    1 Posts 1 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sergu61
      last edited by

      I have two WAN interfaces: WAN and OPT1.
      Below I have described the movements with which I made ​​spamd run on two WAN interfaces.

      1. I created in a folder /usr/local/pkg file spamd.inc.patch:

      *** spamd.inc Tue May 10 16:05:26 2011
      –- spamd.inc_multiwan Tue May 10 16:10:45 2011


      *** 192,210 ****
      --- 192,215 ----
        case 'nat':
        $natrules .= "\n# spam table \n";
                        $wanif = get_real_interface("wan");
      +                $optif = get_real_interface("opt1");
                        $natrules .= "table <whitelist>persist\n";
                        $natrules .= "table <blacklist>persist\n";
                        $natrules .= "table <spamd>persist\n";
                        if(file_exists("/var/db/whitelist.txt"))
                                $natrules .= "table <spamd-white>persist file "/var/db/whitelist.txt"\n";
                        $natrules .= "rdr pass on {$wanif} proto tcp from <blacklist>to port smtp -> 127.0.0.1 port spamd\n";
      +                $natrules .= "rdr pass on {$optif} proto tcp from <blacklist>to port smtp -> 127.0.0.1 port spamd\n";
                        $natrules .= "rdr pass on {$wanif} proto tcp from <spamd>to port smtp -> 127.0.0.1 port spamd\n";
      +                $natrules .= "rdr pass on {$optif} 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";
      +                $natrules .= "rdr pass on {$optif} proto tcp from ! <spamd-white>to port smtp -> 127.0.0.1 port spamd\n";
                        if($config['installedpackages']['spamdsettings']['config'])
                                foreach($config['installedpackages']['spamdsettings']['config'] as $ss)
                                        $nextmta = $ss['nextmta'];
                        if($nextmta <> "") {
                                $natrules .= "rdr pass on {$wanif} proto tcp from <spamd-white>to port smtp -> {$nextmta} port smtp\n";
      +                        $natrules .= "rdr pass on {$optif} proto tcp from <spamd-white>to port smtp -> {$nextmta} port smtp\n";
                        }

      break;

      2. I created in a folder /usr/local/sbin file spamd_patch.sh:

      #!/bin/sh
      SUCCESS=0
      word=opt1
      filename="/usr/local/pkg/spamd.inc"
      cd /usr/local/pkg
      grep -q "$word" "$filename"
      if [ $? -eq $SUCCESS ]
      then
        /etc/rc.filter_configure_sync && pfctl -f /tmp/rules.debug
      else
        patch -i /usr/local/pkg/spamd.inc.patch && /etc/rc.filter_configure_sync && pfctl -f /tmp/rules.debug
      fi
      exit

      3. Recorded in Shellcmd:
      (attachment)

      shellcmd_spamd_patch.jpg
      shellcmd_spamd_patch.jpg_thumb</spamd-white></spamd-white></spamd-white></spamd-white></spamd></spamd></blacklist></blacklist></spamd-white></spamd></blacklist></whitelist>

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.