Qmail Help

Saturday, May 28, 2005

Qmail SMTP Access Control with tcp.smtp

Before we can start using qmail smtpd service, we need to define some access control.

This can be done with file

/etc/tcp.smtp

To allow relaying from localhost, you have to add

127.:allow,RELAYCLIENT=""

This setting wil allow Qmail SMTP server to send email from any IP starting with 127.X.X.X

IP 127.0.0.1 is used by localhost

If you need to allow relay from IP address 200.200.200.100 and localhost, Add following

127.:allow,RELAYCLIENT=""
200.200.200.100:allow,RELAYCLIENT=""

Now you need to use tcprules command to add the rule to qmail database (/etc/tcp.smtp.cdb).

# tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp

2 Comments:

At 8:00 AM, Blogger DaRyL said...

hi FWH,
i have a question fo you.

Which tcp.smtp my qmail smtpd service use?
I have /etc/tcp.smtp.cdb
127.:allow,RELAYCLIENT=""

But my qmail smtp service use this script:

/home/vpopmail/etc/tcp.smtp.cdb
that contain:
127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD=""

Is it ok?


# strings /var/qmail/supervise/qmail-smtpd/run

#!/bin/sh
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`
QMAILQUEUE="/var/qmail/bin/simscan"
export QMAILQUEUE
if [ -z "$MAXSMTPD" -o -z "$LOCAL" ]; then
echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in
echo /var/qmail/supervise/qmail-smtpd/run
exit 1
if [ ! -f /var/qmail/control/rcpthosts ]; then
echo "No /var/qmail/control/rcpthosts!"
echo "Refusing to start SMTP listener because it'll create an open relay"
exit 1
#exec /usr/local/bin/softlimit -m 2000000 \
/usr/local/bin/tcpserver -H -v -x /home/vpopmail/etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-R -u 89 -g 89 0 smtp /usr/local/bin/rblsmtpd -b -C \
-r 'list[dot]dsbl[dot]org:Your message was rejected because the message was sent from a server listed in DSBL - More information regarding this problem is available at /listing?%IP% - Please forward this error to your email server support staff for resolution.' \
-r 'sbl-xbl[dot]spamhaus[dot]org:Your message was rejected because the message was sent from a server listed in the Spamhaus RBL - More information regarding this problems is available at =%IP% - Please forward this error to your email server support staff for resolution.' \
-t 5 /var/qmail/bin/qmail-smtpd 2>&1


Thanks in advance,
Paola

 
At 4:04 AM, Blogger biswadeep baidya said...

hi, I want to configure a smtp gateway with qmail-scanner, clam-av and spamassassin, and in different server I want to install/configure QMAIL server( QMAIL-SMTP & QMAIL-POP3)..
How do I write /etc/tcp.smtp file so that my SMTP gateway server forward the mail to my qmail server.

 

Post a Comment

<< Home