OFFTOPIC (Was: Re: mail filter in python?)

Christopher Browne cbbrowne at news.hex.net
Tue Feb 8 20:14:23 EST 2000


Centuries ago, Nostradamus foresaw a time when Gerrit Holl would say:
>Thomas Wouters wrote on 949942343:
>> On Mon, Feb 07, 2000 at 05:01:56PM +0100, Gerrit Holl wrote:
>> > File locking isn't hard to implement, what kind of security checks do you
>> > mean? Python is portable so that's not a problem.
>> 
>> File locking _is_ hard to implement, in a portable, secure, race-proof
>> manner. flock()/lockf()/O_EXCL are the easiest ways of locking, but are not
>> very portable, and are likely not to work on some filesystems (like NFS).
>> Also, some NFS servers and clients do their best to do NFS locking in a
>> secure way, but most do not succeed, or succeed at the cost of stability and
>> speed.
>
>Oh, sorry. I thought you could just create a file called ".filename.lock"
>and remove it when you're ready, in a try: ... finally: ... clause?

You might want to look into the protocol used by qmail, known as
"maildir."

<http://www.qmail.org/qmail-manual-html/man5/maildir.html>

"maildir is a structure for directories of incoming mail messages.  It
solves the reliability problems that plague mbox files and mh
folders."

See also <http://cr.yp.to/proto/maildir.html>

Note that Postfix and UW imap are other mail systems that support it;
there appears to be a patched version of procmail that supports
maildir; <http://www.em.ca/~bruceg/procmail-maildir/>.
-- 
Everyone has a photographic memory, some don't have film.
cbbrowne at hex.net- <http://www.ntlug.org/~cbbrowne/internet.html>



More information about the Python-list mailing list