Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Phred (5358)


Fred is a Perl and PostgreSQL geek. He has made some very small contributions to a few cpan modules and mod_perl.

Journal of Phred (5358)

Thursday December 08, 2005
02:33 AM

Apache::Qpsmtpd to the rescue

[ #27891 ]

I use Qpsmtpd as my MTA, and it's done a great job over the past couple of years. I've been using tcpserver to handle the connections which has worked out pretty well. I had to up the concurrency limit a few months ago to 50 because spammer bots were hogging up too many connections and slowing the service down.

So today it slowed down again, the bots had used up all 50 connections. Bah. I reached for Apache::Qpsmtpd, Matt Sergeant's module which uses mod_perl2 running under Apache 2.0 to do the connection handling. I added the following virtual host as a config file in my apache config dir to test it out on port 2525 first:

    use lib qw( /home/smtpd/qpsmtpd/lib );
    use Apache::Qpsmtpd;
  <VirtualHost _default_:2525>
    ErrorLog logs/qp.error_log
    CustomLog logs/qp.access_log combined
    PerlSetVar QpsmtpdDir /home/smtpd/qpsmtpd
    PerlModule Apache::Qpsmtpd
    PerlProcessConnectionHandler Apache::Qpsmtpd

I telneted to port 2525 on the server, did a quick run through, then double checked by reconfiguring my Thunderbird SMTP setting to use port 2525, and sent a couple of emails through. The emails came through fine so I changed the config to port 25, removed the qpsmtpd daemontools symlink, sent a kill signal to all smtpd processes, and restarted apache. Apache took over the connection handling and there was a noticable performance increase. No delay sending email while the bots were getting bounced by Apache. Gotta love it :)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.