Skip to content

Commit

Permalink
Merge branch 'release/7.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaben committed Oct 19, 2024
2 parents 536a994 + 55fc7ff commit 9264270
Show file tree
Hide file tree
Showing 150 changed files with 7,721 additions and 5,161 deletions.
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.idea
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
59 changes: 59 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
ARG BUILD_VERSION=1.0.0.0
WORKDIR /work
COPY ["src/Papercut.Service/Papercut.Service.csproj", "/work/Papercut.Service/"]
COPY ["src/Papercut.Common/Papercut.Common.csproj", "/work/Papercut.Common/"]
COPY ["src/Papercut.Core/Papercut.Core.csproj", "/work/Papercut.Core/"]
COPY ["src/Papercut.Infrastructure.IPComm/Papercut.Infrastructure.IPComm.csproj", "/work/Papercut.Infrastructure.IPComm/"]
COPY ["src/Papercut.Infrastructure.Smtp/Papercut.Infrastructure.Smtp.csproj", "/work/Papercut.Infrastructure.Smtp/"]
COPY ["src/Papercut.Message/Papercut.Message.csproj", "/work/Papercut.Message/"]
COPY ["src/Papercut.Rules/Papercut.Rules.csproj", "/work/Papercut.Rules/"]
RUN dotnet restore "/work/Papercut.Service/Papercut.Service.csproj"
COPY . .

#RUN sed "s/\(Assembly\(Informational\|File\)Version(\d34[0-9]\+\.[0-9]\+\.[0-9]\+\.\)[0-9]\+/\1$BUILD_VERSION/" src/GlobalAssemblyInfo.cs

WORKDIR "/work/src/Papercut.Service"

RUN dotnet build "Papercut.Service.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "Papercut.Service.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final

ARG BUILD_VERSION
ARG BUILD_DATE
ARG VCS_REF

LABEL org.opencontainers.image.title="Papercut SMTP Service" \
org.opencontainers.image.description="Papercut SMTP Service is a 2-in-1 quick email viewer AND built-in SMTP server" \
org.opencontainers.image.version=${BUILD_VERSION} \
org.opencontainers.image.url="https://www.papercut-smtp.com/" \
org.opencontainers.image.source="https://github.com/ChangemakerStudios/Papercut-SMTP" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${VCS_REF} \
org.opencontainers.image.licenses="Apache License, Version 2.0"

WORKDIR /app

COPY --from=publish /app/publish .

ENV ASPNETCORE_HTTP_PORTS=80

# HTTP
EXPOSE 80

# SMTP
EXPOSE 25

# optional -- should only be used locally: IPComm
# EXPOSE 37403

