On Tue, Mar 14, 2006 at 11:01:39AM +0100, Thomas -Balu- Walter wrote:
> My users keep adding special characters in their addressbook screen names.
> Problematic ones are e.g. ",", ";", etc.

I'm not sure if RFC720 is the latest and greatest for this definition,
but here it is:

"Address Specification Syntax for Network Mail" 
http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=720&type=ftp&file_format=txt

Name = {An Ascii string without carriage return, line feed, space, '"', ",", 
";", 
        or any L-Bracket or R-Bracket} /
        '"' {An Ascii string with any double quotation marks doubled} '"'

So I think adding double quotes around the name would help a lot - while
double quotes need to be -uhm- doubled.

I've tried to do that in ./program/steps/mail/compose.inc:

--- program/steps/mail/compose.inc.ORIG 2006-03-14 11:46:19.964274615 +0100
+++ program/steps/mail/compose.inc      2006-03-14 12:04:49.105164249 +0100
@@ -585,7 +585,7 @@
 function format_email_recipient($email, $name='')
   {
   if ($name && $name != $email)
-    return sprintf('%s <%s>', strpos($name, ",") ? '"'.$name.'"' : $name, 
$email);
+    return sprintf('"%s" <%s>', str_replace('"', '""', $name), $email);
   else
     return $email;
   }
@@ -620,4 +620,4 @@


 parse_template('compose');
-?>
\ No newline at end of file
+?>

This does not work completely though - e.g. program/include/rcube_imap.inc
has to be changed too (others?).

And when I send a mail with a to like
        To: "Walter "" Thomas" <[EMAIL PROTECTED]>

it results in 
        To: "Walter " " Thomas" <[EMAIL PROTECTED]>

I am not sure if that is done by roundcube, the MTA or my MUA (mutt)?

Or did I get the RFC wrong?

     Balu
PS: I think mutt is not the reason - the raw mail already contains this
header.


Reply via email to