News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

is this a bug ?

Started by katib, October 19, 2008, 09:10:06 AM

Previous topic - Next topic

katib

There was a bug report in 1.1.4 version
Acually, I am facing the same bug with SMF 2 beta 4 (see screenshoot bellow)
Quote from: Croco on April 09, 2008, 07:19:09 PM
when sending emails form the forum
it happens that subject is using html entities and some of mail provider doesn't support that if the encoding is UTF-8

usually if the name of the forum uses non-english chars the subject will contain HTML entities which are not converted to represented chars

It might happen in SMF 2.0 Beta I didn't test it yet

منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

katib

#2
Sorry for starting multiple topics  :(

Now,  I know that at least a memeber of SMF stuff ( you)  knows about my problem !!
I will wait patientlly for a help
Please note that a board with a bogus mail functions  looks like a space mission without telecommunication facilities !!!
منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

Jade Elizabeth

Lol made me laugh.

I have no idea how to help you I'm afraid, I don't use utf-8 because of its problems!
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

SleePy

I know there is a bug report on this, I just can't seem to locate it :(
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

katib

#5
Thank you Sleepy
Is it quite strange that this bug was here since SMF 1.1.4
does it mean that all SMF users with utf8 and non latin characters ( arabic, hebrew, urdu, thai, vietnameese...) are suffring the same problem !!?
by the way,there is a : "convert html entities to utf8"
what does this function do ?
منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

SleePy

I believe it affected all those who are using utf-8 with non Latin characters in the subject.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

katib

Quote from: SleePy on October 20, 2008, 02:32:02 PM
I believe it affected all those who are using utf-8 with non Latin characters in the subject.
Quite frustrating to hear that  :(
I am not a programmer, so I only wonder, why SMF deosnir simply send the subject the same way as the body, because users get the body message readable with normal characters ?
منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

katib

Is there any good news  ::)
My forum is sending garbage to users ( see screenshoot below)
Please notice that a forum with bogus email functions looks like a space mission with NO telecom facilities
It will be lost in the (cyber) space  ;)

منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

katib

I found this solution here
http://www.usenet-forums.com/php-language/32399-unicode-entities-email-subject.html
But I dont understand any thing at program wiriting  :(
Can some one help me how to implement it ? please
QuoteThe "Subject" field can be encoded as MIME header (see RFC 2045-2048).
For example, given the subject $subj encoded as a UTF-8 string,
a possible encoding might be

define("ENCODING", "UTF-8");

$header = "Subject: =?" . ENCODING . "?B?" . base64_encode($subj) . "?= ";

Note that the RFC 2047 sets a limit to the maximum lenght of the resulting
string. Beyond that limit the string must be splitted somewere. However,
the email clients I tested are able to accept a string of any length,
so this is a problem you may ignore as a first step of the implementation.

And note that this encoding has nothing to do with the Content-Type
field or the body of the message.

Obviously, your "Unicode entities" must be converted to regular UTF-8
characters before the Base64 encoding be applied.

منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

SleePy

Hmm, interesting if that might work..

Since I guess you won't mind testing if it works or not.

Find:
$headers = 'From: "' . $from_name . '" <' . (empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']) . '>' . $line_break;


Add After that:
$headers = 'Subject: =?UTF-8?B?' . base64_encode($subject) . '?= ';

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

katib

thanks Sleepy
yes I dont mind testing
but in what file should I search this string ?!
منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

SleePy

Sorry about that, Subs-Post.php where the sendmail function is for SMF :)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

katib

#14
Thanks Sleepy
But it didnot work
I still have garbage characters

After modification you suggested, my Subs-Post.php looks like this:

Quote// Construct the mail headers...
 $headers = 'From: "' . $from_name . '" <' . (empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']) . '>' . $line_break;
$headers = 'Subject: =?UTF-8?B?' . base64_encode($subject) . '?= ';
 $headers .= $from !== null ? 'Reply-To: <' . $from . '>' . $line_break : '';
 $headers .= 'Return-Path: ' . (empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']) . $line_break;
 $headers .= 'Date: ' . gmdate('D, d M Y H:i:s') . ' -0000' . $line_break;
منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

katib

Any help please  :(
All email notifications sent by  forum  have weired characters in  subject field  ???

I wonder how Farsi , Hebrew, thai and russian boards deal with this annoying problem!!
doeas this mean that I am  the only forum owner how suffer this bug !!!?

I am using SMF2Beta4 arabic-utf8
منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

SleePy

Can you pm or email me the raw source of the email? That is the one that contains all the headers about the email. Hopefully this helps.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

katib

Ok
I sent you a PM
Please note that the bug affects only yahoo and hotmail webmail.
Gmail displays email subject in the normal way , no issue !!!
منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

SleePy

I just remembered seeing this in the changelog.
! Mails sent to Yahoo and Hotmail accounts no longer need special treatment. (Subs-Post.php) [Bug 1910]

Open Subs-Post.php
Find:
if (preg_match('~@(yahoo|hotmail|att|comcast|bellsouth)\.[a-zA-Z\.]{2,6}$~i', $to_address) === 1)

Replace:
if (preg_match('~@(att|comcast|bellsouth)\.[a-zA-Z\.]{2,6}$~i', $to_address) === 1)

There was one other line changed, but that was the comment and won't affect us :P

Hopefully that will fix this up :D
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

katib

Thank you very much Sleepy  :D :D
you are my hero !!!
those buggy email notfications was a terrible nightmare for me
Today I reeceived the first email notification with no wierd characters at subject  :D
Tomorrow, I will ask others members, for confirmation
And  I will post in the arabic section to let my fellow know about ythe fix
Thank yu ver much!
منتدى الحجاج ... منتدى للقراءة والكتاب
http://www.hijaj.net

Advertisement: