[vhffs-dev] [1385] improved listengine compilation process, cleaned all get_localpart.' -request@'.get_domain or get_localpart.'@'.get_domain

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


Revision: 1385
Author:   gradator
Date:     2009-03-17 13:55:35 +0100 (Tue, 17 Mar 2009)

Log Message:
-----------
improved listengine compilation process, cleaned all get_localpart.'-request@'.get_domain or get_localpart.'@'.get_domain

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Services/MailingList.pm
    trunk/vhffs-listengine/src/listengine.pl


Modified: trunk/vhffs-api/src/Vhffs/Services/MailingList.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/MailingList.pm	2009-03-17 08:10:58 UTC (rev 1384)
+++ trunk/vhffs-api/src/Vhffs/Services/MailingList.pm	2009-03-17 12:55:35 UTC (rev 1385)
@@ -563,9 +563,16 @@
 sub get_listname
 {
     my $self = shift;
-    return $self->get_localpart."\@".$self->get_domain;
+    return $self->get_localpart.'@'.$self->get_domain;
 }
 
+
+sub get_listrequestname
+{
+    my $self = shift;
+    return $self->get_localpart.'-request@'.$self->get_domain;
+}
+
 1;
 
 __END__

Modified: trunk/vhffs-listengine/src/listengine.pl
===================================================================
--- trunk/vhffs-listengine/src/listengine.pl	2009-03-17 08:10:58 UTC (rev 1384)
+++ trunk/vhffs-listengine/src/listengine.pl	2009-03-17 12:55:35 UTC (rev 1385)
@@ -44,14 +44,10 @@
 use Vhffs::Listengine;
 use Vhffs::Functions;
 
-#		open (MYFILE, '>/tmp/grunt');
-#		print MYFILE "FROM: '$from'  FROMPERM: '$subs->{$from}{'perm'}'   SUB: '$subscriber'   SUBPERM:  '$subs->{$subscriber}{'perm'}'   SUBHASH: '$subs->{$subscriber}{'hash'}'    HASH:  '$hash'\n";
-#		close (MYFILE);
-
 #Huho, if the program stop heres, you have some problems with your MTA configuration
 if( $#ARGV != 2 )
 {
-	print "involve as: listengine action local_part domain\n";
+	print 'involve as: listengine action local_part domain'."\n";
 	exit 1;
 }
 
@@ -81,17 +77,17 @@
     my $list = shift;
     my $mailinglistconfig = $vhffs->get_config->get_service('mailinglist');
 
-    $header->replace( 'List-Unsubscribe' ,"<mailto:".$list->get_localpart."-request"."\@".$list->get_domain."?subject=unsubscribe>" );
-    $header->replace( 'List-Subscribe' ,"<mailto:".$list->get_localpart."-request"."\@".$list->get_domain."?subject=subscribe>" );
-    $header->replace( 'List-Help' ,"<mailto:".$list->get_localpart."-request"."\@".$list->get_domain."?subject=help>" );
+    $header->replace( 'List-Unsubscribe' ,'<mailto:'.$list->get_listrequestname.'?subject=unsubscribe>' );
+    $header->replace( 'List-Subscribe' ,'<mailto:'.$list->get_listrequestname.'?subject=subscribe>' );
+    $header->replace( 'List-Help' ,'<mailto:'.$list->get_listrequestname.'?subject=help>' );
     $header->replace( 'List-Software' , 'Listengine, VHFFS '.Vhffs::Constants::VHFFS_VERSION );
-    $header->replace( 'List-Id' , $list->get_localpart.".".$list->get_domain );
-    $header->replace( 'List-Post' , '<mailto:'.$list->get_localpart."@".$list->get_domain.'>' );
+    $header->replace( 'List-Id' , $list->get_localpart.'.'.$list->get_domain );
+    $header->replace( 'List-Post' , '<mailto:'.$list->get_listname.'>' );
     $header->replace( 'List-Archive' , '<'.$mailinglistconfig->{'url_archives'}.'/'.$list->get_domain.'/'.$list->get_localpart.'>' ) if( $mailinglistconfig->{'url_archives'} );
     $header->replace( 'Precedence' , 'list' );
 
     #Replace the Reply-To field if selected in the panel  
-    $header->replace( 'Reply-To' , $list->get_localpart ."\@" . $list->get_domain ) if( $list->get_replyto == 1 );
+    $header->replace( 'Reply-To' , $list->get_listname ) if( $list->get_replyto == 1 );
 }
 
 
@@ -117,7 +113,7 @@
 		my $errorf = '/dev/null';
 		$errorf = $dir.time().'_'.$$ if -d $dir;
 
-		open(SENDMAIL, "| $SENDMAIL_PATH 2> $errorf 1>&2" ) or die( "Error - cannot open BSMTP input" );
+		open(SENDMAIL, '| '.$SENDMAIL_PATH.' 2> '.$errorf.' 1>&2' ) or die( 'Error - cannot open BSMTP input' );
 		print SENDMAIL 'HELO '.$DOMAIN."\n";
 
 		foreach my $adr ( @{$addrs} )
@@ -129,7 +125,7 @@
 			print SENDMAIL 'RCPT TO:<'.$adr.'>'."\n";
 			print SENDMAIL 'DATA'."\n";
 			print SENDMAIL $mail->as_string;
-			print SENDMAIL "\n.\n";
+			print SENDMAIL "\n".'.'."\n";
 		}
 
 		print SENDMAIL 'QUIT'."\n";
@@ -176,8 +172,8 @@
     my $directory = $DIRECTORY.'/archives/'.$list->get_domain.'/'.$list->get_localpart.'/'.$year.'/'.$month.'/'.$day;
     Vhffs::Functions::create_dir( $directory ) if( ! -d $directory );
 
-    my $file = "$directory/".$message_id;
-    open( FILE , ">$file");
+    my $file = $directory.'/'.$message_id;
+    open( FILE , '>'.$file);
     print FILE $mail->as_string;
     close( FILE );
 }
@@ -200,23 +196,23 @@
     Vhffs::Functions::create_dir( $directory ) if( ! -d $directory );
     
     my $filehash = Digest::MD5::md5_hex( $message_id );
-    my $file = "$directory/".$filehash;
+    my $file = $directory.'/'.$filehash;
         
-    open( FILE , ">$file");
+    open( FILE , '>'.$file);
     print FILE $mail->as_string;
     close( FILE );
     
     foreach ( keys %{$members} )
     {
 	#Prepare the destinataire for the mail
-	push( @tos , $_ ) if( $members->{$_}{perm} == Vhffs::Constants::ML_RIGHT_ADMIN );
+	push( @tos , $_ ) if( $members->{$_}{'perm'} == Vhffs::Constants::ML_RIGHT_ADMIN );
     }
 
     $header = new Mail::Header( );
     $header->replace( 'From' ,  $LISTMASTER );
     $header->replace( 'To' ,  join(', ' , @tos) );
-    $header->replace( 'Subject' ,  "moderate $filehash" );
-    $header->replace( 'Reply-To' , $list->get_localpart ."-request"."\@".$list->get_domain);
+    $header->replace( 'Subject' ,  'moderate '.$filehash );
+    $header->replace( 'Reply-To' , $list->get_listrequestname );
         
     $email = Mail::Internet->new(  [ <> ]  , 
 				   Header => $header,
@@ -240,7 +236,7 @@
 
     if( $sub_ctrl == Vhffs::Constants::ML_SUBSCRIBE_CLOSED )
     {
-	$message = "Subscription are not allowed for this list";
+	$message = 'Subscription are not allowed for this list';
 	push @body , $message ;	
 	push @body , "\n";
 	
@@ -267,7 +263,7 @@
 	    my $subject = 'confirm subscribe '.$pass;
 	    $subject = '['.$list->get_prefix.'] '.$subject if( length( $list->get_prefix ) > 0 );
 	    $header->replace( 'Subject' ,  $subject );
-	    $header->replace( 'Reply-To' , $list->get_localpart ."-request"."\@".$list->get_domain);
+	    $header->replace( 'Reply-To' , $list->get_listrequestname);
 	    
 	    $email = Mail::Internet->new(  [ <> ]  , 
 					   Header => $header,
@@ -313,7 +309,7 @@
 
 	if( ( $hash == -1 ) || ( $hash == -2 ) )
 	{
-	    $header->replace( 'Subject' ,  "error while unsubscribe" );
+	    $header->replace( 'Subject' ,  'error while unsubscribe' );
 	    $email = Mail::Internet->new(  [ <> ] , 
 					   Header => $header ,
 					   Body => Vhffs::Listengine::mail_sub_not_exist( $list , $from )
@@ -321,7 +317,7 @@
 	}
 	elsif( $hash == -3 )
 	{
-	    $header->replace( 'Subject' ,  "Error while unsubscribe" );
+	    $header->replace( 'Subject' ,  'Error while unsubscribe' );
 	    #If $hash == -3, the subscriber was not a subscriber or admin but has different rights (waiting for confirm ...)
 	    $email = Mail::Internet->new(  [ <> ] , 
 					      Header => $header ,
@@ -330,8 +326,8 @@
 	}
 	else
 	{
-	    $header->replace( 'Subject' ,  "confirm unsubscribe $hash" );
-	    $header->replace( 'Reply-To' , $list->get_localpart ."-request"."\@".$list->get_domain);
+	    $header->replace( 'Subject' ,  'confirm unsubscribe '.$hash );
+	    $header->replace( 'Reply-To' , $list->get_listrequestname);
 	    
 	    $email = Mail::Internet->new(  [ <> ] , 
 					   Header => $header ,
@@ -360,7 +356,7 @@
 		my $subject = 'Successfully subscribed';
 		$subject = '['.$list->get_prefix.'] '.$subject if( length( $list->get_prefix ) > 0 );
 		$header->replace( 'Subject' , $subject );
-		$header->replace('Date' , gmtime()." +00");
+		$header->replace('Date' , gmtime().' +00');
 
 		# validation needed or not ?
 		if( $list->get_sub_ctrl == Vhffs::Constants::ML_SUBSCRIBE_APPROVAL_REQUIRED )  {
@@ -389,7 +385,7 @@
 			my $subject = 'approval '.$from;
 			$subject = '['.$list->get_prefix.'] '.$subject if( length( $list->get_prefix ) > 0 );
 			$header->replace( 'Subject' , $subject );
-			$header->replace( 'Reply-To' , $list->get_localpart ."-request"."\@".$list->get_domain);
+			$header->replace( 'Reply-To' , $list->get_listrequestname);
 
 			$email = Mail::Internet->new(  [ <> ]  , 
 				   Header => $header,
@@ -418,7 +414,7 @@
 	    my $subject = 'Subscribe error';
 	    $subject = '['.$list->get_prefix.'] '.$subject if( length( $list->get_prefix ) > 0 );
 	    $header->replace( 'Subject' , $subject );
-    	    $header->replace('Date' , gmtime()." +00");
+    	    $header->replace('Date' , gmtime().' +00');
 	    
 	    my $email = Mail::Internet->new(  [ <> ] , 
 					      Header => $header ,
@@ -447,8 +443,8 @@
 	    $header = new Mail::Header( );
 	    $header->replace( 'To' ,  $from );
 	    $header->replace( 'From' ,  $LISTMASTER );
-	    $header->replace( 'Subject' , "Successfully unsubscribe" );
-    	    $header->replace('Date' , gmtime()." +00");
+	    $header->replace( 'Subject' , 'Successfully unsubscribe' );
+    	    $header->replace('Date' , gmtime().' +00');
 	    
 	    
 	    $email = Mail::Internet->new(  [ <> ] , 
@@ -495,7 +491,7 @@
 		my $subject = 'Subscription accepted';
 		$subject = '['.$list->get_prefix.'] '.$subject if( length( $list->get_prefix ) > 0 );
 		$header->replace( 'Subject' , $subject );
-		$header->replace('Date' , gmtime()." +00");
+		$header->replace('Date' , gmtime().' +00');
 
 		my $email = Mail::Internet->new(  [ <> ] ,
 			Header => $header ,
@@ -513,7 +509,7 @@
 		# send a mail to all admins
 		foreach ( keys %{$members} )
 		{
-			push( @tos , $_ ) if( $members->{$_}{perm} == Vhffs::Constants::ML_RIGHT_ADMIN );
+			push( @tos , $_ ) if( $members->{$_}{'perm'} == Vhffs::Constants::ML_RIGHT_ADMIN );
 		}
 
 		$header = new Mail::Header( );
@@ -538,7 +534,7 @@
 	    my $subject = 'Subscription moderation error';
 	    $subject = '['.$list->get_prefix.'] '.$subject if( length( $list->get_prefix ) > 0 );
 	    $header->replace( 'Subject' , $subject );
-    	    $header->replace('Date' , gmtime()." +00");
+    	    $header->replace('Date' , gmtime().' +00');
 	    
 	    my $email = Mail::Internet->new(  [ <> ] , 
 					      Header => $header ,
@@ -568,7 +564,7 @@
 		my $subject = 'Subscription refused';
 		$subject = '['.$list->get_prefix.'] '.$subject if( length( $list->get_prefix ) > 0 );
 		$header->replace( 'Subject' , $subject );
-		$header->replace('Date' , gmtime()." +00");
+		$header->replace('Date' , gmtime().' +00');
 
 		my $email = Mail::Internet->new(  [ <> ] ,
 			Header => $header ,
@@ -585,7 +581,7 @@
 		# send a mail to all admins
 		foreach ( keys %{$members} )
 		{
-			push( @tos , $_ ) if( $members->{$_}{perm} == Vhffs::Constants::ML_RIGHT_ADMIN );
+			push( @tos , $_ ) if( $members->{$_}{'perm'} == Vhffs::Constants::ML_RIGHT_ADMIN );
 		}
 
 		$header = new Mail::Header( );
@@ -610,7 +606,7 @@
 	    my $subject = 'Subscription moderation error';
 	    $subject = '['.$list->get_prefix.'] '.$subject if( length( $list->get_prefix ) > 0 );
 	    $header->replace( 'Subject' , $subject );
-    	    $header->replace('Date' , gmtime()." +00");
+    	    $header->replace('Date' , gmtime().' +00');
 	    
 	    my $email = Mail::Internet->new(  [ <> ] , 
 					      Header => $header ,
@@ -628,34 +624,32 @@
 {
 	my $mail = shift;
 	my $list = shift;
-	my $listmail = $list->get_localpart . "\@" . $list->get_domain;
 	my $subs = $list->get_members;
    
 	my @tos;
 
 	add_list_header( $mail , $list );
 
-	#Add prefix if not null
-	my $subject = $mail->get('Subject');
-	my $tsubject = Encode::decode('MIME-Header', $subject);
-	$tsubject =~ s/[\n\r]//g;
+	# Add prefix if not null
 	my $prefix = $list->get_prefix;
-	my $qprefix = quotemeta $prefix;
-	unless ( $tsubject =~ /\[$qprefix\]/)
-	{
-		$mail->replace( 'Subject' , '['.$prefix.'] '.$subject ) if( length( $prefix ) > 0 );
+	if( length( $prefix ) > 0 ) {
+		my $subject = $mail->get('Subject');
+		my $tsubject = Encode::decode('MIME-Header', $subject);
+		$tsubject =~ s/[\n\r]//g;
+		my $qprefix = quotemeta $prefix;
+		$mail->replace( 'Subject' , '['.$prefix.'] '.$subject ) unless ( $tsubject =~ /\[$qprefix\]/ );
 	}
 
 	# Add list's signature at the bottom of mail
 	if(defined(my $signature = $list->get_signature)) {
 		my $body = $mail->body;
-		push @$body, "---\n".$signature;
+		push @$body, '---'."\n".$signature."\n";
 	}
 
 	foreach ( keys %{$subs} )
 	{
 		#Send mail to user if he is a confirmed subscriber
-		push( @tos , $_ ) if( $subs->{$_}{perm} != Vhffs::Constants::ML_RIGHT_SUB_WAITING_FOR_REPLY  &&  $subs->{$_}{member} ne $listmail );
+		push( @tos , $_ ) if( $subs->{$_}{'perm'} != Vhffs::Constants::ML_RIGHT_SUB_WAITING_FOR_REPLY  &&  $subs->{$_}{'member'} ne $list->get_listname );
 	}
 
 	sendmail( $mail , \@tos );
@@ -676,23 +670,23 @@
 	my $subs = $list->get_members;
     
 	# we need to know if the sender is a member, an admin, or other
-	my $user_class = "other";  #assume other
-	$user_class = "member" if( defined $subs->{$from}  &&  $subs->{$from}{perm} == Vhffs::Constants::ML_RIGHT_SUB );
-	$user_class = "admin" if( defined $subs->{$from}  &&  $subs->{$from}{perm} == Vhffs::Constants::ML_RIGHT_ADMIN );
+	my $user_class = 'other';  #assume other
+	$user_class = 'member' if( defined $subs->{$from}  &&  $subs->{$from}{'perm'} == Vhffs::Constants::ML_RIGHT_SUB );
+	$user_class = 'admin' if( defined $subs->{$from}  &&  $subs->{$from}{'perm'} == Vhffs::Constants::ML_RIGHT_ADMIN );
 
 	my $post_ctrl = $list->get_post_ctrl;
 
-	if( $user_class eq "admin"  ||  $post_ctrl == Vhffs::Constants::ML_POSTING_OPEN_ALL )  {
+	if( $user_class eq 'admin'  ||  $post_ctrl == Vhffs::Constants::ML_POSTING_OPEN_ALL )  {
 		sendmail_to_list( $mail , $list );
 	}
-	elsif ( $user_class eq "member" )  {
+	elsif ( $user_class eq 'member' )  {
 		if( $post_ctrl == Vhffs::Constants::ML_POSTING_MEMBERS_ONLY  ||  $post_ctrl == Vhffs::Constants::ML_POSTING_OPEN_MEMBERS_MODERATED_OTHERS ) {
 			sendmail_to_list( $mail , $list )
 		} elsif ( $post_ctrl == Vhffs::Constants::ML_POSTING_MODERATED_ALL  ||  $post_ctrl == Vhffs::Constants::ML_POSTING_MEMBERS_ONLY_MODERATED ) {
 			put_in_moderation( $mail , $list );
 		}
 	}
-	elsif ( $user_class eq "other" )  {
+	elsif ( $user_class eq 'other' )  {
 		if( $post_ctrl == Vhffs::Constants::ML_POSTING_MODERATED_ALL  ||  $post_ctrl == Vhffs::Constants::ML_POSTING_OPEN_MEMBERS_MODERATED_OTHERS ) {
 			put_in_moderation( $mail , $list );		
 		}
@@ -703,7 +697,7 @@
 sub get_moderation_dir
 {
     my $list = shift;
-    return( $DIRECTORY . "/moderation/" . $list->get_domain . "/" . $list->get_localpart  );
+    return( $DIRECTORY . '/moderation/' . $list->get_domain . '/' . $list->get_localpart  );
 }
 
 sub validate_message
@@ -713,7 +707,7 @@
     my @tempmail;
     chomp( $hash );
     my $dir  = get_moderation_dir( $list );
-    my $file = $dir . "/" . $hash;
+    my $file = $dir . '/' . $hash;
    
     return -1 if( ! -d $dir );
     return -2 if( ! -f $file );
@@ -743,7 +737,7 @@
     my $hash = shift;
     chomp( $hash );
     my $dir  = get_moderation_dir( $list );
-    my $file = $dir . "/" . $hash;
+    my $file = $dir . '/' . $hash;
     return -1 if( ! -d $dir );
     return -2 if( ! -f $file );
 
@@ -766,7 +760,7 @@
 
     if( ! -d $dir )
     {
-	push( @result , gettext("No message to moderate") );
+	push( @result , gettext('No message to moderate') );
 	push( @result , "\n" );
     }
     else
@@ -777,16 +771,16 @@
 	foreach $file ( @files )
 	{
 	    next if( ( $file eq '.' ) || ( $file eq '..' ) );
-	    $complete = $dir . "/" . $file ;
+	    $complete = $dir . '/' . $file ;
 	    
 	    if( -f $complete )
 	    {
 		$mail = fetch_mail_from_file( $complete );
 		next if( ! defined $mail );
 		
-		push( @result , "Sender: " . $mail->get('From:') );
-		push( @result , "Subject: " . $mail->get('Subject:') );
-		push( @result , "Id in listengine: " . $file );
+		push( @result , 'Sender: ' . $mail->get('From:') );
+		push( @result , 'Subject: ' . $mail->get('Subject:') );
+		push( @result , 'Id in listengine: ' . $file );
 		push( @result , "\n\n");
 	    }
 	}
@@ -827,8 +821,8 @@
 	#If the user specified a lang, we change it to get internationalized messages
 	if( defined $lang )
 	{
-		bindtextdomain("vhffs", '%localedir%');
-		textdomain("vhffs");
+		bindtextdomain('vhffs', '%localedir%');
+		textdomain('vhffs');
 	}
 
 
@@ -840,8 +834,8 @@
 			     );
 		$email->replace('From' ,  $LISTMASTER );
 		$email->replace('To' ,  $from );
-		$email->replace('Subject' , gettext("listengine help") );
-    	$email->replace('Date' , gmtime()." +00");
+		$email->replace('Subject' , gettext('listengine help') );
+    	$email->replace('Date' , gmtime().' +00');
 		sendmail( $email , $from );
     }
     elsif( $subject =~ /^subscribe$/i )
@@ -862,8 +856,8 @@
 					 );
 		$email->replace('From' ,  $LISTMASTER );
 		$email->replace('To' ,  $from );
-		$email->replace('Subject' , gettext("listengine help") );
-		$email->replace('Date' , gmtime()." +00");
+		$email->replace('Subject' , gettext('listengine help') );
+		$email->replace('Date' , gmtime().' +00');
 		sendmail( $email , $from );
 	}
 	else
@@ -873,8 +867,8 @@
 					 );
 	    $email->replace('From' ,  $LISTMASTER );
 	    $email->replace('To' ,  $from );
-	    $email->replace('Subject' , gettext("listengine help") );
-    	    $email->replace('Date' , gmtime()." +00");
+	    $email->replace('Subject' , gettext('listengine help') );
+    	    $email->replace('Date' , gmtime().' +00');
 	    sendmail( $email , $from );
 	}
     }
@@ -890,8 +884,8 @@
 					 );
 	    $email->replace('From' ,  $LISTMASTER );
 	    $email->replace('To' ,  $from );
-	    $email->replace('Subject' , gettext("listengine result command") );
-    	    $email->replace('Date' , gmtime()." +00");
+	    $email->replace('Subject' , gettext('listengine result command') );
+    	    $email->replace('Date' , gmtime().' +00');
 	    sendmail( $email , $from );
 	   
 	}
@@ -905,8 +899,8 @@
 					     );
 		$email->replace('From' ,  $LISTMASTER );
 		$email->replace('To' ,  $from );
-		$email->replace('Subject' , gettext("listengine moderation") );
-    	        $email->replace('Date' , gmtime()." +00");
+		$email->replace('Subject' , gettext('listengine moderation') );
+    	        $email->replace('Date' , gmtime().' +00');
 		sendmail( $email , $from );
 	    }
 	    else
@@ -916,8 +910,8 @@
 					     );
 		$email->replace('From' ,  $LISTMASTER );
 		$email->replace('To' ,  $from );
-		$email->replace('Subject' , gettext("listengine moderation") );
-    	        $email->replace('Date' , gmtime()." +00");
+		$email->replace('Subject' , gettext('listengine moderation') );
+    	        $email->replace('Date' , gmtime().' +00');
 		sendmail( $email , $from );
 	    }
 	 
@@ -932,8 +926,8 @@
 					     );
 		$email->replace('From' ,  $LISTMASTER );
 		$email->replace('To' ,  $from );
-		$email->replace('Subject' , gettext("listengine moderation") );
-    	        $email->replace('Date' , gmtime()." +00");
+		$email->replace('Subject' , gettext('listengine moderation') );
+    	        $email->replace('Date' , gmtime().' +00');
 		sendmail( $email , $from );
 		return;
 	    }
@@ -944,8 +938,8 @@
 					     );
 		$email->replace('From' ,  $LISTMASTER );
 		$email->replace('To' ,  $from );
-		$email->replace('Subject' , gettext("listengine moderation") );
-    	        $email->replace('Date' , gmtime()." +00");
+		$email->replace('Subject' , gettext('listengine moderation') );
+    	        $email->replace('Date' , gmtime().' +00');
 		sendmail( $email , $from );
 	    }
 	    return;
@@ -957,8 +951,8 @@
 					 );
 	    $email->replace('From' ,  $LISTMASTER );
 	    $email->replace('To' ,  $from );
-	    $email->replace('Subject' , sprintf( gettext("listengine - list of messages to moderate for %s") , $list->get_listname  ) );
-    	    $email->replace('Date' , gmtime()." +00");
+	    $email->replace('Subject' , sprintf( gettext('listengine - list of messages to moderate for %s') , $list->get_listname  ) );
+    	    $email->replace('Date' , gmtime().' +00');
 	    sendmail( $email , $from );
 	    return;
 	}
@@ -971,8 +965,8 @@
 					     );
 		$email->replace('From' ,  $LISTMASTER );
 		$email->replace('To' ,  $from );
-		$email->replace('Subject' , gettext("listengine moderation") );
-    	        $email->replace('Date' , gmtime()." +00");
+		$email->replace('Subject' , gettext('listengine moderation') );
+    	        $email->replace('Date' , gmtime().' +00');
 		sendmail( $email , $from );
 	    }
 	    else
