MailHandler ignores "Default notification option" setting
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"
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
the newly created user should have its mail_notification property equal to Setting.default_notification_option
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"
#3 Updated by Marius BALTEANU 3 months ago
Go MAEDA wrote:
FYI: Jean-Philippe Lang wrote in #13341#note-2 as follows:
It can be usefull to disable email notifications when we don't want the user to receive any emails but being able to choose between all the options is not so usefull IMO. I've the set the default to "only_my_events" in r11590.
I think we should change the current behaviour and use the default notification option.