[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Automatically creating user accounts from exim



On Wed, Jun 17, 2009 at 04:51:33PM +0200, David wrote:

> 1. Is there a way for external programs to determine immediately when
> a mail was just delivered into the mail files?

You can monitor files for changes in timestamps or size, which is
essentially what shells do to notify users of new email. Or you can use
a dedicated tool like fileschanged, dnotify, or incron.

> 2. How can external programs manipulate the mail files (read the
> messages, delete, etc), and avoid race conditions with the exim
> process which also uses those files?

If you want to avoid race conditions, all your tools either need to use
locking, or you need to use a mailbox format like Maildir which is
designed to prevent them without locking in the first place. Postfix and
procmail can deliver to Maildir; I'm pretty sure exim can, too.

-- 
"Oh, look: rocks!"
	-- Doctor Who, "Destiny of the Daleks"


Reply to: