[rt-users] Changing a tag in a subject

cronfy - ipnet cronfy at ipnet.ru
Wed Sep 21 08:53:34 EDT 2005


Good day.

We have RT 3.4.4 running.

Our users asked me to insert something in mails generated by RT that
would help to identify a queue that a ticket belongs to (for sorting
purposes). To provide this, I decided to change RT tag this way:

[ORG #Queue_Id-Ticket_Id].

I should say I am not very familiar with Perl, so I was making changes
I guessed to be correct, but I was not sure enough.

After some tries, the working variant of lib/RT/Action/SendEmail.pm looked
as follows:

--- line 716
sub SetSubjectToken {
    my $self = shift;
# -   my $tag  = "[$RT::rtname #" . $self->Ticket
# +
    my $tag  = "[$RT::rtname #" . $self->TicketObj->Queue . "-" . $self->Ticket
    my $sub  = $self->TemplateObj->MIMEObj->head->get('Subject');
    unless ( $sub =~ /\Q$tag\E/ ) {
        $sub =~ s/(\r\n|\n|\s)/ /gi;
        chomp $sub;
        $self->TemplateObj->MIMEObj->head->replace( 'Subject', "$tag $sub" );
    }
}

For my surprise it worked, and we all were satisfied with this, but
next day I noticed that subjects of mails, generated by RT_System are
wrong encoded and are dispayed as question marks (all mail is sent
in koi8-r). Mails with replies were completely correct though.
Subjects with no russian letters inside were correct also.

The question is: what did I do wrong?

Thanks for assistance.

-- 
С уважением,
 cronfy                          mailto:cronfy at ipnet.ru




More information about the rt-users mailing list