Welcome to go-mail v0.8.1! 🎉
This release is only a small release, but fixes a regression on the 386 platform. We hope you enjoy!
Notable features / improvements / fixes
Fix regression on 386 platforms
The NTLM support introduced in v0.8.0 contained a bug affecting 386 platforms: a 32-bit integer could overflow because it wasn't cast to int64. This caused problems when cross-compiling to the 386 architecture. The bug is fixed in #589. In addition, the CI pipeline has been extended to run cross-compile tests for every platform supported by GitHub runners. Thanks to @firefart for reporting the issue.
Opportunistic SMTP authentication
PR #585 introduces an opportunistic authentication mechanism that lets users provide a list of preferred auth types. During SMTP authentication, the client checks the mechanisms the server supports and selects the first match from the preferred list. If the server supports none of the preferred mechanisms, the client falls back to Autodiscover mode and selects the strongest mechanism the server offers.
Convenience helpers for List-Unsubscribe and one-click List-Unsubscribe-Post
We already expose the HeaderListUnsubscribe and HeaderListUnsubscribePost header constants, but until now there was no dedicated function to construct these headers. Users had to assemble the angle-bracket URI list and the exact List-Unsubscribe=One-Click token by hand via SetGenHeader—something that's easy to get subtly wrong (missing <>, an incorrect POST token, or GET-triggerable URLs). Since February 2024, Gmail and Yahoo require a working RFC 8058 one-click unsubscribe for senders exceeding 5k messages per day, making this a common compliance requirement rather than a niche feature. PR #587 adds three convenience helpers to set these headers correctly:
SetListUnsubscribe(uris ...string): sets an RFC 2369List-Unsubscribeheader only (mailto/httpslinks).SetListUnsubscribePost(): setsList-Unsubscribe-Post: List-Unsubscribe=One-Click.SetListUnsubscribeOneClick(httpsURL string, additionalURIs ...string): the common case: sets both headers correctly, validating that at least one HTTPS URL is present as required by RFC 8058.
What's Changed
- Implement opportunistic auth mechanism by @wneessen in #585
- Add RFC 8058 one-click unsubscribe support by @wneessen in #587
- Fix toUint32 range check and add 64bit tests by @wneessen in #589
- Add cross-compile test to CI by @wneessen in #598
CI/CD maintenance changes
- Bump golang.org/x/text from 0.38.0 to 0.39.0 by @dependabot[bot] in #590
- Bump step-security/harden-runner from 2.19.4 to 2.20.0 by @dependabot[bot] in #591
- Bump github/codeql-action/autobuild from 4.36.3 to 4.37.0 by @dependabot[bot] in #595
- Bump github/codeql-action/upload-sarif from 4.36.3 to 4.37.0 by @dependabot[bot] in #594
- Bump github/codeql-action/analyze from 4.36.3 to 4.37.0 by @dependabot[bot] in #593
- Bump github/codeql-action/init from 4.36.3 to 4.37.0 by @dependabot[bot] in #592
- Bump golang.org/x/crypto from 0.53.0 to 0.54.0 by @dependabot[bot] in #597
Full Changelog: v0.8.0...v0.8.1