diff --git a/java/code/src/com/redhat/rhn/common/messaging/SmtpMail.java b/java/code/src/com/redhat/rhn/common/messaging/SmtpMail.java index 06f115b2ef7f..7cfb99eb09e0 100644 --- a/java/code/src/com/redhat/rhn/common/messaging/SmtpMail.java +++ b/java/code/src/com/redhat/rhn/common/messaging/SmtpMail.java @@ -24,6 +24,7 @@ import org.apache.logging.log4j.Logger; import java.io.IOException; +import java.util.Date; import java.util.Enumeration; import java.util.LinkedList; import java.util.List; @@ -142,6 +143,7 @@ public void setFrom(String from) { public void send() { try { + message.setSentDate(new Date()); Address[] addrs = message.getRecipients(RecipientType.TO); if (addrs == null || addrs.length == 0) { log.warn("Aborting mail message {}: No recipients", message.getSubject()); diff --git a/java/spacewalk-java.changes.mcalmer.set-send-date-for-email b/java/spacewalk-java.changes.mcalmer.set-send-date-for-email new file mode 100644 index 000000000000..77e3ad90f4fb --- /dev/null +++ b/java/spacewalk-java.changes.mcalmer.set-send-date-for-email @@ -0,0 +1 @@ +- Set a send date when preparing emails