6.0.0-git
2019-03-19

[#11929] sending mail via AcitveSync fails if addresses contains german umlauts
Summary sending mail via AcitveSync fails if addresses contains german umlauts
Queue Synchronization
Queue Version Git master
Type Bug
State Not A Bug
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester j.goepfert (at) gmx (dot) de
Created 2013-01-02 (2267 days ago)
Due
Updated 2013-01-15 (2254 days ago)
Assigned 2013-01-04 (2265 days ago)
Resolved 2013-01-15 (2254 days ago)
Milestone
Patch No

History
2013-01-15 15:01:08 Michael Rubinsky State ⇒ Not A Bug
 
2013-01-15 14:55:47 j (dot) goepfert (at) gmx (dot) de Comment #6 Reply to this comment
ok, i executed your code snippets in the horde php console and it 
worked. i checked the Core/ActiveSync/Driver.php for a call something 
linke "->toArray(array('charset' => 'UTF-8'))", but there was not 
something like that. i checked the file in the git-repo and noticed a 
lot of changes.
i am not sure but i believe your changes 
(f309400f86940b7bc74ca48472420464d08bbf7b) did it.
i upgraded horde and now it works.
Thanks for your patience. issue can be closed.
Jens
2013-01-09 16:10:30 Michael Rubinsky Comment #5 Reply to this comment
Also, regardless of how the client sends the email, 
Horde_Mime_Headers->toArray() should properly encode it anyway. What 
does the following output for you?

$hdr = new Horde_Mime_Headers();
$hdr->addHeader('To', 'Michael Rübinsky <mrubinsk@horde.org>');
var_dump($hdr->toArray(array('charset' => 'UTF-8')));

For me, it correctly outputs the following for the "To" value:

"Michael =?utf-8?b?UsO8Ymluc2t5?= <mrubinsk@horde.org>"

If this doesn't work for you, then either your git checkout is not up 
to date, or your php is broken.

2013-01-09 15:46:42 Michael Rubinsky Comment #4 Reply to this comment
That's because that is not a valid RFC822 email address.  My guess is 
that your client is sending it incorrectly. What AS client are you 
using?

For reference, sending an email to Michael Rübinsky 
<mike@theupstairsroom.com> results in the following at the same debug 
point you used:

string(59) "Michael =?utf-8?b?UsO8Ymluc2t5?= <mike@theupstairsroom.com>"
2013-01-08 05:06:03 j (dot) goepfert (at) gmx (dot) de Comment #3 Reply to this comment
Hi,
i  added some debug output to Transport.php (line 183) to see what the 
content of the variable $recipients is, which is passed to the 
parseAddressList function.
$recipients = "Günter <jens@sg-dev.de>";
So i created a litte demo script called test.php:

<?php
include 'Rfc822.php';
include 'Exception2.php';
include 'Rfc822/Object.php';
include 'Rfc822/Address.php';
include 'Rfc822/List.php';

$rfc822 = new Horde_Mail_Rfc822();
$recipients = "Günter <jens@sg-dev.de>";
$addresses = $rfc822->parseAddressList($recipients, array('validate' 
=> true));

?>

The same exception like in my log file is thrown. calling with 
$recipients = "Gunter <jens@sg-dev.de>"; works.

Note: in my test script i included Exception2.php which i copied from 
Exception.php and changed it to:
class Horde_Mail_Exception extends Exception
{
}

So i do not have any Horde dependencies to get my test script executable.
2013-01-04 21:24:10 Michael Rubinsky Priority ⇒ 1. Low
 
2013-01-04 21:23:58 Michael Rubinsky Version ⇒ Git master
Queue ⇒ Synchronization
 
2013-01-04 21:23:31 Michael Rubinsky Comment #2
Assigned to Michael Rubinsky
State ⇒ Feedback
Reply to this comment
Unable to reproduce using all kinds of non-ascii characters.

What is the exact email address that is causing validation to fail?
2013-01-02 14:19:21 j (dot) goepfert (at) gmx (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ sending mail via AcitveSync fails if addresses contains german umlauts
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ No
Reply to this comment
if an address contains german umlauts sending emails via ActiveSync 
fails. This happens for the "From"-address and for the 
recipient-addresses. Sending without umlauts works fine.

The active sync log contains the following enries:

2013-01-02T14:08:59+00:00 INFO: Request being handled for device: 
androidc1264404651 Supporting protocol version: 12.1
2013-01-02T14:08:59+00:00 INFO: [androidc1264404651] Handling SendMail 
command.
2013-01-02T14:08:59+00:00 ERR: Error when parsing address list.
2013-01-02T14:08:59+00:00 ERR: exception 'Horde_Mail_Exception' with 
message 'Error when parsing address list.' in 
/var/www/horde5/pear/php/Horde/Mail/Rfc822.php:261
Stack trace:
#0 /var/www/horde5/pear/php/Horde/Mail/Rfc822.php(164): 
Horde_Mail_Rfc822->_parseAddressList()
#1 /var/www/horde5/pear/php/Horde/Mail/Transport.php(186): 
Horde_Mail_Rfc822->parseAddressList('Jens G??pfert <...', Array)
#2 /var/www/horde5/pear/php/Horde/Mail/Transport/Smtp.php(222): 
Horde_Mail_Transport->parseRecipients('Jens G??pfert <...')
#3 /var/www/horde5/pear/php/Horde/Core/ActiveSync/Driver.php(1085): 
Horde_Mail_Transport_Smtp->send('Jens G??pfert <...', Array, Resource 
id #262)
#4 /var/www/horde5/pear/php/Horde/ActiveSync/Request/SendMail.php(54): 
Horde_Core_ActiveSync_Driver->sendMail(Resource id #242, false, false, 
false, true)
#5 /var/www/horde5/pear/php/Horde/ActiveSync/Request/Base.php(213): 
Horde_ActiveSync_Request_SendMail->_handle()
#6 /var/www/horde5/pear/php/Horde/ActiveSync.php(639): 
Horde_ActiveSync_Request_Base->handle()
#7 /var/www/horde5/pear/php/Horde/Rpc/ActiveSync.php(150): 
Horde_ActiveSync->handleRequest('SendMail', 'androidc1264404...')
#8 /var/www/horde5/rpc.php(155): Horde_Rpc_ActiveSync->getResponse(NULL)
#9 {main}
2013-01-02T14:08:59+00:00 ERR: exception 'Horde_Mail_Exception' with 
message 'Error when parsing address list.' in 
/var/www/horde5/pear/php/Horde/Mail/Rfc822.php:261
Stack trace:
#0 /var/www/horde5/pear/php/Horde/Mail/Rfc822.php(164): 
Horde_Mail_Rfc822->_parseAddressList()
#1 /var/www/horde5/pear/php/Horde/Mail/Transport.php(186): 
Horde_Mail_Rfc822->parseAddressList('Jens G??pfert <...', Array)
#2 /var/www/horde5/pear/php/Horde/Mail/Transport/Smtp.php(222): 
Horde_Mail_Transport->parseRecipients('Jens G??pfert <...')
#3 /var/www/horde5/pear/php/Horde/Core/ActiveSync/Driver.php(1085): 
Horde_Mail_Transport_Smtp->send('Jens G??pfert <...', Array, Resource 
id #262)
#4 /var/www/horde5/pear/php/Horde/ActiveSync/Request/SendMail.php(54): 
Horde_Core_ActiveSync_Driver->sendMail(Resource id #242, false, false, 
false, true)
#5 /var/www/horde5/pear/php/Horde/ActiveSync/Request/Base.php(213): 
Horde_ActiveSync_Request_SendMail->_handle()
#6 /var/www/horde5/pear/php/Horde/ActiveSync.php(639): 
Horde_ActiveSync_Request_Base->handle()
#7 /var/www/horde5/pear/php/Horde/Rpc/ActiveSync.php(150): 
Horde_ActiveSync->handleRequest('SendMail', 'androidc1264404...')
#8 /var/www/horde5/rpc.php(155): Horde_Rpc_ActiveSync->getResponse(NULL)
#9 {main}
2013-01-02T15:09:04+01:00 DEBUG: [27658] Initializing state for 
collection: INBOX, synckey: {50bc7406-5c54-4dfb-a993-14613e4b951e}493
2013-01-02T15:09:04+01:00 DEBUG: [27658] Loading state for synckey 
{50bc7406-5c54-4dfb-a993-14613e4b951e}493

Saved Queries