RT-2.0.10 : rt-mailgate with external data source

I’m trying to get rt-mailgate to work with an external data source
defined in my config.pm.

Here’s what I have, notice that I’m using the stock configuration, and
sending email from a valid email address, and I still get the error “RT
couldn’t find requestor via its external database lookup”.

One question, just to make sure I have my variables right…
$params{‘Name’} is the UserName right?
$params{‘EmailAddress’} is the Email field.
$params{‘RealName’} is the RealName field.

So, in principle, if I hardcode my %params with some static information
like.
$params{‘Name’} = “kris”;
$params{‘EmailAddress’} = "kris@eclipseci.com";
$params{‘RealName’} = “Kristopher Lalletti”;

It should recognize me as when I login into the gui with the userid kris
and my secret password… Right?

Here’s a part of my config.pm:

$LookupSenderInExternalDatabase = 1;
$SenderMustExistInExternalDatabase = 1;

sub LookupExternalUserInfo {
my ($EmailAddress, $RealName) = @_;

my $FoundInExternalDatabase = 1;
my %params = {};

#Name is the RT username you want to use for this user.
$params{‘Name’} = $EmailAddress;
$params{‘EmailAddress’} = $EmailAddress;
$params{‘RealName’} = $RealName;

See RT’s contributed code for examples.

http://www.fsck.com/pub/rt/contrib/

return ($FoundInExternalDatabase, %params);
}

Hi Kristopher,

I found the problem wasn’t with the code in config.pm (which you’ve got to
modify for the external lookup anyway), but with rt-mailgate. Here’s the
changed code I use in my rt-mailgate (2.0.8).

{{{ If we require that the sender be found in an external DB and they’re not

forward this message to RTOwner

modified by mkalastro@soe.ucsc.edu

my @ExternalUserInfo = &RT::LookupExternalUserInfo
( $CurrentUser -> UserObj -> EmailAddress,
$CurrentUser -> UserObj -> RealName );
my $FoundUser = shift @ExternalUserInfo;

if ( $RT::LookupSenderInExternalDatabase &&
$RT::SenderMustExistInExternalDatabase &!
$FoundUser ) {

MailError(To => $RT::OwnerEmail,
          Subject => "RT Bounce: $Subject",
          Explanation => "RT couldn't find requestor via its external datab\

ase lookup",
MIMEObj => $entity);

}

}}}On 1/16/02 at 12:39pm, Kristopher Lalletti kris@eclipseci.com wrote:

|I’m trying to get rt-mailgate to work with an external data source
|defined in my config.pm.
|
|Here’s what I have, notice that I’m using the stock configuration, and
|sending email from a valid email address, and I still get the error “RT
|couldn’t find requestor via its external database lookup”.

Matthew Kalastro
Webmaster
Baskin School of Engineering
Baskin Engineering 138
Univ. of Calif., Santa Cruz
1156 High St.
Santa Cruz, CA 95060
(831) 459-5354

Indeed, works perfectly with stock config.

Thanks!-----Original Message-----
From: Matthew Kalastro [mailto:mkalastro@soe.ucsc.edu]
Sent: January 16, 2002 3:03 PM
To: Kristopher Lalletti
Cc: rt-users@lists.fsck.com
Subject: Re: [rt-users] RT-2.0.10 : rt-mailgate with external data
source.

Hi Kristopher,

I found the problem wasn’t with the code in config.pm (which you’ve got
to
modify for the external lookup anyway), but with rt-mailgate. Here’s
the
changed code I use in my rt-mailgate (2.0.8).

{{{ If we require that the sender be found in an external DB and

they’re not

forward this message to RTOwner

modified by mkalastro@soe.ucsc.edu

my @ExternalUserInfo = &RT::LookupExternalUserInfo
( $CurrentUser -> UserObj -> EmailAddress,
$CurrentUser -> UserObj -> RealName );
my $FoundUser = shift @ExternalUserInfo;

if ( $RT::LookupSenderInExternalDatabase &&
$RT::SenderMustExistInExternalDatabase &!
$FoundUser ) {

MailError(To => $RT::OwnerEmail,
          Subject => "RT Bounce: $Subject",
          Explanation => "RT couldn't find requestor via its

external datab
ase lookup",
MIMEObj => $entity);

}

}}}

Kris,

The routine in config.pm is just a place-holder. You need to insert code
that verifies the arguments with the external datasource. For instance, if
your data source is LDAP, you could use the contributed code located at
http://www.fsck.com/pub/rt/contrib/2.0/ called external-users.

The code supplied as of 2.0.9 at least does have a bug against it,
documented at http://fsck.com/rt2/Ticket/Display.html?id=979. If you look
at the last transaction, it contains a patch to correct the bug.

Regards,
Christian

Christian Gilmore
Team Lead
Web Infrastructure & Tools
IBM Software Group