Commit graph

1361 commits

Author SHA1 Message Date
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
6a7d49f1b6
Update doc.go
Bump version to 0.3.6 as preparation for the next release
2022-12-10 13:53:07 +01:00
c571650c97
Merge pull request #86 from wneessen/fix/85_clientsend-returns-is-one-of-the-given-messages-fails
Fix #85: Client.Send() failing for all messages if one is broken
2022-12-10 13:51:35 +01: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
32ac691112
Update doc.go
Bump Version to 0.3.5
2022-11-19 11:33:06 +01:00
2a228c5b08
Merge pull request #83 from wneessen/feature/80_add-getaddrheader
#80: GetAddrHeader and SetGenHeader
2022-11-19 11:31:28 +01:00
17b9d2ccf6
#80: GetAddrHeader and SetGenHeader
This PR introduces two major changes:

* SetHeader and SetHeaderPreformatted have been deprecated in favour of SetGenHeader and SetGenHeaderPreformatted
  As pointed out in #80 the naming was pretty confusing, given that we already have SetAddrHeader. With the new naming convention it should be more clear. For compatibility reasons the old methods have been kept for now but in reality they are just aliases to the new methods
* GetAddrHeader and GetAddrHeaderString have been introduced
  As requested in #80 analogous to GetGenHeader we also need a similar method for the address headers. Since address headers are *mail.Address pointer, we've also added a *String method that will extract the address string and return a string slice instead
  Additionally we're introducing methods for the actual address headers: GetTo, GetFrom, GetCc and GetBcc (with a *String counterpart as well). This way the user has full flexibility. Either they use the more "low-level" GetAddrHeader method or the higher level methods for the corresponding address type
2022-11-19 11:22:20 +01:00
02c47184c1
Merge pull request #82 from wneessen/bugfix/81_error-from-body-writer-is-ignored
#81: Fix error handling in body writer
2022-11-19 10:03:26 +01:00
47eb7b582b
#81: Fix error handling in body writer
The error handling in the msgWriter.writeBody() method was not working properly. We basically overwrote the mw.err with nil if the function that followed after a failed write attempt was successful again

This patch fixes #81
2022-11-19 09:55:38 +01:00
957e705f16
Update README.md
Removed obsolete parts from the README and referred to GoDoc and our documenation website.
2022-10-27 14:31:14 +02:00
12191c0c2e
Update README.md
Added DKIM Support to README.md
2022-10-26 20:06:17 +02:00
1ff87db521
Update doc.go
Bump version to 0.3.4
2022-10-26 16:03:02 +02:00
0c0ddd5f23
Merge pull request #78 from wneessen/fix/msgid-too-long
The new messageID generated with #74 is a bit too long by default. Th…
2022-10-26 16:01:33 +02:00
d327ca73e4
The new messageID generated with #76 is a bit too long by default. This patch reduces the length 2022-10-26 15:48:48 +02:00
dd0e3a9a48
Merge pull request #77 from wneessen/feature/76-ability-for-preformated-headers
Add SetHeaderPreformatted() method
2022-10-26 15:45:13 +02:00
2e60d070a6
Add SetHeaderPreformatted() method
With the SetHeaderPreformatted() method we have the ability to set headers that are already preformatted by the user and will not be altered in the mail message output
2022-10-26 15:33:03 +02:00
4250eaf911
Merge pull request #75 from wneessen/fix/74-messageid-generation-not-random-enough
Fixed SetMessageID message ID generation
2022-10-26 14:22:23 +02:00
38627631cf
Test for random.go added 2022-10-26 14:21:00 +02:00
8484e557d0
Replace math/rand with crypto/rand
Since the Windows tests were still failing, we are replacing the random number generation with math/rand with random string generation via crypto/rand
2022-10-26 14:05:25 +02:00
5bf0c10525
Randomness apparently not good enough for windows. Tests were failing. This fix improves it 2022-10-26 13:43:51 +02:00
021e003e78
Closes #74
This fix makes sure that generated message IDs via SetMessageID() are truly random and unique
2022-10-26 11:59:03 +02:00
c321aeeccc
Update doc.go 2022-10-25 17:04:30 +02:00
6df19e9463
Merge pull request #70 from wneessen/feature/middleware-type
Introducing MiddlewareType and WriteToSkipMiddleware
2022-10-25 17:04:04 +02:00
2bd6851c78
Fix in the storage of the original Middleware 2022-10-25 16:56:40 +02:00
6f93e5835e
Introducing MiddlewareType and WriteToSkipMiddleware
For middlewares to be able to access the fully written mail message, we need a way to execute WriteTo without the calling middleware to be handled, otherwise we end up in an infinite loop

