From e7288af859d00d6a4d12631d73a92404e31ba7f4 Mon Sep 17 00:00:00 2001 From: Andre F de Miranda Date: Tue, 16 Aug 2016 09:13:39 +1000 Subject: [PATCH] NIFI-2519 - ListenSMTP addresses mismatch between smtp.src attribute documentation and attribute.put --- .../main/java/org/apache/nifi/processors/email/ListenSMTP.java | 2 +- .../org/apache/nifi/processors/email/smtp/SmtpConsumer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/ListenSMTP.java b/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/ListenSMTP.java index 760db134d9..9e422ca5ce 100644 --- a/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/ListenSMTP.java +++ b/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/ListenSMTP.java @@ -71,7 +71,7 @@ import org.subethamail.smtp.server.SMTPServer; + "certificates used by an TLS peer"), @WritesAttribute(attribute = "smtp.certificates.*.principal", description = "The principal for each of the " + "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.recipient.*", description = "The values used during RCPT TO (i.e. envelope)"), @WritesAttribute(attribute = "mime.type", description = "Mime type of the message")}) diff --git a/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/smtp/SmtpConsumer.java b/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/smtp/SmtpConsumer.java index 4dad3bc004..a6d7b3363d 100644 --- a/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/smtp/SmtpConsumer.java +++ b/nifi-nar-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/smtp/SmtpConsumer.java @@ -149,7 +149,7 @@ public class SmtpConsumer implements MessageHandler { } 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); for (int i = 0; i < recipientList.size(); i++) { attributes.put("smtp.recipient." + i, recipientList.get(i));