NIFI-2519 - ListenSMTP addresses mismatch between smtp.src attribute documentation and attribute.put

This commit is contained in:
Andre F de Miranda 2016-08-16 09:13:39 +10:00 committed by Oleg Zhurakousky
parent 0ffdc2eb92
commit e7288af859
2 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ import org.subethamail.smtp.server.SMTPServer;
+ "certificates used by an TLS peer"), + "certificates used by an TLS peer"),
@WritesAttribute(attribute = "smtp.certificates.*.principal", description = "The principal for each of the " @WritesAttribute(attribute = "smtp.certificates.*.principal", description = "The principal for each of the "
+ "certificates used by an TLS peer"), + "certificates used by an TLS peer"),
@WritesAttribute(attribute = "smtp.src", description = "The source IP of the SMTP connection"), @WritesAttribute(attribute = "smtp.src", description = "The source IP and port of the SMTP connection"),
@WritesAttribute(attribute = "smtp.from", description = "The value used during MAIL FROM (i.e. envelope)"), @WritesAttribute(attribute = "smtp.from", description = "The value used during MAIL FROM (i.e. envelope)"),
@WritesAttribute(attribute = "smtp.recipient.*", description = "The values used during RCPT TO (i.e. envelope)"), @WritesAttribute(attribute = "smtp.recipient.*", description = "The values used during RCPT TO (i.e. envelope)"),
@WritesAttribute(attribute = "mime.type", description = "Mime type of the message")}) @WritesAttribute(attribute = "mime.type", description = "Mime type of the message")})

View File

@ -149,7 +149,7 @@ public class SmtpConsumer implements MessageHandler {
} }
attributes.put("smtp.helo", context.getHelo()); attributes.put("smtp.helo", context.getHelo());
attributes.put("smtp.remote.addr", context.getRemoteAddress().toString()); attributes.put("smtp.src", context.getRemoteAddress().toString().substring(1));
attributes.put("smtp.from", from); attributes.put("smtp.from", from);
for (int i = 0; i < recipientList.size(); i++) { for (int i = 0; i < recipientList.size(); i++) {
attributes.put("smtp.recipient." + i, recipientList.get(i)); attributes.put("smtp.recipient." + i, recipientList.get(i));