@@ -982,8 +976,8 @@
 					     );
 		$email->replace('From' ,  $LISTMASTER );
 		$email->replace('To' ,  $from );
-		$email->replace('Subject' , gettext("listengine moderation") );
-    	        $email->replace('Date' , gmtime()." +00");
+		$email->replace('Subject' , gettext('listengine moderation') );
+    	        $email->replace('Date' , gmtime().' +00');
 		sendmail( $email , $from );
 	    }
 	}
@@ -1023,8 +1017,8 @@
 			     );
 		$mail->replace('From' ,  $LISTMASTER );
 		$mail->replace('To' ,  $from );
-		$mail->replace('Subject' , gettext("listengine: unknown command") );
-  	  	$mail->replace('Date' , gmtime()." +00");
+		$mail->replace('Subject' , gettext('listengine: unknown command') );
+  	  	$mail->replace('Date' , gmtime().' +00');
 		sendmail( $mail , $from );
     }
 
@@ -1109,8 +1103,8 @@
     if( defined $lang )
     {	
 	#Change current locale to user preferences if defined
-		bindtextdomain("vhffs", '%localedir%');
-		textdomain("vhffs");
+		bindtextdomain('vhffs', '%localedir%');
+		textdomain('vhffs');
 		setlocale(LC_ALL, $lang  );
     }
 }
@@ -1130,8 +1124,8 @@
 	exit( 0 ) if( $from eq '' );
 
 	$from = lc $from;
-	exit( 0 ) if( $from eq $list->get_listname);
-	exit( 0 ) if( $from eq $list->get_localpart.'-request@'.$list->get_domain );
+	#there is no reason to accept From set to the request address
+	exit( 0 ) if( $from eq $list->get_listrequestname );
 }
 
 


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