Re: [rt-users] Email Priority.

2010-08-05 Thread Mark Jenks
Okay!  Figured it out.

Set Priority should be:

$self->TicketObj->SetPriority( 100 );

Also, I needed a Return 1; in the preparation line.

-Original Message-
From: Mark Jenks 
Sent: Thursday, August 05, 2010 11:39 AM
To: Mark Jenks; Christian Loos
Cc: rt-users@lists.bestpractical.com
Subject: RE: [rt-users] Email Priority.

Anyone have any suggestions why the below is not working?

-Original Message-
From: rt-users-boun...@lists.bestpractical.com
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Mark
Jenks
Sent: Wednesday, August 04, 2010 1:00 PM
To: Christian Loos
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Email Priority.

That is exactly what I have an when I send an email into the queue with
the priority on, it doesn't set it.I see it when I show full
headers.

How do you debug a scrip?

-Original Message-
From: Christian Loos [mailto:cl...@netcologne.de] 
Sent: Wednesday, August 04, 2010 10:48 AM
To: Mark Jenks
Cc: rt-users@lists.bestpractical.com
Subject: Re: Email Priority.

You have to create a new scrip with:

Description: On Create Set Priority
Condition: On Create
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate

and my code in 'Custom action cleanupcode'.

-Chris

Am 04.08.2010 17:28, schrieb Mark Jenks:
> Okay, I modified the original "On create notify requestors" and put
that
> code in.  Got nothing.
> Created a new "On create set priority" and it still didn't do
anything.
> 
> -Mark
> 
> -Original Message-
> From: Christian Loos [mailto:cl...@netcologne.de] 
> Sent: Wednesday, August 04, 2010 3:54 AM
> To: Mark Jenks
> Cc: rt-users@lists.bestpractical.com
> Subject: Re: Email Priority.
> 
> Create a scrip 'On Create' with the following 'Custom action cleanup
> code':
> 
> my $ticket;
> my $attachment = $self->TransactionObj->Attachments->First;
> return 1 unless $attachment;
> my $prio = $attachment->GetHeader('Priority');
> return 1 unless $prio;
> 
> if ( $prio eq 'Urgent' ) {
>   $ticket->SetPriority(50);
> }
> return 1;
> 
> -chris
> 
> Am 03.08.2010 20:17, schrieb Mark Jenks:
>> Is there a way to set a ticket priority to 50 if the user sets the
> Email
>> from outlook to Urgent?
>>
>>  
>>
>> Inside of the headers of the email exists "Priority: Urgent".
>>
>>  
>>
>> Can that be checked and acted on when a ticket gets created?
>>

CONFIDENTIALITY NOTICE:  The information contained in this email
message, including any attachments, may be 
privileged, confidential and otherwise protected from disclosure.  If
the reader of this message is not the 
intended recipient, you are hereby notified that any use, dissemination,
distribution or copying of this 
message, including any attachments, is strictly prohibited.  If you have
received this email message in 
error, please notify the sender by reply email and delete/destroy the
email message, including attachments, 
and any copies thereof.  Although we have taken precautions to minimize
the risk of transmitting viruses via 
email and attachments thereto, we do not guarantee that either is
virus-free, and we accept no liability for 
any damages sustained as a result of any such viruses.

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

CONFIDENTIALITY NOTICE:  The information contained in this email message, 
including any attachments, may be 
privileged, confidential and otherwise protected from disclosure.  If the 
reader of this message is not the 
intended recipient, you are hereby notified that any use, dissemination, 
distribution or copying of this 
message, including any attachments, is strictly prohibited.  If you have 
received this email message in 
error, please notify the sender by reply email and delete/destroy the email 
message, including attachments, 
and any copies thereof.  Although we have taken precautions to minimize the 
risk of transmitting viruses via 
email and attachments thereto, we do not guarantee that either is virus-free, 
and we accept no liability for 
any damages sustained as a result of any such viruses.

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


