- Add
to /etc/smrsh as a symlink - programs in here will be run by sendmail - Check the permissions on the file that this links to - mail must be able to stat it
- Add the alias to /etc/aliases eg.:
- sariel "|sarial-mailgw"
- Run "newaliases"
My python program consists of something like the following:
#!/usr/bin/python
import time
t = int(time.time())
f = open("/tmp/sariel.%d"%(t), 'w')
f.write("sariel %d\n"%(t))
f.close()
So, you can then test sending a mail to the program -
echo hello | mail -s "test" sariel@localhost
And a new file should appear in /tmp
If nothing happens, look for returned mail in your own mailbox (mail) or check /var/log/maillog for error messages.
No comments:
Post a Comment