Hello all,

Below another patch, working in production for us (from Brian Passante)

Regards,

Jerome MOLLIER-PIERRET,
Tomao groupe KPF

##########################
I also have this problem, and when starting MailScanner in debug mode, it return this error:


In debug mode the error is :
Bad RFC822 field name ''
 at /usr/lib/perl5/site_perl/5.8.0/Mail/Internet.pm line 130


But, the header "-:" (by reading the rfc822) seems to be compliant. This is the Mail::Header lib which are disagree with that.

I tested parsing a email with the perl lib with the "-:" header and it
return the same rfc822 error.
I find the origin a the error but I am unable to correct it.

In the Header.pm of the Mailtools libs, the function :
sub _tag_case
{
my $tag = shift;
$tag =~ s/\:$//;

join('-',
   map { /^[b-df-hj-np-tv-z]+$|^(?:MIME|SWE|SOAP|LDAP)$/i
       ? uc($_) : ucfirst(lc($_)) }
            split('-', $tag));
}

When parsing, "-:" headers, it return "", and after when a check is done
by :
croak( "Bad RFC822 field name '$tag'\n")
unless(defined $ctag && $ctag =~ /\A($FIELD_NAME|From )/oi);

the error appear because nothing is not rfc compliant.

About a tips:
just comment the 210 & 211 ligne of the Header.pm :
croak( "Bad RFC822 field name '$tag'\n")
unless(defined $ctag && $ctag =~ /\A($FIELD_NAME|From )/oi);

It is not so really bad, because, if Qmail receive a buggy headers mail,
it refuses it so we don't have to really check the rfc.
I test  it by injecting all my buggy mail, and everything is working fine.

Have a nice day
##########################


K.M.Ganesh wrote:
Dear elliot moore,

Thank you for your response!

The 'exit' is from the line:
  croak( "Bad RFC822 field name '$tag'\n")
in Header.pm ?

If I could ask you for some educated advice:
Would it be ok to just comment out the croak line in Header.pm ( Till 5.0.1.7 is released :)
I received the bad header, so I guess it is ok to pass it on...


I hope you don't mind me asking you this.
e.


rather than editing Mail::Header, a quick fix would be to insert a line in /usr/lib/MailScanner/MailScanner/Message.pm

(for openprotect 5.0.1.6)
after line 162 - my $mhobj = new Mail::Header, Modify => 1;

New line (163):

$mhobj->modify(0);

this seems to work for now. any feedback would help.

G.


------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ Opencomputing-openprotect mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opencomputing-openprotect


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Opencomputing-openprotect mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opencomputing-openprotect

Reply via email to