httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rian Hunter <r...@MIT.EDU>
Subject Re: mod_smtpd changes
Date Thu, 05 Jan 2006 20:18:27 GMT
On Sat, 2005-12-31 at 13:47, Brian J. France wrote:
> On Dec 31, 2005, at 1:23 PM, Rian Hunter wrote:
> > Any comments, ideas and criticisms are highly welcomed! Thanks!
> Any changes on how recipients and queue/deliver is handled?
> I started implementing my proposal from a while back and got stuck on  
> how to handle errors.  If a transaction has multiple valid recipients  
> and each one is handle by different queue modules, but only one of  
> queue modules returned a failed, is the whole thing a failure or  
> should the other messages be delivered and what should be returned  
> for a status for the DATA command?
> I am thinking that if all recipients are valid and can be handle by a  
> queue module then DATA will always return OK/200 what ever success  
> is.  If a queue module then finds an error happens while trying to  
> really deliver the message, a bounce need to be generated.  This  
> means we should have a common way to generate a bounce message  
> instead of having every module come up with its own.

I've been thinking about this a lot and what tradeoff's to make in
regard to handling the envelope. I think the main envelope of mod_smtpd
will only support one recipient (= each queue module will handle one
recipient at a time).

What I was thinking is to make smtpd_run_queue a RUN_FIRST hook, so it
will stop whenever a module returns SMTPD_ACCEPT (more about this
below). A default queue will be installed that is inserted absolutely
last, where if it is called it will bounce the message (because all the
rest SMTPD_DECLINED). But this doesn't work in a setting where one
address can be handled by multiple modules, so instead smtpd_run_queue
would be a RUN_ALL hook and modules will set a flag in the envelope
structure if the message was delivered correctly, then mod_smtpd checks
if it was or wasnt' then sends a bounce message for the addresses that

How should a queue module know if it should a certain recipient address?
There are two options:

* Have each queue module maintain its own list or criteria for which it
will queue a message.

* Let mod_smtpd be notified what queue modules should handle which
recipient addresses. Then it sets in each recipients envelope structure
a user defined string for a "queue handler." Each queue module checks
the queue handler string to see if it handles that envelope. This is not
the best either because it only allows for one queuer per recipient.

The first option follows the needs of mod_smtpd but at the same time I
really like the idea of a standardized of way of specifying which
modules get what addresses. This simplifies configuration, eliminates
code bloat and uses less cpu cycles. I'm still thinking about the best
way to implement something like that.

Rian Hunter

View raw message