#! /bin/sh # Init Script for SMTP Redirection for anonymous dial-in users # as SPAM protection (prevents dial-users from direct mail delivery # to the respective MX Hosts. # # Version 0.1 # Last Edit: 26.08.2002, fku # # Please go to http://www.init7.net/anti-spam/ for further reference # and configuration example. # # You need also the dial-spam-block (http://dial-spam-block.sourceforge.net) # for full functionality. # # This script is free software. # Created by Fredy Kuenzler, Init Seven AG, kuenzler@init7.net, 26.08.2002 # Thanks to Raffy (raffy@raffy.ch) and Marco (steinacher@init7.net) # # Please use and redistribute it widely in order to contribute to the fight # against worldwide spam. # # # # Please adjust the following two parameters according to your environment. # Please note that the SMTP Server must not be in the dialrange! dialrange=192.168.10.0/24 smtprelay=192.168.20.20 # nothing below should be adjusted case "$1" in start) echo -n "Starting SMTP Redirect ... " iptables -A PREROUTING --table nat --protocol tcp --source $dialrange --dport 25 -j DNAT --to $smtprelay echo -e "" ;; stop) echo -n "Shutting down SMTP Redirect ... " iptables -F PREROUTING --table nat echo -e "" ;; check) echo -n "Checking SMTP Redirect ... " echo -e "" iptables -L --table nat -v echo -e "" ;; *) echo "Usage: $0 {start|stop|check}" exit 1 esac exit 0