CMD ["dotnet", "Papercut.Service.dll"]
5 changes: 5 additions & 0 deletions Papercut.sln
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".Build", ".Build", "{8661B3
GitVersion.yml = GitVersion.yml
build\ReleaseNotes.cake = build\ReleaseNotes.cake
ReleaseNotes.md = ReleaseNotes.md
.dockerignore = .dockerignore
Dockerfile = Dockerfile
README.md = README.md
build-docker.sh = build-docker.sh
build-docker.ps1 = build-docker.ps1
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Papercut.Infrastructure.Smtp", "src\Papercut.Infrastructure.Smtp\Papercut.Infrastructure.Smtp.csproj", "{873EC485-8E94-4877-8EA7-A7DFE7612E0A}"
Expand Down
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
[![Build status](https://ci.appveyor.com/api/projects/status/bs2asxoafdwbkcxa?svg=true)](https://ci.appveyor.com/project/Jaben/papercut-smtp)

## The problem
If you ever send emails from an application or web site during development, you're familiar with the fear of an email being released into the wild. Are you positive none of the 'test' emails are addressed to colleagues or worse, customers? Of course, you can set up and maintain a test email server for development -- but that's a chore. Plus, the delay when you are waiting to view new test emails can radically slow your development cycle.
If you ever send emails from an application or website during development, you're familiar with the fear of an email being released into the wild. Are you positive none of the 'test' emails are addressed to colleagues or worse, customers? Of course, you can set up and maintain a test email server for development -- but that's a chore. Plus, the delay when waiting to view new test emails can radically slow your development cycle.

## Papercut SMTP to the rescue!
Papercut SMTP is a 2-in-1 quick email viewer AND built-in SMTP server (designed to receive messages only). Papercut SMTP doesn't enforce any restrictions how you prepare your email, but it allows you to view the whole email-chilada: body, html, headers, attachment down right down to the naughty raw encoded bits. Papercut can be configured to run on startup and sit quietly (minimized in the tray) only providing a notification when a new message has arrived.
Papercut SMTP is a 2-in-1 quick email viewer AND built-in SMTP server (designed to receive messages only). Papercut SMTP doesn't enforce any restrictions on how you prepare your email, but it allows you to view the whole email-chilada: body, HTML, headers, and attachment right down to the naughty raw encoded bits. Papercut can be configured to run on startup and sit quietly (minimized in the tray) only providing a notification when a new message has arrived.

## Download Now
### [Download the Papercut.Setup.exe installer](https://github.com/ChangemakerStudios/Papercut-SMTP/releases)

## Requirements
Papercut SMTP UI Requires the "WebView2" Microsoft shared system component be installed on your system. If you have any problems getting it running go to this site:
Papercut SMTP UI Requires the "WebView2" Microsoft shared system component to be installed on your system. If you have any problems getting it running go to this site:
[WebView2 Download](https://developer.microsoft.com/en-us/microsoft-edge/webview2) and install it.

## Features
Expand All @@ -28,9 +28,26 @@ Papercut SMTP UI Requires the "WebView2" Microsoft shared system component be in
#### Logging View
![Logging View](https://changemakerstudios.us/content/images/2020/07/Papercut-Log.png)

## Papercut SMTP Background Service
Papercut SMTP has an optional "always on" service to receive emails even when the client is not running. It's installed by default with [Papercut.Setup.exe](https://github.com/ChangemakerStudios/Papercut/releases).
## Papercut SMTP Service
Papercut SMTP has an optional HTTP server to receive emails even when the client is not running. It's installed by default with [Papercut.Setup.exe](https://github.com/ChangemakerStudios/Papercut/releases).
Alternatively, it can be run in an almost portable way by downloading [Papercut.Service.zip](https://github.com/ChangemakerStudios/Papercut/releases), unzipping and [following the service installation instructions](https://github.com/ChangemakerStudios/Papercut/tree/develop/src/Papercut.Service).

### Host in Docker

Optionally you can run Papercut SMTP Service in docker: [Papercut SMTP Service in Docker](https://hub.docker.com/r/changemakerstudiosus/papercut-smtp)

#### Pull Image:

```powershell
> docker pull changemakerstudiosus/papercut-smtp:latest
```

#### Run Papercut STMP Server Locally in Docker (HTTP Port :8080 and STMP port 25)
```powershell
docker run -d -p 8080:80 -p 25:25 changemakerstudiosus/papercut-smtp:latest
```

The Papercut-SMTP Server Site will be accessible at http://localhost:8080.

## License
Papercut SMTP is Licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
4 changes: 3 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Release Notes

## Papercut SMTP v7.0.0 [2024-05-17]
## Papercut SMTP v7.0.0 [2024-10-14]

_NOTE: Uninstall any existing Papercut SMTP installations BEFORE installing this new version._

- Upgraded to .NET 8
- Upgraded to latest dependencies (Caliburn Micro, Autofac, MahApps) and associated systems to support .NET 8.
- Switched to [Velopack](https://github.com/velopack/velopack) auto-upgradable installation system. Great project! (Thanks, [caesay](https://github.com/caesay)!)
- Fix for log updating constantly causing unnecessary WebView2 loading. (PR thanks to [arthurzaczek](https://github.com/arthurzaczek))
- Fix for double request when clicking on links in emails. Issue #232.
- Added InvokeProcess Rule (#274)

## Papercut SMTP v6.2.0 [2022-04-24]

Expand Down
17 changes: 17 additions & 0 deletions build-docker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
param (
[string]$BuildVersion
)

if (-not $BuildVersion) {
Write-Host "You must specify a build version. E.g.: 7.0.1"
exit 1
}

$BuildDate = (Get-Date).ToString("yyyy-MM-ddTHH:mm:ssZ")
$VcsRef = (git rev-parse --short HEAD)

docker build -t "changemakerstudiosus/papercut-smtp:$BuildVersion" . `
--build-arg BUILD_VERSION=$BuildVersion `
--build-arg BUILD_DATE=$BuildDate `
--build-arg VCS_REF=$VcsRef `
--no-cache
14 changes: 14 additions & 0 deletions build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
BuildVersion=$1
if [ -z "$BuildVersion" ]; then
echo "You must specify a build version. E.g.: 7.0.1"
exit 1
fi

BuildDate=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
VcsRef=$(git rev-parse --short HEAD)

docker build -t changemakerstudiosus/papercut-smtp:"$BuildVersion" . \
--build-arg BUILD_VERSION="$BuildVersion" \
--build-arg BUILD_DATE="$BuildDate" \
--build-arg VCS_REF="$VcsRef" \
--no-cache
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dotnet tool install --global Cake.Tool --version 3.2.0
dotnet tool install --global vpk --version 0.0.359
dotnet tool install --global vpk --version 0.0.626
dotnet-cake --configuration=Release
6 changes: 3 additions & 3 deletions src/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
//------------------------------------------------------------------------------
using System.Reflection;

[assembly: AssemblyVersion("7.0.0.0")]
[assembly: AssemblyFileVersion("7.0.0.0")]
[assembly: AssemblyInformationalVersion("7.0.0.0")]
[assembly: AssemblyVersion("7.1.0.0")]
[assembly: AssemblyFileVersion("7.1.0.0")]
[assembly: AssemblyInformationalVersion("7.1.0-dev.111+Branch.develop.Sha.c6c2a6557ac3b3a8d1ebd93f45de2ff515018f18")]
7 changes: 6 additions & 1 deletion src/Papercut.Common/Papercut.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Runtime.Caching" Version="8.0.0" />
<PackageReference Include="System.Runtime.Caching" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="JetBrains.Annotations" Version="2024.2.0" />
<PackageReference Update="Serilog" Version="4.0.2" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions src/Papercut.Core/AppConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public static class AppConstants

public const string CompanyName = "Changemaker Studios";

public const string UpgradeUrl = "https://github.com/ChangemakerStudios/Papercut-SMTP";

public static string AppDataDirectory { get; } =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
CompanyName,
Expand Down
12 changes: 3 additions & 9 deletions src/Papercut.Core/Domain/Application/ApplicationMeta.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,10 @@

namespace Papercut.Core.Domain.Application
{
public class ApplicationMeta : IAppMeta
public class ApplicationMeta(string appName, string? appVersion = null) : IAppMeta
{
public ApplicationMeta(string appName, string? appVersion = null)
{
this.AppName = appName;
this.AppVersion = appVersion ?? Assembly.GetCallingAssembly().GetName().Version.ToString(3);
}
public string AppName { get; } = appName;

public string AppName { get; }

public string AppVersion { get; }
public string AppVersion { get; } = appVersion ?? Assembly.GetCallingAssembly().GetName().Version?.ToString(3) ?? "1.0.0.0";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static IReadOnlyList<Action<ContainerBuilder>> GetStaticRegisterMethods(t
z => new Action<ContainerBuilder>(
c =>
{
Log.Debug(
Log.Verbose(
"Invoking Registration Method {MethodType} {MethodName}",
z.DeclaringType?.ToString(),
z.ToString());
Expand Down
31 changes: 31 additions & 0 deletions src/Papercut.Core/Infrastructure/Logging/LoggerExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Papercut
//
// Copyright © 2008 - 2012 Ken Robertson
// Copyright © 2013 - 2024 Jaben Cargman
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


namespace Papercut.Core.Infrastructure.Logging;

public static class LoggerExtensions
{
public static bool ErrorWithContext(this ILogger logger, Exception? exception, string message, params object?[] propertyValues)
{
if (logger == null) throw new ArgumentNullException(nameof(logger));

logger.Error(exception, message, propertyValues);

return true;
}
}
19 changes: 12 additions & 7 deletions src/Papercut.Core/Papercut.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@

<ItemGroup>
<PackageReference Include="Autofac">
<Version>8.0.0</Version>
<Version>8.1.1</Version>
</PackageReference>
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
<PackageReference Include="AutofacSerilogIntegration">
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.3</Version>
</PackageReference>
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Trace" Version="3.0.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.Trace" Version="4.0.0" />
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="JetBrains.Annotations" Version="2024.2.0" />
<PackageReference Update="Serilog" Version="4.0.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@

<ItemGroup>
<PackageReference Include="Autofac">
<Version>8.0.0</Version>
<Version>8.1.1</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.3</Version>
</PackageReference>
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="JetBrains.Annotations" Version="2024.2.0" />
<PackageReference Update="Serilog" Version="4.0.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@
<ProjectReference Include="..\Papercut.Message\Papercut.Message.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="JetBrains.Annotations" Version="2024.2.0" />
<PackageReference Update="Serilog" Version="4.0.2" />
</ItemGroup>

</Project>
13 changes: 9 additions & 4 deletions src/Papercut.Message/Papercut.Message.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@

<ItemGroup>
<PackageReference Include="Autofac">
<Version>8.0.0</Version>
<Version>8.1.1</Version>
</PackageReference>
<PackageReference Include="MailKit">
<Version>4.4.0</Version>
<Version>4.8.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="MimeKit">
<Version>4.4.0</Version>
<Version>4.8.0</Version>
</PackageReference>
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="JetBrains.Annotations" Version="2024.2.0" />
<PackageReference Update="Serilog" Version="4.0.2" />
</ItemGroup>
</Project>
Loading

0 comments on commit 9264270

Please sign in to comment.