dir=/home1/tamblayo/mail/inhedo.com/informeges/cur
rm -r INFGES FILGES
mkdir INFGES FILGES

INFGES=`pwd`/
#echo $dir/1552434186.M403233P898282.host213.hostmonster.com,S=98944,W=100567:2,S
for i in $dir/*
do
egrep base64 $i >/dev/null
[ $? = 0 ] && {
echo $i
echo =====================================
awk -F">" ' BEGIN { part=0 }
/Content-Type: text\// { getline } 
/base64/ {
	part++
	r=""
	getline
	while (r=="" && getline)
	{
		print >sprintf("tmp/part%.2d.b64",part)
		if(length <76) r=1
	}
	part++
	
}
{ print >sprintf("tmp/part%.2d",part)} 

' $i
exit
}
done 