[rt-users] Script Codes

2010-08-05 Thread Sysadmin

Is there a cheatsheet of RT script codes? and/or fieldcodes

Specifically,  I'm looking to insert the "Real Name" of the user 
assigned to a ticket. (currently inserts username)


also I'd like to generate the Email notification when the ticket is 
first assigned from "nobody" to "somebody"
I'm currently using the owner change script. which sorta works, but does 
not allow me to use owner change as it was intended.


Thanks,

David
System Administrator
RNS

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


[rt-users] [Rt-announce] RT for Mobile Devices 0.9

2010-08-05 Thread Jesse Vincent
Over the past few weeks, I've been spending my time putting together an
initial implementation of a modern phone-friendly interface for RT.

We've just published the source code to
http://github.com/bestpractical/rt-extension-mobileui and it will show
up at http://search.cpan.org/dist/RT-Extension-MobileUI in the very
near future.

This is very much an initial release and I know there are things that
need improvement, though I'd greatly appreciate feedback to help figure
out what those improvements should be.

We've tested this new UI on the iPhone, Android 2.x, BlackberryOS 4.5
and 5.0, Kindle 2.5 and in a number of desktop browsers. We've only
tested this on a recent RT 3.8, but it _should_ work on older versions
of RT. Reports of failures on 3.6.x or 3.8.x would be much appreciated.

Once you install the extension, you can have a look around from your
desktop browser by visiting /m on your RT server.  The Mobile UI tries
pretty hard to detect mobile browsers and push them to the mobile login
page, though there's a link to get back to the full UI if it gets your
browser wrong.

Right now, the mobile interface supports:

External Authentication
Regular RT Login
Creating Tickets
Search (using the same "Simple Search" as the main UI)
Display of saved searches
Ticket display
Ticket comment/reply
Ticket history
Attachment download

You can see some screenshots at http://blog.bestpractical.com/

-Jesse

-- 
___
RT-Announce mailing list
rt-annou...@lists.bestpractical.com
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-announce

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] Email Priority.

2010-08-05 Thread Mark Jenks
Okay, I'm looking at debug.  It never runs my new Global Scrip of "On
Create Set Priority".

-Mark

[Thu Aug  5 19:28:21 2010] [info]:
 #1543/22696
- Scrip 4 On Create Notify AdminCcs
(/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:300)
[Thu Aug  5 19:28:21 2010] [info]:
 No
recipients found. Not sending.
(/opt/rt3/bin/../lib/RT/Interface/Email.pm:352)
[Thu Aug  5 19:28:21 2010] [info]:

#1543/22696 - Scrip 19 On Create Notify Ccs
(/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:300)
[Thu Aug  5 19:28:21 2010] [info]:
 No
recipients found. Not sending.
(/opt/rt3/bin/../lib/RT/Interface/Email.pm:352)
[Thu Aug  5 19:28:21 2010] [info]:

#1543/22696 - Scrip 3 On Create Notify Requestors
(/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:300)
[Thu Aug  5 19:28:21 2010] [info]:
 sent  To:
mark.je...@iodincorporated.com
(/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:331)
[Thu Aug  5 19:28:21 2010] [info]: Ticket 1543 created in queue
'Systems' by mark.jenks (/opt/rt3/bin/../lib/RT/Ticket_Overlay.pm:671)

-Original Message-
From: Mark Jenks 
Sent: Thursday, August 05, 2010 11:39 AM
To: Mark Jenks; Christian Loos
Cc: rt-users@lists.bestpractical.com
Subject: RE: [rt-users] Email Priority.

Anyone have any suggestions why the below is not working?

-Original Message-
From: rt-users-boun...@lists.bestpractical.com
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Mark
Jenks
Sent: Wednesday, August 04, 2010 1:00 PM
To: Christian Loos
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Email Priority.

That is exactly what I have an when I send an email into the queue with
the priority on, it doesn't set it.I see it when I show full
headers.

How do you debug a scrip?

-Original Message-
From: Christian Loos [mailto:cl...@netcologne.de] 
Sent: Wednesday, August 04, 2010 10:48 AM
To: Mark Jenks
Cc: rt-users@lists.bestpractical.com
Subject: Re: Email Priority.

You have to create a new scrip with:

Description: On Create Set Priority
Condition: On Create
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate

and my code in 'Custom action cleanupcode'.

-Chris

Am 04.08.2010 17:28, schrieb Mark Jenks:
> Okay, I modified the original "On create notify requestors" and put
that
> code in.  Got nothing.
> Created a new "On create set priority" and it still didn't do
anything.
> 
> -Mark
> 
> -Original Message-
> From: Christian Loos [mailto:cl...@netcologne.de] 
> Sent: Wednesday, August 04, 2010 3:54 AM
> To: Mark Jenks
> Cc: rt-users@lists.bestpractical.com
> Subject: Re: Email Priority.
> 
> Create a scrip 'On Create' with the following 'Custom action cleanup
> code':
> 
> my $ticket;
> my $attachment = $self->TransactionObj->Attachments->First;
> return 1 unless $attachment;
> my $prio = $attachment->GetHeader('Priority');
> return 1 unless $prio;
> 
> if ( $prio eq 'Urgent' ) {
>   $ticket->SetPriority(50);
> }
> return 1;
> 
> -chris
> 
> Am 03.08.2010 20:17, schrieb Mark Jenks:
>> Is there a way to set a ticket priority to 50 if the user sets the
> Email
>> from outlook to Urgent?
>>
>>  
>>
>> Inside of the headers of the email exists "Priority: Urgent".
>>
>>  
>>
>> Can that be checked and acted on when a ticket gets created?
>>

CONFIDENTIALITY NOTICE:  The information contained in this email
message, including any attachments, may be 
privileged, confidential and otherwise protected from disclosure.  If
the reader of this message is not the 
intended recipient, you are hereby notified that any use, dissemination,
distribution or copying of this 
message, including any attachments, is strictly prohibited.  If you have
received this email message in 
error, please notify the sender by reply email and delete/destroy the
email message, including attachments, 
and any copies thereof.  Although we have taken precautions to minimize
the risk of transmitting viruses via 
email and attachments thereto, we do not guarantee that either is
virus-free, and we accept no liability for 
any damages sustained as a result of any such viruses.

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

CONFIDENTIALITY NOTICE:  The information contained in this email message, 
including any attachments, may be 
privileged, confidential and otherwise protected from disclosure.  If the 
reader of this message is not the 
intended recipient, you are hereby notified that any use, dissemination, 
distribution or copying of this 
message, including any attachments, is strictly prohibited.  If you have 
received this email message in 
error, please notify the sender by reply email and delete/destroy the email 
message, including attachments, 
and any copies thereof.  Although we have taken precautions to minimize the 
risk of transmitting viruses via 
email and attachments thereto, we do not guarantee that either is virus-free, 
and we accept no liability for 
any damages sustained as a result of any such viruses.

Disco

Re: [rt-users] Debugging templates and scrips

2010-08-05 Thread Kenneth Crocker
Gerard,

I would add some code in strategic places that create a line in the log
file. This would allow you to see how far the template went before dying.

Kenn
LBNL

On Thu, Aug 5, 2010 at 10:52 AM, Gerard FENELON  wrote:

> Hi
>
> does anyone have tips on debugging templates and scrips ?
> I am still using the Stone Age method of adding calls to RT::Logger,
> and I find this method a bit slow.
> In my experience, templates can be a special pain because they can die
> silently.
>
> Thanks
> Gerard
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

[rt-users] Debugging templates and scrips

2010-08-05 Thread Gerard FENELON

Hi

does anyone have tips on debugging templates and scrips ?
I am still using the Stone Age method of adding calls to RT::Logger,
and I find this method a bit slow.
In my experience, templates can be a special pain because they can die 
silently.


Thanks
Gerard

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


[rt-users] Helper functions for templates

2010-08-05 Thread Gerard FENELON

Hi

In my current setup, I have defined a few helper functions in my templates.

Since there is a lot of duplication, I would like to put these helper 
functions

somewhere in the code tree where they would be accessible to all templates.

What would be the best place ?
Something like local/lib ?

Thanks
Gerard

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] Custom Fields

2010-08-05 Thread Kenneth Crocker
David,

We use the following code modification:

Create a /opt/rt3/local/ copy of "/opt/rt3/share/html/Elements/*
EditCustomField
*
Then add the following code after line # 93:

if ($Type eq "Text") {

$Rows = 8;

$Cols = 50;

} elsif ($Type eq "Wikitext") {

$Rows = 8;

$Cols = 50;

} elsif ($Type eq "Select" and $MaxValues == 1) {

$Rows = 1;

$Cols = 30;

}


The last part of the code turns your list of values into a *"drop-down"*list.


Hope this helps.


Kenn

LBNL


On Thu, Aug 5, 2010 at 9:44 AM, Sysadmin  wrote:

> Is it possible to change the size of the wikitext box?
> Ideally I would like to display a large rectangular box under the issue
> description text area
>
> David
> System Administrator
> RNS
>
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

[rt-users] Custom Fields

2010-08-05 Thread Sysadmin

Is it possible to change the size of the wikitext box?
Ideally I would like to display a large rectangular box under the issue 
description text area


David
System Administrator
RNS



Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] Email Priority.

2010-08-05 Thread Mark Jenks
Anyone have any suggestions why the below is not working?

-Original Message-
From: rt-users-boun...@lists.bestpractical.com
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Mark
Jenks
Sent: Wednesday, August 04, 2010 1:00 PM
To: Christian Loos
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Email Priority.

That is exactly what I have an when I send an email into the queue with
the priority on, it doesn't set it.I see it when I show full
headers.

How do you debug a scrip?

-Original Message-
From: Christian Loos [mailto:cl...@netcologne.de] 
Sent: Wednesday, August 04, 2010 10:48 AM
To: Mark Jenks
Cc: rt-users@lists.bestpractical.com
Subject: Re: Email Priority.

You have to create a new scrip with:

Description: On Create Set Priority
Condition: On Create
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate

and my code in 'Custom action cleanupcode'.

-Chris

Am 04.08.2010 17:28, schrieb Mark Jenks:
> Okay, I modified the original "On create notify requestors" and put
that
> code in.  Got nothing.
> Created a new "On create set priority" and it still didn't do
anything.
> 
> -Mark
> 
> -Original Message-
> From: Christian Loos [mailto:cl...@netcologne.de] 
> Sent: Wednesday, August 04, 2010 3:54 AM
> To: Mark Jenks
> Cc: rt-users@lists.bestpractical.com
> Subject: Re: Email Priority.
> 
> Create a scrip 'On Create' with the following 'Custom action cleanup
> code':
> 
> my $ticket;
> my $attachment = $self->TransactionObj->Attachments->First;
> return 1 unless $attachment;
> my $prio = $attachment->GetHeader('Priority');
> return 1 unless $prio;
> 
> if ( $prio eq 'Urgent' ) {
>   $ticket->SetPriority(50);
> }
> return 1;
> 
> -chris
> 
> Am 03.08.2010 20:17, schrieb Mark Jenks:
>> Is there a way to set a ticket priority to 50 if the user sets the
> Email
>> from outlook to Urgent?
>>
>>  
>>
>> Inside of the headers of the email exists "Priority: Urgent".
>>
>>  
>>
>> Can that be checked and acted on when a ticket gets created?
>>

