Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: Simple (but robust) email server (receiver)

by JavaFan (Canon)
on Dec 16, 2008 at 15:48 UTC ( [id://730675]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Simple (but robust) email server (receiver)
in thread Simple (but robust) email server (receiver)

This is vastly more resource-intensive than having a perl daemon that already runs with all required modules pre-loaded.
If that were the case, all the setups that use spamc to talk to spamd (client and daemon of spamassassin) would come to a grinding halt. But that's not true. A light weight program talking to a daemon doesn't have to be resource intensive. If it's run very often, it'll be in memory anyway. ;-)
Of course, you could have a perl daemon running and have qmail send the message to that, but what's the point? You need to use a mail protocol for transfer between qmail and the daemon, so it's no less work to write and you might as well leave qmail out of the process entirely.
Why on earth would you need SMTP to talk to such a daemon? That what your MTA is for. Your MTA can also take care of queuing - you may get bursts of mail faster than your database can store them. Or your database may be down, and you still want to accept mail.
You also have the problem of what to do with messages your perl process can not or does not want to accept. If there's an intermediate MTA, rejecting the message will create a bounce, which may be superfluous. Running your own receiving daemon you can reject at SMTP time which means it's up to the sender to create a bounce or ignore.
Whether or not the MTA will create a bounce that depends on how you configure the MTA, or on the exit status of the delivery program. I can't answer whether there should be a bounce or not - that's up to the OP. I often set qmail systems up in such a way that they never bounce. They accept anything, and just deliver to /dev/null instead of bouncing. There's already enough spam. ;-)

Anyway, as I said, it's my personal preference. I like qmail, it does its job well and efficiently. It's really easy to configure, and I haven't encountered the resource problems you refer to in the beginning of your post.

  • Comment on Re^3: Simple (but robust) email server (receiver)

Replies are listed 'Best First'.
Re^4: Simple (but robust) email server (receiver)
by tirwhan (Abbot) on Dec 16, 2008 at 16:50 UTC
    If that were the case, all the setups that use spamc to talk to spamd (client and daemon of spamassassin) would come to a grinding halt.

    Huh? It's precisely for this reason that any serious spamassassin setup will use spamd and not simply pipe messages through to spamc. The latter will come to a grinding halt under serious load. Thanks for making my point for me ;-)

    Why on earth would you need SMTP to talk to such a daemon?

    You wouldn't, you could also use LMTP. But your MTA has already accepted the message, which means you need a sensible way to communicate error states back to it. If (as you say) your database is down you want to pass back a temporary error to it. If you don't want to accept the message you need to pass a 5xx. Doing that in any other way than via a mail protocol is error-prone.

    Your MTA can also take care of queuing - you may get bursts of mail faster than your database can store them.

    That won't work well if you're piping messages to a new process, the process will either time out or die. In both cases your MTA will (normally) create a bounce, because this is a fatal error, the MTA was unable to deliver the message. You can configure the MTA to behave differently but again, that's hard to do correctly (if you care about RFCs) and much more complicated than writing the correct behaviour in Net::Server::Mail. An [SL]MTP-talking perl daemon can just give back a 4xx or 5xx error to the remote mail server, and that server can take care of the queueing for you. Much better.

    I often set qmail systems up in such a way that they never bounce.They accept anything, and just deliver to /dev/null instead of bouncing.

    Congratulations, you've just broken SMTP. SMTP guarantees that one of two things will happen to a message: 1.)The message will be delivered or 2.) you will get an error message back saying that it wasn't. If you set up a mail system to accept messages and then just blackhole them you have broken the 2nd part of that guarantee and are part of the problem email has these days. Superfluous bounces are another problem, but that can be solved by designing your system so that they do not need to bounce, not by breaking the protocol.


    All dogma is stupid.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://730675]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found