I am sending emails using smtplib using internal relay.
msg['From'] = fromaddr
msg['To'] = toaddr
msg['Subject'] = server
s = smtplib.SMTP('SMTP', port)
s.send_message(msg)
s.quit()
Access is controlled with an ACL and I would like to be able to fire my script from my local machine through an intermediary host that is allowed on the SMTP relay. Until now I have been sshing to the intermediary host but that's a bit of a palaver to be honest.
How would I go about tunneling this traffic so SMTP relay would see the request came from intermediary host?
PS. All actions are done within a domain environment. I just want communication to flow from my hostname, through another host that is allowed on our local smtp relay.