[Exim] SMTP Auth problem with server_set_id and md5 hashes (…

Top Page
Delete this message
Reply to this message
Author: Maximiliano Kolus
Date:  
To: 'exim-users@exim.org'
Subject: [Exim] SMTP Auth problem with server_set_id and md5 hashes (solved)
Hello!

    Finally, this worked... i forgot to include the second parameter to
the lsearch, instead of using "failed" i choosed to use "failed" as a word,
because the first one will reject the auth because of a lookup error and the
second, since there is no des hash that match the world "failed", will give
an authentication error.


    What i did?. From the inner part of the lookup to the outer.


* lookup the domain name using the /etc/hosts file (a sort of rDNS). This is
necesary to build /etc/virtual/domain.com/passwd
* lookup the des hash of the password against /etc/virtual/domain.com/passwd
using the username. The format of the file is just "username:hash".
* do crypteq against the des hash

    Also, i set server_set_id with the authenticated
username@???.


#
# plain text driver

plain:
    driver=plaintext
    public_name=PLAIN
    server_condition="\
    ${if crypteq{$3}{\
        ${lookup {$2} lsearch {/etc/virtual/\
            ${extract{1}{ \t}{\
                ${lookup {$interface_address} lsearch {/etc/hosts} {$value}
{failed}}\
                }\
            }/passwd} {$value} {failed}}}\
    {yes}{no}}"
    server_set_id = $2@${lookup {$interface_address} lsearch {/etc/hosts}
{$value}{failed}}


#
# login driver

login:
    driver=plaintext
    public_name=LOGIN
    server_prompts = "Username:::Password::"
    server_condition="\
    ${if crypteq{$2}{\
        ${lookup {$1} lsearch {/etc/virtual/\
            ${extract{1}{ \t}{\
                ${lookup {$interface_address} lsearch {/etc/hosts}
{$value}{failed}}\
                }\
            }/passwd} {$value}{failed}}}\
    {yes}{no}}"
    server_set_id = $1@${lookup {$interface_address} lsearch {/etc/hosts}
{$value}{failed}}


# End of Exim configuration file

-------------------------------
Maximiliano Kolus
System Engineer - AMTEC S.A.
Microsoft Certified System Engineer
mkolus@???
http://www.amtec.net

Amtec.net - The eBuilder Company of LatinAmerica