nithril / smtp-connection-pool

SMTP Connection Pool
Apache License 2.0
47 stars 19 forks source link

Multiple isConnected() calls on barrowObject is causing SMTP Server to raise 'possible SMTP attack' error #16

Closed gopi-gith closed 6 years ago

gopi-gith commented 6 years ago

When we call borrowObject & testOnBorrow flag is enabled, the library is making two isConnected() calls - once in activateObject & again in validateObject. As each of these isConnected() calls send NOOP operations, SMTP Servers are overwhelmed with number of NOOP operations they receive and flagging the client as 'possible SMTP attack(er)'. We send several millions of emails everyday and two NOOP commands on every borrow operation is causing issues. Also a we noticed degraded performance as explained here on java mail code base

The way we are getting around this is to set testOnBorrow flag to false and relay on validating connection in activateObject method.

Should we consider modifying activteObject method not to call isConnected() method?

nithril commented 6 years ago

Yes you right, I will fix that in the next 3 days. Thanks for reporting.

gopi-gith commented 6 years ago

Thanks