Koozali.org: home of the SME Server

webscript to authenticate and send mail (relay) from external network

Offline larieu

  • *****
  • 214
  • +0/-0
application

I have one external win computer (from my server) on which I have IIS started and some devices connected to monitor some hardware status of some switches
it already exist one "application" on that machine written in .net which can do several things (draw some graphics, put time of changed status into one database...)
this application can be altered to send also mails when some status change

I need to use my mail server to send from that computer / application one email for each changing status to an external email address also

lets say
my server has mail.mydomain.tlc
if I send email on port 25 to my address myaddress@mydomain.tlc it works (it is obvious)
but I need to send also to
myaddress@otherdomain.net
(relay)

for this I need to authenticate to my server on port 465 with SSL/TLS and put my certificate (or accept any) with myaddress and my pass

it exist any ready made script to do this trick?


« Last Edit: May 19, 2011, 05:08:00 PM by larieu »
if everybody's life around you is better, probably yours will be better
just try to improve their life

Offline mmccarn

  • *
  • 2,657
  • +10/-0
You could create a local alias on your SME for the reports that forwards email to the ultimate destination, then reconfigure the external win computer to email the reports to the local alias on the SME.

Or, you could use "plink" in a batch file on the windows box to open an SSH tunnel to the SME before sending the email, then configure the windows box to use itself for the mail server (you'd need to configure a key pair to allow password-less login).

Or, you could VPN from the win box to the SME (I once knew how to open a VPN from a batch file)

Or, You could modify your SME to allow open relay from the IP address of the external win computer using "AllowHosts"

Or, you could install an SMTP server near the win box that knows how to do outbound SMTP authentication (the SMTP server that comes with all Windows server OS's will do this, I think).