[Rt-commit] rt branch, 4.2/single-email-parser, created. rt-4.2.15-6-g9aeae35e4

? sunnavy sunnavy at bestpractical.com
Wed Jul 11 16:21:10 EDT 2018


The branch, 4.2/single-email-parser has been created
        at  9aeae35e41e4362b84db9e475ee2f838358b32dd (commit)

- Log -----------------------------------------------------------------
commit be22a7ad7b4a41a8e44faa65997b8b6d5737e8df
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 12 03:10:17 2018 +0800

    Always use RT::EmailParser::ParseEmailAddress to parse email addresses
    
    This is for consistency and could be more easily maintained.

diff --git a/lib/RT/Action/Notify.pm b/lib/RT/Action/Notify.pm
index 486efff43..9d482a8ec 100644
--- a/lib/RT/Action/Notify.pm
+++ b/lib/RT/Action/Notify.pm
@@ -54,7 +54,6 @@ use warnings;
 
 use base qw(RT::Action::SendEmail);
 
-use Email::Address;
 
 =head2 Prepare
 
@@ -140,9 +139,9 @@ sub SetRecipients {
     if ( $arg =~ /\bOtherRecipients\b/ ) {
         if ( my $attachment = $self->TransactionObj->Attachments->First ) {
             push @{ $self->{'NoSquelch'}{'Cc'} ||= [] }, map $_->address,
-                Email::Address->parse( $attachment->GetHeader('RT-Send-Cc') );
+                RT::EmailParser->ParseEmailAddress( $attachment->GetHeader('RT-Send-Cc') );
             push @{ $self->{'NoSquelch'}{'Bcc'} ||= [] }, map $_->address,
-                Email::Address->parse( $attachment->GetHeader('RT-Send-Bcc') );
+                RT::EmailParser->ParseEmailAddress( $attachment->GetHeader('RT-Send-Bcc') );
         }
     }
 }
diff --git a/lib/RT/Action/NotifyOwnerOrAdminCc.pm b/lib/RT/Action/NotifyOwnerOrAdminCc.pm
index 8d88e3f9c..c68d89ff5 100644
--- a/lib/RT/Action/NotifyOwnerOrAdminCc.pm
+++ b/lib/RT/Action/NotifyOwnerOrAdminCc.pm
@@ -53,7 +53,6 @@ use warnings;
 
 use base qw(RT::Action::Notify);
 
-use Email::Address;
 
 =head1 Notify Owner or AdminCc
 
diff --git a/lib/RT/Action/SendEmail.pm b/lib/RT/Action/SendEmail.pm
index 2a4cf9d95..d2bbd0aa3 100644
--- a/lib/RT/Action/SendEmail.pm
+++ b/lib/RT/Action/SendEmail.pm
@@ -57,7 +57,6 @@ use base qw(RT::Action);
 
 use RT::EmailParser;
 use RT::Interface::Email;
-use Email::Address;
 our @EMAIL_RECIPIENT_HEADERS = qw(To Cc Bcc);
 
 
@@ -258,7 +257,7 @@ sub AddressesFromHeader {
     my $self      = shift;
     my $field     = shift;
     my $header    = Encode::decode("UTF-8",$self->TemplateObj->MIMEObj->head->get($field));
-    my @addresses = Email::Address->parse($header);
+    my @addresses = RT::EmailParser->ParseEmailAddress($header);
 
     return (@addresses);
 }
@@ -810,7 +809,7 @@ sub RemoveInappropriateRecipients {
 
         if ( my $squelch = $attachment->GetHeader('RT-Squelch-Replies-To') ) {
             $blacklist{ $_->address } ||= 'squelch:attachment'
-                foreach Email::Address->parse( $squelch );
+                foreach RT::EmailParser->ParseEmailAddress( $squelch );
         }
     }
 
