procmail
[Top] [All Lists]

Comments on an idea - writing to a file from two procmailrcs

2001-12-29 01:31:27

I have this sample code in two different procmailrc files that do very
different things.  One is the main mail sorting procmailrc and the
other is a procmailrc file that is used in a completely different
process that converts incoming nntpserver output to mail groups.

This snippet is in both files.

The code is supposed to write only headers to a file `response.in'
After having made some edits.  It may seem a little peculiar to remove
the To: header and rewrite it with the message-id contents in its
place.

This has to do with the mail client where final viewing and stuff is
done.

It was a handy way to show the message id in article view but not as a
real message id.  The client can find the message that this is only
the headers to by chasing down what is found in to header.

Confused yet?... well that part isn't really important for my question
here anyway.

My concern is what might happen if both of these processes happen to
write to `response.in' at the same time.

I've set a lock in both instances, but never really understood how
locking works and if it would apply in this case. 

 :0 c
 *^References:(_dot_)*(_at_)reader(_dot_)newsguy(_dot_)com
{
  :0 fh
  * ^Message-[iI][dD]:( |       )*\/.*
  |formail -R "Message-[iI][dD]:" "X-Save-Msgid:" -i "To: ${MATCH}"

   :0 h :
   $HOME/spool/response.in
}

The idea here is to provide a handy one stop spot where a link to any
replies will show up by copying only the headers of messages that have
my message-id right-hand-side in the `References' header.  That is,
messages that are a response to something I posted or mailed.

Hopefully they will show up with the content of message-id inserted
into the To header. (old to header gets rewritten as Old-To)

Providing me with a mail message that contains info I can use to
clicky clack up the real message, regardless of which group its in.
A simple key combo will pull up the real message into the current group.

The concern here is that something bad might happen by writting to
this file from two (unco-ordinated) processes.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Comments on an idea - writing to a file from two procmailrcs, Harry Putnam <=