Re: [exim] How to make EXIM authenticate directly against IM…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Lanny Jason Godsey
Data:  
Para: Marc Perkel
CC: exim-users
Asunto: Re: [exim] How to make EXIM authenticate directly against IMAP

Having exim have to figure out the backend imap server is what I was
trying to help you avoid by using Perdition.

If you haven't used Perdition, it's a fantastic IMAP/POP3 proxy that
can apply all kinds of rules on users to get them to the right
destination. Regular Expressions, Database lookups, many options.

Glad I was able to help.


--- Marc Perkel <marc@???> wrote:

> OK - this works. Thanks a lot Lanny!!!!
>
> What this does is allows you to SMTP authentication against IMAP.
> This
> means that the same login for your IMAP server will work for
> authenticated SMTP. Exim does not need to know anything about the
> backend of your IMAP server. I modified the code to allow for
> authenticating against a different host than localhost.
>
> *** contents of /etc/exim/perl.pl ***
>
> #!/usr/bin/perl
>
> # Parameters Host Account Password
>
> use Net::IMAP::Simple::SSL;
>
> sub imapLogin {
>    my $host = shift;
>    my $account = shift;
>    my $password = shift;

>
>    # open a connection to the IMAP server
>    my $server = new Net::IMAP::Simple($host);

>
>    # login, if success return 1 (true?) and 0 (false?)
>    if ($server->login( $account, $password )) {
>       return 1;
>    } else {
>       return 0;
>    }
>    $server->close();
> }

>
> *** end perl.pl ***
>
>
>
>

######################################################################
> #                   AUTHENTICATION CONFIGURATION                    
> #

>

######################################################################
>
> perl_startup = do '/etc/exim/perl.pl'
> perl_at_start
>
>
> begin authenticators
>
> plain:
> driver = plaintext
> public_name = PLAIN
> server_condition = ${perl{imapLogin}{localhost}{$2}{$3}}
> server_set_id = $2
>
>
> login:
>    driver = plaintext
>    public_name = LOGIN
>    server_prompts = "Username:: : Password::"
>    server_condition = ${perl{imapLogin}{localhost}{$1}{$2}}
>    server_set_id = $1

>
>
> It's a lot better when people help you make something work rather
> than
> grill you about what you shouldn't do it. You're a hero Lanny!
>
> The next step is to add a lookup table for remote domains that I can
> look up to see what IMAP server to authenticate against.
>
>
>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://www.exim.org/eximwiki/
>