mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-05-19 05:47:43 -04:00
26 lines
1020 B
C#
26 lines
1020 B
C#
//-----------------------------------------------------------------------
|
|
// <copyright file="SmtpServerWorker.cs" company="aliasvault">
|
|
// Copyright (c) aliasvault. All rights reserved.
|
|
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
|
|
// </copyright>
|
|
//-----------------------------------------------------------------------
|
|
|
|
namespace AliasVault.SmtpService.Workers;
|
|
|
|
/// <summary>
|
|
/// A worker for the SMTP server.
|
|
/// </summary>
|
|
/// <param name="logger">ILogger instance.</param>
|
|
/// <param name="smtpServer">SmtpServer instance.</param>
|
|
public class SmtpServerWorker(ILogger<SmtpServerWorker> logger, SmtpServer.SmtpServer smtpServer) : BackgroundService
|
|
{
|
|
/// <inheritdoc />
|
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
|
{
|
|
logger.LogInformation("AliasVault.SmtpService started at: {Time}", DateTimeOffset.Now);
|
|
|
|
// Start the SMTP server
|
|
await smtpServer.StartAsync(stoppingToken);
|
|
}
|
|
}
|