Giter Club home page Giter Club logo

niosmtp's Introduction

A NIO implementation of a SMTP/LMTP Transport and Agent

niosmtp's People

Contributors

bago avatar infynyxx avatar jlleitschuh avatar normanmaurer avatar rocketraman avatar suiryc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

niosmtp's Issues

SMTP Messages are being split when using Pipelining

I've been using this library in production for about a year now with almost no issues. Thanks for writing this great library!

Recently, I noticed some emails were failing with a 500 error code ("5.3.3 Unrecognized command"). Upon inspection of the actual packets being sent outbound to the mail server, I noticed the SMTP commands in the pipeline requests were being split mid-command.

Pipleline Message 1 (approx 2780 bytes)

MAIL FROM:<server.com>\r\n
RCPT TO: \r\n
RCPT TO: \r\n
. . .
RCPT TO: <user 91>\r\n
RCP

Pipleline Message 2 (approx 350 bytes)

T TO: <user 92>\r\n
. . .
RCPT TO: <user 100>\r\n
DATA\r\n

Notice the last command from the first pipeline message ("RCP") and the first command from the 2nd pipeline message ("T TO: \r\n") are being split up. The remote mail server is interpreting these as invalid commands.

How can we ensure the SMTP commands remain whole in Netty 4? I looked at the SMTPClientPipelineInitializer and I didn't see anything suspicious.

Optimize handling of PIPELINING

At the moment when the server supports PIPELINING we just send all the commands that are needed via SMTPClientSession.send(..). This works but does nothing to optimize this. Better would be to pass a SMTPPipeliningRequest to the SMTPClientSession and let it handle in a more performant way

Pipelining with SMTPDeliveryAgent Not Handling "530 5.7.1" Response

NOTE: This issue was encountered while using the Netty 4.x branch.

I encountered a problem while using SMTPDeliveryAgent with a configuration of PipeliningMode.TRY. Our exchange mail server has a whitelist of allowed IPs, and if not allowed the server responds to EHLO request with a "530 5.7.1 Client was not authenticated" response. In my development environment, I encountered this scenario and was surprised that the SMTPClientFuture never completed. This problem is specific to PIPELINING as when I use PipeliningMode.NO, everything works OK and the future is completed.

I think I have tracked down the issue to be within the NettySMTPClientSession#addCollectionFutureHandler, where if a 530 is encountered (which short-circuits the other expected responses from RCPT, DATA, etc), the expected 'responsesCount' is never reached and thus never removes itself from the pipeline.

No context available on DeliveryRecipientStatus

When using NioSmtp to send a group of e-mails via the SMTPDeliveryAgent, the agent allows processing the results of the sends via a SMTPClientFuture<Collection<FutureResult<Iterator<DeliveryRecipientStatus>>>> that is returned on the call to deliver.

However, DeliveryRecipientStatus gives almost no contextual information to allow the caller to match up the results with one of the original messages sent. The envelope recipient can be obtained, but that may not be unique -- it is possible the group of e-mails that is being sent contained two e-mails with the same recipient.

Add support for PIPELINING

If the server supports PIPELINGING we should make use of it by send more then one command at the same time

Allow to send more then one message per connection

At the moment the SMTPClient api only supports to send one message per connection. Creating a connection can have some overhead so it would be nice to allow to send more then one message per connection if needed

Unexpected connection close is ignored

During testing I saw that if the SMTP server closes the connection in the middle of an SMTP transaction, niosmtp never executes the SMTPClientFutureListener.operationComplete method.

I am investigating how to fix this with an extra component in the Netty pipeline to detect this condition.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.