Skip to content

Commit 7cd541a

Browse files
committed
Merge branch 'release/7.5.1'
2 parents dbef0d1 + 4a1f688 commit 7cd541a

File tree

11 files changed

+144
-176
lines changed

11 files changed

+144
-176
lines changed

.github/workflows/winget-publish.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,12 @@ jobs:
117117
Write-Host ""
118118
Write-Host "To enable automatic PR creation in the future:"
119119
Write-Host " 1. Fork https://github.com/microsoft/winget-pkgs"
120-
Write-Host " 2. Create a GitHub Personal Access Token with 'repo' and 'workflow' scopes"
120+
Write-Host " 2. Create a GitHub Personal Access Token (classic) with 'repo' and 'workflow' scopes"
121+
Write-Host " OR create a Fine-grained token with:"
122+
Write-Host " - Repository access: All repositories (or specific fork)"
123+
Write-Host " - Permissions: Contents (Read and write), Pull requests (Read and write)"
121124
Write-Host " 3. Add it as WINGET_PUBLISH_TOKEN secret in your repository settings"
122-
Write-Host " 4. Optionally set WINGET_PKGS_FORK secret to 'YourUsername/winget-pkgs'"
125+
Write-Host " 4. Set WINGET_PKGS_FORK secret to 'YourUsername/winget-pkgs' (not the org name)"
123126
Write-Host ""
124127
Write-Host "To submit this release manually:"
125128
Write-Host " 1. Download the 'winget-manifests-${{ steps.version.outputs.VERSION }}' artifact from this workflow run"
@@ -146,6 +149,14 @@ jobs:
146149
# Clone the fork
147150
Write-Host "Cloning fork repository..."
148151
git clone "https://x-access-token:${{ secrets.WINGET_PUBLISH_TOKEN }}@github.com/$forkRepo.git" winget-pkgs-fork
152+
if ($LASTEXITCODE -ne 0) {
153+
Write-Error "Failed to clone fork repository."
154+
Write-Error "This usually means:"
155+
Write-Error " 1. The WINGET_PUBLISH_TOKEN doesn't have access to $forkRepo"
156+
Write-Error " 2. The WINGET_PKGS_FORK secret is set incorrectly (should be 'YourUsername/winget-pkgs')"
157+
Write-Error " 3. The token doesn't have 'repo' scope or Contents (Read and write) permission"
158+
exit 1
159+
}
149160
cd winget-pkgs-fork
150161
151162
# Add upstream and fetch
@@ -172,7 +183,15 @@ jobs:
172183
git commit -m "New version: $packageId version $version"
173184
174185
Write-Host "Pushing to fork..."
175-
git push origin $branchName
186+
git push "https://x-access-token:${{ secrets.WINGET_PUBLISH_TOKEN }}@github.com/$forkRepo.git" $branchName
187+
if ($LASTEXITCODE -ne 0) {
188+
Write-Error "Failed to push to fork repository."
189+
Write-Error "This usually means:"
190+
Write-Error " 1. The WINGET_PUBLISH_TOKEN doesn't have write access to $forkRepo"
191+
Write-Error " 2. The token doesn't have 'repo' scope or Contents (Read and write) permission"
192+
Write-Error " 3. The branch already exists (try deleting it from the fork)"
193+
exit 1
194+
}
176195
177196
# Create PR using GitHub CLI
178197
Write-Host "Creating pull request..."
@@ -183,6 +202,17 @@ jobs:
183202
--base master `
184203
--head "$forkRepo`:$branchName"
185204
205+
if ($LASTEXITCODE -ne 0) {
206+
Write-Error "Failed to create pull request."
207+
Write-Error "This usually means:"
208+
Write-Error " 1. The WINGET_PUBLISH_TOKEN doesn't have 'workflow' scope or Pull requests (Read and write) permission"
209+
Write-Error " 2. A PR with the same head branch already exists"
210+
Write-Error " 3. The token is a fine-grained token without access to the microsoft/winget-pkgs repository"
211+
Write-Error ""
212+
Write-Error "Note: You may need to use a classic PAT with 'public_repo' and 'workflow' scopes."
213+
exit 1
214+
}
215+
186216
Write-Host ""
187217
Write-Host "✓ Pull request created successfully!"
188218
Write-Host "The microsoft/winget-pkgs maintainers will review and merge the PR."

ReleaseNotes.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Release Notes
22

