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

Server-side CHUNKING and BINARYMIME support #106

Merged
merged 3 commits into from
Jul 7, 2020

Conversation

foxcpp
Copy link
Collaborator

@foxcpp foxcpp commented Jun 23, 2020

See #81. This issue is not closed since it also references client support.
Replaces #104 (but hey, that initial solution saves one message copy :) )

@codecov
Copy link

codecov bot commented Jun 23, 2020

Codecov Report

Merging #106 into master will decrease coverage by 0.30%.
The diff coverage is 62.40%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #106      +/-   ##
==========================================
- Coverage   62.52%   62.21%   -0.31%     
==========================================
  Files           8        8              
  Lines         982     1101     +119     
==========================================
+ Hits          614      685      +71     
- Misses        275      309      +34     
- Partials       93      107      +14     
Impacted Files Coverage Δ
smtp.go 100.00% <ø> (ø)
conn.go 59.06% <62.12%> (-0.29%) ⬇️
server.go 58.16% <100.00%> (+2.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 451381b...7665090. Read the comment docs.

conn.go Show resolved Hide resolved
conn.go Show resolved Hide resolved
conn.go Outdated Show resolved Hide resolved
conn.go Outdated Show resolved Hide resolved
conn.go Outdated Show resolved Hide resolved
conn.go Outdated Show resolved Hide resolved
conn.go Outdated Show resolved Hide resolved
backend.go Outdated
@@ -24,6 +24,9 @@ type Backend interface {
// MailOptions contains custom arguments that were
// passed as an argument to the MAIL command.
type MailOptions struct {
// Value of BODY= argument, 7BIT, 8BITMIME or BINARYMIME.
Body string
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we provide a type and constants for valid values?

conn.go Outdated

select {
case <-c.dataResult:
c.dataResult <- errPanic
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can unconditionally send the error to the dataResult channel here I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I forgot to update this path when copy-pasting code from previous PR.

conn.go Outdated
io.Copy(ioutil.Discard, &chunk)

code, enhancedCode, msg := toSMTPStatus(err)
c.WriteResponse(code, enhancedCode, msg)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nit: I think this works:

c.WriteResponse(toSMTPStatus(err))

conn.go Show resolved Hide resolved
Copy link
Owner

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the whole looks good! With these comments fixed this is good to merge.

@emersion
Copy link
Owner

emersion commented Jul 7, 2020

Also please squash the commits into logical commits.

@foxcpp
Copy link
Collaborator Author

foxcpp commented Jul 7, 2020

I just realized I have local changes I forgot to commit that resolve some of issues you mentioned. :)

Copy link
Owner

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot!

@emersion emersion merged commit 77b7722 into emersion:master Jul 7, 2020
@foxcpp foxcpp deleted the chunking-pipe branch January 17, 2021 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants