[rt-users] Trouble with my AutoReply Template

Gentgeen gentgeen at linuxmail.org
Fri Feb 9 22:26:21 EST 2007



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 rt-users mailing list