Agile Web Development

Build it. Launch it. Love it.

Validates as email

This Ruby on Rails plugin implements an ActiveRecord validation helper called validatesas_email. The helper acts as if validatesformat_of was used with a regular expression that defines an RFC822 email address conformance test.

Vitals

Repository https://svn.greenpeace.org/repositories/rails_plugins/validates_as_email/
License
Rating (30 votes)
Created 14 April 2006

Comments

  • Friendly coward
    29 July 2006

    I have to say that putting this behind https and not pointing it to trunk (or a tag) just makes this more difficult than it needs to be. Perhaps, just some instructions and warning would have saved me half an hour. I'm working in RadRails and it doesn't like https. Cheers

  • Avatar
    6 September 2006

    Can someone tell me how to install this? I get an error on plugin install:

    ruby script\plugin -v install https://svn.greenpeace.org/reposito
    ries/rails_plugins/validates_as_email
    Plugins will be installed using http
    fetching from 'https://svn.greenpeace.org/repositories/rails_plugins/validates_a
    s_email'
    c:/ruby/lib/ruby/1.8/net/http.rb:586:in `connect': certificate verify failed (Op
    enSSL::SSL::SSLError)
    from c:/ruby/lib/ruby/1.8/net/http.rb:586:in `connect'
    from c:/ruby/lib/ruby/1.8/net/http.rb:553:in `do_start'
    from c:/ruby/lib/ruby/1.8/net/http.rb:542:in `start'
    from c:/ruby/lib/ruby/1.8/open-uri.rb:245:in `open_http'
    from c:/ruby/lib/ruby/1.8/open-uri.rb:629:in `buffer_open'
    from c:/ruby/lib/ruby/1.8/open-uri.rb:167:in `open_loop'
    from c:/ruby/lib/ruby/1.8/open-uri.rb:165:in `open_loop'
    from c:/ruby/lib/ruby/1.8/open-uri.rb:135:in `open_uri'
    ... 11 levels...
    from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/commands/plugin.rb:8
    71
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
    quire'
    from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_suppo
    rt/dependencies.rb:147:in `require'
    from script/plugin:3

    Thanks,

    Herman

  • DW
    13 September 2006

    Following the directions in the README, the plugin did not install. Not sure why.

    I get: Plugin not found: ["https://svn.greenpeace.org/repositories/railsplugins/validatesas_email/"]

    That being said, I manually created a validatesasemail folder under plugins and copied init.rb and the lib folder there and things seem to work.

  • DW
    13 September 2006

    Following the directions in the README, the plugin did not install. Not sure why.

    I get: Plugin not found: ["https://svn.greenpeace.org/repositories/railsplugins/validatesas_email/"]

    That being said, I manually created a validatesasemail folder under plugins and copied init.rb and the lib folder there and things seem to work.

  • DW
    13 September 2006

    Following the directions in the README, the plugin did not install. Not sure why.

    I get: Plugin not found: ["https://svn.greenpeace.org/repositories/railsplugins/validatesas_email/"]

    That being said, I manually created a validatesasemail folder under plugins and copied init.rb and the lib folder there and things seem to work.

  • Avatar
    marty
    6 November 2006

    This plugin looks promising but having to copy the files manually from the repository was a pain.......

  • Avatar
    marty
    6 November 2006

    This plugin looks promising but having to copy the files manually from the repository was a pain.......

  • Craig Barber
    5 April 2007

    The problem isn't with the site but with open-uri which script/plugin is using. It is throwing a "OpenSSL::SSL::SSLError Exception: certificate verify failed" but the cert validates fine in both Opera and Firefox.

    While waiting for a bug fix, just svn/tortoisesvn to checkout and then do an export.

    svn co https://svn.greenpeace.org/repositories/railsplugins/validatesas_email/trunk/

  • Avatar
    Sean O'Hara
    9 April 2007

    This plugin doesn't seem to do the best job of validating email addresses. It let 'jacksie@yahoo' pass as valid, which it clearly is not (no top level domain).

  • 31 May 2007

    The plugin marks a@yahoo as a valid address. RFC822 defines domain as:

    domain = sub-domain *("." sub-domain)

    i.e. there only has to be one part after the @ sign.

    If you want to ignore the RFC and reject addresses such as a@yahoo, change * to + in the line

    domain = "#{subdomain}(?:\x2e#{subdomain})*"

    to

    domain = "#{subdomain}(?:\x2e#{subdomain})+"

Add a comment