Commit graph

1404 commits

Author SHA1 Message Date
47c0cba4c0
Merge pull request #403 from wneessen/dependabot/github_actions/actions/upload-artifact-4.5.0
Bump actions/upload-artifact from 4.4.3 to 4.5.0
2024-12-18 15:05:17 +01:00
dependabot[bot]
f16c7ae462
Bump actions/upload-artifact from 4.4.3 to 4.5.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.4.3 to 4.5.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](b4b15b8c7c...6f51ac03b9)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-18 13:56:39 +00:00
fba7339518
Merge pull request #402 from wneessen/dependabot/github_actions/sonarsource/sonarqube-scan-action-4.2.1
Bump sonarsource/sonarqube-scan-action from 4.1.0 to 4.2.1
2024-12-17 14:25:46 +01:00
dependabot[bot]
e4dad62513
Bump sonarsource/sonarqube-scan-action from 4.1.0 to 4.2.1
Bumps [sonarsource/sonarqube-scan-action](https://github.com/sonarsource/sonarqube-scan-action) from 4.1.0 to 4.2.1.
- [Release notes](https://github.com/sonarsource/sonarqube-scan-action/releases)
- [Commits](1b442ee39a...bfd4e558cd)

---
updated-dependencies:
- dependency-name: sonarsource/sonarqube-scan-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-17 13:24:44 +00:00
e4562aa094
Merge pull request #401 from wneessen/dependabot/github_actions/github/codeql-action-3.27.9
Bump github/codeql-action from 3.27.7 to 3.27.9
2024-12-13 14:24:23 +01:00
dependabot[bot]
e1f3b83ae5
Bump github/codeql-action from 3.27.7 to 3.27.9
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.7 to 3.27.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](babb554ede...df409f7d92)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-13 13:17:08 +00:00
7eff0b7fa0
Merge pull request #400 from wneessen/dependabot/go_modules/golang.org/x/crypto-0.31.0
Bump golang.org/x/crypto from 0.30.0 to 0.31.0
2024-12-12 19:08:40 +01:00
dependabot[bot]
d459eb3278
Bump golang.org/x/crypto from 0.30.0 to 0.31.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.30.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.30.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-12 14:08:19 +00:00
28ed3a05c1
Merge pull request #398 from wneessen/dependabot/github_actions/actions/setup-go-5.2.0
Bump actions/setup-go from 5.1.0 to 5.2.0
2024-12-11 15:05:26 +01:00
5d757e6704
Merge pull request #399 from wneessen/dependabot/github_actions/github/codeql-action-3.27.7
Bump github/codeql-action from 3.27.6 to 3.27.7
2024-12-11 15:05:10 +01:00
dependabot[bot]
de52d18965
Bump github/codeql-action from 3.27.6 to 3.27.7
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.6 to 3.27.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](aa57810251...babb554ede)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-11 14:01:52 +00:00
dependabot[bot]
3b7569f0cb
Bump actions/setup-go from 5.1.0 to 5.2.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](41dfa10bad...3041bf56c9)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-11 14:01:44 +00:00
8646857fa8
Merge pull request #397 from wneessen/dependabot/github_actions/codecov/codecov-action-5.1.1
Bump codecov/codecov-action from 5.0.7 to 5.1.1
2024-12-06 15:08:29 +01:00
dependabot[bot]
a66e63d974
Bump codecov/codecov-action from 5.0.7 to 5.1.1
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.0.7 to 5.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](015f24e681...7f8b4b4bde)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-06 13:35:21 +00:00
9db600a55b
Merge pull request #395 from wneessen/dependabot/go_modules/golang.org/x/crypto-0.30.0
Bump golang.org/x/crypto from 0.29.0 to 0.30.0
2024-12-05 15:01:26 +01:00
dependabot[bot]
37b396be44
Bump golang.org/x/crypto from 0.29.0 to 0.30.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.29.0 to 0.30.0.
- [Commits](https://github.com/golang/crypto/compare/v0.29.0...v0.30.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-05 13:59:26 +00:00
0922360bd8
Merge pull request #396 from wneessen/dependabot/go_modules/golang.org/x/text-0.21.0
Bump golang.org/x/text from 0.20.0 to 0.21.0
2024-12-05 14:58:21 +01:00
dependabot[bot]
bc46e064c8
Bump golang.org/x/text from 0.20.0 to 0.21.0
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.20.0 to 0.21.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.20.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-05 13:19:33 +00:00
65f4a46237
Merge pull request #394 from wneessen/dependabot/github_actions/github/codeql-action-3.27.6
Bump github/codeql-action from 3.27.5 to 3.27.6
2024-12-03 15:30:33 +01:00
dependabot[bot]
2faeadff6d
Bump github/codeql-action from 3.27.5 to 3.27.6
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.5 to 3.27.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f09c1c0a94...aa57810251)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-03 13:55:59 +00:00
d2dc4af930
Merge pull request #393 from wneessen/dependabot/github_actions/sonarsource/sonarqube-scan-action-4.1.0
Bump sonarsource/sonarqube-scan-action from 4.0.0 to 4.1.0
2024-12-02 16:35:28 +01:00
dependabot[bot]
fb63a50a9c
Bump sonarsource/sonarqube-scan-action from 4.0.0 to 4.1.0
Bumps [sonarsource/sonarqube-scan-action](https://github.com/sonarsource/sonarqube-scan-action) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/sonarsource/sonarqube-scan-action/releases)
- [Commits](94d4f8ac4a...1b442ee39a)

---
updated-dependencies:
- dependency-name: sonarsource/sonarqube-scan-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 15:31:16 +00:00
976a2943e3
Merge pull request #391 from step-security-bot/stepsecurity_remediation_1732996653
[StepSecurity] ci: Harden GitHub Actions
2024-11-30 21:02:00 +01:00
StepSecurity Bot
eb4f53a9fb
[StepSecurity] ci: Harden GitHub Actions
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
2024-11-30 19:57:35 +00:00
acf3c58220
Merge pull request #388 from wneessen/bug/filename-sanitization
Improve filename sanitization in MIME headers
2024-11-26 16:45:04 +01:00
06bee90a1e
Remove charset from octet-stream Content-Type on FreeBSD
The charset parameter in the Content-Type header for octet-stream files on FreeBSD was removed. This aligns the behavior with the expected MIME type format for such files. Other platforms remain unchanged.
2024-11-26 16:38:30 +01:00
f61da9cc2e
Update content-type handling for FreeBSD in msgwriter test
Adjusted the expected content-type header in msgwriter tests to account for FreeBSD by setting it to 'application/octet-stream' instead of 'text/plain'. This ensures compatibility and correct behavior across different operating systems.
2024-11-26 16:34:09 +01:00
75c0e3319b
Simplify attachment test setup
Removed temporary file creation and copying in msgwriter_test.go. Directly attach the source file during the test to streamline the setup process. This change reduces complexity and potential points of failure in the test code.
2024-11-26 16:26:13 +01:00
fe765cd49e
Add filename sanitization tests for attachments
Introduced tests to validate filename sanitization for attachments, ensuring disallowed characters are handled correctly. These tests cover various scenarios, including different character sets such as Japanese, Chinese, and Cyrillic.
2024-11-26 16:17:34 +01:00
b051471f8d
Add tests for the sanitizeFilename function
This commit introduces a series of tests for the sanitizeFilename function in msgwriter_test.go. The tests cover various edge cases to ensure filenames are sanitized correctly by replacing or removing invalid characters. These additions will help maintain the integrity and reliability of filename sanitization in the codebase.
2024-11-26 12:02:15 +01:00
8f8b5079c3
Improve filename sanitization in MIME headers
Sanitize filenames to replace invalid characters before encoding them. This prevents control and special characters from causing issues in MIME headers and file systems. The `sanitizeFilename` function ensures these characters are replaced with underscores.
2024-11-26 11:37:26 +01:00
fe53c86338
Merge pull request #387 from wneessen/bug/fix-comment
Remove unused opts parameter docstring
2024-11-24 12:26:31 +01:00
2f08829fa3
Remove unused opts parameter docstring
The opts parameter documentation was removed as it is no longer used in the quicksend function. This change helps in maintaining accurate and up-to-date code documentation and reduces potential confusion.
2024-11-24 12:25:37 +01:00
ead4067f2d
Merge pull request #386 from wneessen/bug/385_concurrency-issue-in-dialandsendwithcontext
Fix concurrency issue in DialAndSendWithContext
2024-11-22 16:36:10 +01:00
6ebc60d1df
Remove redundant nil check for SMTP client
The removed check for a nil SMTP client was redundant because the previous error handling already covers this case. Streamlining this part of the code improves readability and reduces unnecessary checks.
2024-11-22 16:22:53 +01:00
c61aad4fcb
Remove extra blank line in client_test.go
This change removes an unnecessary blank line at the end of the TestClient_sendSingleMsg function in the client_test.go file. Keeping the code clean and properly formatted improves readability and maintainability.
2024-11-22 16:22:38 +01:00
b4d3b165ed
Add test for dialing SMTP client with context
Introduce a new test, `TestClient_DialToSMTPClientWithContext`, to verify client behavior when establishing and closing an SMTP connection with context handling. Also added a sub-test to simulate and confirm failure scenarios during SMTP connection establishment.
2024-11-22 16:21:49 +01:00
7aba5212c4
Rename method and improve context handling
Renamed `SMTPClientFromDialWithContext` to `DialToSMTPClientWithContext` for clarity and consistency. Updated method parameters and documentation to standardize context usage across the codebase.
2024-11-22 16:06:28 +01:00
4c107f4645
Refactor Client methods to handle smtp.Client parameter
Updated several Client methods to accept a smtp.Client pointer, allowing for more flexible and explicit SMTP client management. Added detailed parameter descriptions and extended error handling documentation.
2024-11-22 15:55:45 +01:00
3553b65769
Add new Send function to client.go and remove duplicates
The new Send function in client.go adds thread safety by using a mutex. This change also removes duplicate Send functions from client_119.go and client_120.go, consolidating the logic in one place for easier maintenance.
2024-11-22 15:38:04 +01:00
3e504e6338
Lock sendMutex to ensure thread safety in Send
Added a mutex lock and unlock around the Send function to prevent concurrent access issues and ensure thread safety. This change helps avoid race conditions when multiple goroutines attempt to send messages simultaneously.
2024-11-22 15:29:31 +01:00
be4201b05a
Refactor debug logging and logger settings in Client
Separated debug logging and logger setting methods to include SMTP client parameter for better encapsulation. Removed commented-out code for cleaner and more manageable codebase.
2024-11-22 15:29:22 +01:00
55884786be
Refactor SMTP client functions to improve modularity
Refactor `DialWithContext` to delegate client creation to `SMTPClientFromDialWithContext`. Add new methods `SendWithSMTPClient`, `CloseWithSMTPClient`, and `ResetWithSMTPClient` to handle specific actions on `smtp.Client`. Simplify `auth`, `sendSingleMsg`, and `tls` methods by passing client as parameters.
2024-11-22 14:59:19 +01:00
f9e869061e
Add mutex locks to DSN option setters
Mutex locks are added to ensure thread safety when setting DSN mail return and recipient notify options. This prevents data races in concurrent environments, improving the client's robustness.
2024-11-22 14:58:41 +01:00
45776c052f
Refactor client error handling and add concurrent send tests
Updated tests to correctly assert the absence of an SMTP client on failure. Added concurrent sending tests for DialAndSendWithContext to improve test coverage and reliability. Also, refined the `AutoDiscover` and other client methods to ensure proper parameter use.
2024-11-22 14:58:05 +01:00
bc5d98031b
Merge pull request #384 from wneessen/dependabot/github_actions/github/codeql-action-3.27.5
Bump github/codeql-action from 3.27.4 to 3.27.5
2024-11-21 15:07:48 +01:00
c217f032bc
Merge pull request #383 from wneessen/dependabot/github_actions/codecov/codecov-action-5.0.7
Bump codecov/codecov-action from 5.0.4 to 5.0.7
2024-11-21 15:03:17 +01:00
d6c96dcd3d
Merge pull request #382 from wneessen/dependabot/github_actions/actions/dependency-review-action-4.5.0
Bump actions/dependency-review-action from 4.4.0 to 4.5.0
2024-11-21 15:03:03 +01:00
dependabot[bot]
62b3314c20
Bump github/codeql-action from 3.27.4 to 3.27.5
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.4 to 3.27.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](ea9e4e3799...f09c1c0a94)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-21 14:02:21 +00:00
dependabot[bot]
49606f197b
Bump codecov/codecov-action from 5.0.4 to 5.0.7
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.0.4 to 5.0.7.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](985343d705...015f24e681)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-21 14:02:09 +00:00