[Rt-commit] rt branch, 4.4/ticket-create-from-email-error, created. rt-4.4.4-46-g5b5d8bd7d

Jim Brandt jbrandt at bestpractical.com
Wed Jun 26 14:59:00 EDT 2019


The branch, 4.4/ticket-create-from-email-error has been created
        at  5b5d8bd7d958369729c046695a683cf16bf9b46e (commit)

- Log -----------------------------------------------------------------
commit 396c91b42e2b65ca86eb1579570061a7297151ff
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Jun 26 14:34:13 2019 -0400

    Send email to OwnerEmail on failure to parse sender
    
    If we are unable to parse a valid sender email address
    from an incoming email, send email to the configured
    OwnerEmail and then call FAILURE. Previously the call to
    FAILURE caused the email to be dropped with only a log entry
    as evidence that RT saw it. Sending the email along to
    OwnerEmail gives the admin a chance to inspect the email
    and possibly determine what the problem is.

diff --git a/lib/RT/Interface/Email/Auth/MailFrom.pm b/lib/RT/Interface/Email/Auth/MailFrom.pm
index ce8ba7da3..5c1416591 100644
--- a/lib/RT/Interface/Email/Auth/MailFrom.pm
+++ b/lib/RT/Interface/Email/Auth/MailFrom.pm
@@ -84,7 +84,13 @@ sub GetCurrentUser {
 
     unless ( $Address ) {
         $RT::Logger->error("Couldn't parse or find sender's address");
-        FAILURE("Couldn't parse or find sender's address");
+
+        MailError(
+            To          => RT->Config->Get('OwnerEmail'),
+            Subject     => "Couldn't parse or find sender's address",
+            Explanation => "Couldn't parse or find sender's address in email headers",
+            FAILURE     => 1,
+        );
     }
 
     my $CurrentUser = RT::CurrentUser->new;

commit 5b5d8bd7d958369729c046695a683cf16bf9b46e
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Jun 26 14:58:50 2019 -0400

    Update tests with new parse failure log message

diff --git a/t/mail/header-characters.t b/t/mail/header-characters.t
index 38a04b5df..6bc9e95d8 100644
--- a/t/mail/header-characters.t
+++ b/t/mail/header-characters.t
@@ -20,7 +20,8 @@ here's some content
     my ($status, $id);
     warnings_like { ( $status, $id ) = RT::Test->send_via_mailgate($mail) }
         [(qr/Unable to parse an email address from/) x 2,
-         qr/Couldn't parse or find sender's address/
+         qr/Couldn't parse or find sender's address/,
+         qr/Couldn't parse or find sender's address: Couldn't parse or find sender's address in email headers/
         ],
         'Got parse error for non-ASCII in From';
     TODO: {
@@ -44,7 +45,8 @@ here's some content
     my ($status, $id);
     warnings_like { ( $status, $id ) = RT::Test->send_via_mailgate($mail) }
         [(qr/Unable to parse an email address from/) x 2,
-         qr/Couldn't parse or find sender's address/
+         qr/Couldn't parse or find sender's address/,
+         qr/Couldn't parse or find sender's address: Couldn't parse or find sender's address in email headers/
         ],
         'Got parse error for iso-8859-1 in From';
     TODO: {
@@ -66,7 +68,8 @@ here's some content
 
     my ($status, $id);
     warnings_like { ( $status, $id ) = RT::Test->send_via_mailgate($mail) }
-        [qr/Couldn't parse or find sender's address/],
+        [qr/Couldn't parse or find sender's address/,
+         qr/Couldn't parse or find sender's address: Couldn't parse or find sender's address in email headers/],
         'Got parse error with no sender fields';
     is( $status >> 8, 1, "The mail gateway failed" );
     ok( !$id, "No ticket created" );

-----------------------------------------------------------------------


More information about the rt-commit mailing list