diff --git a/changelog.html b/changelog.html
index af16f1898f2da169ce4518c3df7779d3e1809ca1..0fdd3f40ca005d2c5021e1ca8205711e375be3a9 100644
--- a/changelog.html
+++ b/changelog.html
@@ -58,6 +58,9 @@ Upcoming changes
Fixed a bug in the symlink creation code on BSD platforms.
issue 12119
+
+ Default e-mail suffix should be used to complete the domain name portion of the recipients list.
+ (pull #324)
Incorrect path delimiter used in ZipArchiver when creating archive on Windows.
issue 9942
diff --git a/core/src/main/java/hudson/tasks/MailSender.java b/core/src/main/java/hudson/tasks/MailSender.java
index 8aa79a720dadbf1a305881d7c90f9fd8da4b124e..45e87e03b07457abf13d0e64e3c2f3db5a731dfa 100644
--- a/core/src/main/java/hudson/tasks/MailSender.java
+++ b/core/src/main/java/hudson/tasks/MailSender.java
@@ -312,6 +312,7 @@ public class MailSender {
msg.setSentDate(new Date());
Set rcp = new LinkedHashSet();
+ String defaultSuffix = Mailer.descriptor().getDefaultSuffix();
StringTokenizer tokens = new StringTokenizer(recipients);
while (tokens.hasMoreTokens()) {
String address = tokens.nextToken();
@@ -326,10 +327,17 @@ public class MailSender {
includeCulpritsOf(up, build, listener, rcp);
} else {
// ordinary address
+
+ // if not a valid address (i.e. no '@'), then try adding suffix
+ if (!address.contains("@") && defaultSuffix != null && defaultSuffix.contains("@")) {
+ address += defaultSuffix;
+ }
+
try {
rcp.add(new InternetAddress(address));
} catch (AddressException e) {
// report bad address, but try to send to other addresses
+ listener.getLogger().println("Unable to send to address: " + address);
e.printStackTrace(listener.error(e.getMessage()));
}
}