On Fri, Feb 08, 2002 at 12:54:58PM +0100, Roman Fordinal wrote: > > problem?
Yes! > :.. Roman Fordinal > :.. project manager Well, as a Project Manager you should, perhaps, be a bit more specific about what you want :-) > sub new > { > my $procc=shift; > my $text=shift; > my $self={}; > return 0 unless $email; Is that -----------^^^^^^ global? And what's it for? > my @body=split('\n',$text); > > foreach (@body) > { > @ref=split(':',$_); > $self->{header}->{$ref[0]}=$ref[1]; > } You cannot be sure that you now have a valid header. What if there's a quoted mailheader *inside* the message content? You need to make sure you only weed out the header section of the mail and ignore the body, since you'd overwrite your valid headers. Check out this sample-mail: ---------- snip ---------- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Some stuff... Dear List members, can anybody enlighten me on why my mails bounce? Here are my headers: ...cut here... From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: overridden ... ---------- snip ---------- And gone are your real header fields. And besides from that you'd have another headerfield called 'Here are my headers' with an empty value. Go to http://search.cpan.org and look for some mailparsing module there. There are things like Mail::Box that'll assist you in parsing emails... -- If we fail, we will lose the war. Michael Lamertz | [EMAIL PROTECTED] Nordstr. 49 | http://www.lamertz.net - http://www.perl-ronin.de 50733 Cologne | Priv: +49 221 445420 Germany | Mobile: +49 171 6900 310 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]