Saturday, December 10, 2011

smtp relay and spam?

If you are using an external email server to relay your emails,
makesure to add spf record to your dns:

Example:
#Create a TXT record containing this text:
v=spf1 a:mail.yourdomain.com -all
#above meants only allow email to be sent directly from mail.yourdomain.com

if you want to use google:
v=spf1 include:aspmx.googlemail.com -all

for multiple mail server:
v=spf1 a:mail.yourdomain.com a:mail2.yourdomain.com -all

-all = exclude all others..


-----
How to setup qmail to forward emails to another smtp server?
sudo vi /var/qmail/control/smtproutes

:yourexternalserver.com:port# username password
#port, username and password are optional

if you want to set for specific domain:
mydomain.com:yourexternalserver.com:port# username password
:otherexternalserver.com:port# username password

Other useful commands for kloxo qmail:
List queue:
/var/qmail/bin/qmail-qread
To test send email:
echo to: your@email.com | /var/qmail/bin/qmail-inject

Kloxo logs -
tail /var/log/kloxo/smtp.log

To force qmail to send queue:
#grap id from qmail-send pid
ps -Af | grep qmail-send
kill -9 #id

sudo /etc/init.d/qmail restart




No comments: