[rt-users] CanonicalizeUserInfo in Email.pm - "Name in use"

Sam Chenkin schenkin at gmail.com
Thu Jan 29 15:50:34 EST 2009


If necessary, you can work around the multiple-email addresses issue
as long as emails to the primary email address get to the user in some
way.

In addition to the change I mentioned before, I edited my MailFrom.pm.
Now it checks the ldap server for any user with a forward address
equal to the incoming email. If it finds it, the email is associated
with that user.

The only problem is that the user will be created with the primary
email address, not any of the secondary ones. This means that all
email generated by the system will get sent to the primary email.
Doesn't matter in my case, since my email server forwards all email to
the secondary address.

Below are my changes for MailFrom.pm:

Find line 72, add:

$RT::Logger->debug("Now doing initial lookup for email address");
my ($UserFoundInExternalDatabase, %ExternalUserInfo) =
RT::Authen::ExternalAuth::LDAP::CanonicalizeUserInfo( 'istmail',
'mail', $Addre
ss );$RT::Logger->debug("Finished Initial Lookup, Did I find someone?:
" . $UserFoundInExternalDatabase);

    if ($UserFoundInExternalDatabase) {
       $Name = $ExternalUserInfo{'Name'} if ($ExternalUserInfo{'Name'});
       $Address  = $ExternalUserInfo{'EmailAddress'} if
($ExternalUserInfo{'EmailAddress'});
       $RealName = $ExternalUserInfo{'RealName'} if
($ExternalUserInfo{'RealName'});
        $RT::Logger->crit("I have found the user in the external database");
   }

Replace the $CurrentUser = CreateUser... line with:
     $CurrentUser = CreateUser( $Name, $Address, $Name, $Address,
$args{'Message'} );




On Thu, Jan 29, 2009 at 12:49 PM, Rob Munsch <rob.munsch at gmail.com> wrote:
> Excellent, thanks.
>
> (Are messages sent to the list filtered from coming back to the sender?)
>
> On Thu, Jan 29, 2009 at 12:44 PM, Mike Peachey <mike.peachey at jennic.com> wrote:
>> Rob Munsch wrote:
>>> On Thu, Jan 29, 2009 at 12:39 PM, Mike Peachey <mike.peachey at jennic.com> wrote:
>>>
>>>> I will be working on functionality for EA 0.09 whereby it will lookup a
>>>> user on reception of e-mail, determine if an account already exists with
>>>> one of the available e-mail addresses in their LDAP service and if so
>>>> log them in with that address, but it is not currently possible in 0.08.
>>>
>>> In the meantime, what's the recommended method for dealing with users
>>> you want to auth via LDAP if they've already submitted tickets via
>>> email, and exist in RT because of that?
>>>
>>>
>>
>> Change the email address of the email created account to @foo.bar
>>
>> --
>> Kind Regards,
>>
>> __________________________________________________
>>
>> Mike Peachey, IT
>> Tel: +44 114 281 2655
>> Fax: +44 114 281 2951
>> Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK
>> Comp Reg No: 3191371 - Registered In England
>> http://www.jennic.com
>> __________________________________________________
>>
>
>
>
> --
> /chown -R us:us /yourbase
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>



More information about the rt-users mailing list