[Rt-devel] Re: Who should call RT::EmailParser::LookupExternalUserInfo()?

Petter Reinholdtsen pere at hungry.com
Thu Aug 26 06:15:56 EDT 2004


[Petter Reinholdtsen]
> Which part of the code is supposed to call this function?  I suspect
> Email/Auth/MailFrom.pm is the best place to insert the call.  Is this
> patch on the right track?

Digging deeper, I found User::CanonicalizeUserInfo() which could use a
call to RT::EmailParser::LookupExternalUserInfo() as well, to make
sure new users are created with the information updated from the
external source.

Here is my proposed patch.

--- lib/RT/User_Overlay.pm.orig      2004-07-12 20:00:53.000000000 +0200
+++ lib/RT/User_Overlay.pm    2004-08-26 12:14:27.000000000 +0200
@@ -670,6 +670,15 @@
     my $args = shift;
     my $success = 1;

+    my %ExternalUserInfo =
+    my ($UserFoundInExternalDatabase, %ExternalUserInfo) =
+        RT::EmailParser::LookupExternalUserInfo( undef, $Address, $Name );
+    if ($UserFoundInExternalDatabase) {
+       for my $key (keys %ExternalUserInfo) {
+           $userhashref->{$key} = $ExternalUserInfo{$key};
+       }
+    }
+
     return ($success);
 }

Is this correct?  If it is, please include in a future version of RT.


More information about the Rt-devel mailing list