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

Bump github.com/wneessen/go-mail from 0.3.6 to 0.3.7 #48

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 4, 2023

Bumps github.com/wneessen/go-mail from 0.3.6 to 0.3.7.

Release notes

Sourced from github.com/wneessen/go-mail's releases.

v0.3.7: Improved delivery error handling

This release introduces the SendError type which satisfies the error interface and provides a better way to identify delivery errors. A new sendError field has been added to the Msg as well, to also allow per-message error handling in bulk mailings.

We've also added different SendErrReason that indicate the different things that can go wrong during mail delivery. These reasons can be checked for, for each Msg using the errors.Is methods. Alternatively, the errors.As method can be used to unwrap the SendError to get access to it's methods. The SendError provides a IsTemp method that returns true if the delivery error is of temporary nature.

This is useful for delivery retries. For example the following code could be used to decide whether the error is retryable or not:

	if err := c.DialAndSend(m); err != nil {
		var se *mail.SendError
		if errors.As(err, &se) && se.IsTemp() {
			// retryable error
			log.Printf("temporary error, will re-try")
		/*
		  perform some re-try logic here
		*/
	}
	// permanent error
	log.Fatal(err)
}

If the Send method runs into more than one error during delivery, these errors are accumulated and returned with the reason ErrAmbiguous, since it's not possible to exactly say what caused the error. For this it comes handy, that the *Msg now provides per-message send errors. The *Msg now has HasSendError(), SendErrorIsTemp() and SendError(). While HasSendError() simply returns a bool in case a *Msg failed during delivery and SendErrorIsTemp() returns true if it's a temporary error, the SendError() will return the full SendError error of the corresponding *Msg.

The Error() method of SendError will return a detailed error string based on the accumulated errors that were collected during the delivery.

Thanks to @​imirkin and @​iwittkau for providing valueable feedback and performing code review on the PR.

What's Changed

Full Changelog: wneessen/go-mail@v0.3.6...v0.3.7

Commits
  • 3b3c1e6 Merge pull request #91 from wneessen/feature/90_provide-a-way-of-knowing-whic...
  • 3d0939b Bump version to 0.3.7 for new release
  • 5897bdd Update msg.go
  • dbb5968 Update msg.go
  • b12b0bb Update client_test.go
  • e6b73c2 Update client_119.go
  • 8d86c3d Better test coverage for senderror.go
  • b8ee25f Simplify error return to make golangci-lint happy
  • 8463f85 Fix merge conflict
  • b8af7a6 Merge remote-tracking branch 'origin/feature/90_provide-a-way-of-knowing-whic...
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [github.com/wneessen/go-mail](https://github.com/wneessen/go-mail) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/wneessen/go-mail/releases)
- [Commits](wneessen/go-mail@v0.3.6...v0.3.7)

---
updated-dependencies:
- dependency-name: github.com/wneessen/go-mail
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jan 4, 2023
@wneessen wneessen merged commit 73d0ea7 into main Jan 4, 2023
@wneessen wneessen deleted the dependabot/go_modules/github.com/wneessen/go-mail-0.3.7 branch January 4, 2023 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant