Re: [exim] Authentication using + separator

Top Page
Delete this message
Reply to this message
Author: mtrainer
Date:  
To: exim-users
Subject: Re: [exim] Authentication using + separator


On 08.05.2014 15:37, Jasen Betts wrote:

> On 2014-05-05,

mtrainer@??? [2] wrote:
>
>>> On 2014-04-28,

mtrainer@??? [1][1] wrote:
>>>
>>>> Hi All, I
>> am

migrating users from a CPanel system and have users that authenticate
using user+domain instead of the usual user@domain format. How do I
support using both the '+" and '@' separators in Exim?
>>
>>> put

users in
>> the database with both forms of username or use like

${sg{$username}{@}{+}}
>
> try this:
>
> public_name = PLAIN
>

server_condition = ${if ldapauth { user="${lookup
> ldapdn{

LDAPS/LDAPBASE?dn?sub?(mail=$1)}}" pass=${quote:$2}
>

LDAPS/}{yes}{no}}
>
> server_condition = ${if ldapauth { user="${lookup


> ldapdn{ LDAPS/LDAPBASE?dn?sub?(mail=${sg{$1}{@}{+}})}}"
>

pass=${quote:$2}LDAPS/}{yes}{no}}
> server_prompts = :
> server_set_id =

${sg{$1}{@}{+}}
>
>> auth_login: driver = plaintext public_name =

LOGIN
>
> server_condition = ${if ldapauth { user="${lookup ldapdn{
>

LDAPS/LDAPBASE?dn?sub?(mail=${sg{$1}{@}{+}})}}" pass=${quote:$2}
>

LDAPS/}{yes}{no}}
> server_prompts = Username:: : Password::
>

server_set_id = ${sg{$1}{@}{+}}

Thanks, I figured it out also. Needed
three backslashes before the '+' to successfully replace it with an '@'.
I didn't need to do the server_set_id as the sg changes the value of the
$1 variable. Also slipped in the accountStatus=active bit.


server_condition = ${if ldapauth { user="${lookup ldapdn{
LDAPS/LDAPBASE?dn?sub?(&(mail=${sg{$1}{\+}{@}})(accountStatus=active))}}"
pass=${quote:$2} LDAPS/}{yes}{no}}

Murray


Links:
------
[1]
mailto:mtrainer@cloud-free.com
[2] mailto:mtrainer@cloud-free.com
[3]
mailto:mtrainer@cloud-free.com