If you need to allow mail relaying from a selected group of IP addresses only, then environment variable RELAYCLIENT can be used.
If the environment variable RELAYCLIENT is set, qmail-smtpd will ignore rcpthosts, and will append the value of RELAYCLIENT to each incoming recipient address.
A standard ucspi-tcp package is being used for TCP connection for qmail. You can read about all of the programs in the package at http://cr.yp.to/ucspi-tcp.html. The particular program we'll be using here is tcpserver, which accepts incoming network connections, sets various environment variables, and then runs a program of your choice.
Now we'll set up the rules file that tcpserver will use to determine whether to set RELAYCLIENT.
Create a file in /etc called tcp.smtp. The file should read as follows:
192.168.10.:allow,RELAYCLIENT=""
172.16.:allow,RELAYCLIENT=""
10.10.:allow,RELAYCLIENT=""
:allow
Now we'll compile this rules file into a qmail daatabase cdb file:
# tcprules tcp.smtp.cdb tcp.smtp.temp < /etc/tcp.smtp
Now rebulid the tcoserver cdb file for SMTP
# qmailctl cdb
Thats it. :)
Now qmail will accept incoming SMTP connection from 192.168.10.0, 172.16.0.0 and 10.10.0.0 range network. In above tcp.smtp file you can add your clients IP address for which you want to allo relay.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment