{"action":"created","issue":{"url":"https://api.github.com/repos/plataformatec/devise/issues/3975","repository_url":"https://api.github.com/repos/plataformatec/devise","labels_url":"https://api.github.com/repos/plataformatec/devise/issues/3975/labels{/name}","comments_url":"https://api.github.com/repos/plataformatec/devise/issues/3975/comments","events_url":"https://api.github.com/repos/plataformatec/devise/issues/3975/events","html_url":"https://github.com/plataformatec/devise/issues/3975","id":136897281,"number":3975,"title":"Devise.email_regexp doesn't detect some wrong emails addresses","user":{"login":"pedramteymoori","id":6186589,"avatar_url":"https://avatars.githubusercontent.com/u/6186589?v=3","gravatar_id":"","url":"https://api.github.com/users/pedramteymoori","html_url":"https://github.com/pedramteymoori","followers_url":"https://api.github.com/users/pedramteymoori/followers","following_url":"https://api.github.com/users/pedramteymoori/following{/other_user}","gists_url":"https://api.github.com/users/pedramteymoori/gists{/gist_id}","starred_url":"https://api.github.com/users/pedramteymoori/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedramteymoori/subscriptions","organizations_url":"https://api.github.com/users/pedramteymoori/orgs","repos_url":"https://api.github.com/users/pedramteymoori/repos","events_url":"https://api.github.com/users/pedramteymoori/events{/privacy}","received_events_url":"https://api.github.com/users/pedramteymoori/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-27T08:42:00Z","updated_at":"2016-02-27T08:47:41Z","closed_at":"2016-02-27T08:47:41Z","body":"In our project, sometimes we get `Net::SMTPServerBusy: 401 4.1.3 Bad recipient address syntax`.\r\nAfter check, we find out that the email was like 'foo@bar..foo' and 'Devise.email_regexp' detects it as a correct email address.\r\n\r\nI think we shoud change Devise email regexp from `/\\A[^@\\s]+@([^@\\s]+\\.)+[^@\\W]+\\z/` to something like `/\\A([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})\\Z/i` as shown [here](http://apidock.com/rails/ActiveModel/Validations/ClassMethods/validates_format_of).\r\n\r\nI can fix this if you confirm.\r\n\r\nRuby : 2.2.3\r\nRails : 4.2.5\r\nDevise : 3.5.6\r\nThanks."},"comment":{"url":"https://api.github.com/repos/plataformatec/devise/issues/comments/189607430","html_url":"https://github.com/plataformatec/devise/issues/3975#issuecomment-189607430","issue_url":"https://api.github.com/repos/plataformatec/devise/issues/3975","id":189607430,"user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"created_at":"2016-02-27T08:47:41Z","updated_at":"2016-02-27T08:47:41Z","body":"That's on purpose. :) Doing correct e-mail validation is actually quite complex and it would allow things like `foo@213.43.23.49` which a lot of people don't want. So we keep a single one on purpose, feel free to change if you want to. You can also consult previous issues open for this exact reason to see previous discussions. THank you!"}}