Roundcube Community Forum
Release Support => Pending Issues => Topic started by: filip on December 27, 2006, 06:42:59 PM
-
Hello,
When I am sending an e-mail from roundcube to a gmail adress for example, if my name is : Malée, it will display it in gmail as : =?UTF-8?Q?Mal=C3=A9e
It it is not very pleasant for people who are receving my emails.
Other wise, all the other accents of the subject and of the text are well displayed.
Thank you for your help.
-
Hi,
I have the same problem so I have got a look in the code, appears to me that the function who encodes 'From' field execute his operations on whole string composed by nickname <mail@domain.ext>
so it puts in the header the result From: =?UTF-whatever...blabla_=?
, in this case when header is passed to the PEAR function who is entitled to process data and send it to server you have as result that someone (PEAR or SMPT I don't know) add the domain extension to this field resulting in a field of the type =?UTF-whatever...blabla_?=@domain.ext
in this case this is not a well formatted 'From' field and we can see the results of this in our recipents mail client, a correct 'From' field is kind From: =?UFT-whatever..blabla?=
, I have modified the txtHeaders function in lib/Mail/mime.php to take care of these considerations, it takes 'From' field from array with only the nickname who eventually should be encoded, than, after add your mail address with a straight copy, it seems to work but I don't know if the encoding of whole 'From' field is necessary (mail address with specialchars perhaps?)
My configuration is SMTP Postfix, PHP 4.4.4.
-
Hi,
Thanks for your reply.
Could you show me exactly what you have modified in your txtHeader function ? Because I don't understand very well what you did.
-
Hi, those are my modifications :) I can't guarantee they don't put on flames your server :P
diff -urNp old/program/lib/Mail/mime.php new/program/lib/Mail/mime.php
--- old/program/lib/Mail/mime.php 2007-01-01 12:58:26.000000000 +0100
+++ new/program/lib/Mail/mime.php 2007-01-01 12:58:02.000000000 +0100
@@ -695,12 +695,17 @@ class Mail_mime
* @return string Plain text headers
* @access public
*/
- function txtHeaders($xtra_headers = null, $overwrite = false)
+ function txtHeaders($xtra_headers = null, $overwrite = false, $sender_address = null)
{
$headers = $this->headers($xtra_headers, $overwrite);
$ret = '';
foreach ($headers as $key => $val) {
- $ret .= "$key: $val" . MAIL_MIME_CRLF;
+ if($key == "From")
+ {
+ if($sender_address != null) $ret .= "$key: $val <$sender_address>" . MAIL_MIME_CRLF;
+ else $ret .= "$key: $val". MAIL_MIME_CRLF;
+ }
+ else $ret .= "$key: $val" . MAIL_MIME_CRLF;
}
return $ret;
}
diff -urNp old/program/steps/mail/sendmail.inc new/program/steps/mail/sendmail.inc
--- old/program/steps/mail/sendmail.inc 2007-01-01 12:57:27.000000000 +0100
+++ new/program/steps/mail/sendmail.inc 2007-01-01 12:57:46.000000000 +0100
@@ -108,7 +108,7 @@ if (empty($identity_arr['string']))
// compose headers array
$headers = array('Date' => date('D, j M Y G:i:s O'),
- 'From' => $identity_arr['string'],
+ 'From' => $identity_arr['name'],
'To' => rcube_charset_convert($mailto, $input_charset, $message_charset));
// additional recipients
@@ -240,7 +240,7 @@ if (!$savedraft) {
unset($send_headers['Bcc']);
// generate message headers
- $header_str = $MAIL_MIME->txtHeaders($send_headers);
+ $header_str = $MAIL_MIME->txtHeaders($send_headers, false, $identity_arr['email']);
// send message
$sent = smtp_mail($from, $a_recipients, $header_str, $msg_body);
-
Thank you very much !
:)
It is working well now.
-
Hi everyone!
I tried to do this, but then RoundCube would'nt send any e-mails.
It just said "Sendng e-mail" and nothing happened. Maybe I did it the wrong way..:
Can anyone tell me detailed how to fix this? Sorry, but I'm a bit of a newbie :-)
I got the latest version of RoundCube.
-
Latest from site or latest from SVN?
-
Latest from site.
What is the difference between SVN and the one from the site?? :)
Please help me solve this problem! :-)
-
Latest SVN is a snapshoot of the version under development, files are different from the milestone release; my mod is based on the 0.1 beta 2 released near xmas so you should have the correct version to apply the mods.
You can apply the patch by hand looking at code generated by diff program (posted above), otherwise you can use the diff counterpart ,patch, which will apply the patch for you following instructions in patch files who you can find in the attached archive.
If you have Windows use the patch file with (w32) string in the name (check attached archive), install patch.exe program by downloading this package http://gnuwin32.sourceforge.net/downlinks/patch.php, unzip roundcube sources in a folder, copy patch in this folder, go in console/prompt ad enter this folder, than, run a test to see if patch will apply
C:\Program\GnuWin32\bin\patch -p1 --dry-run < file_bla_bla_bla.patch
...if you read...
patching file program/lib/Mail/mime.php
patching file program/steps/mail/sendmail.inc
... all may run smooth so patch with the command:
C:\Program\GnuWin32\bin\patch -p1 < file_bla_bla_bla.patch
you should have now the patched and working files in their respective folders.
Hope this will help.
-
Patch worked fine for accented characters in the "From" header.
Very cool mail client.. =)