cosullivan / SmtpServer

A SMTP Server component written in C#
MIT License
676 stars 160 forks source link

SmtpServerOptionsBuilder.MaxMessages #137

Closed reponemec closed 3 years ago

reponemec commented 3 years ago

Is it possible to limit the maximum number of messages server receive? Per a time period (or session) and domain.

cosullivan commented 3 years ago

Hi @reponemec,

You can implement this logic yourself within a IMailboxFilter implementation. https://github.com/cosullivan/SmtpServer/blob/master/Src/SmtpServer/Storage/IMailboxFilter.cs#L17

You can either return a MailboxFilterResult or throw a SmtpResponseException from within this filter to return a more specific response back to the client.

Thanks, Cain.