-
Notifications
You must be signed in to change notification settings - Fork 887
fix: correctly close SMTP message and await response #14495
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ var ( | |
type Config struct { | ||
AuthMechanisms []string | ||
AcceptedIdentity, AcceptedUsername, AcceptedPassword string | ||
FailOnDataFn func() error | ||
} | ||
|
||
type Message struct { | ||
|
@@ -147,6 +148,10 @@ func (s *Session) Data(r io.Reader) error { | |
return err | ||
} | ||
|
||
if s.backend.cfg.FailOnDataFn != nil { | ||
return s.backend.cfg.FailOnDataFn() | ||
} | ||
Comment on lines
+151
to
+153
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At some point in the future, would it make sense to test with something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I evaluated it, but it does not support authentication. |
||
|
||
s.backend.lastMsg.Contents = string(b) | ||
|
||
return nil | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this error non-retryable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not apriori; it could be a temporary failure.