Smtp forwarding tool for PLC controllers and simple devices.

Nowadays thanks to email spammers, sending emails can be a nightmare if one wants to use own server. Very often our home or automation devices like video recorders, routers, cameras and PLC controllers are able to send email message using simple email protocol without fancy TLS/SSL encryption and sometimes even without authentication. These devices are to simple to use properly email accounts hosted by email providers. To solve this problem I have developed simple C# program, that on one side is an smtp server, that doesn’t require authentication (so don’t give it public ip address!!) and on the other side it is an C# email client, which will work with most modern email accounts. What this program does is intercept email send by simple device and forward it via configured email account.

I cant spent more time on this project. I hope someone will find it helpful.

To make it running one must install mono and screen. Modyfy configuration file (look under bin/Release folder in 7z file), copy everything to folder /root/skrypty/ (files: SmtpForwardTool.conf SmtpForwardTool.exe SmtpServer.dll,  MimeKitLite.dll) to your linux machine and create file runScreen containing:

#!/bin/bash
/usr/bin/screen -d -m -t EmailForward -S EmailForward mono /root/skrypty/SmtpForwardTool.exe

exit 0

Now just run script runScreen and to see program running enter screen -r EmailForward. To detach without quitting the application use ctrl+a+d (screen manual).

Now you can use codesys to send emails using oscat network library. If it is required use email to sms gateway to create process alarming application.

 

That’s all folks. Don’t have time to explain more.

Bellow Visual Studio 2013 express project:

http://pliki.vberry.net/SmtpForwardTool.7z

Comments are closed.