-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from ChangemakerStudios/develop
Latest
- Loading branch information
Showing
42 changed files
with
326 additions
and
219 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
![Papercut Logo](https://raw.githubusercontent.com/ChangemakerStudios/Papercut/develop/graphics/PapercutLogo.png)<br> | ||
![Papercut Logo](https://raw.githubusercontent.com/ChangemakerStudios/Papercut/develop/graphics/PapercutLogo.png) | ||
The Simple SMTP Desktop Email Receiver | ||
|
||
<br> | ||
[![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) | ||
|
||
|
||
##What it does | ||
## What it does | ||
Ever need to test emails from an application or web site but don't want them accidently being sent or having to deal with the hassle of setting up a test email server? Papercut is a quick email viewer with a built-in SMTP server designed to only receive messages. It doesn't enforce any restrictions how you send your email. It allows you to view the whole email-chilada: body, html, headers, attachment down to the naughty raw bits. It can be set to run on startup and sits quietly minimized in the tray giving you a balloon popup when a new message arrives. | ||
|
||
##Download Now | ||
####[ClickOnce](https://papercut.codeplex.com/downloads/get/clickOnce/Papercut.application) | [Releases (zip files)](https://github.com/ChangemakerStudios/Papercut/releases) | ||
## Download Now | ||
#### [ClickOnce](https://papercut.codeplex.com/downloads/get/clickOnce/Papercut.application) | [Releases (zip files)](https://github.com/ChangemakerStudios/Papercut/releases) | ||
|
||
##Features | ||
####Instant Feedback When New Email Arrives | ||
## Features | ||
#### Instant Feedback When New Email Arrives | ||
![Instant Feedback When New Email Arrives](http://www.tinygecko.com/downloads/Papercut-v3.1.0-S2.png) | ||
####Rich and Detailed View of Received Email | ||
#### Rich and Detailed View of Received Email | ||
![Rich and Detailed View of Received Email](http://www.tinygecko.com/images/Papercut/Papercut-Main.png) | ||
####View and Download the Mime Sections of your Email | ||
#### View and Download the Mime Sections of your Email | ||
![View and Download the Mime Sections of your Email](http://www.tinygecko.com/images/Papercut/Papercut-Mime.png) | ||
####In Version 4 the Raw View Returns | ||
#### In Version 4 the Raw View Returns | ||
![In Version 4 the Raw View Returns](http://www.tinygecko.com/images/Papercut/Papercut-Raw.png) | ||
####New in Version 4.4: Logging View | ||
#### New in Version 4.4: Logging View | ||
![In Version 4.4: Logging View](http://www.tinygecko.com/images/Papercut/Papercut-Log.png) | ||
|
||
##Papercut Background Service | ||
## Papercut Background Service | ||
Papercut has an optional "always on" service to receive emails even when the client is not running. It's manually installed by [Downloading the 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 <a href="http://www.apache.org/licenses/LICENSE-2.0"> Apache License, Version 2.0. | ||
## License | ||
Papercut is Licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0). |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
os: Visual Studio 2015 | ||
os: Visual Studio 2017 | ||
|
||
configuration: Release | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
91 changes: 91 additions & 0 deletions
91
src/Papercut.Core/Infrastructure/Logging/RegisterLogger.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// Papercut | ||
// | ||
// Copyright © 2008 - 2012 Ken Robertson | ||
// Copyright © 2013 - 2017 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 | ||
{ | ||
using System; | ||
using System.Diagnostics; | ||
using System.IO; | ||
|
||
using Autofac; | ||
|
||
using Papercut.Common.Domain; | ||
using Papercut.Core.Domain.Application; | ||
|
||
using Serilog; | ||
using Serilog.Debugging; | ||
|
||
public class RegisterLogger | ||
{ | ||
public void Register(ContainerBuilder builder) | ||
{ | ||
builder.Register( | ||
c => | ||
{ | ||
var appMeta = c.Resolve<IAppMeta>(); | ||
|
||
string logFilePath = Path.Combine( | ||
AppDomain.CurrentDomain.BaseDirectory, | ||
"Logs", | ||
$"{appMeta.AppName}.log"); | ||
|
||
LoggerConfiguration logConfiguration = | ||
new LoggerConfiguration() | ||
#if DEBUG | ||
.MinimumLevel.Verbose() | ||
#else | ||
.MinimumLevel.Information() | ||
#endif | ||
.Enrich.With<EnvironmentEnricher>() | ||
.Enrich.WithThreadId() | ||
.Enrich.FromLogContext() | ||
.Enrich.WithProperty("AppName", appMeta.AppName) | ||
.Enrich.WithProperty("AppVersion", appMeta.AppVersion) | ||
.WriteTo.ColoredConsole() | ||
.WriteTo.RollingFile(logFilePath); | ||
|
||
// publish event so additional sinks, enrichers, etc can be added before logger creation is finalized. | ||
try | ||
{ | ||
c.Resolve<IMessageBus>().Publish(new ConfigureLoggerEvent(logConfiguration)); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Debug.WriteLine("Failure Publishing ConfigurationLoggerEvent: " + ex.ToString()); | ||
} | ||
|
||
// support self-logging | ||
SelfLog.Out = Console.Error; | ||
|
||
return logConfiguration; | ||
}) | ||
.AsSelf() | ||
.SingleInstance(); | ||
|
||
builder.Register( | ||
c => | ||
{ | ||
Log.Logger = c.Resolve<LoggerConfiguration>().CreateLogger(); | ||
|
||
return Log.Logger; | ||
}) | ||
.As<ILogger>() | ||
.SingleInstance(); | ||
} | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
src/Papercut.Core/Infrastructure/Plugins/RegisterPlugins.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// Papercut | ||
// | ||
// Copyright © 2008 - 2012 Ken Robertson | ||
// Copyright © 2013 - 2017 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.Plugins | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
|
||
using Autofac; | ||
|
||
using Papercut.Common.Extensions; | ||
|
||
using Serilog; | ||
|
||
public class RegisterPlugins | ||
{ | ||
private readonly ILogger _logger; | ||
|
||
public RegisterPlugins(ILogger logger) | ||
{ | ||
this._logger = logger.ForContext<RegisterPlugins>(); | ||
} | ||
|
||
public void Register(ContainerBuilder builder, IEnumerable<Assembly> scannableAssemblies) | ||
{ | ||
var pluginModules = | ||
scannableAssemblies.IfNullEmpty() | ||
.SelectMany(a => a.GetExportedTypes()) | ||
.Where( | ||
s => | ||
{ | ||
var interfaces = s.GetInterfaces(); | ||
return interfaces.Contains(typeof(IDiscoverableModule)) || interfaces.Contains(typeof(IPluginModule)); | ||
}) | ||
.Distinct() | ||
.ToList(); | ||
|
||
foreach (var pluginType in pluginModules) | ||
{ | ||
try | ||
{ | ||
// register and load... | ||
var module = Activator.CreateInstance(pluginType) as IDiscoverableModule; | ||
|
||
if (module != null) | ||
{ | ||
builder.RegisterModule(module.Module); | ||
} | ||
|
||
var plugin = module as IPluginModule; | ||
if (plugin != null) | ||
{ | ||
PluginStore.Instance.Add(plugin); | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
_logger.Error(ex, "Failure Loading Plugin Module Type {PluginModuleType}", pluginType.FullName); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.