github wneessen/go-mail v0.7.3
v0.7.3: Skippable UTF-8 support, improved Base64LineBreaker, binary size reducing, fixes and more

8 hours ago

Welcome to go-mail v0.7.3! 🎉

This release brings some cool improvements, new features, and fixes to go-mail. We hope you enjoy it!

Notable changes/improvements/features/fixes

Deadline fix for connections to a TLS port without TLS

PR #521 fixes a missing deadline in the Client that could cause a deadlock for connections to a TLS port without TLS enabled. Thanks to @james-d-elliott for finding and fixing this issue!

Preseve EHLO and HELO errors

PR #528 fixes an error for cases in which both the HELO and EHLO fail during a client connect. In this case the first error would be overwritten by the 2nd action, potentially deleting valuable information. In go-mail v0.7.3 both errors are now combined. Thanks to @Yanhu007 for their contribution!

Improved Base64LineBreaker

In PR #512 @srpvpn refactored the Base64LineBreaker type to be more performant and easier to read by removing the recursion. Thanks for your contribution!

Reduce binary size by making text/template and html/template support optional

In PR #518 @sblinch introduced a new compile time flag gomailnotpl which will make the text/template and html/template optional. Background is, that using reflect.Value.Method or reflect.Value.MethodByName prevents Go from performing full dead-code elimination because any exported method of any struct in the codebase could potentially be referenced at runtime. Unfortunately text/template and html/template do exactly this to allow method invocation from within templates. So in case your code does not need template support, you can use the new compile flag to remove the support for both packages completely and same some bytes in the resulting binary. Thanks for your contribution!

Fix nil pointer panic in partWriter

PR #543 fixes a potential nil pointer panic in the partWriter in case the underlying io.Writer returns an error during a multipart message write. Thanks to @UgurTheG for reporting and fixing the issue!

Provide access to HELO responses in the SMTP client

PR #530 adds support to access the HELO/EHLO responses via the smtp.Client. This feature is useful when using an SMTP servers pool behind a load balancer, to know which instance took the job. Thanks to @maxatome for submitting this feature!

Multiple addresses support in ReplyTo header

PR #517 adds support for multiple Reply-To addresses within a Msg, as permitted in RFC5322. Thanks to @christian-heusel for pointing this out and for comitting the PR!

Support to disable SMTPUTF8 in the MAIL FROM even if the server announces it

PR #548 adds support for skipping the SMTPUTF8 extension to MAIL FROM commands. By default, when a server announces SMTPUTF8 support in the EHLO, go-mail will add SMTPUTF8 to the MAIL FROM command. As pointed out in #545, some SMTP servers (e. g. specific MS Exchange versions) announce the SMTPUTF8 extension in the EHLO response but when adding the SMTPUTF8 to the MAIL FROM, they will fail with an error. The PR introduces a new WithoutSMTPUTF8() option for the Client which will make sure to skip the SMTPUTF8 extension in the MAIL FROM, even if the server announced it previously. Thanks @mkalus for reporting this issue and for their detailed analysis in #545.

What's Changed

  • minor fix for func ResetWithSMTPClient and DialAndSendWithContext by @sarff in #500
  • Refactored SendWithSMTPClient to improve error handling and added test cases by @wneessen in #502
  • Refactored test and validation logic for message content checks by @wneessen in #503
  • Fix a docstring typo by @mitar in #505
  • Upstream sync: prevent test failures due to expired test certificate by @wneessen in #522
  • fix: deadline not set for initial connection read by @james-d-elliott in #521
  • Add deadlock test for client connections by @wneessen in #525
  • fix: preserve EHLO error when both EHLO and HELO fail by @Yanhu007 in #528
  • refactor: remove recursion from base64LineBreaker.Write by @srpvpn in #512
  • Make text/template support optional to allow dead-code elimination by @sblinch in #518
  • fix: prevent nil pointer panic in writeBody when partWriter is nil by @UgurTheG in #543
  • feat: add (*smtp.Client).HelloResponse method to get EHLO/HELO response by @maxatome in #530
  • feat: add option to skip SMTPUTF8 in "MAIL FROM" commands by @wneessen in #548
  • Allow multiple Addresses in ReplyTo Header and add GetReplyTo() by @christian-heusel in #517

CI/CD maintenance changes

  • Bump golang.org/x/text from 0.29.0 to 0.30.0 by @dependabot[bot] in #501
  • Bump golang.org/x/text from 0.30.0 to 0.31.0 by @dependabot[bot] in #506
  • Bump golang.org/x/text from 0.31.0 to 0.32.0 by @dependabot[bot] in #509
  • Bump Go and golang.org/x/text module versions by @wneessen in #526
  • Bump golang.org/x/text from 0.35.0 to 0.36.0 by @dependabot[bot] in #527
  • Updated .golangci.toml for linter exclusions on specific use cases by @wneessen in #523
  • Updated CI configuration for Go and OS versions in workflows by @wneessen in #524
  • Bump golangci/golangci-lint-action from 7.0.0 to 9.2.0 by @dependabot[bot] in #535
  • Bump ossf/scorecard-action from 2.4.0 to 2.4.3 by @dependabot[bot] in #534
  • Bump fsfe/reuse-action from 5.0.0 to 6.0.0 by @dependabot[bot] in #533
  • Bump vmactions/freebsd-vm from 1.1.5 to 1.4.5 by @dependabot[bot] in #532
  • Bump step-security/harden-runner from 2.10.2 to 2.19.0 by @dependabot[bot] in #531
  • Bump actions/dependency-review-action from 4.5.0 to 4.9.0 by @dependabot[bot] in #540
  • Bump actions/setup-go from 5.2.0 to 6.4.0 by @dependabot[bot] in #539
  • Bump codecov/codecov-action from 5.1.1 to 6.0.0 by @dependabot[bot] in #538
  • Bump actions/upload-artifact from 4.5.0 to 7.0.1 by @dependabot[bot] in #537
  • Bump github/codeql-action from 3.27.9 to 4.35.3 by @dependabot[bot] in #536
  • Bump step-security/harden-runner from 2.19.0 to 2.19.1 by @dependabot[bot] in #541
  • Bump golang.org/x/text from 0.36.0 to 0.37.0 by @dependabot[bot] in #547
  • Bump actions/dependency-review-action from 4.9.0 to 5.0.0 by @dependabot[bot] in #546
  • Bump github/codeql-action from 4.35.3 to 4.35.4 by @dependabot[bot] in #544

New Contributors

Full Changelog: v0.7.2...v0.7.3

Don't miss a new go-mail release

NewReleases is sending notifications on new releases.