On Thu, Dec 11, 2008 at 09:34:31PM +0100, Gaute Amundsen wrote:

> 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())

The problem is that users other than the owner of the mailbox may
need to send mail... So you need either a setuid sendmail(1) or
a system like Postfix with multiple processes at different privilege
levels and IPC between them.

-- 
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:majord...@postfix.org?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.

Reply via email to