Mikhail Kornienko
2008-Jul-14 08:36 UTC
Receiving mail from not strictly RFC-valid email addresses
Hello, I have a blog system which allows users to post articles to their blogs from mobile phones. Users just set up their mobile phone address in blog settings and then send messages from mobile phone to designated server email, which is then parsed and added to their respectful blogs based on the From: field. However, being in Japan and having Japanese mobile phone users setting their email addresses to very strange, RFC-invalid, but still perfectly working email addresses (and mobile operators allowing them to do so..) - I have problem that non-RFC valid emails get killed during the Mailer.receive phase and never actually make it to their blogs. For example, an email address can easily be in a form like "hello_..._all-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org" As far as I understand, TMail''s Address.parse is responsible for parsing stuff which comes to Mailer.receive function. However, it shows error on addresses like that:>> TMail::Address.parse("hello_..._all-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org")TMail::SyntaxError: parse error on token "." from parser.y:379:in `on_error'' What I would like to do is to make the parser less strict. I tried to understand how TMail''s parser works and almost broke my neck :( I would be really grateful if anyone can suggest a solution, or at least give a direction where I should look for a solution. Mail addresses are processes by TMail::Parser (and I don''t understand the syntax..), but it should come to RegExp matching at some point? I don''t know. Any suggestions are very very welcome. Thanks Mike. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---