Replaced `EmailAttachmentContext` with `EmailAttachmentDto` across the codebase to align with the updated DTO naming convention. - Renamed `EmailAttachmentContext` to `EmailAttachmentDto`. - Updated property types, method signatures, and return types to use `EmailAttachmentDto`. - Modified XML documentation references to reflect the new class name. - Updated `ReceivedEmailContext` to `ReceivedEmailDto` and adjusted related methods and properties. - Refactored `FetchEmailsAsync` methods and handlers to use `ReceivedEmailDto`. - Adjusted `BuildAttachmentsAsync` and attachment handling logic in `EmailController` and `LimilabsImapEmailService`. This refactor ensures consistency and improves code clarity while maintaining functionality.
34 lines
1.3 KiB
C#
34 lines
1.3 KiB
C#
using DigitalData.MessagingService.Abstraction;
|
|
using DigitalData.MessagingService.Application.Common.Models.MailSearch;
|
|
|
|
namespace DigitalData.MessagingService.Application.Common.Interfaces;
|
|
|
|
/// <summary>
|
|
/// Service interface for reading emails via IMAP.
|
|
/// </summary>
|
|
public interface IImapEmailService
|
|
{
|
|
/// <summary>
|
|
/// Fetches emails from the specified mailbox folder.
|
|
/// </summary>
|
|
/// <param name="account">Account whose IMAP settings will be used.</param>
|
|
/// <param name="filter">Filter to apply when fetching emails.</param>
|
|
/// When <see langword="true"/> (default), fetched messages are marked as <c>\Seen</c> on the server.
|
|
/// Set to <see langword="false"/> for a non-destructive read (uses <c>BODY.PEEK</c> internally).
|
|
/// </param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
Task<IEnumerable<ReceivedEmailDto>> FetchEmailsAsync(
|
|
EmailAccountDto account,
|
|
MailSearchFilter filter,
|
|
CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Marks a message as seen (read) on the server.
|
|
/// </summary>
|
|
Task MarkAsSeenAsync(
|
|
EmailAccountDto account,
|
|
long uid,
|
|
string folder = "INBOX",
|
|
CancellationToken cancellationToken = default);
|
|
}
|