I am hacking some support for DomainKeys and DKIM into an open source email program that uses a python script to send actual emails through SMTP. I decided to take a quick and dirty route and just write a perl script that receives an email from STDIN, signs it, and then returns it signed.
What I would like to do is from a python script, send the email text that is in the line to the perl script, and save the result in another variable so that I can send a signed letter. However, I am not quite a python guru, and I cannot find a good way to do this. I'm sure I can use something like os.system for this, but forwarding a variable to a perl script is something that seems to elude me.
In short: how can I pass a variable from a python script to a perl script and save the result in Python?
EDIT: I forgot to include that the system I'm working with only has python v2.3
python perl dkim
Alex fort
source share