SonarSource/sonar — pull request #22 by hogmoru (2013-01-31 23:12:09+00:00)
Title: Support default e-mail suffix for notifications

This small change adds support for default e-mail suffix for notifications (along with relevant unit tests).

This applies to users that don't have their e-mail field set: if ```sonar.properties``` contains ```email.address_auto_suffix=@foo.bar``` then the notification will be sent to ```username@foo.bar```.
Please note suffix should include "@", this allows broader support, for example ```.group@domain```.

Quite often the address can be derived from the username (e.g. username@domain), so
this can come in handy when the user authentication system does not provide the e-mail. Furthermore, in such a case, even if users manually type in their e-mail, the field is cleared upon next login (see [SONAR-4034](http://jira.codehaus.org/browse/SONAR-4034)).

If I let Sonar try and send an e-mail to "username" (it is a valid address if the mail server has it aliased), then it fails with ```Missing final '@domain'``` thrown by the underlying JavaMail library. The only solution was to have Sonar add the domain.

So this is the itch I scratched, and I'm thinking it may be more generally useful, hence this pull request (I hope it's okay, it looked like the thing to do after skimming the sonar-dev mailing list archive).

I found no other use of ```User.getEmail()``` so I only changed the email-notification-plugin.