cosullivan / SmtpServer

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

Remote IP? #131

Closed cdwiegand closed 4 years ago

cdwiegand commented 4 years ago

It seems that ISessionContext does not expose the remote endpoint, so I can't seem to find a way to determine the remote IP, either for filtering or logging. Can this be added to that interface? It seems that SmtpSessionContext does have the necessary info, but it's internal sealed, so I can't get at that from my program. Is there a way to do this and I'm not seeing currently?

cosullivan commented 4 years ago

Hi @cdwiegand,

You can access the Remote Endpoint from the session context, see here for an example; https://github.com/cosullivan/SmtpServer/blob/master/Src/SampleApp/SampleMailboxFilter.cs#L32

Thanks, Cain.