Bugs: Browse | Submit New | Admin

[#22771] TMail fails to parse bad email address in email but succeeds on TMail::Address.parse

Date:
2008-11-12 10:18
Priority:
3
Submitted By:
Paul Wright (wrighty)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
TMail fails to parse bad email address in email but succeeds on TMail::Address.parse

Detailed description
We just came across this in an internal application that uses TMail to parse email.  Is the following expected
behaviour?

#!/usr/bin/env ruby

bad_address = 'Foo... <foo@example.com>'

test_email = <<MAIL
From: #{bad_address}
To: "Good Address" <good@example.com>
Subject: A Subject line

Here's a mail body.  Lovely.

MAIL

mail = TMail::Mail.parse(test_email)
p mail.from
p TMail::Address.parse(bad_address).to_s
p TMail::Address.parse(bad_address).spec


output:

nil
"\"Foo...\" <foo@example.com>"
"foo@example.com"

We're using TMail bundled inside Rails (2.1.2) and version.rb is 1.2.3

Add A Comment: Notepad

Please login


Followup

Message
Date: 2008-11-13 12:55
Sender: Paul Wright

Further testing shows that any name in an email address
ending in a period will trigger this bug.

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item