mailgate/Automatic User creation problem

Problem: we want all authorized users of our system to be able to
access RT (Web interface AND email) as ‘unprivileged’ users.

Our solution was to use LookupSenderInExternalDatabase, and arrange for
user authentication on the web server. This works, but only if the user
exists in the rt database: otherwise we get a ‘You are not an authorized
user’ message from RT.
Question: is this the expected behaviour?

We want our users to be registered in the database (at least) by their
first e-mail to one of the RT aliases; but we do not want that a casual
mail arriving to our RT aliases from any spammer causes a new user to be
created. We thought we can achieve this by setting

But when both LookupSenderInExternalDatabase and
SenderMustExistInExternalDatabase variables are defined, program code
(about line 205 ) in the file bin/rt-mailgate effectively disables access
by mail.

We fixed the problem by modifying the test in rt-mailgate line 205 to test
also for the return flag of LookupExternalUserInfo. Moreover,
LookupExternalUserInfo is called in lib/RT/Interface/, and its
return flag is stored in a local variable, that needs to be made global to
be accessed by rt-mailgate.

Is this right? Can the change be incorporated in RT?

Solution: (modifications to 2 files) >
File lib/RT/Interface/

The variable $UserFoundInExternalDatabase was changed to the global
variable $RT::UserFoundInExternalDatabase

File bin/rt-mailgate


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

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

Alvise Nobile, Scientific Computing Section
The Abdus Salam International Centre for Theoretical Physics
Address: str. Costiera 11, I-34100 Trieste, Italy
Tel: +39-040-2240-391 Fax: +39-040-224163/224559