Skip to content

Commit

Permalink
Merge branch 'release/5.8.0' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaben committed Jun 17, 2021
2 parents 8e500ed + 2693a4e commit b51880d
Show file tree
Hide file tree
Showing 195 changed files with 6,314 additions and 13,917 deletions.
5 changes: 1 addition & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
Expand All @@ -11,7 +10,6 @@
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
Expand All @@ -34,7 +32,6 @@
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
Expand All @@ -43,7 +40,6 @@
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
Expand All @@ -61,3 +57,4 @@
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
*.psd filter=lfs diff=lfs merge=lfs -text
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "nuget" # See documentation for possible values
directory: "/src" # Location of package manifests
schedule:
interval: "weekly"
5 changes: 4 additions & 1 deletion Papercut.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,7 @@ limitations under the License. 
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=E1F72DD6C4D1114A8329A3D37FCFBFA4/SearchPattern/@EntryValue"></s:String>
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=E1F72DD6C4D1114A8329A3D37FCFBFA4/Severity/@EntryValue">DO_NOT_SHOW</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Changemaker/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Papercut/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Flyouts/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=orderable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Papercut/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Prestart/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
35 changes: 16 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
![Papercut Logo](https://raw.githubusercontent.com/ChangemakerStudios/Papercut/develop/graphics/PapercutLogo.png)
The Simple Desktop Email Helper
![Papercut Logo](https://raw.githubusercontent.com/ChangemakerStudios/Papercut/develop/graphics/PapercutLogo.png)<br>
*The Simple Desktop Email Helper*

[![Build status](https://ci.appveyor.com/api/projects/status/bs2asxoafdwbkcxa?svg=true)](https://ci.appveyor.com/project/Jaben/papercut)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Jaben/Papercut?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/Jaben)


## 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 setting 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 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.

## Papercut to the rescue!
Papercut is a 2-in-1 quick email viewer AND built-in SMTP server (designed to receive messages only). Not only does it not 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 to the rescue!
Papercut SMTP is a 2-in-1 quick email viewer AND built-in SMTP server (designed to receive messages only). Not only does it not 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.

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

## Features
#### Instant Feedback When New Email Arrives
![Instant Feedback When New Email Arrives](https://changemakerstudios.us/images/Papercut/Papercut-v3.1.0-S2.png)
![Instant Feedback When New Email Arrives](https://changemakerstudios.us/content/images/2020/07/Papercut-2013.3-SS2.png)
#### Rich and Detailed View of Received Email
![Rich and Detailed View of Received Email](https://changemakerstudios.us/images/Papercut/Papercut-Main.png)
![Rich and Detailed View of Received Email](https://changemakerstudios.us/content/images/2020/07/Papercut-Main.png)
#### View and Download the Mime Sections of your Email
![View and Download the Mime Sections of your Email](https://changemakerstudios.us/images/Papercut/Papercut-Mime.png)
#### In Version 4 the Raw View Returns
![In Version 4 the Raw View Returns](https://changemakerstudios.us/images/Papercut/Papercut-Raw.png)
#### New in Version 4.4: Logging View
![In Version 4.4: Logging View](https://changemakerstudios.us/images/Papercut/Papercut-Log.png)
![View and Download the Mime Sections of your Email](https://changemakerstudios.us/content/images/2020/07/Papercut-Mime.png)
#### Raw View
![Raw View](https://changemakerstudios.us/content/images/2020/07/Papercut-Raw.png)
#### Logging View
![Logging View](https://changemakerstudios.us/content/images/2020/07/Papercut-Log.png)

## Papercut Background Service
Papercut 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) -- but can also be installed separately 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).
## 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) -- but can also be installed separately 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).

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

## Papercut v5.8.0 [2021-06-16]
- Moved to .NET Framework 4.7.2
- Upgraded to latest dependencies (Caliburn Micro, Autofac, MahApps)
- Fixed: Window sizes weren't binding properly.
- Converted system to Async.
- Added additional theme colors.
- Updated the logo.
- Fixed: Hide passwords in rules logging output.
- Fixed: Don't show passwords in rules logging output.
- [#175] Added font weight changing when message has been seen (PR thanks to [LewisJohnson](https://github.com/LewisJohnson))
- [#180] Fixed message not displaying in Web UI when id includes '#' symbol (PR thanks to [ryan-warrener](https://github.com/ryan-warrener))
- [#185] Responsive Delete button (PR thanks to [rfverbruggen](https://github.com/rfverbruggen))

## Papercut v5.7.0 [2020-04-05]
- Renamed product to "Papercut SMTP" to seperate from other products.
- Moved "Readme.eml" and logs to *\ProgramData\Changemaker Studios\Papercut SMTP* allowing it to be deleted.
Expand Down
4 changes: 2 additions & 2 deletions build/ReleaseNotes.cake

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions chocolatey/papercut-service.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>papercut-service</id>
<version>5.0.0.0</version>
<title>Papercut</title>
<version>5.8.0.0</version>
<title>Papercut-Smtp</title>
<authors>Jaben</authors>
<owners>Jaben</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
Expand Down
4 changes: 2 additions & 2 deletions chocolatey/papercut.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>papercut</id>
<version>5.0.0.0</version>
<title>Papercut</title>
<version>5.8.0.0</version>
<title>Papercut-Smtp</title>
<authors>Jaben</authors>
<owners>Jaben</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
Expand Down
Binary file modified graphics/PapercutLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/PapercutLogo.psd
Binary file not shown.
3 changes: 3 additions & 0 deletions graphics/PapercutLogoV2.psd
Git LFS file not shown
62 changes: 52 additions & 10 deletions src/Papercut.App.WebApi/Controllers/MessagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
namespace Papercut.App.WebApi.Controllers
{
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -27,6 +28,7 @@ namespace Papercut.App.WebApi.Controllers
using System.Net.Mime;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Results;

using MimeKit;

Expand All @@ -36,15 +38,20 @@ namespace Papercut.App.WebApi.Controllers
using Papercut.Message;
using Papercut.Message.Helpers;

using Serilog;
using Serilog.Context;

public class MessagesController : ApiController
{
readonly MessageRepository _messageRepository;
readonly MimeMessageLoader _messageLoader;
private readonly ILogger _logger;

public MessagesController(MessageRepository messageRepository, MimeMessageLoader messageLoader)
public MessagesController(MessageRepository messageRepository, MimeMessageLoader messageLoader, ILogger logger)
{
this._messageRepository = messageRepository;
this._messageLoader = messageLoader;
_logger = logger;
}

[HttpGet]
Expand Down Expand Up @@ -74,30 +81,65 @@ public HttpResponseMessage DeleteAll()
this._messageRepository.LoadMessages()
.ForEach(msg =>
{
try
{
this._messageRepository.DeleteMessage(msg);
}
catch
using (LogContext.PushProperty("MessageEntry", msg, true))
{
// ignored
try
{
this._messageRepository.DeleteMessage(msg);
}
catch (Exception ex) when (LogFailure(ex, "Failure Deleting Message"))
{
}
}
});

return this.Request.CreateResponse(HttpStatusCode.OK);
}

[HttpDelete]
public IHttpActionResult DeleteMessage(string id)
{
var msg = this._messageRepository.LoadMessages()
.FirstOrDefault(m => m.Name == id);

if (msg == null)
{
return this.NotFound();
}

using (LogContext.PushProperty("MessageEntry", msg, true))
{
try
{
this._messageRepository.DeleteMessage(msg);
}
catch (Exception ex) when (LogFailure(ex, "Failure Deleting Message"))
{
}
}

return this.Ok();
}

private bool LogFailure(Exception ex, string message)
{
this._logger.Error(ex, message);

return true;
}

[HttpGet]
public async Task<HttpResponseMessage> Get(string id)
public async Task<IHttpActionResult> Get(string id)
{
var messageEntry = this._messageRepository.LoadMessages().FirstOrDefault(msg => msg.Name == id);
if (messageEntry == null)
{
return this.Request.CreateResponse(HttpStatusCode.NotFound);
return this.NotFound();
}

var dto = MimeMessageEntry.DetailDto.CreateFrom(new MimeMessageEntry(messageEntry, await this._messageLoader.GetAsync(messageEntry)));
return this.Request.CreateResponse(HttpStatusCode.OK, dto);

return this.Ok(dto);
}

[HttpGet]
Expand Down
30 changes: 30 additions & 0 deletions src/Papercut.App.WebApi/FodyWeavers.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="IncludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
Expand All @@ -43,6 +53,16 @@
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeRuntimeReferences" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls if runtime assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="UseRuntimeReferencePaths" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls whether the runtime assemblies are embedded with their full path or only with their assembly name.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCompression" type="xs:boolean">
<xs:annotation>
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
Expand Down Expand Up @@ -73,6 +93,16 @@
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExcludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
Expand Down
14 changes: 8 additions & 6 deletions src/Papercut.App.WebApi/Papercut.App.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,25 @@

<ItemGroup>
<PackageReference Include="Autofac">
<Version>4.9.0</Version>
<Version>6.2.0</Version>
</PackageReference>
<PackageReference Include="Autofac.WebApi2">
<Version>4.2.0</Version>
<Version>6.0.1</Version>
</PackageReference>
<PackageReference Include="Costura.Fody">
<Version>4.1.0</Version>
<Version>5.3.0</Version>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.WebApi.OwinSelfHost" Version="5.2.7" />
<PackageReference Include="MimeKit">
<Version>2.5.2</Version>
<Version>2.12.0</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.1</Version>
<Version>13.0.1</Version>
</PackageReference>
<PackageReference Include="Serilog">
<Version>2.8.0</Version>
<Version>2.10.0</Version>
</PackageReference>
<PackageReference Include="Strathweb.CacheOutput.WebApi2">
<Version>0.11.0</Version>
Expand Down
5 changes: 3 additions & 2 deletions src/Papercut.App.WebApi/PapercutWebApiModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ namespace Papercut.App.WebApi
using Autofac;
using Autofac.Integration.WebApi;

using Papercut.Core.Domain.WebServer;

public class PapercutWebApiModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder.RegisterType<WebServer>()
.AsImplementedInterfaces()
builder.RegisterType<PapercutWebServer>().As<IPapercutWebServer>()
.SingleInstance();

builder.RegisterApiControllers(this.ThisAssembly);
Expand Down
7 changes: 6 additions & 1 deletion src/Papercut.App.WebApi/RouteConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public static void Init(HttpConfiguration config, ILifetimeScope scope)
new { controller = "Messages", action = "DeleteAll" },
new { HttpMethod = new HttpMethodConstraint(HttpMethod.Delete) });

config.Routes.MapHttpRoute("delete message",
"api/messages/{id}",
new {controller = "Messages", action = "DeleteMessage"},
new {HttpMethod = new HttpMethodConstraint(HttpMethod.Delete)});

config.Routes.MapHttpRoute("load message detail",
"api/messages/{id}",
new {controller = "Messages", action = "Get"});
Expand All @@ -54,7 +59,7 @@ public static void Init(HttpConfiguration config, ILifetimeScope scope)
"api/messages/{messageId}/sections/{index}",
new {controller = "Messages", action = "DownloadSection" });

config.Routes.MapHttpRoute("download raw message palyload",
config.Routes.MapHttpRoute("download raw message payload",
"api/messages/{messageId}/raw",
new { controller = "Messages", action = "DownloadRaw" });

Expand Down
Loading

0 comments on commit b51880d

Please sign in to comment.