Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC 3030 (CHUNKING, BINARYMIME) support #81

Open
foxcpp opened this issue Dec 7, 2019 · 7 comments
Open

RFC 3030 (CHUNKING, BINARYMIME) support #81

foxcpp opened this issue Dec 7, 2019 · 7 comments

Comments

@foxcpp
Copy link
Collaborator

foxcpp commented Dec 7, 2019

CHUNKING (BDAT) support

Client support: Prefer over DATA if available (avoids the overhead of dot-encoding), require if BODY=BINARYMIME is used (as required by spec).
Server support: Transparent support, io.Reader passed to Session.Data reads multiple chunks. Error returned by Data early consumes the current chunk and returns an error without consuming the whole message.

BINARYMIME support

Support BODY=BINARYMIME argument for MAIL command, no other actions required.

Specification: https://tools.ietf.org/html/rfc3030

@emersion
Copy link
Owner

emersion commented Jul 7, 2020

Server part has been merged in #106. Keeping this issue opened for client support.

@norguhtar
Copy link
Contributor

I'm test BINARYMIME and get error. What i do. Send mail with attachment (10mb size) like this

BDAT 1048576
...
some binary data
....
554 5.0.0 Error: transaction failed, blame it on the weather: smtp: too longer line in input stream

I checked source and found this error generated LimitReader when readLine is got limit. But when we used BDAT and BINARYMIME content not split by lines

From RFC3030

 When the receiver-SMTP accepts a
   MAIL command with the BINARYMIME body-value, it agrees to preserve
   all bits in each octet passed using the BDAT command.  Once a
   receiver-SMTP supporting the BINARYMIME service extension accepts a
   message containing binary material, the receiver-SMTP MUST deliver or
   relay the message in such a way as to preserve all bits in each
   octet.

I can set bigger MaxLineLength but think this not really right solution

@foxcpp
Copy link
Collaborator Author

foxcpp commented Mar 18, 2021

Oh well, this is a problem. Perhaps we could disable lineLimitReader while reading a BDAT chunk? Can you make a PR?

@emersion
Copy link
Owner

Looks like a good idea to me too.

@norguhtar
Copy link
Contributor

Oh well, this is a problem. Perhaps we could disable lineLimitReader while reading a BDAT chunk? Can you make a PR?

Yes. I investigate problem and send PR

@emersion
Copy link
Owner

What would be a good chunk size for BDAT? Should we only use BDAT when PIPELINING is also available (to avoid having to wait for the server ACK'ing each chunk)?

@norguhtar
Copy link
Contributor

I'm send really big data. For work purpose i'm need send 8Gb data file. And use really big chunk size. I think usefull size 1Megabyte.

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

No branches or pull requests

3 participants