MyBB Community Forums
[F] UTF-8 in FROM mail header problem - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: Archived Bug Reports (https://community.mybb.com/forum-74.html)
+------ Forum: MyBB 1.4.1 (https://community.mybb.com/forum-93.html)
+------ Thread: [F] UTF-8 in FROM mail header problem (/thread-36950.html)



[F] UTF-8 in FROM mail header problem - imei - 2008-08-30

I don't know why this problem happened or any other ppls have same problem or not.
First of all I'm using a SMTP mail function in localhost.
My forum name is in persian and so it should send a utf-8 encoded header in from header. at the moment I'm using 1.4.1 and it send mails with headers like this:
From: "=?utf-8?B?2q/Ystin2LHZhyI=?= <[email protected]>
I thought that it is in result of quotation that not ended. so I reported this thread and I added a quotation at the end.
after that mail never delivers!
I checked out my mails that correctly delivered to me with a persian title in from section and they was like this:
From: =?UTF-8?B?2LnZhNuMINio2KfZhdix2KfZhQ==?= <[email protected]>
and logged headers of smtp mail connection:
HELO localhostMAIL FROM:<=?utf-8?B?2q/Ystin2LHZhyI=?= <[email protected]>>RCPT TO:<[email protected]>DATADate: Sat, 30 Aug 2008 16:13:47 +0000To: [email protected]: =?utf-8?B?2LHZhdiyINmI2LHZiNivINm+2KfaqSDYtNivINiv2LEg2q/Ystin2LHZhw==?=From: =?utf-8?B?2q/Ystin2LHZhyI=?= <[email protected]>
Return-Path: [email protected]
Reply-To: [email protected]
Message-ID: <[email protected]>
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: MyBB
X-MyBB-Script: xxx.com/member.php
MIME-Version: 1.0
a slight comparison shows where the problem is:
FROM:<=?utf-8?B?2q/Ystin2LHZhyI=?= <[email protected]>>
so I believe that inc/mailhandlers/smtp.php {line~193} should be altered to:
if(!$this->send_data('MAIL FROM:'.$this->from.'', '250'))

I don't know that if this affect any other sections of mailing of board but I did it and I get result.
and also inc/class_mailhandler.php
should be altered same as this:
$this->from = $this->utf8_encode($mybb->settings['bbname']);
because utf-8 encoding does not need that indeed!
thanks.


RE: UTF-8 in FROM mail header problem - Ryan Gordon - 2008-08-30

That's not the correct fix, but I've already fixed this.


[F] UTF-8 in FROM mail header problem - Ryan Gordon - 2008-08-30

Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.


RE: [F] UTF-8 in FROM mail header problem - imei - 2008-08-30

may you provide me correct fix?


RE: [F] UTF-8 in FROM mail header problem - my_bb - 2008-09-01

(2008-08-30, 05:06 PM)imei Wrote: may you provide me correct fix?

Me too


RE: [F] UTF-8 in FROM mail header problem - Choli - 2008-09-07

(2008-08-30, 05:06 PM)imei Wrote: may you provide me correct fix?

I've had the same bug and fixed it before noticing this thread. Until the new version of MyBB is released, you can use this fix (which I assume it is the one Ryan implemented):

In the file inc/class_mailhandler.php, find this line:
$this->from = '"'.$this->utf8_encode($mybb->settings['bbname'].'"');
and replace it by
$this->from = '"'.$this->utf8_encode($mybb->settings['bbname']).'"';