Can you share the headers and content for one of these emails going into RT? Feel free to sanitize any email addresses.
Could you please give me more detailed instruction on how to do it or post some links where I can read about it?
You can create a local overlay of the ParseTicketId
function /opt/rt4/local/lib/RT/Interface/Email_Local.pm
Then you can have the following content where all I added to the function was an error log with the subject passed:
package RT::Interface::Email;
use strict;
use warnings;
no warnings 'redefine';
=head3 ParseTicketId
Takes a string (the email subject) and searches for [subjecttag #id]
For customizations, the L<MIME::Entity> object is passed as the second
argument.
Returns the id if a match is found. Otherwise returns undef.
=cut
sub ParseTicketId {
my $Subject = shift;
my $Entity = shift;
RT::Logger->error( "Subject passed: $Subject" );
my $rtname = RT->Config->Get('rtname');
my $test_name = RT->Config->Get('EmailSubjectTagRegex') || qr/\Q$rtname\E/i;
# We use @captures and pull out the last capture value to guard against
# someone using (...) instead of (?:...) in $EmailSubjectTagRegex.
my $id;
if ( my @captures = $Subject =~ /\[$test_name\s+\#(\d+)\s*\]/i ) {
$id = $captures[-1];
} else {
foreach my $tag ( RT->System->SubjectTag ) {
next unless my @captures = $Subject =~ /\[\Q$tag\E\s+\#(\d+)\s*\]/i;
$id = $captures[-1];
last;
}
}
return undef unless $id;
$RT::Logger->debug("Found a ticket ID. It's $id");
return $id;
}
1;