procmail
[Top] [All Lists]

Re: Generating the leading "From "

1997-06-14 20:40:00
Bill Evans wrote about my reply to wotan(_at_)netcom(_dot_)com's FFrom problem:

| I have also seen the same symptom simply because I didn't have a lock
| where I needed one.  Added the lock, and poof! the problem was gone.

Yes, failing to use a local lockfile will allow it to happen more often.  But
as I said, I used to get it on occasion despite having proper locks.

If the question had come from a greenhorn, lack of a lock would be a likely
culprit, but Wotan knows about lockfiles by now.  If he had accidentally left
off a local lockfile in his .procmailrc, he'd have seen that for himself and
fixed it without asking the list for help.

Without locks it usually comes about this way:

1. Procmail #1 writes its F;
2. Procmail #2 writes its F;
3. Procmail #1 writes "rom " and the rest of the text;
4. Often while procmail #1 is still writing out the rest of the message
   but after #1 has gotten as far as "rom ", procmail #2 writes "rom "
   and the rest of the text.

If #1 can finish the entire message before #2 writes "rom ", you'll get the
typical "FFrom "/"rom " problem.

But *with* locks this can still happen:

1. Procmail #1 gets the lock, writes its F, but dies without writing anything
   else.
2. Procmail #2 finds that #1's lock is stale and steals it.
3. Procmail #2 writes "From " next to #1's "F" and then finishes its text.
4. Sometimes #1 revives, believes it still has the lock, and writes "rom "
   and the rest of its text.

So it is a lot more likely without proper locking, but proper locking is not
100% effective against this, and I'm sure that Wotan is using local lockfiles
correctly.

<Prev in Thread] Current Thread [Next in Thread>