Bug #1613
Email address format validation preventing admin user creation
Description
On both RPM versions 0.4.2-0.1 and 0.5.1-1 the admin user is being created with the Auth type not set. On 0.4.2, without the :login setting, I can browse to the dashboard which logs me in as admin. If I then enable :login and refresh the dashboard I am automatically logged in and can see that the admin user has no Auth type set.
When I try to reset the admin user I receive the following Mail is invalid
error
[root@foreman1 foreman]# rake -t -v permissions:reset RAILS_ENV=production Libvirt binding are missing - hypervisor management is disabled /usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:10: warning: already initialized constant ENC_NONE /usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:11: warning: already initialized constant ENC_EUC /usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:12: warning: already initialized constant ENC_SJIS /usr/lib/ruby/gems/1.8/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:13: warning: already initialized constant ENC_UTF8 ** Invoke permissions:reset (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute permissions:reset Mail is invalid
I am able to bypass the error by commenting out the validation in the user model:
# validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :allow_nil => true
This happens both with a domain of localdomain
or localdomain.mydomain.com
. The latter appears to pass with email address root@localdomain.mydomain.com. I am not sure what may be failing.
This is on CentOS 6 x86_64 using foreman-installer.
Associated revisions
History
#1
Updated by Ohad Levy almost 11 years ago
- Difficulty set to easy
#2
Updated by Ohad Levy almost 11 years ago
- Target version deleted (
1.0)
Hi Andy,
I've tried to reproduce, but none of my test email addresses were failing, can you mention which email address did it try to create it under?
thanks
#3
Updated by Andy Shinn almost 11 years ago
I was trying with a local domain I had setup. The local domain is called, literally, 'localdomain'. So my root email is root@localhost.localdomain. I'm in the process of setting up a new environment to test Foreman in so if this is reproducible it can be closed and I can reopen if it happens on the latest version.
#4
Updated by Ohad Levy almost 11 years ago
- Assignee set to Ohad Levy
- Priority changed from Low to Normal
- Target version set to 1.0
#5
Updated by Ohad Levy almost 11 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset 111a4083f7d8cafb3138e48a70ce0636bf98d1c2.
fixes #1613 - Email address format validation preventing admin user creation