[rt-users] prevent email ticket creation by new users?

Phil R Lawrence prlawrence at Lehigh.EDU
Thu Jan 30 11:37:11 EST 2003

Phil Homewood wrote:

 > Phil R Lawrence wrote:
 >> By default, a new user is auto-created if an unrecognized email 
address is used.  How can I disable this?  I only want users that I 
create to have the right to create Tickets.
 > Untested: try enabling LookupSenderInExternalDatabase
 > and SenderMustExistInExternalDatabase in config.pm. The
 > LookupExternalUserInfo shim in config.pm shouldn't need
 > touching. This could perhaps be considered slight abuse
 > of the ExternalUserInfo stuff. :-)

This certainly blocked the creation of new users...  it also disabled 
the ability for *anyone* create tickets via email (because everyone 
fails the LookupExternalUserInfo function).

So I guess I want to replace this function with one that authenticates 
against the RT database.  I had the bright idea that I might use one of 
the RT::* modules to do this...

Before I list out my lame first test script (which didn't work) perhaps 
someone already know the best way to do this?

Anyway, here is my attempt, which fails with:
Can't use string ("RT::User") as a HASH ref while "strict refs" in use 
at /usr/lib/perl5/site_perl/5.8.0/DBIx/SearchBuilder/Record.pm line 890.

#! /usr/bin/perl
use warnings;
use diagnostics;
use strict;

use lib "/opt/rt2/lib";
use lib "/opt/rt2/etc";

use RT::Interface::CLI  qw(CleanEnv LoadConfig DBConnect
                            GetCurrentUser GetMessageContent);

#Clean out all the nasties from the environment

#Load etc/config.pm and drop privs

#Connect to the database and get RT::SystemUser
# and RT::Nobody loaded

use RT::User;
use Data::Dumper;

my $user;
$user = RT::User->Load("tjs5");
print Dumper($user);

More information about the rt-users mailing list