Class ImapConsumer
IMAP consumer — fetches email messages via MailKit ImapClient.
Supports polling mode and IMAP IDLE push mode.
Full support for filtering, sorting, post-processing (mark read, delete, move),
attachments, idempotency, and OAuth2.
public class ImapConsumer : DrainableConsumer, IConsumer
Inheritance
Implements
Inherited Members
DrainableConsumer.AwaitRunTask(),DrainableConsumer.ConsumerEndpoint,DrainableConsumer.ConsumerName,DrainableConsumer.DecrementInflight(),DrainableConsumer.Endpoint,DrainableConsumer.IncrementInflight(),DrainableConsumer.Logger,DrainableConsumer.OnStarting(CancellationToken),DrainableConsumer.OnStopAccepting(),DrainableConsumer.OnStopped(),DrainableConsumer.Processor,DrainableConsumer.ProcessWithTracking(IExchange, TransportSpan, CancellationToken),DrainableConsumer.ProcessWithTracking(IExchange, CancellationToken),DrainableConsumer.RunAsync(CancellationToken, CancellationToken),DrainableConsumer.Start(CancellationToken),DrainableConsumer.Stop(CancellationToken)
Properties
ConsumerEndpoint
The endpoint this consumer is attached to.
protected override IEndpoint ConsumerEndpoint { get; }
ConsumerName
Display name for logging (e.g. "kafka:orders", "file:/tmp/in").
protected override string ConsumerName { get; }
Methods
OnStarting(CancellationToken)
Called during Start() before RunAsync. Override for async setup (topology, subscriptions).
protected override Task OnStarting(CancellationToken ct)
RunAsync(CancellationToken, CancellationToken)
Main consumer loop. Receives pollCt (stop accepting new work)
protected override Task RunAsync(CancellationToken pollCt, CancellationToken processingCt)
Constructors
ImapConsumer(ImapEndpoint, IProcessor, MailEndpointOptions)
Creates an IMAP consumer.