This message is related to my previous thread titled "HTML templates in RT 4.2.1".
I changed the subject because I think the problem is unfortunately deeper than I thought at first. Even with our much-simplified template (attached), we sometimes have stack dumps in the RT log, related to template parsing. Sometimes the stack dump starts with "[error]: Template parsing error: ...", and this usually does not prevent RT from sending out the email. Other times the stack dump starts with: "[error]: Scrip Preapre nn died. ..." and this does prevent RT from sending out the email. I have been unable to track down the offending elements. Every case seems different. I am somehow convinced it can be tracked down to changes in the way RT shreds HTML, but I have no proof till now. Here are a couple of stack dumps: --------------------------------------------------------- [14911] [Thu Jan 2 10:25:43 2014] [error]: Template parsing error: Can't call method "content" on an undefined value at /usr/local/share/perl5/HTML/FormatText/W ithLinks/AndTables.pm line 217. Stack: [/usr/local/share/perl5/HTML/FormatText/WithLinks/AndTables.pm:217] [/usr/local/share/perl5/HTML/FormatText/WithLinks/AndTables.pm:101] [/usr/local/share/perl5/HTML/FormatText/WithLinks/AndTables.pm:83] [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1777] [/opt/rt4/sbin/../lib/RT/Transaction.pm:348] [template:14] [/opt/rt4/sbin/../lib/RT/Template.pm:551] [/opt/rt4/sbin/../lib/RT/Template.pm:507] [/opt/rt4/sbin/../lib/RT/Template.pm:435] [/opt/rt4/sbin/../lib/RT/Template.pm:415] [/opt/rt4/sbin/../lib/RT/Action/SendEmail.pm:139] [/opt/rt4/sbin/../lib/RT/Action/Notify.pm:69] [/opt/rt4/sbin/../lib/RT/ScripAction.pm:222] [/opt/rt4/sbin/../lib/RT/Scrip.pm:561] [/opt/rt4/sbin/../lib/RT/Scrips.pm:358] [/opt/rt4/sbin/../lib/RT/Transaction.pm:189] [/opt/rt4/sbin/../lib/RT/Record.pm:1626] [/opt/rt4/sbin/../lib/RT/Ticket.pm:533] [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1415] [/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:61] (/opt/rt4/sbin/../lib/RT/Template.pm:546) --------------------------------------------------------- [22792] [Thu Jan 2 15:29:03 2014] [error]: Scrip Prepare 10 died. - Can't call method "content" on an undefined value at /usr/local/share/perl5/HTML/FormatText/ WithLinks/AndTables.pm line 217. Stack: [/usr/local/share/perl5/HTML/FormatText/WithLinks/AndTables.pm:217] [/usr/local/share/perl5/HTML/FormatText/WithLinks/AndTables.pm:101] [/usr/local/share/perl5/HTML/FormatText/WithLinks/AndTables.pm:83] [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:1777] [/opt/rt4/sbin/../lib/RT/Template.pm:666] [/opt/rt4/sbin/../lib/RT/Template.pm:421] [/opt/rt4/sbin/../lib/RT/Action/SendEmail.pm:139] [/opt/rt4/sbin/../lib/RT/Action/Notify.pm:69] [/opt/rt4/sbin/../lib/RT/ScripAction.pm:222] [/opt/rt4/sbin/../lib/RT/Scrip.pm:561] [/opt/rt4/sbin/../lib/RT/Scrips.pm:358] [/opt/rt4/sbin/../lib/RT/Scrips.pm:291] [/opt/rt4/sbin/../lib/RT/Ticket.pm:2555] [/opt/rt4/sbin/../lib/RT/Ticket.pm:2526] [/opt/rt4/sbin/../lib/RT/Ticket.pm:2596] [/usr/local/share/perl5/HTML/Mason/Request.pm:1295] [/opt/rt4/share/html/Ticket/autohandler:66] [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:680] [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:368] [/opt/rt4/share/html/autohandler:53] (/opt/rt4/sbin/../lib/RT/Scrip.pm:564) --------------------------------------------------------- Anybody seeing this? Bye Cris
Content-Type: text/html Subject: {$Ticket->Subject} RT-Attach-Message: yes <h2>Risoluzione:</h2></a> <p> { my $Transactions = $Ticket->Transactions; $Transactions->Limit( FIELD => 'Type', VALUE => 'Comment' ); $Transactions->OrderByCols ( { FIELD => 'Created', ORDER => 'DESC' }, { FIELD => 'id', ORDER => 'DESC' }, ); my $resolution_comment; my $CommentObj = $Transactions->First; if( $CommentObj && $CommentObj->id ) { $resolution_comment = $CommentObj->Content; } $resolution_comment; } { my $res; my $Transactions = $Ticket->Transactions; $Transactions->Limit( FIELD => 'Type', VALUE => 'Comment' ); $Transactions->OrderByCols ( { FIELD => 'Created', ORDER => 'DESC' }, { FIELD => 'id', ORDER => 'DESC' }, ); my $resolution_comment; my $CommentObj = $Transactions->First; if( $CommentObj && $CommentObj->id ) { my $Attachments = $CommentObj->Attachments; $Attachments->Limit( FIELD => 'Filename', OPERATOR => '!=', VALUE => '' ); while (my $a = $Attachments->Next) { $res .= "Allegati:\n" unless ($res); $res .= " ". $a->Filename; ## $self->TransactionObj->Attach( ## Type => $a->ContentType, ## Charset => $a->OriginalEncoding, ## Data => $a->OriginalContent, ## Filename => Encode::decode_utf8($a->Filename), ## Encoding => '-SUGGEST' ## ); } } $res; } { my $signature = ''; my $siginclude = RT->Config->Get('MessageBoxIncludeSignatureOnComment'); if (my $text = $Ticket->OwnerObj->Signature and not $siginclude) { $signature = "<pre>-- \n". $text . "</pre>"; } $signature; } </p> <br/> <hr/> <a name="richiesta"><h2>Richiesta iniziale:</h2></a> <p> {$Ticket->Transactions->First->Content} </p> <br/><br/> <hr/> <h2>Storia completa del ticket:</h2></a> <pre> { use Text::Reform; my $resolved_message = ''; my $last_content = ''; my $transactions = $Ticket->Transactions; $transactions->Limit( FIELD => 'Type', VALUE => 'Correspond' ); while (my $transaction = $transactions->Next) { my $attachments = $transaction->Attachments; while (my $message = $attachments->Next) { next unless $message->ContentType =~ m!^(text/plain|message|text$)!i; my $content = $message->Content; next unless $content; next if $last_content eq $content; $last_content = $content; my $subject = ($message->Subject || $Ticket->Subject); my $wrapper = Text::Wrapper->new(columns=>65); $content = $wrapper->wrap($content); $resolved_message .= "Subject: "; $resolved_message .= $subject; $resolved_message .= "\n"; $resolved_message .= "From: "; $resolved_message .= $message->CreatorObj->RealName || $message->CreatorObj->EmailAddress; $resolved_message .= "\n"; $resolved_message .= "Time: "; $resolved_message .= $message->CreatedObj->AsString; $resolved_message .= "\n"; $resolved_message .= "\n"; $resolved_message .= "$content\n"; $resolved_message .= "------------------------------------------------\n"; } } $format = "==> [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[["; $data = $resolved_message; $resolved_message = form $format, $data; $resolved_message; } </pre> <h2>Note:</h2> <p><small> La richiesta in oggetto è stata evasa. Per maggiori dettagli leggere il commento di risoluzione. <br/><br/> Se la risoluzione dovesse risultare incompleta o errata, rispondendo a questo messaggio il ticket verrà riaperto. <br/><br/> <b>In tutti gli altri casi vi preghiamo di NON RISPONDERE A QUESTO MESSAGGIO</b>. <br/><br/> {$Ticket->OwnerObj->RealName || $Ticket->OwnerObj->Name} </small></p> <h3>Informazioni:</h3> <small> Non è necessario rispondere a questo messaggio, a meno di voler RIAPRIRE il ticket contrassegnato con l'ID [{$Ticket->QueueObj->SubjectTag} #{$Ticket->id}]. <br/><br/> NOTE:<br/> - Includere sempre la dicitura [{$Ticket->QueueObj->SubjectTag} #{$Ticket->id}] nell'oggetto di ogni futura corrispondenza riguardante il presente problema.<br/> - NON includere il contenuto delle mail precedenti inviate da RT (cioè con mittente "xxx via RT").<br/> <br/> <i><b>Nota di riservatezza:</b> Il presente messaggio non è di natura personale ma inviato per esigenze lavorative; leventuale messaggio di risposta potrà essere conosciuto anche da altri soggetti diversi dalloriginatore di questo messaggio per dette esigenze o per controllo aziendale. Questo messaggio, corredato dei relativi allegati, contiene informazioni da considerarsi strettamente riservate, ed è destinato esclusivamente al destinatario sopra indicato, il quale è l'unico autorizzato ad usarlo, copiarlo e, sotto la propria responsabilità, diffonderlo. Chiunque ricevesse questo messaggio per errore o comunque lo leggesse senza esserne legittimato è avvertito che trattenerlo, copiarlo, divulgarlo, distribuirlo a persone diverse dal destinatario è severamente proibito, ed è pregato di rinviarlo immediatamente al mittente distruggendone l'originale.</i> </small>