Therefore, this PR introduces the MiddlewareType and the corresponding change of the Middleware interface. We now require to return the MiddlewareType when the Type() method on the interface is called

This way we can also introduce the WriteToSkipMiddleware method which takes a MiddlewareType as argument. This will allow us to use a WriteTo call with the initiating Middleware to be skipped
2022-10-25 16:42:18 +02:00
a44383eed2
Update doc.go
Bump version to 0.3.2
2022-10-20 18:46:24 +02:00
c32d2770e9
Merge pull request #68 from wneessen/fix-io-reader
New Reader type
2022-10-20 18:45:16 +02:00
7cbb5a71e3
Fix REUSE header 2022-10-20 18:33:18 +02:00
b6beeb5cae
Finalized the Reader type and removed the broken Read() method 2022-10-20 18:26:51 +02:00
183fb347d6
Fix create header maps in case SetHeader or SetAddrHeader is called on an empty Msg type 2022-10-20 18:06:26 +02:00
5faa6dfbd6
We now return a Reader instead of the io.Reader interface 2022-10-20 18:03:57 +02:00
4a309dc73a
REUSE fix 2022-10-20 15:53:59 +02:00
966615584d
Implement a proper io.Reader interface since the current implementation is flawed 2022-10-20 15:52:53 +02:00
50ee227456
Update sonar-project.properties
Remove gosec
2022-10-18 17:37:34 +02:00
4a1b1ede96
Update sonarqube.yml
Remove gosec and update to Go 1.19
2022-10-18 17:36:13 +02:00
ff6a6a5f85
Merge pull request #67 from wneessen/codecov-versionfix
Fix codecov Go version setup
2022-10-18 16:49:18 +02:00
f36df2fcdb
Fix codecov Go version setup
The different code version usages in the codecov workflow were missing the actual go setup set, which caused all tests to always run with Go 1.17. This PR fixes this
2022-10-18 16:40:03 +02:00
b0dbe19ee1
Updated .gitignore 2022-10-18 15:39:55 +02:00
ebe6fc5e6b
Merge pull request #66 from wneessen/golangci-lint
Introduce golangci-lint
2022-10-17 18:46:19 +02:00
8c6f291b38
Update golangci-lint.yml 2022-10-17 18:35:53 +02:00
b01947117b
Update golangci-lint config 2022-10-17 18:34:05 +02:00
03b5916615
Update golangci-lint config 2022-10-17 18:29:18 +02:00
69a97c7c98
Update golangci-lint config 2022-10-17 18:27:53 +02:00
d89f50ec6b
Update golangci-lint config 2022-10-17 18:26:54 +02:00
9e2fc70ee6
Update golangci-lint.yml 2022-10-17 18:21:28 +02:00
0149003d49
Update golangci-lint.yml 2022-10-17 18:20:37 +02:00
d4ae5fe07c
Fix golangci-lint config SPDX license 2022-10-17 18:19:50 +02:00
872315ed80
Create golangci-lint.yml 2022-10-17 18:18:32 +02:00
d200e982bf
Make golangci-lint errorlint happy 2022-10-17 18:16:00 +02:00
321b512c95
Make golangci-lint gofumpt happy 2022-10-17 18:13:28 +02:00