From 6585ccac494cb8f1e726fa02ceb6bcc576e8bc70 Mon Sep 17 00:00:00 2001 From: fukachan Date: Fri, 24 Nov 2006 06:51:15 +0000 Subject: use environment variable FML_EMUL_FROM if specified. show unix from. append time information to avoid body checksum loop check. --- regress/message/scramble.pl | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/regress/message/scramble.pl b/regress/message/scramble.pl index be3dfc0e..0682e670 100755 --- a/regress/message/scramble.pl +++ b/regress/message/scramble.pl @@ -1,29 +1,29 @@ #!/usr/bin/env perl #-*- perl -*- # -# Copyright (C) 2001,2002 Ken'ichi Fukamachi +# Copyright (C) 2001,2002,2004,2006 Ken'ichi Fukamachi # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: scramble.pl,v 1.2 2002/12/30 13:18:50 fukachan Exp $ +# $FML: scramble.pl,v 1.3 2004/03/28 13:11:59 fukachan Exp $ # use strict; use Carp; -my $from = undef; +my $from = $ENV{ FML_EMUL_FROM } || undef; my $from_found = 0; my $date_found = 0; my $msgid_found = 0; -if (defined $ENV{ FML_EMUL_FROM }) { - $from = $ENV{ FML_EMUL_FROM }; -} +# unix from +print "From $from\n"; +# main part while (<>) { if (/^date:/i) { - $date_found = 1; - } + $date_found = 1; + } if (/^message-id/i) { my $time = time; @@ -38,20 +38,27 @@ while (<>) { if (/^$/) { unless ($msgid_found) { - my $time = time; - my $host = `hostname`; chomp $host; - print "Message-ID: <$time\@$host>\n"; - $msgid_found = 1; + my $time = time; + my $host = `hostname`; chomp $host; + print "Message-ID: <$time\@$host>\n"; + $msgid_found = 1; } unless ($date_found) { - print "Date: "; - print `date +"%a, %d %b %Y %H:%M:%S +0900 (JST)."`; - $date_found = 1; + print "Date: "; + print `date +"%a, %d %b %Y %H:%M:%S +0900 (JST)."`; + $date_found = 1; } } print $_; } +# avoid body loop check. +require 'ctime.pl'; +print "\n"; +print "XXX AVOID BODY CHECKSUM LOOP CHECK: "; +print ctime(time); +print "\n"; + exit 0; -- cgit v1.2.1