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

Re: [users] Maildir protocaol spec?



also sprach Eugene van Zyl (on Wed, 23 May 2001 09:01:13AM +0200):
> I want to use a maildir as a sort of queue for processing incoming
> emails with structered data which needs to be processed and written
> to a db. Now, once I've decided to read a message, I move it to
> ./cur, but how do I let any other process like a POP3 server know
> that I'm currently reading this message and could be delieting it
> from under its nose? Also how do I know whether another process
> might be reading messages I left for processing in ./cur ? Basically
> what are the rules for reading & deleting. Writing seems to be only
> dependent on the naming scheme, right?

what POP3 server are you using? usually, they only target messages in
/new, so if you move to /cur, then you should be safe to edit.

other than that, there is no locking or anything going on. if you want
to be absolutely sure to get exclusive access, you link the file into
/tmp, unlink from /cur (or /new), work on the file, and then reverse
the process for delivery of the message. just like specified in
maildir(5).

i think i need more specifics from you as to what exactly you want to
do before i can help. a great source of information is also the mutt
(and procmail) source code.

martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:"; net@madduck
-- 
you work very hard. don't try to think as well.



Reply to: