async-email / async-smtp

Apache License 2.0
59 stars 12 forks source link

Pipeline `MAIL FROM:` and `RCPT TO:` commands. #48

Closed link2xt closed 1 year ago

link2xt commented 2 years ago

Currently each command is only sent after receiving a reply for the previous one.

There is an await for each command: https://github.com/async-email/async-smtp/blob/3e7a8f3de19fdeb19d14cf123a8696c49685d3fa/src/smtp/smtp_client.rs#L695 https://github.com/async-email/async-smtp/blob/3e7a8f3de19fdeb19d14cf123a8696c49685d3fa/src/smtp/smtp_client.rs#L705

This means on a high-latency connection you need an RTT per recipient. If you send a message to 10 users and RTT is 1 second, you wait 11 seconds before even starting to send the message.

See related post here: https://github.com/deltachat/deltachat-core-rust/issues/3092#issuecomment-1049009858

link2xt commented 2 years ago

There is a separate pipelining extension to allow grouping of MAIL TO, RCPT TO and DATA: https://datatracker.ietf.org/doc/html/rfc2920