changeset 105:6455a0438570 draft

TEST: Safeguard to mailloop
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 05 Apr 2023 10:18:42 +0859
parents 02e452079659
children 3c15bfbe68dd
files after5.rb
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/after5.rb	Thu Nov 19 19:42:29 2020 +0900
+++ b/after5.rb	Wed Apr 05 10:18:42 2023 +0859
@@ -4,7 +4,7 @@
 # Associative Scheduling Table - after5
 # (C)2003, 2004, 2006, 2008, 2012-2020 by HIROSE Yuuji [yuuji<at>gentei.org]
 # $Id: after5.rb,v 1.20 2012/12/03 15:54:20 yuuji Exp $
-# Last modified Thu Nov 19 19:40:13 2020 on firestorm
+# Last modified Wed Apr  5 10:18:06 2023 on firestorm
 # See http://www.gentei.org/~yuuji/software/after5/
 # このスクリプトはEUCで保存してください。
 $hgid = <<_HGID_.split[1..-2].join(" ")
@@ -2787,6 +2787,7 @@
     hold = []
     ret = []
     skip = false
+    mailcountheader = 0
     while line = body.shift
       case line.toeuc
   # #Below does not work correctly when (from|subject): is final line
@@ -2812,6 +2813,12 @@
             end
           end
           hold = ["From: "+rewritefrom(email, comment, fromhack)+"\n"]
+        elsif /^x-mail-count:/i =~ line
+          if (mailcountheader += 1) > 2
+            # Maybe loop!  Silently finish
+            STDERR.puts("Too many X-Mail-Count(maybe loop)")
+            exit 0			# XXXXXXXX
+          end
         elsif /^received:/i =~ line
           # Put original received headers aside to reduce hop count
           line = "X-pre"+line

yatex.org