3+
## Papercut SMTP v7.5.1 [2025-10-31]
4+
5+
### Bug Fixes
6+
7+
- **Forwarding Rules Failing** - Fixed critical bug where email forwarding rules were completely broken due to TaskCanceledException. Fixes [#331](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/331) (Thanks, [wcwhitehead](https://github.com/wcwhitehead)!)
8+
- **SSL/TLS Connection Mode** - Fixed SSL/TLS connection mode to use SslOnConnect for port 465 and Auto for STARTTLS
9+
- **SMTP Timeout** - Set proper SMTP timeout of 30 seconds for forwarding rules
10+
- **Backend Service Status** - Fixed initial status detection for backend service
11+
12+
### Contributors
13+
14+
Special thanks to [wcwhitehead](https://github.com/wcwhitehead) for reporting the critical forwarding rules bug!
15+
316
## Papercut SMTP v7.5.0 [2025-10-28]
417

518
### New Features

ReleaseNotesCurrent.md

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,14 @@
11
# Release Notes
22

3-
## Papercut SMTP v7.5.0 [2025-10-28]
4-
5-
### New Features
6-
7-
- **Search Functionality** - Added Ctrl+F search to all message detail views (Message, Body, Headers, and Raw). Fixes [#295](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/295)
8-
- **Zoom Controls** - Added Ctrl+Mouse Scroll Wheel zoom support to message detail views with persistence and visual indicators. Fixes [#323](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/323)
9-
- **Attachment Display** - Attachments now display in the main message panel with icons and easy access. Fixes [#112](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/112)
10-
- **Context Menu for Links** - Right-click context menu added for email links with copy and open functionality. Fixes [#218](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/218)
11-
- **Empty State Placeholders** - Added smart empty state messaging to message list and detail views for better first-time user experience. Fixes [#268](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/268)
12-
- **SMTP Authentication and TLS/STARTTLS Support** - Full support for SMTP authentication and TLS/STARTTLS encryption for secure email testing. Fixes [#102](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/102)
13-
- **Periodic Background Rules** - Added periodic background rule execution with mail retention cleanup to both UI and Service. Related to [#251](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/251)
14-
- **Windows Package Manager (winget) Support** - Papercut SMTP can now be installed and updated via winget. Fixes [#231](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/231)
15-
- **File Links Support** - Made file:/// links functional by opening with shell/explorer. Fixes [#232](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/232)
16-
- **Example Console Applications** - Added comprehensive example console applications for email testing scenarios
17-
- **Installer Help Support** - Added help parameter support for PowerShell/cmd users. Fixes [#287](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/287)
18-
19-
### Improvements
20-
21-
- **Word-Wrap Support** - Added CSS word-wrap support to HTML email rendering for better display of long text strings. Fixes [#154](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/154)
22-
- **Non-Standard Email Domains** - Added support for non-standard email domains in development environments (e.g., .local, .dev). Fixes [#284](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/284)
23-
- **SSL Certificate Error Handling** - Added optional SSL certificate error handling for WebView2 to support self-signed certificates. Fixes [#243](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/243)
24-
- **Comprehensive Unit Tests** - Added extensive unit tests with FluentAssertions for improved code quality and reliability
25-
- **NuGet Package Upgrades** - Upgraded all NuGet packages to latest versions, including migration to new Polly ResiliencePipeline API
26-
- **Service Architecture** - Refactored attachment and process handling into dedicated services for better separation of concerns
27-
- **Settings Debouncing** - Implemented debounced settings saves using Rx Throttle operator to reduce unnecessary I/O
3+
## Papercut SMTP v7.5.1 [2025-10-31]
284

295
### Bug Fixes
306

31-
- **Window Size Saving** - Fixed window size not saving correctly when minimized. Fixes [#327](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/327)
32-
- **PDF Attachment Opening** - Fixed PDF attachment opening on Windows 11 24H2 and double-click issues. Fixes [#310](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/310), [#280](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/280)
33-
- **Message Rendering with # Characters** - Fixed message rendering for subjects containing # characters. Fixes [#282](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/282) (Thanks, [xavero](https://github.com/xavero)!)
34-
- **SMTP IP Logging** - Fixed SMTP service not logging remote client IP address correctly. Fixes [#291](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/291)
35-
- **Empty State Flicker** - Fixed placeholder flicker when switching between emails
36-
- **WebView2 Deserialization** - Added robust error handling for WebView2 message deserialization
37-
- **Null Safety** - Various null safety improvements and fixes throughout the codebase
38-
- **Process.Start Null Checks** - Added null checks for Process.Start return values to prevent exceptions
39-
40-
### Code Quality
41-
42-
- Refactored to use IUiCommandHub.ShowMessage instead of MessageBox.Show for better testability
43-
- Extracted debouncing logic into reusable SettingsSaveDebouncer
44-
- Improved async patterns and error handling in example applications
45-
- Fixed test assertions to use FluentAssertions consistently
46-
- Added nullable reference type attributes throughout codebase
47-
48-
### Documentation
49-
50-
- Added comprehensive TLS/STARTTLS setup documentation with Docker examples
51-
- Created example projects: SendEmailTest, SendRichEmailTest, SendWordWrapTest, SendEmailWithTls, SendEmailWithFileLinks
52-
- Improved Docker documentation with troubleshooting guides
53-
- Added installation guide for PowerShell and command-line users
7+
- **Forwarding Rules Failing** - Fixed critical bug where email forwarding rules were completely broken due to TaskCanceledException. Fixes [#331](https://github.com/ChangemakerStudios/Papercut-SMTP/issues/331) (Thanks, [wcwhitehead](https://github.com/wcwhitehead)!)
8+
- **SSL/TLS Connection Mode** - Fixed SSL/TLS connection mode to use SslOnConnect for port 465 and Auto for STARTTLS
9+
- **SMTP Timeout** - Set proper SMTP timeout of 30 seconds for forwarding rules
10+
- **Backend Service Status** - Fixed initial status detection for backend service
5411

5512
### Contributors
5613

57-
Special thanks to [xavero](https://github.com/xavero) for fixing message rendering with # characters!
14+
Special thanks to [wcwhitehead](https://github.com/wcwhitehead) for reporting the critical forwarding rules bug!

installation/winget/ChangemakerStudios.PapercutSMTP.installer.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PackageIdentifier: "ChangemakerStudios.PapercutSMTP"
2-
PackageVersion: "7.5.0"
2+
PackageVersion: "7.5.1"
33
Platform:
44
- "Windows.Desktop"
55
MinimumOSVersion: "10.0.17763.0"
@@ -13,13 +13,13 @@ InstallerSwitches:
1313
UpgradeBehavior: "install"
1414
Installers:
1515
- Architecture: "x64"
16-
InstallerUrl: "https://github.com/ChangemakerStudios/Papercut-SMTP/releases/download/7.5.0/PapercutSMTP-win-x64-stable-Setup.exe"
16+
InstallerUrl: "https://github.com/ChangemakerStudios/Papercut-SMTP/releases/download/7.5.1/PapercutSMTP-win-x64-stable-Setup.exe"
1717
InstallerSha256: "<SHA256_HASH_x64>"
1818
- Architecture: "x86"
19-
InstallerUrl: "https://github.com/ChangemakerStudios/Papercut-SMTP/releases/download/7.5.0/PapercutSMTP-win-x86-stable-Setup.exe"
19+
InstallerUrl: "https://github.com/ChangemakerStudios/Papercut-SMTP/releases/download/7.5.1/PapercutSMTP-win-x86-stable-Setup.exe"
2020
InstallerSha256: "<SHA256_HASH_x86>"
2121
- Architecture: "arm64"
22-
InstallerUrl: "https://github.com/ChangemakerStudios/Papercut-SMTP/releases/download/7.5.0/PapercutSMTP-win-arm64-stable-Setup.exe"
22+
InstallerUrl: "https://github.com/ChangemakerStudios/Papercut-SMTP/releases/download/7.5.1/PapercutSMTP-win-arm64-stable-Setup.exe"
2323
InstallerSha256: "<SHA256_HASH_arm64>"
2424
ManifestType: "installer"
2525
ManifestVersion: "1.6.0"

installation/winget/ChangemakerStudios.PapercutSMTP.locale.en-US.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PackageIdentifier: "ChangemakerStudios.PapercutSMTP"
2-
PackageVersion: "7.5.0"
2+
PackageVersion: "7.5.1"
33
PackageLocale: "en-US"
44
Publisher: "Changemaker Studios"
55
PublisherUrl: "https://github.com/ChangemakerStudios"
@@ -29,7 +29,7 @@ Tags:
2929
- "testing"
3030
- "developer-tools"
3131
- "mail-server"
32-
ReleaseNotes: "https://github.com/ChangemakerStudios/Papercut-SMTP/releases/tag/7.5.0"
33-
ReleaseNotesUrl: "https://github.com/ChangemakerStudios/Papercut-SMTP/releases/tag/7.5.0"
32+
ReleaseNotes: "https://github.com/ChangemakerStudios/Papercut-SMTP/releases/tag/7.5.1"
33+
ReleaseNotesUrl: "https://github.com/ChangemakerStudios/Papercut-SMTP/releases/tag/7.5.1"
3434
ManifestType: "defaultLocale"
3535
ManifestVersion: "1.6.0"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PackageIdentifier: "ChangemakerStudios.PapercutSMTP"
2-
PackageVersion: "7.5.0"
2+
PackageVersion: "7.5.1"
33
DefaultLocale: "en-US"
44
ManifestType: "version"
55
ManifestVersion: "1.6.0"

installation/winget/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ You can also manually trigger the winget publishing workflow:
5959

6060
```bash
6161
# Via GitHub CLI
62-
gh workflow run winget-publish.yml --ref master -f version=7.5.0
62+
gh workflow run winget-publish.yml --ref master -f version=7.5.1
6363

6464
# Or use the GitHub Actions UI and select "Run workflow"
6565
```
@@ -116,7 +116,7 @@ If automated publishing is not configured, you can manually submit to winget:
116116
#### Option B: Use wingetcreate Tool
117117

118118
```powershell
119-
$version = "7.5.0"
119+
$version = "7.5.1"
120120
wingetcreate update ChangemakerStudios.PapercutSMTP `
121121
--version $version `
122122
--urls `

src/Papercut.Rules/App/Relaying/RelayRuleExtensions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ public static async Task<SmtpClient> CreateConnectedSmtpClientAsync(this RelayRu
3838
{
3939
if (forwardRule == null) throw new ArgumentNullException(nameof(forwardRule));
4040

41-
var client = new SmtpClient();
41+
var client = new SmtpClient
42+
{
43+
// Set reasonable timeout (default is 100 seconds, set to 30 seconds)
44+
Timeout = 30000
45+
};
4246

4347
await client.ConnectAsync(
4448
forwardRule.SmtpServer,
4549
forwardRule.SmtpPort,
46-
forwardRule.SmtpUseSSL ? SecureSocketOptions.Auto : SecureSocketOptions.None,
50+
forwardRule.SmtpUseSSL ? SecureSocketOptions.SslOnConnect : SecureSocketOptions.Auto,
4751
token);
4852

4953
// Note: since we don't have an OAuth2 token, disable

src/Papercut.Rules/App/RulesRunner.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ public async Task RunNewMessageRules(INewMessageRule[] rules, MessageEntry messa
6565

6666
foreach (var rule in rules.Where(r => r.IsEnabled))
6767
{
68-
token.ThrowIfCancellationRequested();
69-
7068
var invoke = _dispatchRuleMethod.MakeGenericMethod(rule.GetType()).Invoke(
7169
this,
7270
[rule, messageEntry, token]);
@@ -88,8 +86,6 @@ public Task RunPeriodicBackgroundRules(IPeriodicBackgroundRule[] rules, Cancella
8886

8987
foreach (var rule in rules.Where(r => r.IsEnabled))
9088
{
91-
token.ThrowIfCancellationRequested();
92-
9389
var invoke = _dispatchRuleMethod.MakeGenericMethod(rule.GetType()).Invoke(
9490
this,
9591
[rule, null, token]);

src/Papercut.UI/AppLayer/IpComm/BackendServiceCoordinator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public async Task OnStartedAsync()
7979
await this.AttemptExchangeAsync();
8080
}
8181

82+
private bool IsOnlineUnknown => _isOnline is null;
83+
8284
public bool IsOnline
8385
{
8486
get => this._isOnline ?? false;
@@ -119,7 +121,7 @@ public async Task HandleAsync(SettingsUpdatedEvent @event, CancellationToken tok
119121

120122
private async Task SetOnlineStatus(bool newStatus, CancellationToken token = default)
121123
{
122-
if (this._isOnline != newStatus)
124+
if (IsOnlineUnknown || this.IsOnline != newStatus)
123125
{
124126
this.IsOnline = newStatus;
125127

0 commit comments

Comments
 (0)