How about this?
Even more off topic!
But so far this seems to work for me.
Kmail "could not write lockfile" when reading the mbox, but "FCNTL" worked,
whatever that means :)
Considerable room for improvement I'm sure, but in principle?
Suggestions welcome :)
Gaute
/usr/bin/sendmail:
#!/usr/bin/python
import mailbox
import sys
import email
from time import gmtime, strftime
mbox = mailbox.mbox('/var/mail/root', factory=None, create=True)
msg = email.message_from_file(sys.stdin)
msg['From'] = 'r...@localhost'
msg['Date']= strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
mbox.add(msg)