6.0.0-beta1
7/6/25

[#9525] Sender validation fails for non-ascii letters
Summary Sender validation fails for non-ascii letters
Queue IMP
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester wrobel (at) horde (dot) org
Created 01/19/2011 (5282 days ago)
Due
Updated 01/20/2011 (5281 days ago)
Assigned 01/19/2011 (5282 days ago)
Resolved 01/20/2011 (5281 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
01/20/2011 07:50:00 AM Gunnar Wrobel Comment #12
State ⇒ Resolved
Reply to this comment
It does. Thanks for the quick fix!
01/20/2011 07:20:21 AM Michael Slusarz Comment #11 Reply to this comment
This should fix things (?)
01/20/2011 07:20:08 AM Git Commit Comment #10 Reply to this comment
Changes have been made in Git for this ticket:

Bug #9525: Switch header charsets if we can't encode properly

http://git.horde.org/horde-git/-/commit/0c59c79c42530ea086a137b065da74d6292704f7
01/20/2011 06:51:31 AM Gunnar Wrobel Comment #9 Reply to this comment
In both tests you use 'UTF-8' as charset. In my case 
$message->getHeaderCharset() returns 'us-ascii' which is probably 
causing the problems. I'm replying to another message. Might that 
result in assuming an incorrect character set here?
01/20/2011 06:22:26 AM Michael Slusarz Comment #8 Reply to this comment
The validation fails on l.850 in imp/lib/Compose.php. Is the 
Horde_Mime::encodeAddress call above it the one that should quote it?
Yes.  The email address should be MIME encoded after that call, so it 
will pass validation (since it no longer contains non-7bit characters).

Added some tests to horde/Mime - both pass for me.
01/20/2011 06:21:22 AM Git Commit Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

Bug #9525: Add Horde_Mime::encodeAddress() tests

http://git.horde.org/horde-git/-/commit/8696a5446ebb64c22233e6ec37f6379ae42eb98c
01/20/2011 05:59:55 AM Gunnar Wrobel Comment #6 Reply to this comment
Ah, I see. Thanks for the feedback.

The validation fails on l.850 in imp/lib/Compose.php. Is the 
Horde_Mime::encodeAddress call above it the one that should quote it?
01/20/2011 04:14:32 AM Michael Slusarz Comment #5 Reply to this comment
+            'ß <wrobel@pardus.de>',
Except this *is* an invalid address.  The ß must be quoted - if it is, 
the validation correctly passes.

So for whatever reason this character is being quoted when I send a 
message but not when you send a message.  We need to find where in IMP 
this quoting is failing to occur (unit tests are unfortunately not 
going to help us here :( ).
01/20/2011 04:12:00 AM Git Commit Comment #4 Reply to this comment
Changes have been made in Git for this ticket:

Bug #9525: Add validation tests

http://git.horde.org/horde-git/-/commit/d17e468f3b8c781100fad3bfadb305fdd4164b5d
01/19/2011 09:05:42 PM Gunnar Wrobel Comment #3 Reply to this comment
The following test for the "Mail" package reproduces the problem on my side:

diff --git a/framework/Mail/test/Horde/Mail/ParseTest.php 
b/framework/Mail/test/Horde/Mail/ParseTest.php
index f095c1c..fec8988 100644
--- a/framework/Mail/test/Horde/Mail/ParseTest.php
+++ b/framework/Mail/test/Horde/Mail/ParseTest.php
@@ -189,4 +189,16 @@ class Horde_Mail_ParseTest extends 
PHPUnit_Framework_TestCase
          $this->assertEquals(count($res), 3);
      }

+    public function testBug9525()
+    {
+        $parser = new Horde_Mail_Rfc822();
+        $ob = $parser->parseAddressList(
+            'ß <wrobel@pardus.de>',
+            array(
+                'default_domain' => 'pardus.de',
+                'nest_groups' => false,
+                'validate' => true
+            )
+        );
+    }
  }


Having a unit test now I assume I would be able to solve it myself. I 
just wont find the time today anymore and in case you immediately spot 
the problem I'm of course happy if I don't have to dive into the code :)
01/19/2011 07:14:24 PM Michael Slusarz Comment #2
State ⇒ Feedback
Reply to this comment
I don't see this.  Just sent a message and it worked fine.  Headers:

[...]
To: =?utf-8?b?w58=?= <slusarz@curecanti.org>
Subject: Test
User-Agent: Internet Messaging Program (IMP) H4 (5.0-git)
[...]

01/19/2011 01:24:49 PM Gunnar Wrobel Assigned to Michael Slusarz
 
01/19/2011 01:24:34 PM Gunnar Wrobel Comment #1
Patch ⇒ No
State ⇒ Unconfirmed
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ Sender validation fails for non-ascii letters
Type ⇒ Bug
Priority ⇒ 1. Low
Reply to this comment
Not quite certain if the problem is caused by non-ascii letters in 
general but when trying to send a message to

ß <wrobel@horde.org>

in the dynamic version of imp I get the error that sending of the 
message failed with

Validation failed for: ß <wrobel@horde.org>

Saved Queries