[svn:qpsmtpd] r614 - branches/0.3x/lib/Qpsmtpd

[email protected] 7 Feb 2006 18:42:16 -0000
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
Author: jpeacock
Date: Tue Feb  7 10:42:16 2006
New Revision: 614

Modified:
   branches/0.3x/lib/Qpsmtpd/Address.pm
Log:
Better handling of <> in address comparisons

Modified: branches/0.3x/lib/Qpsmtpd/Address.pm
==============================================================================
--- branches/0.3x/lib/Qpsmtpd/Address.pm	(original)
+++ branches/0.3x/lib/Qpsmtpd/Address.pm	Tue Feb  7 10:42:16 2006
@@ -308,8 +308,8 @@ sub _addr_cmp {
     }
 
     #invert the address so we can sort by domain then user    
-    $left = lc($left->host.'='.$left->user);
-    $right = lc($right->host.'='.$right->user);
+    ($left  = join( '=', reverse( split('@', $left->format))) ) =~ tr/[<>]//d;
+    ($right = join( '=', reverse( split('@',$right->format))) ) =~ tr/[<>]//d;
 
     if ( $swap ) {
 	($right, $left) = ($left, $right);