>> TMail::Address.parse(''no_valid_email'')=> #<TMail::Address no_valid_email> I know that you have a massive test repository, but I''m just surprised that an email address doesn''t have to contain an @ Br, Morten
On Fri, Jul 25, 2008 at 5:47 AM, Morten <lists at kikobu.com> wrote:>>> TMail::Address.parse(''no_valid_email'') > => #<TMail::Address no_valid_email> > > I know that you have a massive test repository, but I''m just surprised that > an email address doesn''t have to contain an @Yes, you can send email to another person on your system without an email address. The SMTP gateway will attempt to deliver it locally. Mikel -- http://lindsaar.net/ Rails, RSpec and Life blog....
On Jul 25, 2008, at 2:20 AM, Mikel Lindsaar wrote:> On Fri, Jul 25, 2008 at 5:47 AM, Morten <lists at kikobu.com> wrote: >>>> TMail::Address.parse(''no_valid_email'') >> => #<TMail::Address no_valid_email> >> >> I know that you have a massive test repository, but I''m just >> surprised that >> an email address doesn''t have to contain an @ > > Yes, you can send email to another person on your system without an > email address. The SMTP gateway will attempt to deliver it locally.Ah, I''d completely forgotten about that. Thanks. How about this one: >> TMail::Address.parse(''hans at foo.com '').address => "hans at foo.com" Is it intended that the parser rewrites the value? The trailing white space is not a problem? I know that this is an edge case - our usage is "if the email is valid per tmail, save it to the DB" then later when we get an incoming mail with that address, we''re not able to find it as the parsed value does not contain the whitespace (natrually). Easy enough to work around, I''m just here due to curiosity :-) Br, Morten
> Ah, I''d completely forgotten about that. Thanks. > How about this one: > >>> TMail::Address.parse(''hans at foo.com '').address > => "hans at foo.com" > > Is it intended that the parser rewrites the value? The trailing white space > is not a problem? I know that this is an edge case - our usage is "if the > email is valid per tmail, save it to the DB" then later when we get an > incoming mail with that address, we''re not able to find it as the parsed > value does not contain the whitespace (natrually). Easy enough to work > around, I''m just here due to curiosity :-)Well, trailing whitespace is ignored on the email line per the RFCs, so that''s what you would be hitting there. I would take the tmail address object and take it''s output and pump that into your database. Get''s rid of all sorts of unwanted guff too... like trailing white space :) Mikel -- http://lindsaar.net/ Rails, RSpec and Life blog....