Bug 150550

Summary: Bug in mail header patch for PHP when using UTF-8
Product: Ports & Packages Reporter: Daniel Ylitalo <daniel>
Component: Individual Port(s)Assignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Daniel Ylitalo 2010-09-14 08:20:00 UTC
Hi!

I found a bug in the mail header patch when using UTF-8.

If you have a url that contains custom chars, such as å ä ö, the mail header patch breaks that utf-8 encoding when it puts the path into the mailheader.
You will then have a malformed header (see attached screenshot) and will be picked up by spamdetection softwares as "BAD HEADER".

you can find a screenshot of a mailsource of such an email here:
http://www.blodan.se/mail-header-patch-bug.jpg

Fix: 

Make sure to use utf-8 compatible functiosn in the mail header patch
How-To-Repeat: create a rewritten url, either with htaccess in apache or in the rewrite config in lighttpd, with one of the chars å ä ö, or probably any other multibyte char. Make sure to set the header and encodings to utf-8 for that site.

Send a mail using mail();
Comment 1 Alex Dupre freebsd_committer freebsd_triage 2010-09-14 09:08:53 UTC
State Changed
From-To: open->closed

Do you know that URLs don't have a defined charset? 
So don't use anything except ASCII. If you like, you may contact 
the patch author: Teck Choon Giam <giamteckchoon@gmail.com>