This problem comes from the core but I only could detect it by using the Email-Ext plugin ().
Here is a description of the problem:
- When SCM changes are detected during a build, users that do not exist yet are created in Jenkins embedded users db. They are usually created with just a username (and no email address info).
- The Email-Ext plugin has an option to send emails to commiters. When this option is activated, it tries to resolve addresses for all of them with Jenkins core static method MailAddressResolver.resolve(User u). If the user has no email address configured, the core looks if there is a default email suffix configured with Mailer.descriptor().getDefaultSuffix().
- If Jenkins has not been configured with a default email suffix, Mailer.descriptor().getDefaultSuffix() returns an empty string. But MailAddressResolver.resolve(User u) only checks if it returns null.
- All of this implies that MailAddressResolver.resolve(User u) never returns null. Since the Email-Ext plugin relies on this to determine which addresses to send the notifications to, it always send emails (even to non-existing silly addresses without a suffix ). I believe that this must affect other plugins or parts of the application.
I attached a patch that fixes this behaviour.
Important note: We currently work with Jenkins 1.424.x LTS. Could this patch be integrated to the LTS release?