Project

General

Profile

Actions

Feature #29817

open

MailHandler ignores "Default notification option" setting

Added by Eugene Dubinin about 6 years ago. Updated about 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Hi. We are using Redmine in our company and relying on its incoming email processing features.

In a case when created from inbound email (via rdm-mailhandler.rb), the new user account will be configured with "only_my_events" email notification setting which is hard-coded in MailHandler.new_user_from_attributes method as can be seen here https://github.com/redmine/redmine/blob/master/app/models/mail_handler.rb#L525

I am not sure if this is by design, should the default notification option be used instead, so such user account presets are consistent with accounts created via Redmine UI?

preconditions:
  • running Redmine server with email Webservice enabled
  • a valid parseable email message;
  • the user with the address in email FROM field should not exist
  • a project with the name referenced in rdm-handler call should exist
  • the default_notification_option setting should have any value except "only my events"

test case:
invoke rdm-handler.rb from the command line

./rdm-mailhandler.rb -u http://$HOST:$PORT -k $EMAIL_WS_API_KEY  --unknown-user create --project $PROJECT_NAME  < ./msg.txt

expected result:
the newly created user should have its mail_notification property equal to Setting.default_notification_option

observed result:

2.2.5 :007 > User.last.mail_notification
  User Load (1.2ms)  SELECT  "users".* FROM "users" WHERE "users"."type" IN ('User', 'AnonymousUser')  ORDER BY "users"."id" DESC LIMIT 1
 => "only_my_events" 
2.2.5 :008 > Setting.default_notification_option
 => "all" 

Thanks,
Eugene Dubinin


Related issues

Related to Redmine - Feature #13341: Mail handler: --no-notification option to disable notifications to the created userClosedJean-Philippe Lang

Actions
Actions

Also available in: Atom PDF