Commit graph

83 commits

Author SHA1 Message Date
e36511e90e
Fix tests to not log authentication data
We don't want to expose SMTP authentication details in tests, therefore the tests have been adjusted a bit
2023-01-14 13:05:04 +01:00
34b432a985
Implement debug logging in SMTP client
Resolves #101.

Since we now have full control over the SMTP client we can also access the message input and output.

This PR introduces a new debug logging feature. Via the `Client.WithDebugLog` the user can enable this feature. It will then make use of the new `smtp/Client.SetDebugLog` method. Once the flag is set to true, the SMTP client will start logging incoming and outgoing messages to os.Stderr.

Log directions will be output accordingly
2023-01-14 12:47:51 +01:00
0d6777ab39
Fork net/smpt into go-mail
As part of #97 we are going to fork the official `net/smtp` package into go-mail to provide us with more flexibility.

This commit fulfills the first big step of importing the package into smtp/. Also go-mail's own LoginAuth has been moved from auth/ into smtp/ to be consistent with the stdlib.

There are still a couple of open issues (i. e. license adjustments and making golangci-lint happy) but so far all tests already work, which is a good start.
2023-01-10 00:38:42 +01:00
f454ae8c41
Merge pull request #88 from james-d-elliott/feat-without-noop
feat: without noop option
2022-12-26 16:49:38 +01:00
James Elliott
567276d75d
feat: without noop option
This allows disabling the Noop command during the dial. This is useful for servers which delay potentially unwanted clients when they perform commands other than AUTH.
2022-12-27 00:06:20 +11:00
James Elliott
b8646489ae
fix: tls config unused with dialer
This ensures the configured tls.Config is used with the tls.Dialer.
2022-12-26 23:48:52 +11:00
48b4dc6b6c
Fix #85: Client.Send() failing for all messages if one is broken
`Client.Send()` provides the possibility to send multiple `*Msg` in one go. If one of the `*Msg` caused an error with the sending mail server, we were returning completely, while not processing any `*Msg` that came after the failing message.

This PR fixes this behaviour by processing each message first and then return a accumulated error in case any of the `*Msg` processing failed

Additionally, this PR separates the `Client.Send()` method into two different versions. One that makes use of the new `errors.Join()` functionality that is introduced with Go 1.20 and one that handles it the old way for any supported version lower than Go 1.20
2022-12-10 13:41:00 +01:00
d200e982bf
Make golangci-lint errorlint happy 2022-10-17 18:16:00 +02:00
5bea905ff9
Make golangci-lint gofumpt happy 2022-10-17 18:12:18 +02:00
f53579fcf9
Closes #54
- Adds `DialAndSendWithContext()` and makes `DialAndSend()` use the new method
2022-09-26 10:40:57 +02:00
885d80aeb7
Let's actually not expose those new methods as they should not be used externally 2022-09-11 21:59:18 +02:00
4d8bc7ca28
Implemented DSNs as described in RFC 1891
- Implemented MAIL FROM RET parameter
- Implemented RCPT TO NOTIFY parameter

Not implemented so far (not sure if we need this at all):
- MAIL FROM ENVID parameter
- RCPT TO ORCPT parameter

TBD:
- Test coverage
2022-09-11 20:24:28 +02:00
31001e87b2
#24: Add SPDX license IDs for REUSE compliance
# SUMMARY

* Bad licenses:
* Deprecated licenses:
* Licenses without file extension:
* Missing licenses:
* Unused licenses:
* Used licenses: CC0-1.0, MIT
* Read errors: 0
* Files with copyright information: 45 / 45
* Files with license information: 45 / 45

Congratulations! Your project is compliant with version 3.0 of the REUSE Specification :-)
2022-06-17 15:05:54 +02:00
894ff7128c
Rename Write() to WriteTo() so it satisfies the io.WriteTo interface 2022-05-24 15:46:59 +02:00
1c699da955
More tests. Also testing GH's behaviour on ENV variables for testing 2022-03-16 21:02:31 +01:00
a0ebc5bd78
More and better tests for client.go 2022-03-15 22:37:55 +01:00
fe3925c1e6
More tests coverage for client.go 2022-03-15 21:48:36 +01:00
4585a53be8
Added error to Options so we can check inputs 2022-03-15 21:10:03 +01:00
1157180369
v0.1.1: Added embeds/attachments 2022-03-14 10:29:53 +01:00
8c804ec573
Implemented MIME multipart handling for alternative content 2022-03-13 17:15:23 +01:00
06e37755f2
Some progress was made:
- Implemented proper AUTH LOGIN mechanism
- Implemented msgWriter for handling io
- Implemented proper mail header formatting/output
- Minor refactoring
2022-03-12 15:10:01 +01:00
5aebb12241
Calling it a day... 2022-03-11 19:17:43 +01:00
98d7982738
Calling it a day... 2022-03-10 16:56:41 +01:00
57ebb171c5
Lots of cleanups and refactoring 2022-03-10 16:19:51 +01:00
59a1d14ca7
Better context and connection handling 2022-03-10 12:10:27 +01:00
4babc309fb
Implemented SMTP AUTH 2022-03-10 10:53:38 +01:00
ba5f519d9d
Make GoLint happy 2022-03-09 17:05:38 +01:00
4b4c8065f6
Progress 2022-03-09 13:20:01 +01:00
82bb87ea4f
Calling it a day... 2022-03-07 18:14:38 +01:00
b3554a9578
Slow progress 2022-03-07 16:24:49 +01:00
2fcc0f59cd
Adding first tests 2022-03-06 15:15:42 +01:00
261481344f
Makeing some progress... 2022-03-05 16:27:09 +01:00
4dd9c1bf40
Let's get started... 2022-03-05 12:36:53 +01:00