Matt Holgate writes:

I want to be able to automatically add keywords to incoming mail from procmail, so I added a recipe, and a helper script, which I've included below.

This seems to work really well, however, I wanted to confirm that it is sane:

1) Is this concurrent-safe? Is there a race if the MUA sees the mail and causes courier to move it from 'new' to 'cur' while the labelling is happening? Or does maildirkw cope with this safely?

Yes, there is a small window where the MUA might read the folder before the keyword gets set, and therefore will not pick up the keyword. The next time MUA resyncs the folder's contents, it will receive an update that adds the keyword to this particular message.

2) I have IMAP_USELOCKS set to 1 in /etc/courier/imap. Do I need to do anything with my procmail recipes to make them use this locking too, or is this not necessary (I read elsewhere that maildir doesn't use locks at all, so I was a little confused).

3) Can you see any other problems with my approach below?

The fact that you use procmail at all, whose maildir support is broken in a number of ways.

Replace procmail with maildrop, which can initialize the keywords itself, without any race conditions.


Attachment: pgpu46ygq1CvW.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to