[rt-users] patch for CanonicalizeEmailAddress
    Phil Lawrence 
    prlawrence at Lehigh.EDU
       
    Mon May 16 13:15:48 EDT 2005
    
    
  
Hi,
As of 3.4.2, canonicalizing fails when the Replace string uses backrefs:
RT_SiteConfig.pm snippet
------------------------
# our users like to just CC usernames instead of
# typing out the whole username at mycompany.com
#
# e.g.  'username' --> 'username at mycompany.com'
Set($CanonicalizeEmailAddressMatch , '^([\w\-\+]+)$');
Set($CanonicalizeEmailAddressReplace , '\1\@mycompany\.com');
But this change to User_Overlay.pm will let it work:
682c682,689
<         $email =~ 
s/$RT::CanonicalizeEmailAddressMatch/$RT::CanonicalizeEmailAddressReplace/gi;
---
 >         if ($email =~ /$RT::CanonicalizeEmailAddressMatch/) {
 >             $_ = $email;
 >             eval {
 >                 eval 
"s/$RT::CanonicalizeEmailAddressMatch/$RT::CanonicalizeEmailAddressReplace/gi";
 >             };
 >             $RT::Logger->crit("Failure in CanonicalizeEmailAddress") 
if $@;
 >             $email = $_;
 >         }
Regards,
Phil Lawrence
    
    
More information about the rt-users
mailing list