I’m getting this message in the build console:
Not sending mail to unregistered user firstname.lastname@example.org because your SCM claimed this was associated with a user ID `` which your security realm does not recognize; you may need changes in your SCM plugin.
How can I fix the issue?
This error is generated by the Email Extension plugin.
The issue is that you are trying to send email notifications to an SCM user (e.g. Github user), not a Jenkins user.
A common scenario is that someone commits a change in Github but they don’t have a user in Jenkins. The code change is picked up by Jenkins to create a build and the job is configured to send notifications to the author of the commit. That means we are asking Jenkins to send emails to non-Jenkins users.
SECURITY-372 implemented changes to prevent sending emails to non-Jenkins users by default. In order to resolve the issue, we need to create a Jenkins user who is expecting to receive these notifications.
As mentioned in the plugin changelog, if the security fix is undesirable in a particular instance, it can be disabled with either or both of the following two system properties:
-Dhudson.tasks.MailSender.SEND_TO_UNKNOWN_USERS=true: send mail to build culprits even if they do not seem to be associated with a valid Jenkins login.
-Dhudson.tasks.MailSender.SEND_TO_USERS_WITHOUT_READ=true: send mail to build culprits associated with a valid Jenkins login even if they would not otherwise have read access to the job.
Turn on the configuration under Manage Jenkins -→ Configure System -→ Extended E-mail Notification -→ Allow sending to unregistered users.