wneessen / go-mail

📧 Easy to use, yet comprehensive library for sending mails with Go
https://go-mail.dev
MIT License
571 stars 44 forks source link

Fix SMTP AUTH LOGIN method for servers with uncommon success messages #95

Closed wneessen closed 1 year ago

wneessen commented 1 year ago

This fixes #94 and basically reverts d0f0435. As James points out correctly in #94, we should not assume specific responses from the server. As long as the spec is followed and the server returns the correct SMTP code, we should not do our own magic.

I've also extended the getTestConnection method in client_test.go, so that we can specify more test environment options like TEST_PORT and TEST_TLS_SKIP_VERIFY. This was needed for testing with the ProtonMail Bridge which listens on a different port and has non-trusted certificates.

codecov-commenter commented 1 year ago

Codecov Report

Merging #95 (39a9949) into main (3b3c1e6) will decrease coverage by 0.07%. The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
- Coverage   83.15%   83.07%   -0.08%     
==========================================
  Files          15       15              
  Lines        1549     1548       -1     
==========================================
- Hits         1288     1286       -2     
- Misses        186      187       +1     
  Partials       75       75              
Impacted Files Coverage Δ
auth/login.go 96.29% <66.66%> (-3.71%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more