Hi, I have an email manager app, and I am having an issue with one of the email?s ?from? header address. As you can see below, I am receiving a inaccurate results for the from address with this email?s header. Any ideas on what I should look in to, I can?t seem to find a solution for this one. I?ve attached the email.>> include ?tmail? >> email = TMail::Mail.parse(STDIN.read)... Paste the attached email ... => #<TMail::Mail port=#<TMail::StringPort:id=0xf0f802> bodyport=nil>>> email.from=> nil>> email.from_addrs=> []>> email.header_string(?from?)=> ??>> email.header_string(?From?)=> ??>> email.to=> ["mxc.cxxxxxxxe at exxxxxxxr.com"] Thanks, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/tmail-talk/attachments/20090212/b0fd4d9e/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: raw_email.eml Type: application/octet-stream Size: 3600 bytes Desc: not available URL: <http://rubyforge.org/pipermail/tmail-talk/attachments/20090212/b0fd4d9e/attachment-0001.obj>
Seems to be choking on the < > chars in "From: flname at DOMain.com <flname at domain.com>" Changing it to "From: flname at DOMain.com" fixes it for me. I''m no expert on RFC822 but I think it is proper syntax to have "alias <real at email.tld>"
> I''m no expert on RFC822 but I think it is proper syntax to have "alias > <real at email.tld>" >Meaning that I would expect what you have in your example mail to be OK, and that TMail is not parsing correctly. I could be wrong though :)
On Fri, Feb 13, 2009 at 6:31 AM, Matt Simpson <matt.simpson3 at gmail.com> wrote:> I have an email manager app, and I am having an issue with one of the > email''s ''from'' header address. > > As you can see below, I am receiving a inaccurate results for the from > address with this email''s header. Any ideas on what I should look in to, I > can''t seem to find a solution for this one. I''ve attached the email.What version of TMail are you using?>> TMail::VERSION::STRING=> "1.2.3">> data = File.read(''test'')=> (your email)>> mail = TMail::Mail.parse(data)=> #<TMail::Mail port=#<TMail::StringPort:id=0x916130> bodyport=nil>>> mail.from=> ["flname at domain.com"] Works fine... Mikel -- http://lindsaar.net/ Rails, RSpec and Life blog....
Same as you:>> RUBY_VERSION=> "1.8.6">> TMail::VERSION::STRING=> "1.2.3">> RAILS_GEM_VERSION=> "2.1.2" Also, I opened the email in Mozilla Thunderbird, Microsoft Entourage and Apple Mail and it renders no problem. however I still cannot parse out the from address.> From: Mikel Lindsaar <raasdnil at gmail.com> > Reply-To: "tmail-talk at rubyforge.org" <tmail-talk at rubyforge.org> > Date: Fri, 13 Feb 2009 13:10:01 +1100 > To: "tmail-talk at rubyforge.org" <tmail-talk at rubyforge.org> > Subject: Re: [Tmail-talk] Urgent issue with parsing from address > > On Fri, Feb 13, 2009 at 6:31 AM, Matt Simpson <matt.simpson3 at gmail.com> wrote: >> I have an email manager app, and I am having an issue with one of the >> email''s ''from'' header address. >> >> As you can see below, I am receiving a inaccurate results for the from >> address with this email''s header. Any ideas on what I should look in to, I >> can''t seem to find a solution for this one. I''ve attached the email. > > What version of TMail are you using? > >>> TMail::VERSION::STRING > => "1.2.3" >>> data = File.read(''test'') > => (your email) >>> mail = TMail::Mail.parse(data) > => #<TMail::Mail port=#<TMail::StringPort:id=0x916130> bodyport=nil> >>> mail.from > => ["flname at domain.com"] > > Works fine... > > Mikel > > -- > http://lindsaar.net/ > Rails, RSpec and Life blog.... > _______________________________________________ > Tmail-talk mailing list > Tmail-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/tmail-talk
Well, I''ve opened the email in Microsoft Entourage, Mozilla Thunderbird and Apple Mail and no issues.> From: jeff emminger <jemminger at gmail.com> > Reply-To: "tmail-talk at rubyforge.org" <tmail-talk at rubyforge.org> > Date: Thu, 12 Feb 2009 17:38:03 -0500 > To: "tmail-talk at rubyforge.org" <tmail-talk at rubyforge.org> > Subject: Re: [Tmail-talk] Urgent issue with parsing from address > >> I''m no expert on RFC822 but I think it is proper syntax to have "alias >> <real at email.tld>" >> > > Meaning that I would expect what you have in your example mail to be > OK, and that TMail is not parsing correctly. I could be wrong though > :) > _______________________________________________ > Tmail-talk mailing list > Tmail-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/tmail-talk
its ok just for get it --- On Fri, 2/13/09, Matt Simpson <matt.simpson3 at gmail.com> wrote: From: Matt Simpson <matt.simpson3 at gmail.com> Subject: Re: [Tmail-talk] Urgent issue with parsing from address To: "tmail-talk at rubyforge.org" <tmail-talk at rubyforge.org> Date: Friday, February 13, 2009, 2:27 PM Same as you:>> RUBY_VERSION=> "1.8.6">> TMail::VERSION::STRING=> "1.2.3">> RAILS_GEM_VERSION=> "2.1.2" Also, I opened the email in Mozilla Thunderbird, Microsoft Entourage and Apple Mail and it renders no problem. however I still cannot parse out the from address.> From: Mikel Lindsaar <raasdnil at gmail.com> > Reply-To: "tmail-talk at rubyforge.org"<tmail-talk at rubyforge.org>> Date: Fri, 13 Feb 2009 13:10:01 +1100 > To: "tmail-talk at rubyforge.org" <tmail-talk at rubyforge.org> > Subject: Re: [Tmail-talk] Urgent issue with parsing from address > > On Fri, Feb 13, 2009 at 6:31 AM, Matt Simpson<matt.simpson3 at gmail.com> wrote:>> I have an email manager app, and I am having an issue with one of the >> email''s ''from'' header address. >> >> As you can see below, I am receiving a inaccurate results for the from >> address with this email''s header. Any ideas on what I should lookin to, I>> can''t seem to find a solution for this one. I''ve attached theemail.> > What version of TMail are you using? > >>> TMail::VERSION::STRING > => "1.2.3" >>> data = File.read(''test'') > => (your email) >>> mail = TMail::Mail.parse(data) > => #<TMail::Mail port=#<TMail::StringPort:id=0x916130>bodyport=nil>>>> mail.from > => ["flname at domain.com"] > > Works fine... > > Mikel > > -- > http://lindsaar.net/ > Rails, RSpec and Life blog.... > _______________________________________________ > Tmail-talk mailing list > Tmail-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/tmail-talk_______________________________________________ Tmail-talk mailing list Tmail-talk at rubyforge.org http://rubyforge.org/mailman/listinfo/tmail-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/tmail-talk/attachments/20090213/1fe83453/attachment.html>