# HG changeset patch # User HIROSE Yuuji # Date 1680657549 -32373 # Node ID 6455a043857044538a87cfa97e60c02f715cb7af # Parent 02e4520796596783d3f31d2333b7e2d3f9557286 TEST: Safeguard to mailloop diff -r 02e452079659 -r 6455a0438570 after5.rb --- 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 [yuujigentei.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