[vhffs-dev] [1324] removed uneeded lc, improved some checks

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1324
Author:   gradator
Date:     2009-01-11 19:34:33 +0100 (Sun, 11 Jan 2009)

Log Message:
-----------
removed uneeded lc, improved some checks

Modified Paths:
--------------
    trunk/vhffs-listengine/src/listengine.pl


Modified: trunk/vhffs-listengine/src/listengine.pl
===================================================================
--- trunk/vhffs-listengine/src/listengine.pl	2009-01-11 17:48:36 UTC (rev 1323)
+++ trunk/vhffs-listengine/src/listengine.pl	2009-01-11 18:34:33 UTC (rev 1324)
@@ -143,7 +143,8 @@
 		unlink $errorf if ( -f $errorf  &&  ! -s $errorf );
 	}
 	else {
-		my $from = lc $mail->get('From');
+		my ( $from ) = ( $mail->get('From') =~ /(([\+\.a-zA-Z_\-0-9^\s]+)@([\.a-zA-Z_\-0-9^\s]+)\.(\w+))/);
+		my $from = lc $from;
 
 		foreach my $adr (@tos)
 		{
@@ -788,7 +789,7 @@
 		$mail = fetch_mail_from_file( $complete );
 		next if( ! defined $mail );
 		
-		push( @result , "Sender: " . lc $mail->get('From:') );
+		push( @result , "Sender: " . $mail->get('From:') );
 		push( @result , "Subject: " . $mail->get('Subject:') );
 		push( @result , "Id in listengine: " . $file );
 		push( @result , "\n\n");
@@ -1129,7 +1130,8 @@
         my $list = shift;
         my $mail = shift;
 
-        my $from = lc $mail->get('From');
+	my ( $from ) = ( $mail->get('From') =~ /(([\+\.a-zA-Z_\-0-9^\s]+)@([\.a-zA-Z_\-0-9^\s]+)\.(\w+))/);
+	$from = lc $from;
 
         my $temp = $list->get_localpart."-request\@".$list->get_domain;
         exit( 0 ) if( $from eq $list->get_listname);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/