[rt-users] Error in custom Autoreply email

Thomas Smith theitsmith at gmail.com
Thu Oct 6 16:46:07 EDT 2011


Hi,

I configured an Autoreply Template using this as a foundation:
http://requesttracker.wikia.com/wiki/AutogeneratedPassword

When I email in a Ticket from an account without a password, the
ticket is created but no response sent. This is what I'm getting in
the error logs:

Oct  6 12:41:23 host RT: error:    couldn't parse head; error near:
Greetings,   This message has been automatically generated in response
to the creation of a trouble ticket regarding:            "This is a
test",   a summary of which appears below.   There is no need to reply
to this message right now.  Your ticket has been assigned an ID of
[sub.domain.tld #619]. (/opt/rt4/sbin/../lib/RT/Template.pm:363)

Also note that I'm using RT::Authen::ExternalAuth (not sure if this
matters or not).

Here's my modified Templete. Did I do something wrong when I altered
this Template?

Subject: AutoReply: {$Ticket->Subject}

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding:

         "{$Ticket->Subject()}",

a summary of which appears below.

There is no need to reply to this message right now.  Your ticket has been
assigned an ID of [{$rtname} #{$Ticket->id()}].

Please include the string:

         [{$rtname} #{$Ticket->id}]

in the subject line of all future correspondence about this issue. To do so,
you may reply to this message.

{
*RT::User::GenerateRandomNextChar = \&RT::User::_GenerateRandomNextChar;


if (($Ticket->RequestorAddresses !~ m/domain\.tld$/i) &&
    ($Transaction->CreatorObj->id != $RT::Nobody->id) &&
    (!$Transaction->CreatorObj->Privileged) &&
    ($Transaction->CreatorObj->__Value('Password') eq '*NO-PASSWORD*')
    ) {



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



        if (!$stat) {
                 $OUT .=

"An internal error has occurred. RT was not able to set a password for you.
Please contact your local RT administrator for assistance.";


        }


$OUT .= "

When prompted, enter the following username and password:

         Username: ".$user->Name."
         Password: ".$pass."

";
}
}

You can check the current status and history of your requests at:

         ".$RT::WebURL."

Thank you,

{$Ticket->QueueObj->CorrespondAddress()}

-------------------------------------------------------------------------
{$Transaction->Content()}



More information about the rt-users mailing list