On Jul 19, 2005, at 6:51 AM, Nick Kew wrote:
the problem i found when i did my poc is when there is in the command, different destination email. It's difficult here to keep the virtualHost
scheme.
It would be nice to keep a conf file like

<virtualHost>
    ServerName mail.bla.com
    SmtpUserMap mail.bla.com-user.map
    or SmtpRelay host
    ....
</virtualHost>


Yes. I think there is a logical difficulty here. smtpd_create_request
is run before process_smtp_connection_internal, and the design doesn't
allow for multiple recipients to be processed differently.

My own feeling was that multiple recipients require a request each.
Maybe we could get that in your design by creating a subrequest
for each RCPT TO?

This is possible but I'm not sure what the advantage is. Would you mind setting up a hypothetical situation where this is necessary? I figure that ultimately the handler will be responsible for dealing with each rcpt to differently.

Early on I wanted configuration possibility similar to:
#########
Listen 21
<VirtualHost *:21>
    # mod_smtpd conf
      SmtpProtocol On
    SetHandler unix-module

    # mod_smtpd_unix
    AcceptDomains thelaststop.net www.thelaststop.net
    Relay On

    # mod_smtpd_easyfilter
    <Filter>
        # matches against email in MAIL TO: smtp command
        RegexMailTo "/thelaststop.net$/"
        SetHandler maildir-module

        # mod_smtpd_maildir conf
        MaildirBase "/usr/local/virtual"
        MailboxLimit 50M
    </Filter>

    # Simple spam filter using mod_smtpd_easyfilter
    # Default handler does nothing with mail message
    <Filter>
        RegexHeader "Subject" "/cialis/"
        SetHandler none
    </Filter>
</VirtualHost>
##########

In the case of this httpd.conf embedded filtering mechanism, I figured the handlers could be changed based on the certain RegExs right before ap_run_handler() was called. Maybe ap_run_fixups() could be called, and my hypothetical mod_smtpd_easyfilter would have a fixups hook where it accomplished something similar to this situation. Although after thinking about it I realize now that mod_smtpd_easyfilter couldn't set different handlers for different rcpt tos. Is this what you meant?

I think this requires some more thought considering different smtp connections and server requirements. The main drawback to sub- requesting each rcpt to is that we have two different handlers trying to read data from the socket. Is this problem solved by spooling the data, and letting the two separate requests read from the spool bucket?
-rian

Reply via email to