CONFIDENTIALITY NOTICE:  The information contained in this email
message, including any attachments, may be 
privileged, confidential and otherwise protected from disclosure.  If
the reader of this message is not the 
intended recipient, you are hereby notified that any use, dissemination,
distribution or copying of this 
message, including any attachments, is strictly prohibited.  If you have
received this email message in 
error, please notify the sender by reply email and delete/destroy the
email message, including attachments, 
and any copies thereof.  Although we have taken precautions to minimize
the risk of transmitting viruses via 
email and attachments thereto, we do not guarantee that either is
virus-free, and we accept no liability for 
any damages sustained as a result of any such viruses.

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

CONFIDENTIALITY NOTICE:  The information contained in this email message, 
including any attachments, may be 
privileged, confidential and otherwise protected from disclosure.  If the 
reader of this message is not the 
intended recipient, you are hereby notified that any use, dissemination, 
distribution or copying of this 
message, including any attachments, is strictly prohibited.  If you have 
received this email message in 
error, please notify the sender by reply email and delete/destroy the email 
message, including attachments, 
and any copies thereof.  Although we have taken precautions to minimize the 
risk of transmitting viruses via 
email and attachments thereto, we do not guarantee that either is virus-free, 
and we accept no liability for 
any damages sustained as a result of any such viruses.

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] RTx:Tags - can you have queue specific tagclouds

2010-08-05 Thread Jerrad Pierce
> Does anyone know how you might go about having tagclouds that are specific
> to a queue?
I never had the need. It's not impossible, but would take considerable work.

Part of the problem is that for expediency the extension does its work
with raw SQL,
rather than the RT API. Therefore, it is not aware of users' CF ACLs.
Although hacking
in that bit wouldn't be too hard. Feel free to submit a bug report at
rt.cpan.org, but
I can't make any guarantees when I might be able to do so.

However, I would make the case that while there may be some information leakage
through seeing tags on tickets one cannot access, access to a full
list of tags in
current use helps standardize tag names and reduce proliferation. Not
getting results
when clicking on tags ranks as a minor annoyance on par with search result count
not matching the number of returned results :-P

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


[rt-users] Setting up Escalation

2010-08-05 Thread Paul Broadwith
Bit stuck here.

 

Looked at the page
http://wiki.bestpractical.com/view/ConfigureEscalation to setup
Escalation. One of the examples suggested using this command line to
test it: 

 

/opt/rt3/bin/rt-crontool --verbose --search RT::Search::FromSQL
--search-arg "(Status='new' OR Status='open') AND FinalPriority > 0 AND
Due > 'Jan 1, 1970'" --action RT::Action::Generic

 

So I did that and get the following error:

 

102: Processing without transaction, some conditions and actions may
fail. Consider using --transaction argumentAction prepared...Action
committed.

 

Many times (I assume the number is the ticket number).

 

The problem I *think* I am having is that the account that cron runs
under has to match a user in RT. I setup a user called rt_user in RT,
gave it Global Permissions to ShowTicket and ModifyTicket and then set
the account up in Linux (again as suggested in an example) , su into
that account and run the command above but then I get an error about not
finding RT_Config.pm - permission denied. I added rt_user to the root
group but still the same problem. So I had a brainwave, setup an account
on rt called root but it won't let me do that.

 

So, I'm stuck. I don't want to start playing around with permissions in
RT so can somebody please tell me what I need to do or point me in the
right direction? Have checked the RT Essentials book but nothing
significant in there.

 

Kind regards,

 

Paul Broadwith (MBCS)

Microsoft Certified Professional

Blue Ivy Ltd - Microsoft Small Business Specialist, UK Partner Qualified
for 2010 and Microsoft Registered Partner



 
Blue Ivy Limited is a limited company registered in Scotland.
Registered company number: SC 221649.
Registered VAT number: GB 774 8460 88.
Registered Office: 67 Kelburn Street, Barrhead, Glasgow, G78 1LD

