Configuring SMTP server for no-authentication access#586
Merged
Conversation
Copilot created this pull request from a session on behalf of
GZTimeWalker
July 5, 2026 14:07
View session
GZTimeWalker
marked this pull request as ready for review
July 5, 2026 14:07
GZTimeWalker
approved these changes
Jul 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the SMTP mail-sending logic to support SMTP servers that allow sending without SMTP AUTH, by only attempting authentication when both username and password are configured.
Changes:
- Introduced a
_useSmtpAuthenticationflag derived from configured username/password. - Made both the background sender worker and the SMTP connectivity test skip
Authenticate*calls when auth is not configured.
Comment on lines
+32
to
+40
| var hasUserName = !string.IsNullOrWhiteSpace(_options.UserName); | ||
| var hasPassword = !string.IsNullOrWhiteSpace(_options.Password); | ||
| _useSmtpAuthentication = hasUserName && hasPassword; | ||
| _cancellationToken = _cancellationTokenSource.Token; | ||
|
|
||
| if (hasUserName != hasPassword) | ||
| _logger.SystemLog("SMTP username/password is partially configured. SMTP AUTH will be skipped.", | ||
| TaskStatus.Degraded, LogLevel.Warning); | ||
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## work #586 +/- ##
==========================================
- Coverage 59.36% 59.35% -0.02%
==========================================
Files 190 190
Lines 9804 9811 +7
Branches 1202 1204 +2
==========================================
+ Hits 5820 5823 +3
- Misses 3488 3491 +3
- Partials 496 497 +1
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request created by AI Agent