-
Notifications
You must be signed in to change notification settings - Fork 64
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
Fixed issue with HTML attachments (501 Syntax error - line too long) #114
Conversation
@@ -99,13 +99,13 @@ public struct SMTP { | |||
/// - mail: `Mail` object to send. | |||
/// - completion: Callback when sending finishes. `Error` is nil on success. (optional) | |||
public func send(_ mail: Mail, completion: ((Error?) -> Void)? = nil) { | |||
send([mail]) { (_, failed) in | |||
send([mail], completion: { (_, failed) in |
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.
Just curious, were these syntax changes necessary?
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.
Necessary, no - it was just XCode 12.2 (12B45b) complaining with a warning:
Backward matching of the unlabeled trailing closure is deprecated; label the argument with 'completion' to suppress this warning
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.
Oh interesting. I'll make a note to review that Issue 116, but I think your update is more readable anyway.
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.
Looks good.
Would you mind rebasing to master? |
Rebase done. |
…tax error - line too long)
I fixed the tests. While running them, I found out that the line problem also occurs on data and html attachments. Should be also fixed now. All tests were successful, except TestTLSMode.testIgnoreTLS(), but that seems to be because of my server configuration, not because of the test. |
Kudos, SonarCloud Quality Gate passed! |
Is this gonna be merged anytime soon? |
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.
👍
I still need to look into what it'll take to get tests working again Issue 115 But I'll push this through in the mean time. |
The PR fixes an issue that occurred when trying to send long HTML attachments. The server then responded with an "501 Syntax error - line too long" error.
I also fixed some closures.
Motivation and Context
I wanted to send some HTML mails and ran into the error, also it is subject of the following issue: #106