You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement custom SMTP response codes in my mailbox filters but finding some inconsistencies in the documentation and implementation.
In the sample code from the README:
publicclassSampleMailboxFilter:IMailboxFilter,IMailboxFilterFactory{publicTask<MailboxFilterResult>CanAcceptFromAsync(ISessionContextcontext,IMailbox@from,intsize,CancellationTokencancellationToken){if(String.Equals(@from.Host,"test.com")){returnTask.FromResult(MailboxFilterResult.Yes);}returnTask.FromResult(MailboxFilterResult.NoPermanently);}// ...}However,whenimplementingthisin SmtpServer 10.0.0.1:
MailboxFilterResult appears to be deprecated/removed
The base MailboxFilter class uses boolreturn types instead
It's unclear whatthe current best practice isfor returning customSMTP response codes
Currently,I'm setting the response through context.Response =SmtpResponse.Create(code,message),but I'm unsureifthisistherecommended approach.
Could you please clarify:Whatisthe current recommended way to implement custom SMTP responsesinmailboxfilters?Is there a preferred method between using context.Properties["SmtpResponse"] vs context.Response?Could you provide an updated example showing the correct implementation for version 10.0.0.1?Thanks for your help!
The text was updated successfully, but these errors were encountered:
I'm trying to implement custom SMTP response codes in my mailbox filters but finding some inconsistencies in the documentation and implementation.
In the sample code from the README:
The text was updated successfully, but these errors were encountered: