Defect #7717

MailHandler user creation for unknown_user impossible due to diverging length-limits of login and email fields

Added by Nil Nil almost 7 years ago. Updated almost 6 years ago.

Status:ClosedStart date:2011-02-25
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Email receiving
Target version:1.3.0
Resolution:Fixed Affected version:

Description

On redmine-1.1.1 it is not possible to create a user by sending a ticket by mail.

  • The maximum email length is 60 chars.
  • Login is generated from the email address, which has a size of only 30 chars.
--- a/redmine-1.1.1/app/models/user.rb
+++ b/redmine-1.1.1/app/models/user.rb
@@ -67,7 +67,7 @@ class User < Principal
   validates_uniqueness_of :mail, :if => Proc.new { |user| !user.mail.blank? }, :case_sensitive => false
   # Login must contain lettres, numbers, underscores only
   validates_format_of :login, :with => /^[a-z0-9_\-@\.]*$/i
-  validates_length_of :login, :maximum => 30
+  validates_length_of :login, :maximum => 60
   validates_format_of :firstname, :lastname, :with => /^[\w\s\'\-\.]*$/i
   validates_length_of :firstname, :lastname, :maximum => 30
   validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :allow_nil => true
--- a/redmine-1.1.1/db/migrate/001_setup.rb
+++ b/redmine-1.1.1/db/migrate/001_setup.rb
@@ -200,7 +200,7 @@ class Setup < ActiveRecord::Migration
     end

     create_table "users", :force => true do |t|
-      t.column "login", :string, :limit => 30, :default => "", :null => false
+      t.column "login", :string, :limit => 60, :default => "", :null => false
       t.column "hashed_password", :string, :limit => 40, :default => "", :null => false
       t.column "firstname", :string, :limit => 30, :default => "", :null => false
       t.column "lastname", :string, :limit => 30, :default => "", :null => false

Related issues

Related to Redmine - Feature #4969: issue creation by email fails when on-the-fly user creati... Closed 2010-03-02
Duplicated by Redmine - Defect #5724: Email creation of new issues for anonymous users failing ... Closed 2010-06-22
Duplicated by Redmine - Defect #8450: redmine:email:receive_imap fails silently when creating a... Closed 2011-05-27

History

#1 Updated by Etienne Massip almost 7 years ago

  • Category changed from Accounts / authentication to Email receiving

#2 Updated by mark burdett about 6 years ago

Still a problem in Redmine 1.2.2

This is a fairly serious bug for those who want to use the --unknown-user=create option.

#3 Updated by Terence Mill about 6 years ago

+1

#4 Updated by Mischa The Evil about 6 years ago

  • Subject changed from MailHandler user creation for unknown_user to MailHandler user creation for unknown_user impossible due to length-limits of login and email fields

#5 Updated by Mischa The Evil about 6 years ago

  • Subject changed from MailHandler user creation for unknown_user impossible due to length-limits of login and email fields to MailHandler user creation for unknown_user impossible due to diverging length-limits of login and email fields

#6 Updated by Jean-Philippe Lang almost 6 years ago

  • Tracker changed from Patch to Defect
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 1.3.0
  • Resolution set to Fixed

This problem should be fixed with r7952. Login is now truncated if needed.

Also available in: Atom PDF