diff --git a/docs/api/toc.json b/docs/api/toc.json
index 08e321a..70ecc1b 100644
--- a/docs/api/toc.json
+++ b/docs/api/toc.json
@@ -1,2 +1,2 @@
-{"items":[{"name":"Microsoft.Extensions.Hosting","href":"Microsoft.Extensions.Hosting.html","topicHref":"Microsoft.Extensions.Hosting.html","topicUid":"Microsoft.Extensions.Hosting","items":[{"name":"Extensions","href":"Microsoft.Extensions.Hosting.Extensions.html","topicHref":"Microsoft.Extensions.Hosting.Extensions.html","topicUid":"Microsoft.Extensions.Hosting.Extensions"}]},{"name":"Projects","href":"Projects.html","topicHref":"Projects.html","topicUid":"Projects","items":[{"name":"wan24_AutoDiscover","href":"Projects.wan24_AutoDiscover.html","topicHref":"Projects.wan24_AutoDiscover.html","topicUid":"Projects.wan24_AutoDiscover"}]},{"name":"wan24.AutoDiscover","href":"wan24.AutoDiscover.html","topicHref":"wan24.AutoDiscover.html","topicUid":"wan24.AutoDiscover","items":[{"name":"Constants","href":"wan24.AutoDiscover.Constants.html","topicHref":"wan24.AutoDiscover.Constants.html","topicUid":"wan24.AutoDiscover.Constants"},{"name":"VersionInfo","href":"wan24.AutoDiscover.VersionInfo.html","topicHref":"wan24.AutoDiscover.VersionInfo.html","topicUid":"wan24.AutoDiscover.VersionInfo"},{"name":"XmlResponse","href":"wan24.AutoDiscover.XmlResponse.html","topicHref":"wan24.AutoDiscover.XmlResponse.html","topicUid":"wan24.AutoDiscover.XmlResponse"}]},{"name":"wan24.AutoDiscover.Controllers","href":"wan24.AutoDiscover.Controllers.html","topicHref":"wan24.AutoDiscover.Controllers.html","topicUid":"wan24.AutoDiscover.Controllers","items":[{"name":"DiscoveryController","href":"wan24.AutoDiscover.Controllers.DiscoveryController.html","topicHref":"wan24.AutoDiscover.Controllers.DiscoveryController.html","topicUid":"wan24.AutoDiscover.Controllers.DiscoveryController"}]},{"name":"wan24.AutoDiscover.Models","href":"wan24.AutoDiscover.Models.html","topicHref":"wan24.AutoDiscover.Models.html","topicUid":"wan24.AutoDiscover.Models","items":[{"name":"DiscoveryConfig","href":"wan24.AutoDiscover.Models.DiscoveryConfig.html","topicHref":"wan24.AutoDiscover.Models.DiscoveryConfig.html","topicUid":"wan24.AutoDiscover.Models.DiscoveryConfig"},{"name":"DomainConfig","href":"wan24.AutoDiscover.Models.DomainConfig.html","topicHref":"wan24.AutoDiscover.Models.DomainConfig.html","topicUid":"wan24.AutoDiscover.Models.DomainConfig"},{"name":"EmailMapping","href":"wan24.AutoDiscover.Models.EmailMapping.html","topicHref":"wan24.AutoDiscover.Models.EmailMapping.html","topicUid":"wan24.AutoDiscover.Models.EmailMapping"},{"name":"Protocol","href":"wan24.AutoDiscover.Models.Protocol.html","topicHref":"wan24.AutoDiscover.Models.Protocol.html","topicUid":"wan24.AutoDiscover.Models.Protocol"},{"name":"Protocol.LoginName_Delegate","href":"wan24.AutoDiscover.Models.Protocol.LoginName_Delegate.html","topicHref":"wan24.AutoDiscover.Models.Protocol.LoginName_Delegate.html","topicUid":"wan24.AutoDiscover.Models.Protocol.LoginName_Delegate"}]},{"name":"wan24.AutoDiscover.Services","href":"wan24.AutoDiscover.Services.html","topicHref":"wan24.AutoDiscover.Services.html","topicUid":"wan24.AutoDiscover.Services","items":[{"name":"CommandLineInterface","href":"wan24.AutoDiscover.Services.CommandLineInterface.html","topicHref":"wan24.AutoDiscover.Services.CommandLineInterface.html","topicUid":"wan24.AutoDiscover.Services.CommandLineInterface"},{"name":"ExceptionHandler","href":"wan24.AutoDiscover.Services.ExceptionHandler.html","topicHref":"wan24.AutoDiscover.Services.ExceptionHandler.html","topicUid":"wan24.AutoDiscover.Services.ExceptionHandler"}]}],"memberLayout":"SamePage"}
+{"items":[{"name":"wan24.AutoDiscover","href":"wan24.AutoDiscover.html","topicHref":"wan24.AutoDiscover.html","topicUid":"wan24.AutoDiscover","items":[{"name":"Constants","href":"wan24.AutoDiscover.Constants.html","topicHref":"wan24.AutoDiscover.Constants.html","topicUid":"wan24.AutoDiscover.Constants"},{"name":"VersionInfo","href":"wan24.AutoDiscover.VersionInfo.html","topicHref":"wan24.AutoDiscover.VersionInfo.html","topicUid":"wan24.AutoDiscover.VersionInfo"},{"name":"XmlResponse","href":"wan24.AutoDiscover.XmlResponse.html","topicHref":"wan24.AutoDiscover.XmlResponse.html","topicUid":"wan24.AutoDiscover.XmlResponse"}]},{"name":"wan24.AutoDiscover.Controllers","href":"wan24.AutoDiscover.Controllers.html","topicHref":"wan24.AutoDiscover.Controllers.html","topicUid":"wan24.AutoDiscover.Controllers","items":[{"name":"DiscoveryController","href":"wan24.AutoDiscover.Controllers.DiscoveryController.html","topicHref":"wan24.AutoDiscover.Controllers.DiscoveryController.html","topicUid":"wan24.AutoDiscover.Controllers.DiscoveryController"}]},{"name":"wan24.AutoDiscover.Models","href":"wan24.AutoDiscover.Models.html","topicHref":"wan24.AutoDiscover.Models.html","topicUid":"wan24.AutoDiscover.Models","items":[{"name":"DiscoveryConfig","href":"wan24.AutoDiscover.Models.DiscoveryConfig.html","topicHref":"wan24.AutoDiscover.Models.DiscoveryConfig.html","topicUid":"wan24.AutoDiscover.Models.DiscoveryConfig"},{"name":"DomainConfig","href":"wan24.AutoDiscover.Models.DomainConfig.html","topicHref":"wan24.AutoDiscover.Models.DomainConfig.html","topicUid":"wan24.AutoDiscover.Models.DomainConfig"},{"name":"EmailMapping","href":"wan24.AutoDiscover.Models.EmailMapping.html","topicHref":"wan24.AutoDiscover.Models.EmailMapping.html","topicUid":"wan24.AutoDiscover.Models.EmailMapping"},{"name":"Protocol","href":"wan24.AutoDiscover.Models.Protocol.html","topicHref":"wan24.AutoDiscover.Models.Protocol.html","topicUid":"wan24.AutoDiscover.Models.Protocol"},{"name":"Protocol.LoginName_Delegate","href":"wan24.AutoDiscover.Models.Protocol.LoginName_Delegate.html","topicHref":"wan24.AutoDiscover.Models.Protocol.LoginName_Delegate.html","topicUid":"wan24.AutoDiscover.Models.Protocol.LoginName_Delegate"}]},{"name":"wan24.AutoDiscover.Services","href":"wan24.AutoDiscover.Services.html","topicHref":"wan24.AutoDiscover.Services.html","topicUid":"wan24.AutoDiscover.Services","items":[{"name":"CommandLineInterface","href":"wan24.AutoDiscover.Services.CommandLineInterface.html","topicHref":"wan24.AutoDiscover.Services.CommandLineInterface.html","topicUid":"wan24.AutoDiscover.Services.CommandLineInterface"},{"name":"ExceptionHandler","href":"wan24.AutoDiscover.Services.ExceptionHandler.html","topicHref":"wan24.AutoDiscover.Services.ExceptionHandler.html","topicUid":"wan24.AutoDiscover.Services.ExceptionHandler"}]}],"memberLayout":"SamePage"}
diff --git a/docs/api/wan24.AutoDiscover.Services.CommandLineInterface.html b/docs/api/wan24.AutoDiscover.Services.CommandLineInterface.html
index 7d70486..c7109cc 100644
--- a/docs/api/wan24.AutoDiscover.Services.CommandLineInterface.html
+++ b/docs/api/wan24.AutoDiscover.Services.CommandLineInterface.html
@@ -267,7 +267,7 @@ Returns
Edit this page
- View Source
+ View Source
PostUpgradeAsync(string, string, CancellationToken)
diff --git a/docs/api/wan24.AutoDiscover.XmlResponse.html b/docs/api/wan24.AutoDiscover.XmlResponse.html
index 5e4f821..c69ff13 100644
--- a/docs/api/wan24.AutoDiscover.XmlResponse.html
+++ b/docs/api/wan24.AutoDiscover.XmlResponse.html
@@ -140,6 +140,18 @@ Inherited Members
+
+
+
+
@@ -170,6 +182,9 @@ Inherited Members
DisposableBase.CreateStackInfo
+
+ DisposableBase.DestructorDisposing
+
DisposableBase.IsDisposing
diff --git a/docs/index.html b/docs/index.html
index ffc31cf..20042a8 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -111,9 +111,9 @@ How to get it
For example on a Debian Linux server:
mkdir /home/autodiscover
cd /home/autodiscover
-wget https://github.com/nd1012/wan24-AutoDiscover/releases/download/v1.1.0/wan24-AutoDiscover.v1.1.0.zip
-unzip wan24-AutoDiscover.v1.1.0.zip
-rm wan24-AutoDiscover.v1.1.0.zip
+wget https://github.com/nd1012/wan24-AutoDiscover/releases/download/v1.2.0/wan24-AutoDiscover.v1.2.0.zip
+unzip wan24-AutoDiscover.v1.2.0.zip
+rm wan24-AutoDiscover.v1.2.0.zip
appsettings.json
The appsettings.json
file contains the webservice configuration. The
diff --git a/docs/index.json b/docs/index.json
index 3aee16a..8d7d0dc 100644
--- a/docs/index.json
+++ b/docs/index.json
@@ -1,24 +1,4 @@
{
- "api/Microsoft.Extensions.Hosting.Extensions.html": {
- "href": "api/Microsoft.Extensions.Hosting.Extensions.html",
- "title": "Class Extensions | wan24-AutoDiscover",
- "keywords": "Class Extensions Inheritance object Extensions Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Namespace: Microsoft.Extensions.Hosting Assembly: wan24-AutoDiscover.ServiceDefaults.dll Syntax public static class Extensions Methods | Edit this page View Source AddDefaultHealthChecks(IHostApplicationBuilder) Declaration public static IHostApplicationBuilder AddDefaultHealthChecks(this IHostApplicationBuilder builder) Parameters Type Name Description IHostApplicationBuilder builder Returns Type Description IHostApplicationBuilder | Edit this page View Source AddServiceDefaults(IHostApplicationBuilder) Declaration public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder) Parameters Type Name Description IHostApplicationBuilder builder Returns Type Description IHostApplicationBuilder | Edit this page View Source ConfigureOpenTelemetry(IHostApplicationBuilder) Declaration public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicationBuilder builder) Parameters Type Name Description IHostApplicationBuilder builder Returns Type Description IHostApplicationBuilder | Edit this page View Source MapDefaultEndpoints(WebApplication) Declaration public static WebApplication MapDefaultEndpoints(this WebApplication app) Parameters Type Name Description WebApplication app Returns Type Description WebApplication"
- },
- "api/Microsoft.Extensions.Hosting.html": {
- "href": "api/Microsoft.Extensions.Hosting.html",
- "title": "Namespace Microsoft.Extensions.Hosting | wan24-AutoDiscover",
- "keywords": "Namespace Microsoft.Extensions.Hosting Classes Extensions"
- },
- "api/Projects.html": {
- "href": "api/Projects.html",
- "title": "Namespace Projects | wan24-AutoDiscover",
- "keywords": "Namespace Projects Classes wan24_AutoDiscover"
- },
- "api/Projects.wan24_AutoDiscover.html": {
- "href": "api/Projects.wan24_AutoDiscover.html",
- "title": "Class wan24_AutoDiscover | wan24-AutoDiscover",
- "keywords": "Class wan24_AutoDiscover Inheritance object wan24_AutoDiscover Implements IProjectMetadata IResourceAnnotation Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Namespace: Projects Assembly: wan24-AutoDiscover.AppHost.dll Syntax public class wan24_AutoDiscover : IProjectMetadata, IResourceAnnotation Properties | Edit this page View Source ProjectPath Gets the fully-qualified path to the project. Declaration public string ProjectPath { get; } Property Value Type Description string Implements Aspire.Hosting.IProjectMetadata Aspire.Hosting.ApplicationModel.IResourceAnnotation"
- },
"api/index.html": {
"href": "api/index.html",
"title": "API reference | wan24-AutoDiscover",
@@ -92,7 +72,7 @@
"api/wan24.AutoDiscover.XmlResponse.html": {
"href": "api/wan24.AutoDiscover.XmlResponse.html",
"title": "Class XmlResponse | wan24-AutoDiscover",
- "keywords": "Class XmlResponse XML response Inheritance object DisposableBase XmlResponse Implements IWillDispose IDisposableObject IDisposable IAsyncDisposable Inherited Members DisposableBase.DisposeSyncObject DisposableBase.AsyncDisposing DisposableBase.AllowFinalizer DisposableBase.DisposeObjects DisposableBase.StackInfo DisposableBase.RegisterForDispose(in T) DisposableBase.EnsureUndisposed(in bool, in bool) DisposableBase.IfUndisposed(in T, in bool) DisposableBase.IfUndisposed(in Action, in bool) DisposableBase.IfUndisposed(in Func, in bool) DisposableBase.IfUndisposedNullable(in Func, in bool) DisposableBase.DisposeCore() DisposableBase.DisposeAttributes() DisposableBase.DisposeAttributesAsync() DisposableBase.Dispose() DisposableBase.DisposeAsync() DisposableBase.CreateStackInfo DisposableBase.IsDisposing DisposableBase.IsDisposed DisposableBase.OnDisposing DisposableBase.OnDisposed object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Namespace: wan24.AutoDiscover Assembly: wan24AutoDiscover.dll Syntax public class XmlResponse : DisposableBase, IWillDispose, IDisposableObject, IDisposable, IAsyncDisposable Constructors | Edit this page View Source XmlResponse() Constructor Declaration public XmlResponse() Properties | Edit this page View Source XML XML Declaration public XmlWriter XML { get; } Property Value Type Description XmlWriter | Edit this page View Source XmlOutput XML output Declaration public BlockingBufferStream XmlOutput { get; } Property Value Type Description BlockingBufferStream Methods | Edit this page View Source Dispose(bool) Dispose Declaration protected override void Dispose(bool disposing) Parameters Type Name Description bool disposing Disposing? (may be false, if called from the destructor) Overrides DisposableBase.Dispose(bool) | Edit this page View Source FinalizeXmlOutput() Finalize Declaration public virtual void FinalizeXmlOutput() Implements wan24.Core.IWillDispose wan24.Core.IDisposableObject IDisposable IAsyncDisposable"
+ "keywords": "Class XmlResponse XML response Inheritance object DisposableBase XmlResponse Implements IWillDispose IDisposableObject IDisposable IAsyncDisposable Inherited Members DisposableBase.DisposeSyncObject DisposableBase.AsyncDisposing DisposableBase.AllowFinalizer DisposableBase.DisposeObjects DisposableBase.StackInfo DisposableBase.RegisterForDispose(in T) DisposableBase.EnsureUndisposed(in bool, in bool) DisposableBase.LockDisposing(in TimeSpan, in CancellationToken) DisposableBase.LockDisposingAsync(TimeSpan, CancellationToken) DisposableBase.TryLockDisposing(out SemaphoreSyncContext, in TimeSpan, in CancellationToken) DisposableBase.TryLockDisposingAsync(TimeSpan, CancellationToken) DisposableBase.IfUndisposed(in T, in bool) DisposableBase.IfUndisposed(in Action, in bool) DisposableBase.IfUndisposed(in Func, in bool) DisposableBase.IfUndisposedNullable(in Func, in bool) DisposableBase.DisposeCore() DisposableBase.DisposeAttributes() DisposableBase.DisposeAttributesAsync() DisposableBase.Dispose() DisposableBase.DisposeAsync() DisposableBase.CreateStackInfo DisposableBase.DestructorDisposing DisposableBase.IsDisposing DisposableBase.IsDisposed DisposableBase.OnDisposing DisposableBase.OnDisposed object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Namespace: wan24.AutoDiscover Assembly: wan24AutoDiscover.dll Syntax public class XmlResponse : DisposableBase, IWillDispose, IDisposableObject, IDisposable, IAsyncDisposable Constructors | Edit this page View Source XmlResponse() Constructor Declaration public XmlResponse() Properties | Edit this page View Source XML XML Declaration public XmlWriter XML { get; } Property Value Type Description XmlWriter | Edit this page View Source XmlOutput XML output Declaration public BlockingBufferStream XmlOutput { get; } Property Value Type Description BlockingBufferStream Methods | Edit this page View Source Dispose(bool) Dispose Declaration protected override void Dispose(bool disposing) Parameters Type Name Description bool disposing Disposing? (may be false, if called from the destructor) Overrides DisposableBase.Dispose(bool) | Edit this page View Source FinalizeXmlOutput() Finalize Declaration public virtual void FinalizeXmlOutput() Implements wan24.Core.IWillDispose wan24.Core.IDisposableObject IDisposable IAsyncDisposable"
},
"api/wan24.AutoDiscover.html": {
"href": "api/wan24.AutoDiscover.html",
@@ -107,6 +87,6 @@
"index.html": {
"href": "index.html",
"title": "wan24-AutoDiscover | wan24-AutoDiscover",
- "keywords": "wan24-AutoDiscover This is a micro-webservice which supports a small part of the Microsoft Exchange POX autodiscover standard, which allows email clients to receive automatic configuration information for an email account. It was created using .NET 8 and ASP.NET. You find a published release build for each published release on GitHub as ZIP file download for self-hosting. The webservice is designed for working with dynamic MTA configurations and tries to concentrate on the basics for fast request handling and response. All required informations will be held in memory, so no database or filesystem access is required for request handling. Usage Pre-requirements This app is a .NET 8 app and needs the ASP.NET runtime environment. How to get it For example on a Debian Linux server: mkdir /home/autodiscover cd /home/autodiscover wget https://github.com/nd1012/wan24-AutoDiscover/releases/download/v1.1.0/wan24-AutoDiscover.v1.1.0.zip unzip wan24-AutoDiscover.v1.1.0.zip rm wan24-AutoDiscover.v1.1.0.zip appsettings.json The appsettings.json file contains the webservice configuration. The DiscoveryConfig is a wan24.AutoDiscovery.Models.DiscoveryConfig object. An example: { \"Logging\": { \"LogLevel\": { \"Default\": \"Information\", \"Microsoft.AspNetCore\": \"Warning\" } }, \"Kestrel\": { \"Endpoints\": { \"AutoDiscover\": { \"Url\": \"http://127.0.0.1:5000\" } } }, \"AllowedHosts\": \"*\", \"DiscoveryConfig\": { \"PreForkResponses\": 10, \"KnownProxies\": [ \"127.0.0.1\" ], \"Discovery\": { \"localhost\": { \"AcceptedDomains\": [ \"wan24.de\", \"wan-solutions.de\" ], \"Protocols\": [ { \"Type\": \"IMAP\", \"Server\": \"imap.wan24.de\", \"Port\": 993 }, { \"Type\": \"SMTP\", \"Server\": \"smtp.wan24.de\", \"Port\": 587 } ] } } } } Since the webservice should only listen local and be proxied by a real webserver (like Apache2), there is a wan24.AutoDiscover.Models.DomainConfig for localhost, which produces POX response for the allowed domains wan24.de and wan-solutions.de in this example (you should use your own domain names instead). The email client configuration will get an IMAP and a SMTP server pre- configuration, which contains the alias of the requested email address as login name and has all the other defaults from a wan24.AutoDiscover.Models.Protocol instance. With the PreForkResponses value you can define a number of pre-forked POX response XML documents to serve faster responses. Any change to this file will cause an automatic reload of the DomainConfig section. For serving a request, the DomainConfig will be looked up by the email address domain part by the served request hostname by any DomainConfig which has the email address domain part in the AcceptedDomains property, which contains a list of accepted domain names by the DomainConfig with an empty domain name as key Any unmatched DomainConfig will cause a Bad request http response. Find the online documentation of the used types here: DiscoveryConfig DomainConfig Protocol Run as systemd service On a Debian Linux host you can run the wan24-AutoDiscover microservice using systemd: dotnet wan24AutoDiscover.dll autodiscover systemd > /etc/systemd/system/autodiscover.service systemctl enable autodiscover systemctl start autodiscover systemctl status autodiscover Apache2 proxy setup Create the file /etc/apache2/sites-available/autodiscover.conf: ServerName [DOMAIN] SSLEngine on SSLCertificateFile /path/to/fullchain.pem SSLCertificateKeyFile /path/to/privkey.pem ProxyPreserveHost On ProxyPass / http://127.0.0.1:5000/ ProxyPassReverse / http://127.0.0.1:5000/ Replace [IP] with your servers public IP address and [DOMAIN] with your domain name which you'd like to use for serving autodiscover. Then activate the proxy: a2enmod proxy a2ensite autodiscover systemctl restart apache2 POX request and response This is an example POX request to /autodiscover/autodiscover.xml: alias@wan24.de https://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a The response with the demo appsettings.json: email settings IMAP imap.wan24.de 993 alias off on on SMTP smtp.wan24.de 587 alias off on on Required DNS configuration In order to make autodiscover working in an email client, you'll need to create a SRV record for your email domain - example: _autodiscover._tcp 1D IN SRV 0 0 443 [MTA-DOMAIN]. The domain wan24.de uses this record, for example: _autodiscover._tcp 1D IN SRV 0 0 443 mail.wan24.de. CLI API The wan24-AutoDiscover has a small built in CLI API, which can do some things for you: Create a systemd service file dotnet wan24AutoDiscover.dll autodiscover systemd > /etc/systemd/system/autodiscover.service Parse a Postfix virtual configuration file dotnet wan24AutoDiscover.dll autodiscover postfix < /etc/postfix/virtual > /home/autodiscover/postfix.json Display version number dotnet wan24AutoDiscover.dll autodiscover version Upgrade online Check for an available newer version only: dotnet wan24AutoDiscover.dll autodiscover upgrade -checkOnly NOTE: The command will exit with code #2, if an update is available online. Upgrade with user interaction: dotnet wan24AutoDiscover.dll autodiscover upgrade Upgrade without user interaction: dotnet wan24AutoDiscover.dll autodiscover upgrade -noUserInteraction Display detailed CLI API usage instructions dotnet wan24AutoDiscover.dll help -details Login name mapping If the login name isn't the email address or the alias of the given email address, you can create a login name mapping per domain and/or protocol, by defining a mapping from the email address or alias to the login name. During lookup the protocol mapping and then the domain mapping will be used by trying the email address and then the alias as key. Automatic email address to login user mapping with Postfix If your Postfix virtual email mappings are stored in a hash text file, you can create an email mapping from is using dotnet wan24AutoDiscover.dll autodiscover postfix < /etc/postfix/virtual > /home/autodiscover/postfix.json Then you can add the postix.json to your appsettings.json: { ... \"DiscoveryConfig\": { ... \"EmailMappings\": \"/home/autodiscover/postfix.json\", ... } } The configuration will be reloaded, if the postfix.json file changed, so be sure to re-create the postfix.json file as soon as the virtual file was changed. If you don't want that, set WatchEmailMappings to false. Additionally watched files You can set a list of additionally watched file paths to WatchFiles in your appsettings.json file. When any file was changed, the configuration will be reloaded. Pre-reload command execution To execute a command before reloading a changed configration, set the PreReloadCommand value in your appsettings.json like this: { ... \"DiscoveryConfig\": { ... \"PreReloadCommand\": [\"/command/to/execute\", \"argument1\", \"argument2\", ...], ... } } Automatic online upgrades You can upgrade wan24-AutoDiscover online and automatic. For this some steps are recommended: Create sheduled task for auto-upgrade (daily, for example) Stop the service before installing the newer version Start the service after installing the newer version The sheduled auto-upgrade task should execute this command on a Debian Linux server, for example: dotnet /home/autodiscover/wan24AutoDiscover.dll autodiscover upgrade -noUserInteraction --preCommand systemctl stop autodiscover --postCommand systemctl start autodiscover If the upgrade download failed, nothing will happen - the upgrade won't be installed only and being re-tried at the next sheduled auto-upgrade time. If the upgrade installation failed, the post-upgrade command won't be executed, and the autodiscover service won't run. This'll give you the chance to investigate the broken upgrade and optional restore the running version manually. CAUTION: The auto-upgrade is being performed using the GitHub repository. There are no security checks at present - so if the repository was hacked, you could end up with upgrading to a compromised software which could harm your system! The upgrade setup should be done in less than a second, if everything was fine. Manual upgrade Download the latest release ZIP file from GitHub Extract the ZIP file to a temporary folder Stop the autodiscover service, if running Create a backup of your current installation Copy all extracted files/folders excluding appsettings.json to your installation folder Remove files/folders that are no longer required and perform additional upgrade steps, which are required for the new release (see upgrade instructions) Start the autodiscover service Delete the previously created backup and the temporary folder These steps are being executed during an automatic upgrade like described above also."
+ "keywords": "wan24-AutoDiscover This is a micro-webservice which supports a small part of the Microsoft Exchange POX autodiscover standard, which allows email clients to receive automatic configuration information for an email account. It was created using .NET 8 and ASP.NET. You find a published release build for each published release on GitHub as ZIP file download for self-hosting. The webservice is designed for working with dynamic MTA configurations and tries to concentrate on the basics for fast request handling and response. All required informations will be held in memory, so no database or filesystem access is required for request handling. Usage Pre-requirements This app is a .NET 8 app and needs the ASP.NET runtime environment. How to get it For example on a Debian Linux server: mkdir /home/autodiscover cd /home/autodiscover wget https://github.com/nd1012/wan24-AutoDiscover/releases/download/v1.2.0/wan24-AutoDiscover.v1.2.0.zip unzip wan24-AutoDiscover.v1.2.0.zip rm wan24-AutoDiscover.v1.2.0.zip appsettings.json The appsettings.json file contains the webservice configuration. The DiscoveryConfig is a wan24.AutoDiscovery.Models.DiscoveryConfig object. An example: { \"Logging\": { \"LogLevel\": { \"Default\": \"Information\", \"Microsoft.AspNetCore\": \"Warning\" } }, \"Kestrel\": { \"Endpoints\": { \"AutoDiscover\": { \"Url\": \"http://127.0.0.1:5000\" } } }, \"AllowedHosts\": \"*\", \"DiscoveryConfig\": { \"PreForkResponses\": 10, \"KnownProxies\": [ \"127.0.0.1\" ], \"Discovery\": { \"localhost\": { \"AcceptedDomains\": [ \"wan24.de\", \"wan-solutions.de\" ], \"Protocols\": [ { \"Type\": \"IMAP\", \"Server\": \"imap.wan24.de\", \"Port\": 993 }, { \"Type\": \"SMTP\", \"Server\": \"smtp.wan24.de\", \"Port\": 587 } ] } } } } Since the webservice should only listen local and be proxied by a real webserver (like Apache2), there is a wan24.AutoDiscover.Models.DomainConfig for localhost, which produces POX response for the allowed domains wan24.de and wan-solutions.de in this example (you should use your own domain names instead). The email client configuration will get an IMAP and a SMTP server pre- configuration, which contains the alias of the requested email address as login name and has all the other defaults from a wan24.AutoDiscover.Models.Protocol instance. With the PreForkResponses value you can define a number of pre-forked POX response XML documents to serve faster responses. Any change to this file will cause an automatic reload of the DomainConfig section. For serving a request, the DomainConfig will be looked up by the email address domain part by the served request hostname by any DomainConfig which has the email address domain part in the AcceptedDomains property, which contains a list of accepted domain names by the DomainConfig with an empty domain name as key Any unmatched DomainConfig will cause a Bad request http response. Find the online documentation of the used types here: DiscoveryConfig DomainConfig Protocol Run as systemd service On a Debian Linux host you can run the wan24-AutoDiscover microservice using systemd: dotnet wan24AutoDiscover.dll autodiscover systemd > /etc/systemd/system/autodiscover.service systemctl enable autodiscover systemctl start autodiscover systemctl status autodiscover Apache2 proxy setup Create the file /etc/apache2/sites-available/autodiscover.conf: ServerName [DOMAIN] SSLEngine on SSLCertificateFile /path/to/fullchain.pem SSLCertificateKeyFile /path/to/privkey.pem ProxyPreserveHost On ProxyPass / http://127.0.0.1:5000/ ProxyPassReverse / http://127.0.0.1:5000/ Replace [IP] with your servers public IP address and [DOMAIN] with your domain name which you'd like to use for serving autodiscover. Then activate the proxy: a2enmod proxy a2ensite autodiscover systemctl restart apache2 POX request and response This is an example POX request to /autodiscover/autodiscover.xml: alias@wan24.de https://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a The response with the demo appsettings.json: email settings IMAP imap.wan24.de 993 alias off on on SMTP smtp.wan24.de 587 alias off on on Required DNS configuration In order to make autodiscover working in an email client, you'll need to create a SRV record for your email domain - example: _autodiscover._tcp 1D IN SRV 0 0 443 [MTA-DOMAIN]. The domain wan24.de uses this record, for example: _autodiscover._tcp 1D IN SRV 0 0 443 mail.wan24.de. CLI API The wan24-AutoDiscover has a small built in CLI API, which can do some things for you: Create a systemd service file dotnet wan24AutoDiscover.dll autodiscover systemd > /etc/systemd/system/autodiscover.service Parse a Postfix virtual configuration file dotnet wan24AutoDiscover.dll autodiscover postfix < /etc/postfix/virtual > /home/autodiscover/postfix.json Display version number dotnet wan24AutoDiscover.dll autodiscover version Upgrade online Check for an available newer version only: dotnet wan24AutoDiscover.dll autodiscover upgrade -checkOnly NOTE: The command will exit with code #2, if an update is available online. Upgrade with user interaction: dotnet wan24AutoDiscover.dll autodiscover upgrade Upgrade without user interaction: dotnet wan24AutoDiscover.dll autodiscover upgrade -noUserInteraction Display detailed CLI API usage instructions dotnet wan24AutoDiscover.dll help -details Login name mapping If the login name isn't the email address or the alias of the given email address, you can create a login name mapping per domain and/or protocol, by defining a mapping from the email address or alias to the login name. During lookup the protocol mapping and then the domain mapping will be used by trying the email address and then the alias as key. Automatic email address to login user mapping with Postfix If your Postfix virtual email mappings are stored in a hash text file, you can create an email mapping from is using dotnet wan24AutoDiscover.dll autodiscover postfix < /etc/postfix/virtual > /home/autodiscover/postfix.json Then you can add the postix.json to your appsettings.json: { ... \"DiscoveryConfig\": { ... \"EmailMappings\": \"/home/autodiscover/postfix.json\", ... } } The configuration will be reloaded, if the postfix.json file changed, so be sure to re-create the postfix.json file as soon as the virtual file was changed. If you don't want that, set WatchEmailMappings to false. Additionally watched files You can set a list of additionally watched file paths to WatchFiles in your appsettings.json file. When any file was changed, the configuration will be reloaded. Pre-reload command execution To execute a command before reloading a changed configration, set the PreReloadCommand value in your appsettings.json like this: { ... \"DiscoveryConfig\": { ... \"PreReloadCommand\": [\"/command/to/execute\", \"argument1\", \"argument2\", ...], ... } } Automatic online upgrades You can upgrade wan24-AutoDiscover online and automatic. For this some steps are recommended: Create sheduled task for auto-upgrade (daily, for example) Stop the service before installing the newer version Start the service after installing the newer version The sheduled auto-upgrade task should execute this command on a Debian Linux server, for example: dotnet /home/autodiscover/wan24AutoDiscover.dll autodiscover upgrade -noUserInteraction --preCommand systemctl stop autodiscover --postCommand systemctl start autodiscover If the upgrade download failed, nothing will happen - the upgrade won't be installed only and being re-tried at the next sheduled auto-upgrade time. If the upgrade installation failed, the post-upgrade command won't be executed, and the autodiscover service won't run. This'll give you the chance to investigate the broken upgrade and optional restore the running version manually. CAUTION: The auto-upgrade is being performed using the GitHub repository. There are no security checks at present - so if the repository was hacked, you could end up with upgrading to a compromised software which could harm your system! The upgrade setup should be done in less than a second, if everything was fine. Manual upgrade Download the latest release ZIP file from GitHub Extract the ZIP file to a temporary folder Stop the autodiscover service, if running Create a backup of your current installation Copy all extracted files/folders excluding appsettings.json to your installation folder Remove files/folders that are no longer required and perform additional upgrade steps, which are required for the new release (see upgrade instructions) Start the autodiscover service Delete the previously created backup and the temporary folder These steps are being executed during an automatic upgrade like described above also."
}
}
\ No newline at end of file
diff --git a/docs/manifest.json b/docs/manifest.json
index 897df74..bf035b1 100644
--- a/docs/manifest.json
+++ b/docs/manifest.json
@@ -10,46 +10,6 @@
}
}
},
- {
- "type": "ManagedReference",
- "source_relative_path": "api/Microsoft.Extensions.Hosting.Extensions.yml",
- "output": {
- ".html": {
- "relative_path": "api/Microsoft.Extensions.Hosting.Extensions.html"
- }
- },
- "version": ""
- },
- {
- "type": "ManagedReference",
- "source_relative_path": "api/Microsoft.Extensions.Hosting.yml",
- "output": {
- ".html": {
- "relative_path": "api/Microsoft.Extensions.Hosting.html"
- }
- },
- "version": ""
- },
- {
- "type": "ManagedReference",
- "source_relative_path": "api/Projects.wan24_AutoDiscover.yml",
- "output": {
- ".html": {
- "relative_path": "api/Projects.wan24_AutoDiscover.html"
- }
- },
- "version": ""
- },
- {
- "type": "ManagedReference",
- "source_relative_path": "api/Projects.yml",
- "output": {
- ".html": {
- "relative_path": "api/Projects.html"
- }
- },
- "version": ""
- },
{
"type": "Conceptual",
"source_relative_path": "api/index.md",
diff --git a/docs/xrefmap.yml b/docs/xrefmap.yml
index b4f6515..9aaad4c 100644
--- a/docs/xrefmap.yml
+++ b/docs/xrefmap.yml
@@ -1,95 +1,6 @@
### YamlMime:XRefMap
sorted: true
references:
-- uid: Microsoft.Extensions.Hosting
- name: Microsoft.Extensions.Hosting
- href: api/Microsoft.Extensions.Hosting.html
- commentId: N:Microsoft.Extensions.Hosting
- fullName: Microsoft.Extensions.Hosting
- nameWithType: Microsoft.Extensions.Hosting
-- uid: Microsoft.Extensions.Hosting.Extensions
- name: Extensions
- href: api/Microsoft.Extensions.Hosting.Extensions.html
- commentId: T:Microsoft.Extensions.Hosting.Extensions
- fullName: Microsoft.Extensions.Hosting.Extensions
- nameWithType: Extensions
-- uid: Microsoft.Extensions.Hosting.Extensions.AddDefaultHealthChecks(Microsoft.Extensions.Hosting.IHostApplicationBuilder)
- name: AddDefaultHealthChecks(IHostApplicationBuilder)
- href: api/Microsoft.Extensions.Hosting.Extensions.html#Microsoft_Extensions_Hosting_Extensions_AddDefaultHealthChecks_Microsoft_Extensions_Hosting_IHostApplicationBuilder_
- commentId: M:Microsoft.Extensions.Hosting.Extensions.AddDefaultHealthChecks(Microsoft.Extensions.Hosting.IHostApplicationBuilder)
- fullName: Microsoft.Extensions.Hosting.Extensions.AddDefaultHealthChecks(Microsoft.Extensions.Hosting.IHostApplicationBuilder)
- nameWithType: Extensions.AddDefaultHealthChecks(IHostApplicationBuilder)
-- uid: Microsoft.Extensions.Hosting.Extensions.AddDefaultHealthChecks*
- name: AddDefaultHealthChecks
- href: api/Microsoft.Extensions.Hosting.Extensions.html#Microsoft_Extensions_Hosting_Extensions_AddDefaultHealthChecks_
- commentId: Overload:Microsoft.Extensions.Hosting.Extensions.AddDefaultHealthChecks
- isSpec: "True"
- fullName: Microsoft.Extensions.Hosting.Extensions.AddDefaultHealthChecks
- nameWithType: Extensions.AddDefaultHealthChecks
-- uid: Microsoft.Extensions.Hosting.Extensions.AddServiceDefaults(Microsoft.Extensions.Hosting.IHostApplicationBuilder)
- name: AddServiceDefaults(IHostApplicationBuilder)
- href: api/Microsoft.Extensions.Hosting.Extensions.html#Microsoft_Extensions_Hosting_Extensions_AddServiceDefaults_Microsoft_Extensions_Hosting_IHostApplicationBuilder_
- commentId: M:Microsoft.Extensions.Hosting.Extensions.AddServiceDefaults(Microsoft.Extensions.Hosting.IHostApplicationBuilder)
- fullName: Microsoft.Extensions.Hosting.Extensions.AddServiceDefaults(Microsoft.Extensions.Hosting.IHostApplicationBuilder)
- nameWithType: Extensions.AddServiceDefaults(IHostApplicationBuilder)
-- uid: Microsoft.Extensions.Hosting.Extensions.AddServiceDefaults*
- name: AddServiceDefaults
- href: api/Microsoft.Extensions.Hosting.Extensions.html#Microsoft_Extensions_Hosting_Extensions_AddServiceDefaults_
- commentId: Overload:Microsoft.Extensions.Hosting.Extensions.AddServiceDefaults
- isSpec: "True"
- fullName: Microsoft.Extensions.Hosting.Extensions.AddServiceDefaults
- nameWithType: Extensions.AddServiceDefaults
-- uid: Microsoft.Extensions.Hosting.Extensions.ConfigureOpenTelemetry(Microsoft.Extensions.Hosting.IHostApplicationBuilder)
- name: ConfigureOpenTelemetry(IHostApplicationBuilder)
- href: api/Microsoft.Extensions.Hosting.Extensions.html#Microsoft_Extensions_Hosting_Extensions_ConfigureOpenTelemetry_Microsoft_Extensions_Hosting_IHostApplicationBuilder_
- commentId: M:Microsoft.Extensions.Hosting.Extensions.ConfigureOpenTelemetry(Microsoft.Extensions.Hosting.IHostApplicationBuilder)
- fullName: Microsoft.Extensions.Hosting.Extensions.ConfigureOpenTelemetry(Microsoft.Extensions.Hosting.IHostApplicationBuilder)
- nameWithType: Extensions.ConfigureOpenTelemetry(IHostApplicationBuilder)
-- uid: Microsoft.Extensions.Hosting.Extensions.ConfigureOpenTelemetry*
- name: ConfigureOpenTelemetry
- href: api/Microsoft.Extensions.Hosting.Extensions.html#Microsoft_Extensions_Hosting_Extensions_ConfigureOpenTelemetry_
- commentId: Overload:Microsoft.Extensions.Hosting.Extensions.ConfigureOpenTelemetry
- isSpec: "True"
- fullName: Microsoft.Extensions.Hosting.Extensions.ConfigureOpenTelemetry
- nameWithType: Extensions.ConfigureOpenTelemetry
-- uid: Microsoft.Extensions.Hosting.Extensions.MapDefaultEndpoints(Microsoft.AspNetCore.Builder.WebApplication)
- name: MapDefaultEndpoints(WebApplication)
- href: api/Microsoft.Extensions.Hosting.Extensions.html#Microsoft_Extensions_Hosting_Extensions_MapDefaultEndpoints_Microsoft_AspNetCore_Builder_WebApplication_
- commentId: M:Microsoft.Extensions.Hosting.Extensions.MapDefaultEndpoints(Microsoft.AspNetCore.Builder.WebApplication)
- fullName: Microsoft.Extensions.Hosting.Extensions.MapDefaultEndpoints(Microsoft.AspNetCore.Builder.WebApplication)
- nameWithType: Extensions.MapDefaultEndpoints(WebApplication)
-- uid: Microsoft.Extensions.Hosting.Extensions.MapDefaultEndpoints*
- name: MapDefaultEndpoints
- href: api/Microsoft.Extensions.Hosting.Extensions.html#Microsoft_Extensions_Hosting_Extensions_MapDefaultEndpoints_
- commentId: Overload:Microsoft.Extensions.Hosting.Extensions.MapDefaultEndpoints
- isSpec: "True"
- fullName: Microsoft.Extensions.Hosting.Extensions.MapDefaultEndpoints
- nameWithType: Extensions.MapDefaultEndpoints
-- uid: Projects
- name: Projects
- href: api/Projects.html
- commentId: N:Projects
- fullName: Projects
- nameWithType: Projects
-- uid: Projects.wan24_AutoDiscover
- name: wan24_AutoDiscover
- href: api/Projects.wan24_AutoDiscover.html
- commentId: T:Projects.wan24_AutoDiscover
- fullName: Projects.wan24_AutoDiscover
- nameWithType: wan24_AutoDiscover
-- uid: Projects.wan24_AutoDiscover.ProjectPath
- name: ProjectPath
- href: api/Projects.wan24_AutoDiscover.html#Projects_wan24_AutoDiscover_ProjectPath
- commentId: P:Projects.wan24_AutoDiscover.ProjectPath
- fullName: Projects.wan24_AutoDiscover.ProjectPath
- nameWithType: wan24_AutoDiscover.ProjectPath
-- uid: Projects.wan24_AutoDiscover.ProjectPath*
- name: ProjectPath
- href: api/Projects.wan24_AutoDiscover.html#Projects_wan24_AutoDiscover_ProjectPath_
- commentId: Overload:Projects.wan24_AutoDiscover.ProjectPath
- isSpec: "True"
- fullName: Projects.wan24_AutoDiscover.ProjectPath
- nameWithType: wan24_AutoDiscover.ProjectPath
- uid: wan24.AutoDiscover
name: wan24.AutoDiscover
href: api/wan24.AutoDiscover.html
diff --git a/src/wan24-AutoDiscover Docs/index.md b/src/wan24-AutoDiscover Docs/index.md
index aef3198..1c2f31e 100644
--- a/src/wan24-AutoDiscover Docs/index.md
+++ b/src/wan24-AutoDiscover Docs/index.md
@@ -25,9 +25,9 @@ For example on a Debian Linux server:
```bash
mkdir /home/autodiscover
cd /home/autodiscover
-wget https://github.com/nd1012/wan24-AutoDiscover/releases/download/v1.1.0/wan24-AutoDiscover.v1.1.0.zip
-unzip wan24-AutoDiscover.v1.1.0.zip
-rm wan24-AutoDiscover.v1.1.0.zip
+wget https://github.com/nd1012/wan24-AutoDiscover/releases/download/v1.2.0/wan24-AutoDiscover.v1.2.0.zip
+unzip wan24-AutoDiscover.v1.2.0.zip
+rm wan24-AutoDiscover.v1.2.0.zip
```
### `appsettings.json`