Software: greysmtpd
tcpserver-compatible anti-spam (greylisting) smtpd
Description
Use greylisting to protect against spam.
Greylisting will not be used if $RELAYCLIENT is set. Greylisting will not be used if client not listed in RBL and client's domain name doesn't looks like dynamic IP (dial-up, DSL, etc.). These rules allow most of non-spam email to be delivered without additional delay, like if you don't use greylisting at all.
Inspired by qgreylistrbl and rblsmtpd.
How it differs from qgreylistrbl?
- Only thing it's doing is greylisting, nothing less, nothing more (it doesn't try to detect spam by parsing HELO/EHLO/RCPT).
- No configuration (by editing source code) required.
- No additional Perl modules required.
- Require adns.
- Safe. In case of any internal error it will run next command (usually qmail-smtpd) just like if this client have passed greylisting, so no emails will be bounced because of error in greysmtpd.
- Faster. If possible DNS requests will be avoided; else all DNS requests will be executed asynchronously.
- Log to STDERR instead of syslog.
- Handle SMTP exactly as rblsmtpd do.
Requirements
- It compatible with any SMTP server that can run under tcpserver (like qmail).
- You must have adns installed to use greysmtpd (it use adnshost tool to speedup DNS requests).
Install
If you use my portage overlay
then just run:
emerge greysmtpd
Or you can install it manually:
- Make sure you've adns installed (on Gentoo just run emerge adns).
- Download latest greysmtpd-x.y.z.tgz.
- Execute:
tar xzf greysmtpd-x.y.z.tgz cd greysmtpd-x.y.z cp greysmtpd /usr/bin/ mkdir /var/greysmtpd for i in $(seq 0 255); do mkdir /var/greysmtpd/$i; done chown -R qmaild /var/greysmtpd
- Add this line to root's crontab, to run every hour:
0 * * * * find /var/greysmtpd/ -type f -mtime +0 -delete
- Setup greysmtpd to run between tcpserver
and your SMTP daemon (qmail).
# Gentoo: add into /var/qmail/control/conf-smtpd this line QMAIL_SMTP_PRE="${QMAIL_SMTP_PRE} greysmtpd" # Other systems, in general: replace something like this tcpserver -p -v -R 0.0.0.0 smtp qmail-smtpd # with this tcpserver -p -v -R 0.0.0.0 smtp greysmtpd qmail-smtpd
That's all! Now you've 80-90% less spam delivered to your server. :-)