[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-anubis] Question about esmtp-auth-id manipulation
From: |
Gabriel Araujo |
Subject: |
Re: [bug-anubis] Question about esmtp-auth-id manipulation |
Date: |
Wed, 12 Jan 2011 13:03:32 -0200 |
I completely understand and agree with you - the decision about credentials
should be done before the connection establishment.
Although it could reuse a lot of the rules logic/syntax/code it would rather
be like a pre-connection phase. This could be a very interesting new
functionality, giving the user the flexibility to make decisions about the
entire SMTP structure - what server to use, what user, password, etc.
After the connection is established, everything works pretty much the same.
I think your change would be great!
On Wed, Jan 12, 2011 at 12:29 PM, Sergey Poznyakoff <address@hidden> wrote:
> Gabriel Araujo <address@hidden> ha escrit:
>
> > Let me say I have been using Anubis for a while and its an excellent
> > piece of software - congrats!
>
> Thanks. Wojciech and I are very pleased to hear that :)
>
> > To be able to use esmtp-* keywords into rule section would be great -
> > not sure how hard it is to implement.
>
> Technically speaking, Anubis sends each SMTP command to the remote server
> immediately after receiving it from the client, so if esmtp-auth
> is requested in your config file, then authorization takes place
> immediately
> after receiving the EHLO reply from the remote server. If this decision
> should depend on the value of a particular message header (this is
> basically what you need), then Anubis would have to suspend all
> SMTP dialogue with the remote server until at least the requested header
> (or end of header marker) has been received from the client as a part of
> DATA
> block, and then "replay" it back. This constitutes a rather considerable
> rewrite of the program's logic.
>
> The things would become easier if the decision should depend not on a
> message
> header, but on the value of a SMTP command (e.g., that of MAIL FROM). This
> would require relatively small changes and would permit to achieve the
> same effect (provided the client is able to alter the value of
> that command, of course).
>
> In other words, this change will allow you to write such a rule:
>
> BEGIN SMTP
> if command ["mail from:"] "<address@hidden>.*"
> esmtp-auth-id "smtp-user1"
> esmtp-password "pass1"
> else if command ["mail from:"] "<address@hidden>.*"
> esmtp-auth-id "smtp-user2"
> esmtp-password "pass2"
> fi
> fi
> END
>
> I think I'll start from implementing this approach as a proof of concept,
> and then switch to the full-fledged implementation.
>
> What do you think?
>
> Regards,
> Sergey
>
>
>
--
gabriel at macacos org