diff options
author | Craig Kaiser <craig@bestpractical.com> | 2020-04-23 23:36:14 +0300 |
---|---|---|
committer | Craig Kaiser <craig@bestpractical.com> | 2020-04-23 23:36:14 +0300 |
commit | 67dec2b5bae7fd3501a454cea617d2e031ec51bd (patch) | |
tree | ecbb0e28cb4ac98dc92199eb129fcb4cde2cd9e4 | |
parent | cc03b490af32328d1d3d7e805383ace89420f456 (diff) |
Decode mailgate args4.2/decode-mailgate-args
Need to decode mailgate args before they reach the database or else Postgres
can run into encoding issues.
Using a queue name in the mailgate command that has ascii characters
can result in RT not being able to find and load the queue if the queue
name string is not decoded.
-rw-r--r-- | share/html/REST/1.0/NoAuth/mail-gateway | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/share/html/REST/1.0/NoAuth/mail-gateway b/share/html/REST/1.0/NoAuth/mail-gateway index 547f944e20..4593f3404a 100644 --- a/share/html/REST/1.0/NoAuth/mail-gateway +++ b/share/html/REST/1.0/NoAuth/mail-gateway @@ -58,7 +58,10 @@ $m->callback( %ARGS, CallbackName => 'Pre' ); use RT::Interface::Email (); # It's an exporter, but we don't care $r->content_type('text/plain; charset=utf-8'); $m->error_format('text'); -my ( $status, $error, $Ticket ) = RT::Interface::Email::Gateway( \%ARGS ); + +my %decoded_args = RT::Interface::Web::DecodeARGS( \%ARGS ); +my ( $status, $error, $Ticket ) = RT::Interface::Email::Gateway( \%decoded_args ); + if ( $status == 1 ) { $m->out("ok\n"); if ( $Ticket && $Ticket->Id ) { |