Skip to content

Add support for SMTP pipelining #308

Closed

Description

@t101jv

https://tools.ietf.org/html/rfc2920

For our email sending, we have noticed that the latency is being dominated by the outgoing SMTP send. We are currently using the simple-java-mail library, but are considering evaluating https://github.com/HubSpot/NioSmtpClient so that we can optimize the SMTP connection by taking advantage of it's pipelining feature.

Activity

  1. bbottema commented on Mar 23, 2021

    @bbottema
    Owner

    Interesting, I had never heard of pipelining before...

    That said, have you looked into using Simple Java Mail's batch-module? With it you get a connection pool with reusable Transport connections that don't close. Even having a pool of one connection that doesn't close can double your performance as up to half of the time spent on sending an email is simply opening up a Transport connection.

  2. bbottema commented on Mar 23, 2021

    @bbottema
    Owner

    Regarding adding pipelining support: At first glance, as Simple Java Mail builds upon Jakarta Mail (previously JavaMail), it seems impossible to configure support at this level. Simple Java Mail doesn't handle the actually server commands such as EHLO and Jakarta Mail has no support for pipelining, and looking around a bit, it doesn't seem to be on the radar either (can barely find any documentation on it, their bug tracker returns zilch and so do the mailing list and forums).

    I'll do a bit more research, but I'm afraid I'll have to wait for Jakarta to make a move here.

  3. t101jv commented on Mar 23, 2021

    @t101jv
    Author

    That should be fine, we are going to try tuning our connection pool size and lifecycle and see where that gets us.

  4. bbottema commented on Apr 10, 2021

    @bbottema
    Owner

    Any update on your performance?

  5. t101jv commented on Apr 11, 2021

    @t101jv
    Author

    We haven't had the capacity to fix it yet. I've changed teams as well. I'll let them know they can follow up here if necessary. Feel free to close the issue if you'd like.

  6. bbottema commented on Apr 11, 2021

    @bbottema
    Owner

    In that case I'll close the issue until further notice. But looking forward to your performance update.

  7. bbottema commented on Feb 8, 2023

    @bbottema
    Owner

    If you know more by now, I'm still curious as to your findings.

  8. t101jv commented on Feb 8, 2023

    @t101jv
    Author

    I haven't worked on the announcements team for almost two years and have left the company as well. I'd refer you to Zubair Khan who is the current lead on the team, but i don't see him on LinkedIn and have no way to contact him otherwise.

  9. bbottema commented on Aug 9, 2026

    @bbottema
    Owner

    WIll be continued in #699.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions