[ 
https://issues.apache.org/jira/browse/NIFI-1899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15370238#comment-15370238
 ] 

ASF GitHub Bot commented on NIFI-1899:
--------------------------------------

Github user ijokarumawak commented on the issue:

    https://github.com/apache/nifi/pull/483
  
    @trixpan I found why I got the `Too many connection` exception.
    
    I didn't setup SSL at ListenSMTP processor, so it was expecting plain text 
connections.
    But PutEmail uses `javax.net.ssl.SSLSocketFactory` by default, although 
it's configurable, I didn't. Then PutEmail tries to open SSL connection while 
ListenSMTP expects plain text.
    
    Then `javax.mail.SocketFetcher` fallbacks from SSL to Plain socket, as 
`mail.smtp.socketFactory.fallback` is set to 
[true](https://javamail.java.net/nonav/docs/api/com/sun/mail/smtp/package-summary.html).
 It opens SSL socket, and got an exception, then reopen plains socket. That's 
why I see two connection attempts on SMTP server side.
    
    I suspect there's a race condition between SMTPServer releasing the 
Semaphore and PutEmail requesting 2nd connection (fallback).
    
    After I changed `SMTP Socket Factory` to `javax.net.DefaultSocketFactory`, 
the error disappeared.


> Create ListenSMTP & ExtractEmailAttachment processors
> -----------------------------------------------------
>
>                 Key: NIFI-1899
>                 URL: https://issues.apache.org/jira/browse/NIFI-1899
>             Project: Apache NiFi
>          Issue Type: New Feature
>            Reporter: Andre
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to