OneTicketPerRequestor: Add debug logging.

This commit is contained in:
Brett Smith 2018-04-10 10:43:43 -04:00
parent 13d6d49af0
commit daeabc1aa6

View file

@ -46,6 +46,7 @@ sub ReadHeader {
}
sub BeforeDecrypt {
$RT::Logger->debug("Entered OneTicketPerRequestor BeforeDecrypt");
my %args = (
Message => undef,
RawMessage => undef,
@ -57,9 +58,11 @@ sub BeforeDecrypt {
my $queue_name = $args{Queue}->Name;
my $sort_orders = $QUEUES{$queue_name};
if (!defined($sort_orders)) {
$RT::Logger->debug("OTPR stopping: Not configured for $queue_name");
return;
}
elsif (RT::Interface::Email::ExtractTicketId($args{Message})) {
$RT::Logger->debug("OTPR stopping: Message already has ticket ID");
return;
}
my $headers = $args{Message}->head();
@ -90,6 +93,8 @@ sub BeforeDecrypt {
my $dest_ticket = $ticket_search->First;
if (!defined($dest_ticket)) {
$RT::Logger->debug(sprintf("OTPR stopping: No ticket found from <%s> in queue %s",
$from_address, $queue_name));
return;
}
$RT::Logger->info(sprintf("OTPR: Redirecting email from <%s> to ticket #%s",