[rt-users] Mapping attributes.
Patterson, Craig
crpatter at ci.grand-rapids.mi.us
Tue Feb 19 10:12:05 EST 2008
I'd put some debug statements in there, especially after you bind and after you search so you can isolate where it's dying.
Craig
-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of "Fábio M. Catunda"
Sent: Monday, February 18, 2008 5:36 PM
To: rt-users at lists.bestpractical.com
Subject: Re: [rt-users] Mapping attributes.
Well, my ultra-mega User_Local.pm realy does not work, here it is:
no warnings qw(redefine);
sub Create {
my $Email = $$args{'Name'};
use Net::LDAP;
$ldap = Net::LDAP->new( '<ldap host>' ) or die "$@";
$mesg = $ldap->bind ;
$mesg = $ldap->search( attrs => ['cn'],
scope => "sub",
base => "ou=Users,dc=contactnet,dc=com,dc=br",
filter => "(&(mail=$Email))" );
$mesg->code && die $mesg->error;
if ($mesg->entries){
$res = $mesg->entry(0);
$res = $res->get_value("cn", 1);
$$args{'Name'} = $res;
}
$mesg = $ldap->unbind;
return 1;
};
1;
And here it goes some logging:
Mon Feb 18 22:30:23 2008] [crit]: User 'testert at contactnet.com.br'
could not be loaded in the mail gateway
(/usr/share/request-tracker3.6/lib/RT/Interface/Email.pm:241)
Stack trace:
RT::Interface::Email::MailError() called at
/usr/share/request-tracker3.6/lib/RT/Interface/Email.pm:328
RT::Interface::Email::CreateUser() called at
/usr/share/request-tracker3.6/lib/RT/Interface/Email/Auth/MailFrom.pm:172
RT::Interface::Email::Auth::MailFrom::GetCurrentUser() called at
/usr/share/request-tracker3.6/lib/RT/Interface/Email.pm:627
RT::Interface::Email::Gateway() called at
/usr/share/request-tracker3.6/html/REST/1.0/NoAuth/mail-gateway:59
HTML::Mason::Commands::__ANON__() called at
/usr/share/perl5/HTML/Mason/Component.pm:135
HTML::Mason::Component::run() called at
/usr/share/perl5/HTML/Mason/Request.pm:1251
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:1246
HTML::Mason::Request::comp() called at
/usr/share/perl5/HTML/Mason/Request.pm:460
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:460
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:412
HTML::Mason::Request::exec() called at
/usr/share/perl5/HTML/Mason/ApacheHandler.pm:165
HTML::Mason::Request::ApacheHandler::exec() called at
/usr/share/perl5/HTML/Mason/ApacheHandler.pm:832
HTML::Mason::ApacheHandler::handle_request() called at
/usr/share/request-tracker3.6/libexec/webmux.pl:123
(eval)() called at
/usr/share/request-tracker3.6/libexec/webmux.pl:123
RT::Mason::handler() called at -e:0
(eval)() called at -e:0
[Mon Feb 18 22:30:23 2008] [error]: RT could not load a valid user, and
RT's configuration does not allow
for the creation of a new user for this email (testert at contactnet.com.br).
You might need to grant 'Everyone' the right 'CreateTicket' for the
queue Suporte. (/usr/share/request-tracker3.6/lib/RT/Interface/Email.pm:241)
Stack trace:
RT::Interface::Email::MailError() called at
/usr/share/request-tracker3.6/lib/RT/Interface/Email.pm:846
RT::Interface::Email::_NoAuthorizedUserFound() called at
/usr/share/request-tracker3.6/lib/RT/Interface/Email.pm:652
RT::Interface::Email::Gateway() called at
/usr/share/request-tracker3.6/html/REST/1.0/NoAuth/mail-gateway:59
HTML::Mason::Commands::__ANON__() called at
/usr/share/perl5/HTML/Mason/Component.pm:135
HTML::Mason::Component::run() called at
/usr/share/perl5/HTML/Mason/Request.pm:1251
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:1246
HTML::Mason::Request::comp() called at
/usr/share/perl5/HTML/Mason/Request.pm:460
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:460
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:412
HTML::Mason::Request::exec() called at
/usr/share/perl5/HTML/Mason/ApacheHandler.pm:165
HTML::Mason::Request::ApacheHandler::exec() called at
/usr/share/perl5/HTML/Mason/ApacheHandler.pm:832
HTML::Mason::ApacheHandler::handle_request() called at
/usr/share/request-tracker3.6/libexec/webmux.pl:123
(eval)() called at
/usr/share/request-tracker3.6/libexec/webmux.pl:123
RT::Mason::handler() called at -e:0
(eval)() called at -e:0
[Mon Feb 18 22:30:23 2008] [error]: RT could not load a valid user, and
RT's configuration does not allow
for the creation of a new user for your email.
(/usr/share/request-tracker3.6/lib/RT/Interface/Email.pm:241)
Stack trace:
RT::Interface::Email::MailError() called at
/usr/share/request-tracker3.6/lib/RT/Interface/Email.pm:859
RT::Interface::Email::_NoAuthorizedUserFound() called at
/usr/share/request-tracker3.6/lib/RT/Interface/Email.pm:652
RT::Interface::Email::Gateway() called at
/usr/share/request-tracker3.6/html/REST/1.0/NoAuth/mail-gateway:59
HTML::Mason::Commands::__ANON__() called at
/usr/share/perl5/HTML/Mason/Component.pm:135
HTML::Mason::Component::run() called at
/usr/share/perl5/HTML/Mason/Request.pm:1251
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:1246
HTML::Mason::Request::comp() called at
/usr/share/perl5/HTML/Mason/Request.pm:460
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:460
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:412
HTML::Mason::Request::exec() called at
/usr/share/perl5/HTML/Mason/ApacheHandler.pm:165
HTML::Mason::Request::ApacheHandler::exec() called at
/usr/share/perl5/HTML/Mason/ApacheHandler.pm:832
HTML::Mason::ApacheHandler::handle_request() called at
/usr/share/request-tracker3.6/libexec/webmux.pl:123
(eval)() called at
/usr/share/request-tracker3.6/libexec/webmux.pl:123
RT::Mason::handler() called at -e:0
(eval)() called at -e:0
[Mon Feb 18 22:30:23 2008] [error]: Could not record email: Could not
load a valid user
(/usr/share/request-tracker3.6/html/REST/1.0/NoAuth/mail-gateway:73)
Stack trace:
HTML::Mason::Commands::__ANON__() called at
/usr/share/perl5/HTML/Mason/Component.pm:135
HTML::Mason::Component::run() called at
/usr/share/perl5/HTML/Mason/Request.pm:1251
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:1246
HTML::Mason::Request::comp() called at
/usr/share/perl5/HTML/Mason/Request.pm:460
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:460
(eval)() called at /usr/share/perl5/HTML/Mason/Request.pm:412
HTML::Mason::Request::exec() called at
/usr/share/perl5/HTML/Mason/ApacheHandler.pm:165
HTML::Mason::Request::ApacheHandler::exec() called at
/usr/share/perl5/HTML/Mason/ApacheHandler.pm:832
HTML::Mason::ApacheHandler::handle_request() called at
/usr/share/request-tracker3.6/libexec/webmux.pl:123
(eval)() called at
/usr/share/request-tracker3.6/libexec/webmux.pl:123
RT::Mason::handler() called at -e:0
(eval)() called at -e:0
Thanks for any help!
_______________________________________________
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