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
How do you add a custom EndpointListener when using Dependency Injection?
Also I see that IEndpointListener now requires GetPipeAsync rather than GetStreamAsync, is there a simple example of filtering on IP address using the new interface?
The text was updated successfully, but these errors were encountered:
Firstly, you can listen for the SessionCreated event on the SmtpServer instance and check the IP address from there. The default EndpointListener will add the IP address to the session context (check out the SessionTracingExample). If you get an IP address that you want to block, you can simply throw an exception here and the client will be disconnected and closed.
The second option is similar to before whereby you can create a custom endpoint listener. From within the custom endpoint listener, get the underlying Pipe and you can dispose of that and return null.
Related to #140
How do you add a custom EndpointListener when using Dependency Injection?
Also I see that IEndpointListener now requires GetPipeAsync rather than GetStreamAsync, is there a simple example of filtering on IP address using the new interface?
The text was updated successfully, but these errors were encountered: