Defect #6433

IMAP receiving does not create a new user

Added by Miloš Kozák about 10 years ago. Updated over 9 years ago.

Status:NewStart date:2010-09-19
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email receiving
Target version:-
Resolution: Affected version:1.0.1

Description

Hi,
I tried to use http://redmine.rubyforge.org/svn/tags/1.0.1/lib/tasks/email.rake for email downloading and acceptiong as a new issue through command:

  rake -f /opt/redmine/1.0.1/Rakefile redmine:email:receive_imap  host=mail.server username=helpdesk@domain.tld password=XXXXX  move_on_success=read move_on_failure=failed unknown_user=create  project=test allow_overwrite=project --trace RAILS_ENV=production

But I encountered an issue that the issue ticket is not created when is submitted from foreign email. (But create option stands for creation of the new user?) When I use option unknown_user=accept everything is working properly but there is no information about sender, which I highly need.

Or Is there any plugin which deals with it? I tried plugin from trolltech, redmine_helpdesk and few other but any of them didn't work at all.

Thank you

History

#1 Updated by Simen Endsjø almost 10 years ago

I have the exact same problem in 1.0.2
Nothing is written to procuction.log either.

#2 Updated by Simen Endsjø almost 10 years ago

I have ldap enabled, and it seems this might be a problem.
If a user registered in ldap sends an email, the user is created as an internal user - not connected to ldap. Any users outside of ldap doesn't get added.

#3 Updated by Felix Schäfer almost 10 years ago

unknown_user=create will create a user based on the incoming email, but the user will only have the non member role, which might not be permission enough to create an issue in whatever project you're trying to throw it in. Add something like no_permission_check=true if you want redmine to not check the permissions of the sender.

#4 Updated by Simen Endsjø almost 10 years ago

The problem is that unknown_user=create doesn't create a user at all.
I've also tried no_permission_check, but still no user is created.

#5 Updated by Felix Schäfer almost 10 years ago

Do you have any user custom fields that are required? I.e. can a user be created by only entering a first, lastname and mail address?

#6 Updated by Simen Endsjø almost 10 years ago

The required fields are the default ones: login, firstname, lastname, email and password.

#7 Updated by Felix Schäfer almost 10 years ago

Then I have no idea… Is the system maybe set to require the admin to confirm new registration?

#8 Updated by Simen Endsjø almost 10 years ago

Nope. I'm pretty sure this has something to do with LDAP authentication.

If an unknown email is picked up AND the email exists in ldap, the user is created.
The user is then created as an internal user and not linked to ldap at all.

If an unknown email that doesn't exist in ldap is encountered, no user is created. Anonymous ticket creation still works.

#9 Updated by Miloš Kozák almost 10 years ago

Thank you for your reactions.. But I deal with MySQL, not LDAP. It tried everything described there, but nothing worked.
I am afraid It is an internal problem. I even tried to set all permissions to all users..

#10 Updated by Simen Endsjø almost 10 years ago

Ok, I've only tried with MySQL + ldap. As it work's when the email exists in ldap, I thought it was only related to ldap.

Is there any way I can enable more logging to try to pinpoint the problem a bit better?

#11 Updated by Miloš Kozák almost 10 years ago

Ok, it is not related to LDAP only :) I try to run it with mysql.. If there was a clean way how to achieve a more verbose logging, would be great, but I do not know it.

#12 Updated by Felix Schäfer almost 10 years ago

Try toggling the boolean values of lines 20 and 21 in source:/trunk/config/environments/production.rb#L20, though I'm not sure how much logging is done in the mail-receiving thing.

#13 Updated by Simen Endsjø almost 10 years ago

Not quite sure I understand what you mean..

Change

config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching             = true

To

config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching             = false

#14 Updated by Simen Endsjø almost 10 years ago

Ok, I tried

config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching             = false

and restarted the mongrel instance, but it didn't have any impact.

#15 Updated by Felix Schäfer almost 10 years ago

Well, then you're probably in development mode already, and I don't think there's more logging you can get.

#16 Updated by Simen Endsjø almost 10 years ago

This is a very attractive feature for us as we could use Redmine also for customer support.
Do you have any idea what else I might try to make this work or get some error messages?

#17 Updated by Axel B. almost 10 years ago

Same here ... we are also using Redmine 1.0.2. Within our Redmine instance user accounts have to be checked manually. But to test the issue mail importer I enabled the option automatic account activation. Unfortunately without positiv results...

I also changed the cron script between imap and pop3 interface, but only with the result, that the pop3 task is not that silent, but still not very informative.

Connecting to pop3.server.com...
1 email(s) to process...
--> Message <AANLkTimk6sXuH69OjJ+6KokUAhf1-nJ1xYLrCBaYfGFo@mail.gmail.com> NOT processed and left on the server

Switching the "unknown_user" option back to "accept", everything works fine - as already mentioned. Additionally I don't understand why a user has to be created at all, to have a sender/ issue creator. Isn't it possible to use the accept mode with the anonymous user and just use the email sender as issue creator name/ label ... whatever?

#18 Updated by Terence Mill almost 10 years ago

Axel B. wrote:

Additionally I don't understand why a user has to be created at all, to have a sender/ issue creator. Isn't >it possible to use the accept mode with the anonymous user and just use the email sender as issue creator >name/ label ... whatever?

That is exactly what we would need also!

#19 Updated by Einārs Broks over 9 years ago

Is there any new solution for this problem? Is something changed in Redmine 1.1.0 ?

#20 Updated by Øyvind Sean Kinsey over 9 years ago

The reason why 'create' does not work is that the user model has a limitation on 30 characters for the firstname property.
When extracting the name from the email address, redmine might use the 'raw' string, and when this is an ISO-8859 encoded string this might look like '=?ISO-8859-1?Q?=D8yvind_Sean_Kinsey?=', and as you can see the encoding takes most of the available characters.

I just replaced the default with 'user.firstname = '-' in app/models/mail_handler.rb:331 and now it works.

But as many others here - no logging whatsoever.

#21 Updated by Einārs Broks over 9 years ago

Just tried this last fix, but it is not working for me :( maybe that is because I have LDAP authentification enabled

Also available in: Atom PDF