qmail, greylisting, and everything

Afternoon all,

Being a ‘Postfix dude’, I’ve sort of been chucked mercilessly into the land of qmail in order to manage our shiny shared InterWorx host.
DJB creates some very frightening things.

Anyway, I’m looking to implement greylisting, as we’ve had great luck with it on our standalone Postfix-based mail server.

The implementation I ended up choosing is here:

http://www.datenklause.de/en/software/qgreylistrbl.html

It seemed fairly simplistic, had few requirements, and didn’t require recompiling qmail. Egh.

Anyway, I’ve gotten as far as the included README will allow me to go. The step that I’m choking reads as follows:

Now I’m pretty certain InterWorx uses ‘tcpserver’, but I’ll be damned if I can figure out where this needs to be configured. /etc/init.d/smtp doesn’t seem to hold any useful information, and delving into /var/qmail is kind of frightening. Any gurus care to shed some light/clue sticks?

Cheers,
Mike

Mike,

Check out /service/smtp/run which is the file that initiates qmail’s smtp daemon. Regarding patches, I’m not sure if the latest release of our RPMs includes any for greylisting so I’ll let Paul chime in and comment since he’s the qmail guru.

Chris

While there are a number of patches included, greylisting functionality isn’t one of them.

And like Chris said, that’s the file you want to edit.

One way would be to change the line

 $RBLSMTPD $BLACKLIST $SMTPD $VCHKPW /bin/true 2>&1

to

 $RBLSMTPD $BLACKLIST /var/qmail/bin/greylist $SMTPD $VCHKPW /bin/true 2>&1

You can then restart the smtp service with:

svc -t /service/smtp

Paul

Chris/Paul:

As usual, you guys are awesome. Thanks for the protips, I’m going to give this a shot.

Update: That seems to work just fine. Sweet.

Thanks again,
Mike

I am not familiar with how interworx works particullarly but I tried to install this and I believe I have done everything correctly however after I do it no mail can be sent or recieved from the server. I dont see any errors in the logs at all, infact I dont see any sort of realisation that an email is incoming or outgoing…

Hi

Did you check /var/log/smtp/current and /var/log/send/current ?

Do you see in these logs files some kinds of errors ?

Pascal

[QUOTE=IWorx-Paul;9485]While there are a number of patches included, greylisting functionality isn’t one of them.

And like Chris said, that’s the file you want to edit.

One way would be to change the line

 $RBLSMTPD $BLACKLIST $SMTPD $VCHKPW /bin/true 2>&1

to

 $RBLSMTPD $BLACKLIST /var/qmail/bin/greylist $SMTPD $VCHKPW /bin/true 2>&1

You can then restart the smtp service with:

svc -t /service/smtp

Paul[/QUOTE]

I thought qgreylistrbl was a replacement for the D.J Bernstein’s rblsmtpd ?

qgreylistrbl is a replacement for rblsmtpd by D.J. Bernstein. Simply put qgreylistrbl instead of rblsmtpd in the command line for starting qmail-smtpd.

So shouldn’t it be

$BLACKLIST /var/qmail/bin/greylist $SMTPD $VCHKPW /bin/true 2>&1

Pascal

It would appear that’s what the webpage says to do, yes. I suspect both can be included though, if you want to use both.

Paul

Hi guys, I’m trying with this one:

http://www.atomicrocketturtle.com/Joomla/content/view/97/29/

but when I go to the

service qmail restart

nothing happens… Any idea why? Thanks!

OK, I did actually manage to get it installed. Now I need to fine-tune it. What are your settings in the /var/qmail/bin/greylist file? Here are mine:

# how long, after 1st seening an ip address, is it kept on the greylist
# (a minute or two is good enough - a few spammers retry within 30 seconds
#  or so, then never again. the others that do retry will do so for long enough
#  to bypass any sensible value for this)
my $greytime = 1 * 60;
# how long, after seeing an ip address once, before is it forgotten about
# (this needs to be high enough to allow for retry intervals of the
#  most overloaded mail server, but low enough to avoid a 2nd spam from
#  the same IP address)
my $maxageonce = 8 * 60 * 60;
# how long, after seeing an ip address several times, before it is forgotten about
# (this should be high enough that messages from weekly, if not monthly,
#  mail lists do not expire from the list)
my $maxagegood = 30 * 24 * 60 * 60;
# how often to run IP address expiry (a minimum - this is only checked when mail arrives)
# (when this runs the script does a stat() on every IP address file,
#  but it does need to be small enough that the $maxage* values work)
my $cleanupinterval = 15 * 60;
# timeout to use waiting for smtp commands
# (rfc2821 recommends at least 5 minutes for most commands)
my $smtptimeout = 5 * 60;
# greylist against entire class-c (/24) networks rather than IP addresses
# if set to 1, greylist entire class-c networks rather than single IP addresses
# this should help with clusters of mailservers which connect from separate
# IP addresses with each delivery attempt (eg. yahoo groups)
my $greylistclassc = 0;

I don’t think you speak about the same geaylist

Yours seems to be this one : http://www.jonatkins.com/page/software/qgreylist and not this one http://www.datenklause.de/en/software/qgreylistrbl.html

Pascal

Correct Pascal, we’re not :frowning: I’m sorry about the confusion, but if anyone has installed the first one, could you share your config file with us? Thanks!