Hello, I’ve noticed that RT6’s new inline images do not work when the rtname directive contains whitespace. It looks like it breaks the translation in naming from “cid” format to “Attachment”.
![Pasted image 20250916121157.png]()
In the above screenshot, the lower comment includes an inline image which was created when rtname was “RT6 TEST”, containing a space, and results in a broken image link being inserted. The upper comment was made after changing rtname to “RT6_TEST” and restarting the server, and results in the image being inserted as expected.
I’m wondering, is this something that might be fixed, to account for rtnames which contain whitespace? Or is there any workaround to use inline images without changing rtname?
I’m aware of EmailSubjectTagRegex, but I’d prefer to keep our current rtname which contains a space, if possible.
2 Likes
Yes, I’m also encountering this bug in RT 6.0.0. Our RT name also has a space and I’d rather not have to change it as a workaround….
hi guys.I hope this helps. I have created a hotfix by applying the following code to the Web.pm file.
You should modify the ”sub RewriteInlineImages” function. Obviously, this is a temporary fix while we wait for an official patch in the new version.
# --- HOTFIX: tolerate spaces or altered CIDs (rtname with whitespace) ---
my $cid_clean = $cid;
$cid_clean =~ s/\s+//g;
$cid_clean =~ s/%20//g;
$cid_clean =~ s/@.*//;
for my $attach (@{$args{Related}}) {
my $content_id = ($attach->GetHeader("Content-ID") || "");
$content_id =~ s/[<>]//g;
$content_id =~ s/\s+//g;
$content_id =~ s/%20//g;
$content_id =~ s/@.*//;
if (lc($content_id) eq lc($cid_clean)) {
push @rewritten, $attach->Id;
RT->Logger->debug("Matched inline image for cleaned cid=$cid_clean (Attachment " . $attach->Id . ")");
return "$args{AttachmentPath}/" . $attach->TransactionId . "/" . $attach->Id;
}
}
# No attachments means this is a bogus CID
RT->Logger->debug(qq[Found bogus inline image src="cid:$cid"]);
return "cid:$cid";
Greetings!