Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] UTF-8 in FROM mail header problem
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
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!
That's not the correct fix, but I've already fixed this.
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.
may you provide me correct fix?
(2008-08-30, 05:06 PM)imei Wrote: may you provide me correct fix?

Me too
(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']).'"';
[Image: choli_av.php]

Forum Jump:

Users browsing this thread: 1 Guest(s)