[Rt-commit] rt branch, 4.0/emailparser-false-positives, updated. rt-4.0.3-20-gbe1308d

Jason May jasonmay at bestpractical.com
Mon Dec 5 17:08:58 EST 2011


The branch, 4.0/emailparser-false-positives has been updated
       via  be1308dc51378fbbecac5866a69ccf374c2203f2 (commit)
      from  947198aba7dc38f9b5e098585b1507cbaa2f85b8 (commit)

Summary of changes:
 lib/RT/EmailParser.pm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit be1308dc51378fbbecac5866a69ccf374c2203f2
Author: Jason May <jasonmay at bestpractical.com>
Date:   Mon Dec 5 17:06:52 2011 -0500

    Validate the email address before the config checks
    
    The email address should be checked before all else so nothing is
    computed in vain if the address turns out to be invalid.

diff --git a/lib/RT/EmailParser.pm b/lib/RT/EmailParser.pm
index e442370..a3df8f0 100644
--- a/lib/RT/EmailParser.pm
+++ b/lib/RT/EmailParser.pm
@@ -330,6 +330,8 @@ sub IsRTAddress {
     my $self = shift;
     my $address = shift;
 
+    return undef unless defined($address) and $address =~ /\S/;
+
     if ( my $address_re = RT->Config->Get('RTAddressRegexp') ) {
         return $address =~ /$address_re/i ? 1 : undef;
     }
@@ -342,8 +344,6 @@ sub IsRTAddress {
         return 1 if lc $comment_address eq lc $address;
     }
 
-    return undef unless defined($address) and $address =~ /\S/;
-
     my $queue = RT::Queue->new( RT->SystemUser );
     $queue->LoadByCols( CorrespondAddress => $address );
     return 1 if $queue->id;

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


More information about the Rt-commit mailing list