Defect #6433
openIMAP receiving does not create a new user
0%
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
Updated by Simen Endsjø about 14 years ago
I have the exact same problem in 1.0.2
Nothing is written to procuction.log either.
Updated by Simen Endsjø about 14 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.
Updated by Felix Schäfer about 14 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.
Updated by Simen Endsjø about 14 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.
Updated by Felix Schäfer about 14 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?
Updated by Simen Endsjø about 14 years ago
The required fields are the default ones: login, firstname, lastname, email and password.
Updated by Felix Schäfer about 14 years ago
Then I have no idea… Is the system maybe set to require the admin to confirm new registration?
Updated by Simen Endsjø about 14 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.
Updated by Miloš Kozák about 14 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..
Updated by Simen Endsjø about 14 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?
Updated by Miloš Kozák about 14 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.
Updated by Felix Schäfer about 14 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.
Updated by Simen Endsjø about 14 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
Updated by Simen Endsjø about 14 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.
Updated by Felix Schäfer about 14 years ago
Well, then you're probably in development mode already, and I don't think there's more logging you can get.
Updated by Simen Endsjø about 14 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?
Updated by Axel B. about 14 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?
Updated by Terence Mill about 14 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!
Updated by Einārs Broks almost 14 years ago
Is there any new solution for this problem? Is something changed in Redmine 1.1.0 ?
Updated by Øyvind Sean Kinsey almost 14 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.
Updated by Einārs Broks almost 14 years ago
Just tried this last fix, but it is not working for me :( maybe that is because I have LDAP authentification enabled