Hi there!
On 25 Mar 00, at 15:38, Istv�n Szendr� wrote
about "Re: Okay, who wants to test this stuff?":
> AVK> Okay, I've found some time (look when this message is composed;-)) to make
> AVK> that Perl script I've promised a few days ago.
> Thanks a lot for helping. Are you a night owl, too?
Usually, yes;-) But wait, I've found a bug in that script today: it won't work
against *your* messages (i.e. when the From: name contains 8bit, in either
QP or base64 form). The corrected script is attached to this one. Should now
work: it uses the e-mail _address_ of the sender when his/hers name contains
8bit symbols this time...
So it's now up to you to test it properly (i.e. you'll need to compare the number
of messages processed by this script and the number of the messages
actually _written_ to the disk: these should be equal. If this is not the case,
there is some bug in it, yet;-() I'll upload the updated archive with the exec
later this evening.
BTW, if somebody wants a script that would scan a _directory_ for
NNNNN.msg files and autorename these in any meaningful way, judging by
the headers, you're welcome to ask for it <sigh>;-)
--
SY, Alex
(St.Petersburg, Russia)
http://mph.phys.spbu.ru/~akiselev
---
Thought for the day:
The light at the end of the tunnel is the headlamp of an
oncoming train.
---
PGP public keys on keyservers:
0xA2194BF9 (RSA); 0x214135A2 (DH/DSS)
fingerprints:
F222 4AEF EC9F 5FA6 7515 910A 2429 9CB1 (RSA)
A677 81C9 48CF 16D1 B589 9D33 E7D5 675F 2141 35A2 (DH/DSS)
---
You are subscribed as : [email protected]
# Script that should automate messagebase backup in The Bat!
# (c)2000 Alexander V. Kiselev
open IN, 'gibberish.ini' or $failed=1;
@dirinfo=<IN>;
@dirinfo[0]=~/(.*?)\n/;
$dir=$1;
if ($failed==1)
{$dir="."};
@test=<>;
$kisa=<<EOF;
@test
EOF
# print "$kisa\n\n"; #Just check;-)
$kisa=~/from:\s*"?(.*?)"?\s*\</i;
$from=$1;
if ($from=~/^=\?.*?\?[QB]\?/i)
{$kisa=~/from:.*?\<(.*?)\>/i;
$from=$1;
print "8bit characters in From: detected;\n";
print " using e-mail address instead of the name.\n\n"};
if ($from eq "")
{$from="nobody"};
# print "$from\n"; #Just check;-)
$kisa=~/subject:\s*(.*?)\s*\n/i;
if ($1 ne "")
{$subj=$1}
else {$subj="nothing"};
if ($subj=~/^=\?.*?\?[QB]\?/i)
{$subj="8bit subject";
print "8bit characters in the Subject: field detected;\n";
print " can do nothing about it;-(\n\n"};
$subj=~tr/\:\"\*\\\|\?\//\# _____/;
# print "$subj\n"; #Just check;-)
$temp=join "__","$from","$subj";
$out=join ".",$temp,"msg";
$type='msg';
@files=<*.$type>;
$kisa=<<EOFF;
@files
EOFF
$incr=1;
while ($kisa=~/$out/)
{
$out=join ".",$temp,$incr,"msg";
$incr++;
};
chdir $dir;
print "Attempting write to file $dir/$out ...\n";
open OUT, ">$dir/$out" or die "Cannot open $out for write :$!";
print OUT @test;
print "Apparently, success;-))\n\n";
print "Thanx and bye.";