[wplug] Trouble with my RT AutoReply Template

Gentgeen gentgeen at linuxmail.org
Mon Feb 12 16:44:39 EST 2007


Dear List,

First, let me applogize for this off posting.  I have posted the same
message to the RT user group (once like you see below, and once with
completely different wording about a month ago), both times without any
answers.  So I am hoping someone here can help.

----------------------------------------------------
Here is the executive summary:
----------------------------------------------------

  I think I am having some problem with my Request Tracker (RT)
autoreply template.  Since it is just perl scripting, I am hoping
someone here with better perl skills can see my mistake (or let me know
that everything looks fine).  Below is the email I sent most resent,
along with the script, or you can view the text of the reply here:
http://gentgeen.homelinux.org/~kevin/autoreply.pm

If those of you with some perl skills could look it over, I would really
appriciate it.

Thanks for you time, and sorry for the extra long posting,
   Kevin



----------------------------------------------------------------
Original Email
-----------------------------------------------------------------
I was trying to use the AutoReply With Password listed in the "RT
Essentials" book by O'reilly.  I have the one that is on the wiki
working, but I want the autoreply email to contain the password field
even if the requester already has a password (and create one if they do
not)

I have no perl skills, so I have basically tried to copy it from the
book letter for letter/space for space.  (Guess what my next O'reilly
book is going to be :-)  )  When it did not work, I stripped it down to
what is pasted below.

An email does get sent out when a privileged user creates the ticket
from within RT, but the code part is blank.  The log from that event
looks like this:

Feb  9 22:14:41 trouble RT:
<rt-3.4.1-24-312-3.2.75163762268249 at pavcs.org> #24/312 - Scrip 3 
(/usr/share/request-tracker3.4/lib/RT/Action/SendEmail.pm:235)  

Feb  9 22:14:41 trouble RT:
<rt-3.4.1-24-312-3.2.75163762268249 at pavcs.org> sent To:
gentgeen at linuxmail.org Cc:  Bcc: 
(/usr/share/request-tracker3.4/lib/RT/Action/SendEmail.pm:295)  

Feb  9 22:14:41 trouble RT: <rt-3.4.1-24-312-4.10.34140028225 at pavcs.org>
#24/312 - Scrip 4 
(/usr/share/request-tracker3.4/lib/RT/Action/SendEmail.pm:235)  

Feb  9 22:14:41 trouble RT: <rt-3.4.1-24-312-4.10.34140028225 at pavcs.org>
No recipients found. Not sending. 
(/usr/share/request-tracker3.4/lib/RT/Action/SendEmail.pm:247)  

Feb  9 22:14:41 trouble RT: Ticket 24 created in queue 'testing' by
ksquire (/usr/share/request-tracker3.4/lib/RT/Ticket_Overlay.pm:730)  


But when an email is sent in, no autoreply is sent out at all. here is
the logs when a email it sent in:

Feb  9 22:05:30 trouble RT:
<rt-3.4.1-23-307-4.1.13206847127032 at pavcs.org> #23/307 - Scrip 4 
(/usr/share/request-tracker3.4/lib/RT/Action/SendEmail.pm:235)  

Feb  9 22:05:30 trouble RT:
<rt-3.4.1-23-307-4.1.13206847127032 at pavcs.org> No recipients found. Not
sending.  (/usr/share/request-tracker3.4/lib/RT/Action/SendEmail.pm:247)
 
Feb  9 22:05:30 trouble RT: Ticket 23 created in queue 'testing' by
gentgeen at gmail.com
(/usr/share/request-tracker3.4/lib/RT/Ticket_Overlay.pm:730)  


Here is what I got for the template:

-------- Begin Paste -----------------

Subject: Autoreply


Greating and information here


{

if ( $Transaction->CreatorObj->id != $RT::Nobody->id
     && !$Transaction->CreatorObj->Privileged
     && !$Transaction->CreatorObj->HasPassword ) {

     my $user = RT::User->new( $RT::SystemUser );
     $user->Load( $Transaction->CreatorObj->Id );


     my ($stat, $pass) = $user->SetRandomPassword();


     if ($stat) {
            my $username = $user->Name;

               $OUT .= "
When prompted, enter the following username and password:

        Username: $username
        Password: $pass
	
";

     } else {
          $RT::Logger->error( 'Error trying to set random password for '
                               . $user->Name . ": $pass" );
              $OUT .= "
There was an error when trying to assign you a password.
Please contact your local RT administrator for assistance.
";
     }
   }
}

Salutation here

-------- End Paste -----------------


I am really hoping someone can spot my error.  Thanks for your time
reading my rather long post.

-- 
http://gentgeen.homelinux.org

#############################################################
 Associate yourself with men of good quality if you esteem    
 your own reputation; for 'tis better to be alone then in bad 
 company.        - George Washington, Rules of Civility


More information about the wplug mailing list