v0.4.2: EML parsing, AuthTypes, SMTP/Fallback port selection and more
This release of go-mail brings some new features as well as some code clean up and stability improvments.
EML parsing
With #145 / #249 a new parsing feature has been added to go-mail which allows the user to parse generic EML files into a go-mail Msg
struct. This is helpful if you have a already sent mail and want to re-use it with go-mail. Three new public methods have been added: EMLToMsgFromString
, EMLToMsgFromReader
and EMLToMsgFromFile
, allowing the user to parse the EML from different sources.
Caveat: Even though I put lots of efforts into testing this new feature and I am certain that most cases should work without issue, emails are still a complex topic with lots of written and unwritten standards. There might be some special cases in which the parsing might be off. In this case, please raise an issue with an example of the mail, so that I can have a look.
SMTPAuthNoAuth AuthType
The SMTPAuthNoAuth
AuthType has been added as convenience feature. It is equivalent to performing no authentication at all. It can be used for mail servers that do not support/require authentication. It is still advised to use the Client without the WithSMTPAuth
option, instead.
Refactoring of variable names for readability
When I started go-mail, I was following the Go best practices document, choosing mostly single-character variable names. Looking at the code base size of go-mail and considering how many people work with the code base and actually contribute to the project now, I think this was the wrong decision, as it makes it hard for contributors to follow the code - especially given that I have not followed the recommendation of using more descriptive variables names for global context variables. Therefore with #182 I've refactored all variable names for better readability.
Note: The code in the smtp/
directory has been left untouched so that syncing with the upstream stdlib is not made more complicated than it has to be.
Refinement of the SMTP port selection and fallback logic
It has been pointed out in #181 that the changes to the default ports and fallback ports wasn't well thought through. With #207 this behaviour has been reworked. The clients' functions WithSSLPort
, WithTLSPortPolicy
, SetTLSPortPolicy
, and SetSSLPort
were revised to avoid overriding previously set ports. Additionally, the deprecation notes have been removed and replaced with notes on best-practice recommendations, referring the new *Port()
methods.
User-Agent skipping
With #178 and option to skip the setting of the User-Agent has been added. This option is suitable for scenarios like SMTP proxies where headers are conditionally passed based on receipt. Thanks a lot to @gegorov2030 for their contribution!
What's Changed
- Update SMTP authentication mechanisms and related tests by @wneessen in #177
- Add an option to skip adding a User-Agent by @gegorov2030 in #178
- Refactor variable names for readability by @wneessen in #182
- [StepSecurity] Apply security best practices by @step-security-bot in #185
- Add SPDX license headers to GitHub workflow files by @wneessen in #191
- Bump actions/dependency-review-action from 2.5.1 to 4.2.3 by @dependabot in #189
- Bump ossf/scorecard-action from 2.0.6 to 2.3.1 by @dependabot in #190
- Bump golangci/golangci-lint-action from 3.7.0 to 4.0.0 by @dependabot in #188
- Bump codecov/codecov-action from 3.1.6 to 4.1.0 by @dependabot in #187
- Bump github/codeql-action from 1.1.39 to 3.24.9 by @dependabot in #186
- Add read permissions to GitHub workflow files by @wneessen in #192
- Implement fuzzing by @wneessen in #193
- Add OpenSSF Best Practices badge to README.md by @wneessen in #194
- [StepSecurity] ci: Harden GitHub Actions by @step-security-bot in #195
- Add OpenSSF Scorecard badge to README by @wneessen in #196
- Full test coverage in B64LineBreaker by @wneessen in #197
- Bump actions/setup-go from 3.5.0 to 5.0.0 by @dependabot in #201
- Bump fsfe/reuse-action from 1.3.0 to 3.0.0 by @dependabot in #200
- Bump actions/dependency-review-action from 4.2.3 to 4.2.4 by @dependabot in #199
- Bump actions/upload-artifact from 3.1.3 to 4.3.1 by @dependabot in #198
- Bump actions/dependency-review-action from 4.2.4 to 4.2.5 by @dependabot in #202
- Bump codecov/codecov-action from 4.1.0 to 4.1.1 by @dependabot in #203
- Bump sonarsource/sonarqube-scan-action from 9ad16418d1dd6d28912bc0047ee387e90181ce1c to 53c3e3207fe4b8d52e2f1ac9d6eb1d2506f626c0 by @dependabot in #204
- Bump codecov/codecov-action from 4.1.1 to 4.2.0 by @dependabot in #206
- Bump sonarsource/sonarqube-quality-gate-action from f9fe214a5be5769c40619de2fff2726c36d2d5eb to 72f24ebf1f81eda168a979ce14b8203273b7c3ad by @dependabot in #205
- Refine SMTP port selection and fallback logic by @wneessen in #207
- Update format string in Debugf method calls in tests by @wneessen in #208
- Bump github/codeql-action from 3.24.9 to 3.24.10 by @dependabot in #209
- Bump codecov/codecov-action from 4.2.0 to 4.3.0 by @dependabot in #210
- Bump github/codeql-action from 3.24.10 to 3.25.0 by @dependabot in #211
- Bump github/codeql-action from 3.25.0 to 3.25.1 by @dependabot in #213
- Bump actions/upload-artifact from 4.3.1 to 4.3.2 by @dependabot in #214
- Bump github/codeql-action from 3.25.1 to 3.25.2 by @dependabot in #216
- Bump actions/upload-artifact from 4.3.2 to 4.3.3 by @dependabot in #215
- Bump golangci/golangci-lint-action from 4.0.0 to 5.0.0 by @dependabot in #217
- Bump github/codeql-action from 3.25.2 to 3.25.3 by @dependabot in #218
- Bump step-security/harden-runner from 2.7.0 to 2.7.1 by @dependabot in #221
- Bump golangci/golangci-lint-action from 5.0.0 to 5.1.0 by @dependabot in #220
- Bump actions/dependency-review-action from 4.2.5 to 4.3.1 by @dependabot in #219
- Bump actions/dependency-review-action from 4.3.1 to 4.3.2 by @dependabot in #222
- Bump codecov/codecov-action from 4.3.0 to 4.3.1 by @dependabot in #223
- Bump actions/setup-go from 5.0.0 to 5.0.1 by @dependabot in #224
- Bump golangci/golangci-lint-action from 5.1.0 to 5.3.0 by @dependabot in #225
- Update README.md by @wneessen in #226
- Bump golangci/golangci-lint-action from 5.3.0 to 6.0.0 by @dependabot in #227
- Bump ossf/scorecard-action from 2.3.1 to 2.3.3 by @dependabot in #230
- Bump github/codeql-action from 3.25.3 to 3.25.5 by @dependabot in #231
- Bump golangci/golangci-lint-action from 6.0.0 to 6.0.1 by @dependabot in #229
- Bump codecov/codecov-action from 4.3.1 to 4.4.0 by @dependabot in #232
- Bump github/codeql-action from 3.25.5 to 3.25.6 by @dependabot in #234
- Bump codecov/codecov-action from 4.4.0 to 4.4.1 by @dependabot in #233
- Bump step-security/harden-runner from 2.7.1 to 2.8.0 by @dependabot in #235
- Bump sonarsource/sonarqube-scan-action from 2.0.2 to 2.1.0 by @dependabot in #236
- Sync with upstream by @wneessen in #237
- Bump github/codeql-action from 3.25.6 to 3.25.7 by @dependabot in #238
- Bump golang/govulncheck-action from 1.0.2 to 1.0.3 by @dependabot in #239
- Bump github/codeql-action from 3.25.7 to 3.25.8 by @dependabot in #241
- Bump actions/dependency-review-action from 4.3.2 to 4.3.3 by @dependabot in #243
- Bump step-security/harden-runner from 2.8.0 to 2.8.1 by @dependabot in #244
- Bump codecov/codecov-action from 4.4.1 to 4.5.0 by @dependabot in #245
- Bump sonarsource/sonarqube-scan-action from 2.1.0 to 2.2 by @dependabot in #247
- Bump github/codeql-action from 3.25.8 to 3.25.9 by @dependabot in #246
- Bump github/codeql-action from 3.25.9 to 3.25.10 by @dependabot in #248
- Add EML parser by @wneessen in #249
New Contributors
- @gegorov2030 made their first contribution in #178
- @step-security-bot made their first contribution in #185
- @dependabot made their first contribution in #189
Full Changelog: v0.4.1...v0.4.2