This email and its attachments may be confidential and are intended solely for 
the use of the individual to whom it is addressed. Any views or opinions 
expressed are solely those of the author and do not necessarily represent those 
of ?Blue Ivy Ltd?.

If you are not the intended recipient of this email and its attachments, you 
must take no action based upon them, nor must you copy or show them to anyone.

Please contact the sender if you believe you have received this email in error.



{Blue Ivy Ltd - ICT For Small Businesses}
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

[rt-users] RT 3.8 Active Directory integration and single sign-on

2010-08-05 Thread Eugene M. Evans
ain,dc=domainSuffix',
>  'pass'  =>  'the_ldap_password',
>  'base'  =>  'dc=domain,dc=
> domainSuffix',
>
>  'filter'=>
> '(&(ObjectCategory=User)(ObjectClass=Person))',
>  'd_filter'  =>
> '(userAccountControl:1.2.840.113556.1.4.803:=2)',
>
> # 'tls'   =>  0,
> #'ssl_version'   =>  3,
>
>  'net_ldap_args' => [version =>
> 3   ],
>  'group' =>
'cn=group,ou=Services,dc=
> domain,dc=domainSuffix',
>  'group_attr'=>  'member',
>
>  'attr_match_list'   => [   'Name',
> 'EmailAddress'   ],
>  'attr_map'  => {   'Name' =>
> 'sAMAccountName',
> 'EmailAddress' => 
> 'mail',
> 'Organization' => 
> 'physicalDeliveryOfficeName',
> 'RealName' =>
'cn',
> 'ExternalAuthId' 
> => 'sAMAccountName',
> 'Gecos' => 
> 'sAMAccountName',
> 'WorkPhone' => 
> 'telephoneNumber',
> 'Address1' => 
> 'streetAddress',
> 'City' => 'l',
> 'State' => 'st',
> 'Zip' =>
'postalCode',
> 'Country' => 'co'
> }
> }
> }
> );
>
> Set(@Plugins, qw(RT::Authen::ExternalAuth)); 1; #End 
> /opt/rt3/local/plugins/RT-Authen-ExternalAuth/etc/RT_SiteConfig.pm
>
>
>
>
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>



--
Mike Johnson
Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON   P7B 5E1
Phone: (807) 766-7331
Email: mike.john...@nosm.ca
-- next part --
An HTML attachment was scrubbed...
URL:
<http://lists.bestpractical.com/pipermail/rt-users/attachments/20100805/
193b2e31/attachment.html>

--

___
RT-Users mailing list
RT-Users@lists.bestpractical.com
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users


End of RT-Users Digest, Vol 77, Issue 20


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] RT 3.8 Active Directory integration and single sign-on

2010-08-05 Thread Mike Johnson
b) should be done easily using ExternalAuth.  when I say easily, I mean, as
soon as you get ExternalAuth working, b is done but it did take me
almost a week to figure out my issues(a spelling mistake in the config file
:'()

a) sounds like you want ExternalAuth with AutoCreate Privleged=>0 set, but
you'd also need to tweak the RT system.

The problem with just doing the above, if someone has already sent an email
to your system prior to attempting to login, their email address generates a
user in RT.  That user has username = email address, as well as email
address filled out too.  Then when they go to login, ExternalAuth pulls the
user's email address from LDAP and attempts to create the user with that
email address, however that email address already exists on the autocreated
user from the email they sent in.. so the create user fails.

Ken Marshall shared something on the listserv of a way to fix this, but I
haven't got it working yet(I'm new to perl, still learning)


He edited the spot in RT that runs everytime an email address is found.
>From reading the code, I believe his changes makes the
CanonicalizeEmailAddress subroutine connect to your LDAP and pull the LDAP
info in (as defined in ExternalAuth's config) instead of just creating a
user using the email address alone.

What I mean is, RT out of the box, when an email comes in, the unedited
CanonicalizeEmailAddress sub does pretty much nothing but a word
substitution(based on a config file setting), but Ken's version actually
connects to LDAP and pulls the real name, the username, etc.

The way Ken explained it to me, it should not only fix old accounts that
already exist, but ensure all new accounts work correctly as well.

Below is the code, also search the listserv for my post about workarounds
while waiting for ExternalAuth 0.09.

Good luck!
Mike
***Ken's code below***

sub CanonicalizeEmailAddress {
   my $self = shift;
   my $email = shift;
   # Leave some addresses intact
   if ( $email =~ /[\w-...@mysafe1.rice.edu$/ ) {
   return ($email);
   }
   if ( $email =~ /[\w-...@mysafe2.rice.edu$/ ) {
   return ($email);
   }
   # Example: the following rule would treat all email
   # coming from a subdomain as coming from second level domain
   # foo.com
   if ( my $match   = RT->Config->Get('CanonicalizeEmailAddressMatch') and
my $replace = RT->Config->Get('CanonicalizeEmailAddressReplace') )
   {
   $email =~ s/$match/$replace/gi;
   }
   $email .= '@rice.edu' if ($email =~ /^[\w-]+$/);
   #
   # Now we should have an Email address that is of the form a...@rice.edu
   # Use LDAP to map this to the primary vanity Email alias.
   my $params = ( Name => undef,
  EmailAddress => undef);
   my $ldap = new Net::LDAP($RT::LdapServer)
 or $RT::Logger->critical("CanonicalizeEmailAddress: Cannot connect to
LDAP\n"),
   return ($email);
   my $mesg = $ldap->bind();
   if ($mesg->code != LDAP_SUCCESS) {
 $RT::Logger->critical("CanonicalizeEmailAddress: Unable to bind to
$RT::LdapServer: ",
   ldap_error_name($mesg->code), "\n");
 return ($email);
   }
   # First check to see if the E-mail address uniquely characterizes the
   # user. If so, update the information with the LDAP query results.
   my $filter = "(mailAlternateAddress=$email)";
   $mesg = $ldap->search(base   => $RT::LdapBase,
 filter => $filter,
 attrs  => [ $RT::LdapMailAttr ]);
   if ($mesg->code != LDAP_SUCCESS and $mesg->code != LDAP_PARTIAL_RESULTS)
{
 $RT::Logger->critical("Unable to search in LDAP: ",
ldap_error_name($mesg->code), "\n");
 return ($email);
   }
   # The search succeeded with just one match
   if ($mesg->count == 1) {
 $email = ($mesg->first_entry->get_value($RT::LdapMailAttr))[0];
   }
   $mesg = $ldap->unbind();
   if ($mesg->code != LDAP_SUCCESS) {
 $RT::Logger->critical("Could not unbind from LDAP: ",
ldap_error_name($mesg->code), "\n");
   }
   undef $ldap;
   undef $mesg;
   return ($email);
}

You will also need these somewhere ahead of there use:
use Net::LDAP;
use Net::LDAP::Constant qw(LDAP_SUCCESS LDAP_PARTIAL_RESULTS);
use Net::LDAP::Util qw (ldap_error_name);
use Net::LDAP::Filter;
We have them at the top under "use strict".

On Wed, Aug 4, 2010 at 10:58 PM, Eugene M. Evans  wrote:

>  I am trying to accomplish two things:
>
> First, to integrate RT with Active Directory such that an RT user account
> will automatically be created in either of the following cases.
>a) when a user first submits a ticket request via email, and
>b) when a user first logs in via the RT web interface
>
> Secondly, Single sign-on, such that once an RT account has been created an
> MS-Windows user will not need to enter their password on subsequent visits
> to the RT web interface.
>
> I've started by attempting to implement the Auth::ExternalAuth extension
> but have been unable to get it working.  I cannot log into the RT web
> interface using any acc