cosullivan / SmtpServer

A SMTP Server component written in C#
MIT License
690 stars 163 forks source link

Wrong response code from MailboxFilter #184

Closed azsft closed 11 months ago

azsft commented 1 year ago

MailboxFilterResult.NoTemporarily response from MailboxFilter returns 550 (no permanently) instead of 450 (no temporarily). Causing client will not defer message, but send NDR.

cosullivan commented 11 months ago

Yes, you are correct here.

The issue is that there are numerous codes which the filter could return for different scenarios and I tried to simplify this. I think its probably better for the IMailboxFilter to simply return true or false and then it already will allow the implementor to throw an SmtpResponseException to control the actual code to return.

azsft commented 11 months ago

Returning true/false from IMailboxFilter would be less confusing.

As I have been stucked to pre-defined MailboxFilterResult.NoTemporarily option with misconfigured response, so I missed that I can just throw SmtpResponseException if I want to return specific SmtpReply code and message

cosullivan commented 11 months ago

Hi,

This should now be fixed in v10.0.0 which is now published.

Please note that there is a breaking change to the mailbox filter API but its a very easy modification for implementations.