[Debian-l10n-commits] r1203 - in /ddtp/trunk/bin: mailparser mailparser.pl

grisu at users.alioth.debian.org grisu at users.alioth.debian.org
Thu Aug 14 23:32:32 UTC 2008


Author: grisu
Date: Thu Aug 14 23:32:32 2008
New Revision: 1203

URL: http://svn.debian.org/wsvn/?sc=1&rev=1203
Log:

   * mailparser
      * handel better log files
   * mailparser.pl
      * send lesser mails (spam problem)
      * add some mail filter


Modified:
    ddtp/trunk/bin/mailparser
    ddtp/trunk/bin/mailparser.pl

Modified: ddtp/trunk/bin/mailparser
URL: http://svn.debian.org/wsvn/ddtp/trunk/bin/mailparser?rev=1203&op=diff
==============================================================================
--- ddtp/trunk/bin/mailparser (original)
+++ ddtp/trunk/bin/mailparser Thu Aug 14 23:32:32 2008
@@ -2,11 +2,11 @@
 
 cd ~ddtp/ddts/bin/
 
-tee -a ../log/mailin | ./mailparser.pl 2> ../log/mailparser.err.log.$$ > ../log/mailparser.log.$$
+tee -a ../log/mailin | ./mailparser.pl 2> ../log/mailparser.err.log-$$ > ../log/mailparser.log-$$ || true
 
-cat ../log/mailparser.err.log.$$ >>../log/mailparser.err.log
-cat ../log/mailparser.log.$$ >>../log/mailparser.log
+cat ../log/mailparser.err.log-$$ >>../log/mailparser.err.log
+cat ../log/mailparser.log-$$ >>../log/mailparser.log
 
-rm ../log/mailparser.err.log.$$
-rm ../log/mailparser.log.$$
+rm ../log/mailparser.err.log-$$
+rm ../log/mailparser.log-$$
 

Modified: ddtp/trunk/bin/mailparser.pl
URL: http://svn.debian.org/wsvn/ddtp/trunk/bin/mailparser.pl?rev=1203&op=diff
==============================================================================
--- ddtp/trunk/bin/mailparser.pl (original)
+++ ddtp/trunk/bin/mailparser.pl Thu Aug 14 23:32:32 2008
@@ -41,6 +41,8 @@
 
 # Number of days before we ignore the owner when sending descriptions to translate
 my $OWNER_EXPIRE = 28;
+
+my $add_translation=0;
 
 sub desc_to_parts ($) {
         my $desc = shift;
@@ -738,6 +740,8 @@
 		return;
 	}
 
+	$add_translation++;
+
 	$btsclose_nr = 0;
 
 	my @lines = $part -> bodyhandle -> as_lines;
@@ -983,8 +987,23 @@
 		suicide "no messageid";
 	}
 
+	if ($from =~ /\@(?i:selex-comms.com)/) {
+		suicide "from selex-comms.com";
+	}
+	if ($from =~ /(?i:mailmarshal)\@/) {
+		suicide "from mailmarshal";
+	}
+	if ($from =~ /(?i:imss\@city.uozu.lg.jp)/) {
+		suicide "from imss\@city.uozu.lg.jp";
+	}
+	if ($from =~ /(agl.com.au)/) {
+		suicide "from agl.com.au";
+	}
 	if ($from =~ /(?i:postmaster)\@/) {
 		suicide "from postmaster";
+	}
+	if ($from =~ /(?i:administrator)\@/) {
+		suicide "from administrator";
 	}
 	if ($from =~ /(?i:MAILER-DAEMON)\@/) {
 		suicide "from Mailer-Daemon";
@@ -1004,7 +1023,7 @@
 	my $desc_charset;
 	my $new_file;
 #	my $copy_file;
-	my $add_guide=1;
+	my $add_guide=0;
 #	my $add_status=0;
 	my $count=0;
 	my $package;
@@ -1122,6 +1141,16 @@
 		status	"nothing";
 	} elsif	(/\b(?i:command)\b/) {
 	} else {
+		if (/\b(?i:help)\b/) {
+			debug	"found HELP";
+
+			$add_guide = 1;
+		};
+		if (/\b(?i:guide)\b/) {
+			debug	"found GUIDE";
+
+			$add_guide = 1;
+		};
 		if (/\b(?i:noguide)\b/) {
 			debug	"found NOGUIDE";
 
@@ -1300,7 +1329,14 @@
 #	$mail_in  -> smtpsend if mailable($log_address{$lang_postfix});
 
 #	$mail_out -> smtpsend if mailable($from			     );
-	$mail_out -> smtpsend;
+
+	debug	"add_translation = $add_translation";
+	if (($count<0) || ($count>0) || ($add_guide) || ($add_translation>0)) {
+		$mail_out -> smtpsend;
+		debug "send mail";
+	} else {
+		debug "don't send mail";
+	}
 
 	$mail_in  -> purge;		# purge, this is only received parts
 	#$mail_out -> purge;		# don't purge. This remove files like status-XX, guide-XX.txt, ... 




More information about the Debian-l10n-commits mailing list