Redirecting mail from one to another - WeOnlyDo Discussion board

Redirecting mail from one to another (wodSmtpServer / wodPop3Server / wodImapServer)

by ajitpals, Monday, November 09, 2015, 17:12 (3302 days ago)
edited by ajitpals, Monday, November 09, 2015, 17:19

We have already a service running in C# listening to SMTP email connections over the Port 25. The current connection doesn't support SSL/TLS for the Service. We want to shift the current service to the Port 26 and have new service which support SSL connection run at port 25. When user connect to the new service (support SSL), we want this service to act as proxy and send all event back to the port 26 and wait for the reply from there and then process further.

Is it possible to handle all these events or any other suggestion are welcome. We want to have both SSL/ Non SSL connection.

can something like this work on the server. It support both cases, unless we change the Enum SecurityRequired.

if (IsSSLSupported)
{
//Apply the certificate.
Certificate cert = null;
cert = new Certificate();

cert.Load("certifcate.cer");
cert.LoadKey("certificate.pfx", "password");

SMTPServer.Certificate = cert;
SMTPServer.Security = SmtpSecurityEnum.SecurityAllowed;
}

can sending client or server, can check, if starttls is there, they should use it or sending is always default back to the non SSL?

Redirecting mail from one to another

by Jasmine, Monday, November 09, 2015, 17:18 (3302 days ago) @ ajitpals

Hi.

If you're thinking on using wodSmtpServer as SSL->cleartext proxy, then wodSmtpServer cannot do that.


But.. Why don't you just run two instances of wodSmtpServer, one with SSL and one without, and just share the code so they behave the same?

Kind regards,
Jasmine.

Redirecting mail from one to another

by ajitpals, Monday, November 09, 2015, 17:35 (3302 days ago) @ Jasmine

hi Jasmine,

I made a mistake in the question, actually the already running service is written in C++, we don't have the code for it (it contain the business logic). We can only change its port in the configuration file. Can we host a service in C# and redirect some sort of event/email connection logic back to the c++ port 26 as we receive commands from the Events on port 25.

Thanks,
Ajit

Redirecting mail from one to another

by Jasmine, Monday, November 09, 2015, 17:36 (3302 days ago) @ ajitpals

Hi Ajit.

Oh, in that case I don't see how you could change it.

I can only suggest some 3rd party program that will do SSL->cleartext redirection for you.

Kind regards,
Jasmine.

Redirecting mail from one to another

by ajitpals, Monday, November 09, 2015, 18:06 (3302 days ago) @ Jasmine

Hi,

One last query, is it possible to construct the complete email message in C# SSL running service using various events and forward as email back to port 26?

thanks,
Ajit

Redirecting mail from one to another

by Jasmine, Monday, November 09, 2015, 18:17 (3302 days ago) @ ajitpals

Hi.

I'm not really sure what you're asking, and what component you're referring to.

wodSmtpServer (I assume you're referring to that component) doesn't go into message contents, so it doesn't parse/construct it. It stores it in files and delivers it from files.

You can access those files by yourself and change as you wish.

I hope it helps!
Jasmine.