Tux's lil' helper
Joined: 26 May 2002
|Posted: Wed Jun 19, 2002 3:04 pm Post subject: Script: relay for qmail
|Another very very simple little script, but still helpfull.
This script takes an ip as an argument (or not). If you dont specify an ip it just rebuilds your /etc/tcp.smtp.cdb from the current /etc/tcp.smtp
If you do specify an ip, it adds that ip to the /etc/tcp.smtp file with relay access then rebuilds the /etc/tcp.smtp.cdb database.
I just named this relay and use it when adding friends or people I trust with relay access through my qmail smtp server.
# Add a relay enabled ip to the tcp.smtp.cbd database
if [ "$1" != "" ]; then
echo "$1:allow,RELAYCLIENT=\"\"" >> /etc/tcp.smtp
tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
Usage is very simple (here are some examples):
to rebuild the database based on the current file just:
To add the ip 127.0.0.1 as a relay enabled ip and then rebuild:
To add the whole 192.168.0 class of ips:
(notice the trailing . it doesnt require *)