Changing a tag in a subject

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@ipnet.ru

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 don’t know about the character set issue, but I believe RT
parses this tag in the subject if a user replies to an email.
If you change the format in output, but not the parsing
routine, you won’t be able to append to a ticket via email.

I’d suggest leaving the tag as is, and adding the queue name
separately afterwards.

  bobg