Friday, November 26, 2010

BAD HEADER, Improper use of control character (char 0D hex)

SkyHi @ Friday, November 26, 2010
I looked at the headers of a message from pligg by chance and saw this in there.


X-Amavis-Alert: BAD HEADER, Improper use of control character (char 0D hex):

From: webmaster@nothing.no.no\r\n


So my Amavis virus filtering didn't like the \r\n - which I don't believe is needed. I tested it with just the \n and no problems. It still passes but the more stringent mail systems may bounce it.


diff linkadmin.php.original linkadmin.php

117c117

< $headers = 'From: ' . PLIGG_PassEmail_From . "\r\n";

---

> $headers = 'From: ' . PLIGG_PassEmail_From . "\n";


editlink.php, login.php, recommend.php also have this. In recommend.php on line 91 it looks like it was fixed. It was commented out and has a line below with just the \n and no \r.


I looked at the svn from last night - 407 I think?


I solved the issue by turning almost all \r\n into \n in the php

module called "compose2.php". I hope I will not have to do the same

with the whole code...

REFERENCES
http://forums.pligg.com/questions-comments/2801-emails-have-control-character-them.html
http://osdir.com/ml/mail.ilohamail.devel/2007-03/msg00000.html