On 08.05.2014 15:37, Jasen Betts wrote:
> On 2014-05-05, [email protected] [2] wrote: > >>> On 2014-04-28, [email protected] [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:[email protected] [2] mailto:[email protected] [3] mailto:[email protected] -- ## List details at https://lists.exim.org/mailman/listinfo/exim-users ## Exim details at http://www.exim.org/ ## Please use the Wiki with this list - http://wiki.exim.org/
