Defect #35531
openredmine unexpected undefined local variable or method `project'" for mail handler , did you mean project_url
0%
Description
Hi,
I am getting an error on Redmine while reading a particular email, error is :
Redmine unexpected undefined local variable or method `project'" for mail handler, did you mean project_url?
Email is getting read but it's not creating tickets in Redmine.
Could you guys please help us?
Updated by anju dhiman over 3 years ago
Hi,
Exact issue is :
MailHandler: an unexpected error occurred when receiving email: undefined local variable or method `project' for #<MailHandler:0x0000561f96fae478>
Did you mean? project_url
Updated by Go MAEDA over 3 years ago
anju dhiman wrote:
Exact issue is :
MailHandler: an unexpected error occurred when receiving email: undefined local variable or method `project' for #<MailHandler:0x0000561f96fae478>
Did you mean? project_url
I want to know where the error occurs. Without the information, it is difficult to figure out the cause.
In log/production.log file, there may be more detailed information under the error line. It looks something like the following.
app/models/issue.rb:187:in `editable?' app/views/issues/_action_menu.html.erb:4 app/views/issues/show.html.erb:1 app/controllers/issues_controller.rb:118:in `block (2 levels) in show' app/controllers/issues_controller.rb:110:in `show' lib/redmine/sudo_mode.rb:61:in `sudo_mode'
Updated by Massimiliano Calipari over 3 years ago
Hi, I had the same issue.
Tring to figure out what was wrong I noticed that the issue occurred only if the email sender was a user not known for redmine.
My cron job settings already had the option "unknown_user=accept" so reading the documentation better I found that "Permissions have to be consistent with the chosen option. E.g. if you choose 'create', the 'Non member' role must have the 'Add issues' permission so that an issue can be created by an unknown user via email."
So I decided to add the "no_permission_check=1" option and the issue is gone!
The main issue is that the error message is misleading
Creating scope :system. Overwriting existing method Enumeration.system. Creating scope :sorted. Overwriting existing method Group.sorted. Creating scope :sorted. Overwriting existing method User.sorted. MailHandler: an unexpected error occurred when receiving email: undefined local variable or method `project' for #<MailHandler:0x0000000001cb2400> Did you mean? project_url MailHandler: an unexpected error occurred when receiving email: undefined local variable or method `project' for #<MailHandler:0x0000000006fcee90> Did you mean? project_url