@@ -826,7 +825,7 @@ sub RemoveInappropriateRecipients {
         my $reason = delete $blacklist{ $address };
         $blacklist{ lc $_ } = $reason
             foreach map RT::User->CanonicalizeEmailAddress( $_->address ),
-            Email::Address->parse( $address );
+            RT::EmailParser->ParseEmailAddress( $address );
     }
 
     $self->RecipientFilter(
diff --git a/lib/RT/Action/SendForward.pm b/lib/RT/Action/SendForward.pm
index 7b03270ea..a59596b9a 100644
--- a/lib/RT/Action/SendForward.pm
+++ b/lib/RT/Action/SendForward.pm
@@ -54,7 +54,6 @@ use warnings;
 
 use base qw(RT::Action::SendEmail);
 
-use Email::Address;
 
 =head2 Prepare
 
diff --git a/lib/RT/Attachment.pm b/lib/RT/Attachment.pm
index 8252a5f9d..9e8e14753 100644
--- a/lib/RT/Attachment.pm
+++ b/lib/RT/Attachment.pm
@@ -581,7 +581,7 @@ sub Addresses {
         my @Addresses;
         my $line = $self->GetHeader($hdr);
         
-        foreach my $AddrObj ( Email::Address->parse( $line )) {
+        foreach my $AddrObj ( RT::EmailParser->ParseEmailAddress( $line )) {
             my $address = $AddrObj->address;
             $address = lc RT::User->CanonicalizeEmailAddress($address);
             next if $current_user_address eq $address;
diff --git a/lib/RT/Crypt.pm b/lib/RT/Crypt.pm
index a5ae1f178..47db430c0 100644
--- a/lib/RT/Crypt.pm
+++ b/lib/RT/Crypt.pm
@@ -441,7 +441,7 @@ sub SignEncrypt {
         $args{'Signer'} =
             $self->UseKeyForSigning
             || do {
-                my ($addr) = map {Email::Address->parse( Encode::decode( "UTF-8", $_ ) )}
+                my ($addr) = map {RT::EmailParser->ParseEmailAddress( Encode::decode( "UTF-8", $_ ) )}
                     $entity->head->get( 'From' );
                 $addr ? $addr->address : undef
             };
@@ -450,7 +450,7 @@ sub SignEncrypt {
         my %seen;
         $args{'Recipients'} = [
             grep $_ && !$seen{ $_ }++, map $_->address,
-            map Email::Address->parse( Encode::decode("UTF-8", $_ ) ),
+            map RT::EmailParser->ParseEmailAddress( Encode::decode("UTF-8", $_ ) ),
             map $entity->head->get( $_ ),
             qw(To Cc Bcc)
         ];
diff --git a/lib/RT/Crypt/GnuPG.pm b/lib/RT/Crypt/GnuPG.pm
index 836452e66..b544ef220 100644
--- a/lib/RT/Crypt/GnuPG.pm
+++ b/lib/RT/Crypt/GnuPG.pm
@@ -494,7 +494,7 @@ sub SignEncryptRFC3156 {
     }
     if ( $args{'Encrypt'} ) {
         my @recipients = map $_->address,
-            map Email::Address->parse( Encode::decode( "UTF-8", $_ ) ),
+            map RT::EmailParser->ParseEmailAddress( Encode::decode( "UTF-8", $_ ) ),
             map $entity->head->get( $_ ),
             qw(To Cc Bcc);
 
@@ -1568,7 +1568,7 @@ sub _ParseUserHint {
     return (
         MainKey      => $main_key_id,
         String       => $user_str,
-        EmailAddress => (map $_->address, Email::Address->parse( $user_str ))[0],
+        EmailAddress => (map $_->address, RT::EmailParser->ParseEmailAddress( $user_str ))[0],
     );
 }
 
diff --git a/lib/RT/Crypt/SMIME.pm b/lib/RT/Crypt/SMIME.pm
index a734faafa..f05b2f2eb 100644
--- a/lib/RT/Crypt/SMIME.pm
+++ b/lib/RT/Crypt/SMIME.pm
@@ -228,7 +228,7 @@ sub SignEncrypt {
     if ( $args{'Encrypt'} ) {
         my %seen;
         $args{'Recipients'} = [
-            grep !$seen{$_}++, map $_->address, map Email::Address->parse(Encode::decode("UTF-8",$_)),
+            grep !$seen{$_}++, map $_->address, map RT::EmailParser->ParseEmailAddress(Encode::decode("UTF-8",$_)),
             grep defined && length, map $entity->head->get($_), qw(To Cc Bcc)
         ];
     }
@@ -571,7 +571,7 @@ sub _Decrypt {
 
     my %seen;
     my @addresses =
-        grep !$seen{lc $_}++, map $_->address, map Email::Address->parse($_),
+        grep !$seen{lc $_}++, map $_->address, map RT::EmailParser->ParseEmailAddress($_),
         grep length && defined, @{$args{'Recipients'}};
 
     my ($buf, $encrypted_to, %res);
diff --git a/lib/RT/EmailParser.pm b/lib/RT/EmailParser.pm
index e8ed1f2c3..d6fd45d6b 100644
--- a/lib/RT/EmailParser.pm
+++ b/lib/RT/EmailParser.pm
@@ -298,8 +298,8 @@ sub ParseCcAddressesFromHead {
 
     my (@Addresses);
 
-    my @ToObjs = Email::Address->parse( Encode::decode( "UTF-8", $self->Head->get('To') ) );
-    my @CcObjs = Email::Address->parse( Encode::decode( "UTF-8", $self->Head->get('Cc') ) );
+    my @ToObjs = $self->ParseEmailAddress( Encode::decode( "UTF-8", $self->Head->get('To') ) );
+    my @CcObjs = $self->ParseEmailAddress( Encode::decode( "UTF-8", $self->Head->get('Cc') ) );
 
     foreach my $AddrObj ( @ToObjs, @CcObjs ) {
         my $Address = $AddrObj->address;
diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index 02875f308..1dd59fff4 100644
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -52,7 +52,6 @@ use strict;
 use warnings;
 use 5.010;
 
-use Email::Address;
 use MIME::Entity;
 use RT::EmailParser;
 use File::Temp;
@@ -747,7 +746,7 @@ sub SignEncrypt {
     }
     return 0 unless @bad_recipients;
 
-    $_->{'AddressObj'} = (Email::Address->parse( $_->{'Recipient'} ))[0]
+    $_->{'AddressObj'} = (RT::EmailParser->ParseEmailAddress( $_->{'Recipient'} ))[0]
         foreach @bad_recipients;
 
     foreach my $recipient ( @bad_recipients ) {
@@ -955,7 +954,7 @@ sub ParseCcAddressesFromHead {
     return
         grep $_ ne $current_address && !RT::EmailParser->IsRTAddress( $_ ),
         map lc $user->CanonicalizeEmailAddress( $_->address ),
-        map RT::EmailParser->CleanupAddresses( Email::Address->parse(
+        map RT::EmailParser->CleanupAddresses( RT::EmailParser->ParseEmailAddress(
               Encode::decode( "UTF-8", $args{'Head'}->get( $_ ) ) ) ),
         qw(To Cc);
 }
@@ -1057,7 +1056,7 @@ sub DeleteRecipientsFromHead {
     foreach my $field ( qw(To Cc Bcc) ) {
         $head->replace( $field => Encode::encode( "UTF-8",
             join ', ', map $_->format, grep !$skip{ lc $_->address },
-                Email::Address->parse( Encode::decode( "UTF-8", $head->get( $field ) ) ) )
+                RT::EmailParser->ParseEmailAddress( Encode::decode( "UTF-8", $head->get( $field ) ) ) )
         );
     }
 }
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index b8d64cd97..3a5695a73 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -2204,7 +2204,7 @@ sub CreateTicket {
     } else {
         my @txn_squelch;
         foreach my $type (qw(Requestor Cc AdminCc)) {
-            push @txn_squelch, map $_->address, Email::Address->parse( $create_args{$type} )
+            push @txn_squelch, map $_->address, RT::EmailParser->ParseEmailAddress( $create_args{$type} )
                 if grep $_ eq $type || $_ eq ( $type . 's' ), @{ $ARGS{'SkipNotification'} || [] };
         }
         push @{$create_args{TransSquelchMailTo}}, @txn_squelch;
@@ -2415,13 +2415,13 @@ sub _ProcessUpdateMessageRecipients {
     my @txn_squelch;
     foreach my $type (qw(Cc AdminCc)) {
         if (grep $_ eq $type || $_ eq ( $type . 's' ), @{ $args{ARGSRef}->{'SkipNotification'} || [] }) {
-            push @txn_squelch, map $_->address, Email::Address->parse( $message_args->{$type} );
+            push @txn_squelch, map $_->address, RT::EmailParser->ParseEmailAddress( $message_args->{$type} );
             push @txn_squelch, $args{TicketObj}->$type->MemberEmailAddresses;
             push @txn_squelch, $args{TicketObj}->QueueObj->$type->MemberEmailAddresses;
         }
     }
     if (grep $_ eq 'Requestor' || $_ eq 'Requestors', @{ $args{ARGSRef}->{'SkipNotification'} || [] }) {
-        push @txn_squelch, map $_->address, Email::Address->parse( $message_args->{Requestor} );
+        push @txn_squelch, map $_->address, RT::EmailParser->ParseEmailAddress( $message_args->{Requestor} );
         push @txn_squelch, $args{TicketObj}->Requestors->MemberEmailAddresses;
     }
 
diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index f00d9fda9..5985ce376 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -1613,7 +1613,7 @@ sub _RecordNote {
 
             my $addresses = join ', ', (
                 map { RT::User->CanonicalizeEmailAddress( $_->address ) }
-                    Email::Address->parse( $args{ $type . 'MessageTo' } ) );
+                    RT::EmailParser->ParseEmailAddress( $args{ $type . 'MessageTo' } ) );
             $args{'MIMEObj'}->head->replace( 'RT-Send-' . $type, Encode::encode( "UTF-8", $addresses ) );
         }
     }
diff --git a/lib/RT/User.pm b/lib/RT/User.pm
index 63ee7fd55..6b5a4e538 100644
--- a/lib/RT/User.pm
+++ b/lib/RT/User.pm
@@ -587,7 +587,7 @@ sub ValidateEmailAddress {
 
     if ( RT->Config->Get('ValidateUserEmailAddresses') ) {
         # We only allow one valid email address
-        my @addresses = Email::Address->parse($Value);
+        my @addresses = RT::EmailParser->ParseEmailAddress($Value);
         return ( 0, $self->loc('Invalid syntax for email address') ) unless ( ( scalar (@addresses) == 1 ) && ( $addresses[0]->address ) );
     }
 
diff --git a/share/html/Dashboards/Subscription.html b/share/html/Dashboards/Subscription.html
index b00dde6b6..514f9dbdc 100644
--- a/share/html/Dashboards/Subscription.html
+++ b/share/html/Dashboards/Subscription.html
@@ -244,7 +244,7 @@ if (defined $ARGS{Save}) {
 
     # validation
     if ($fields{Recipient}) {
-        my @addresses = Email::Address->parse($fields{Recipient});
+        my @addresses = RT::EmailParser->ParseEmailAddress($fields{Recipient});
         if (@addresses == 0) {
             push @results, loc('Recipient must be an email address');
             $ok = 0;
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index e3d73de99..5c651d259 100644
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -428,7 +428,7 @@ if ( !exists $ARGS{'AddMoreAttach'} && ($ARGS{'id'}||'') eq 'new' ) {
         my $value = $ARGS{ $field };
         next unless defined $value && length $value;
 
-        my @emails = Email::Address->parse( $value );
+        my @emails = RT::EmailParser->ParseEmailAddress( $value );
         foreach my $email ( grep RT::EmailParser->IsRTAddress($_->address), @emails ) {
             push @results, loc("[_1] is an address RT receives mail at. Adding it as a '[_2]' would create a mail loop", $email->format, loc($field =~ /^(.*?)s?$/) );
             $checks_failure = 1;
diff --git a/share/html/Ticket/ModifyPeople.html b/share/html/Ticket/ModifyPeople.html
index 81f24e3cb..ea5045abe 100644
--- a/share/html/Ticket/ModifyPeople.html
+++ b/share/html/Ticket/ModifyPeople.html
@@ -68,7 +68,7 @@
   <li>
   <input type="hidden" name="autorecipient" value="<% $addr %>">
   <input type="checkbox" name="checked_recipient" id="checked_recipient_<%$addr%>" value="<%$addr%>" <% $recips{$addr} ? "checked" : "" %>>
-  <label for="checked_recipient_<%$addr%>"><& /Elements/ShowUser, Address => Email::Address->parse($addr) &></label>
+  <label for="checked_recipient_<%$addr%>"><& /Elements/ShowUser, Address => RT::EmailParser->ParseEmailAddress($addr) &></label>
   </li>
 % }
 </ul>
diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index c763f2454..b77019de7 100644
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -280,7 +280,7 @@ if ( $ARGS{'SubmitTicket'} ) {
         my $value = $ARGS{ $field };
         next unless defined $value && length $value;
 
-        my @emails = Email::Address->parse( $value );
+        my @emails = RT::EmailParser->ParseEmailAddress( $value );
         foreach my $email ( grep RT::EmailParser->IsRTAddress($_->address), @emails ) {
             push @results, loc("[_1] is an address RT receives mail at. Adding it as a '[_2]' would create a mail loop", $email->format, loc(substr($field, 6)) );
             $checks_failure = 1;
diff --git a/share/html/m/ticket/create b/share/html/m/ticket/create
index e6506c53a..fafa82633 100644
--- a/share/html/m/ticket/create
+++ b/share/html/m/ticket/create
@@ -184,7 +184,7 @@ if ( !exists $ARGS{'AddMoreAttach'} && ($ARGS{'id'}||'') eq 'new' ) {
         my $value = $ARGS{ $field };
         next unless defined $value && length $value;
 
-        my @emails = Email::Address->parse( $value );
+        my @emails = RT::EmailParser->ParseEmailAddress( $value );
         foreach my $email ( grep RT::EmailParser->IsRTAddress($_->address), @emails ) {
             push @results, loc("[_1] is an address RT receives mail at. Adding it as a '[_2]' would create a mail loop", $email->format, loc($field =~ /^(.*?)s?$/) );
             $checks_failure = 1;
diff --git a/share/html/m/ticket/reply b/share/html/m/ticket/reply
index c7414b11c..24790761e 100644
--- a/share/html/m/ticket/reply
+++ b/share/html/m/ticket/reply
@@ -202,7 +202,7 @@ ProcessAttachments(ARGSRef => \%ARGS);
         my $value = $ARGS{ $field };
         next unless defined $value && length $value;
 
-        my @emails = Email::Address->parse( $value );
+        my @emails = RT::EmailParser->ParseEmailAddress( $value );
         foreach my $email ( grep RT::EmailParser->IsRTAddress($_->address), @emails ) {
             push @results, loc("[_1] is an address RT receives mail at. Adding it as a '[_2]' would create a mail loop", $email->format, loc(substr($field, 6)) );
             $checks_failure = 1;
diff --git a/t/security/CVE-2012-4735-sign-any-key.t b/t/security/CVE-2012-4735-sign-any-key.t
index 0a28b8cbb..4e8489ae0 100644
--- a/t/security/CVE-2012-4735-sign-any-key.t
+++ b/t/security/CVE-2012-4735-sign-any-key.t
@@ -17,7 +17,7 @@ my %secret_keys;
     my %info = RT::Crypt->GetKeysInfo( Type => 'private', Force => 1 );
     for my $key (@{$info{info}}) {
         my $user = $key->{User}[0]{String};
-        $user = (Email::Address->parse( $user ))[0]->address;
+        $user = (RT::EmailParser->ParseEmailAddress( $user ))[0]->address;
         $secret_keys{$user} = $key->{Key};
     }
 }

commit 5cc86f8284b8c44e382e5e3d1b848ba467cc02b1
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 12 03:13:02 2018 +0800

    No need to parse undef string for emails
    
    This is to avoid uninitialized warnings.

diff --git a/lib/RT/EmailParser.pm b/lib/RT/EmailParser.pm
index d6fd45d6b..9bfeb34b6 100644
--- a/lib/RT/EmailParser.pm
+++ b/lib/RT/EmailParser.pm
@@ -533,6 +533,8 @@ sub ParseEmailAddress {
     my $self = shift;
     my $address_string = shift;
 
+    return unless defined $address_string;
+
     my @list = Email::Address::List->parse(
         $address_string,
         skip_comments => 1,

commit 7066e5a4d230e388511645b684714c90f988173d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 12 01:22:55 2018 +0800

    Update tests to capture warnings in RT::EmailParser::ParseEmailAddress
    
    This is because we switched from Email::Address::parse, which doesn't
    warn invalid email addresses.

diff --git a/t/api/user.t b/t/api/user.t
index 94494f162..82c0aa6c1 100644
--- a/t/api/user.t
+++ b/t/api/user.t
@@ -2,7 +2,8 @@
 use strict;
 use warnings;
 use RT;
-use RT::Test tests => 122;
+use RT::Test tests => undef;
+use Test::Warn;
 
 
 {
@@ -75,12 +76,18 @@ ok (!$id, $msg);
 
 # Make sur we can't create a user with multiple email adresses separated by space
 my $u9 = RT::User->new(RT->SystemUser);
-($id, $msg) = $u9->Create(Name => 'CreateTest9'.$$, EmailAddress => $$.'create-test-91 at example.com '.$$.'create-test-92 at example.com');
+warnings_like {
+    ($id, $msg) = $u9->Create(Name => 'CreateTest9'.$$, EmailAddress => $$.'create-test-91 at example.com '.$$.'create-test-92 at example.com');
+}
+qr/is not a valid email address/, "warned about invalid email address";
 ok (!$id, $msg);
 
 # Make sur we can't create a user with invalid email address
 my $u10 = RT::User->new(RT->SystemUser);
-($id, $msg) = $u10->Create(Name => 'CreateTest10'.$$, EmailAddress => $$.'create-test10}@[.com');
+warnings_like {
+    ($id, $msg) = $u10->Create(Name => 'CreateTest10'.$$, EmailAddress => $$.'create-test10}@[.com');
+}
+qr/is not a valid email address/, "warned about invalid email address";
 ok (!$id, $msg);
 RT->Config->Set('ValidateUserEmailAddresses' => undef);
 
@@ -362,3 +369,4 @@ ok($rqv, "Revoked the right successfully - $rqm");
     is $marks[0], $b_ticket->id;
 }
 
+done_testing;
diff --git a/t/crypt/no-signer-address.t b/t/crypt/no-signer-address.t
index 31ba5ebc2..8f902a0e8 100644
--- a/t/crypt/no-signer-address.t
+++ b/t/crypt/no-signer-address.t
@@ -35,8 +35,10 @@ my ($status, undef, $msg) = $ticket->Create(
 );
 ok( $status, "created ticket" ) or diag "error: $msg";
 
-is( scalar @warnings, 1, "Got a warning" );
-like( $warnings[0], qr{signing failed: secret key not available},
+is( scalar @warnings, 2, "Got 2 warnings" );
+like( $warnings[0], qr{is not a valid email address},
+    "Found warning of invalid email address");
+like( $warnings[1], qr{signing failed: secret key not available},
     "Found warning of no secret key");
 
 done_testing;

commit 47e5d8280bdff40b332956bef2b2ab339e6f0706
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 12 01:24:13 2018 +0800

    Drop unused and invalid email addresses in tests
    
    As we switched from Email::Address::parse to
    RT::EmailParser::ParseEmailAddress, invalid email addresses couldn't be
    used as user's EmailAddress any more.
    
    Since invalid email addresses are not actually used here, we can simply
    drop them.

diff --git a/t/web/simple_search.t b/t/web/simple_search.t
index 710efb1d1..394a731c2 100644
--- a/t/web/simple_search.t
+++ b/t/web/simple_search.t
@@ -149,7 +149,6 @@ for my $quote ( q{'}, q{"} ) {
     is( ref($user), 'RT::User' );
     my ( $id, $msg ) = $user->Create(
         Name         => qq!foo${quote}bar!,
-        EmailAddress => qq!foo${quote}bar$$\@example.com !,
         Privileged   => 1,
     );
     ok ($id, "Creating user - " . $msg );

commit 9aeae35e41e4362b84db9e475ee2f838358b32dd
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 12 01:34:03 2018 +0800

    Skip old tests when we didn't filter invalid email addresses
    
    For invalid addresses like "foo\@example.com\nEvil: yes\n\nMalicious",
    previously we extracted "foo at example.com", but as we switched to
    RT::EmailParser::ParseEmailAddress, we won't extract anything from that
    string.

diff --git a/t/security/CVE-2012-4730-email-header-injection.t b/t/security/CVE-2012-4730-email-header-injection.t
index 2a5bb5a9a..50590999b 100644
--- a/t/security/CVE-2012-4730-email-header-injection.t
+++ b/t/security/CVE-2012-4730-email-header-injection.t
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => undef;
+use RT::Test skip_all => 'Invalid email addresses are already filtered';
 use Email::Abstract;
 
 # Multiple email addresses for a single user are supported in 3.8 and 4.0 via

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


More information about the rt-commit mailing list