Subject: PINE mail filter bug

From: "Mike A. Harris" <[email-masked]>
Date: Thu, 8 Mar 2001 11:02:56 -0500 (EST)

I just confirmed my assumptions of pine mail filter bug.

If one uses PINE mail filters, one can not have multiple
instances of PINE running simultaneously or else every running
copy of PINE will each filter incoming mail resulting in as many
duplicates as there are PINE processes running.

Steps to reproduce:

1) Log into a machine where you have your mail spool and mail
   folders.

2) Run PINE, set up an incoming mail filter of some kind, lets
   say you set up a filter to file all mail coming from mailing
   list [email-masked] into the foo-list folder.

3) Make sure you're subscribed to foo-list, and that you are
   actually receiving mail from the list, and that PINE is
   filtering it into your folder properly.

4) Leave this PINE running, and log into the same machine again
   from another VC, or from somewhere else, etc.  and run PINE
   again.  You'll get the "PINE is already running, trying to get
   the mailbox lock from other pine session" message, which of
   course works.

5) Repeat step 4 again so you have 3 running copies of PINE on
   the same host.

Now send an email to foo-list, or wait until some mail comes in.
You might want to try [email-masked] for a good way
of reproducing quickly.  ;o)

As soon as mail comes in from foo-list, every single running PINE
will grab the message, and each will file it into your foo-list
folder, so you have 3 copies of the message (or rather one copy
for each PINE that is running at the time).  Oddly enough, they
all don't get filtered simultaneously.  It may be anywhere from
30 minutes to 12 hours later that duplicates appear, which is
very odd indeed.

Killing all PINE instances but one corrects the problem at least
until you run PINE again.

One might be inclined to say "don't run multiple copies of PINE
while filtering is enabled" but that isn't very useful for those
that need to do so IMHO.  What is worse is that you may not be
aware multiple copies of PINE are running, as you may have had a
remote ssh session get killed leaving a PINE running but
detached, or some other scenario, or even multiple PINE's
running on separate hosts, but all accessing the same inbox and
folders via NFS.  I consider this a pretty severe bug because it
hampers the functionality of PINE mail filters.

Possible _partial_ solution:  When PINE acquires the mailbox lock
from another PINE process have that other process not only give
up the lock, but also disable all mail filters on that instance.
This would ensure all PINE instances on a given host only one is
filtering and thus would avoid these duplicate emails.

It doesn't solve the problem of PINE being ran on different hosts
but accessing the same inbox/folders via NFS.  I dunno how this
could be solved at all, or if it can be, if it would work cross
platform (probably not).

Please let me know if this is considered fixable, and when we
might expect to see a fix.  I'm willing also to test out proposed
patches, etc. if it helps fix the problem.

For now I'm falling back to using procmail filters for
everything.

TIA

----------------------------------------------------------------------
    Mike A. Harris  -  Linux advocate  -  Free Software advocate
          This message is copyright 2001, all rights reserved.
  Views expressed are my own, not necessarily shared by my employer.
----------------------------------------------------------------------

-- 
-----------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/pine/pine-info/
-----------------------------------------------------------------

---

From: Mohit Agarwal <[email-masked]>
Date: Thu, 8 Mar 2001 23:04:08 +0530 (IST)

> duplicates as there are PINE processes running.

[...]

Yes, I've also seen this happening.  Not only does this happen when you
have multiple sessions of pine ruuning simultaneously, but also in case
pine aborts abnormally.

-- 
Mohit Agarwal                             <[email-masked]>
---------------------------------------------------------------------------
GPG Public Key:  http://cfdlab.aero.iisc.ernet.in/~mohit/mohit.gpg
---------------------------------------------------------------------------
Love your enemies: they'll go crazy trying to figure out what you're up to.

---

From: "Mike A. Harris" <[email-masked]>
Date: Thu, 8 Mar 2001 14:06:28 -0500 (EST)

>have multiple sessions of pine ruuning simultaneously, but also in case

I am unable to use PINE's filters anymore until this is fixed.
;o(

An optimal solution would be to have PINE use procmail as it's
filter optionally, and allow the user to specify the recipes
filename, that way one could use .procmailrc normally, and inside
the main rc include .procmailrc-pine for example.  It would also
throw in regular expressions to boot.  ;o)

GNU MANA uses procmail in this manner for filtering.

----------------------------------------------------------------------
    Mike A. Harris  -  Linux advocate  -  Free Software advocate
          This message is copyright 2001, all rights reserved.
  Views expressed are my own, not necessarily shared by my employer.
----------------------------------------------------------------------
Looking for Linux software?   http://freshmeat.net  http://www.rpmfind.net
http://filewatcher.org  http://www.coldstorage.org  http://sourceforge.net

---

From: Nemo <[email-masked]>
Date: Thu, 8 Mar 2001 15:50:23 -0800 (PST)

Well actually, if you go to "S"etup, "R"ules, "F"ilters and go to the end
of the list, you'll see a small but important feature called:

move-only-if-not-deleted

See, when pine moves a message, it marks it as deleted.  So next time it
will ignore the message.   This was implemented in pine 4.32 if I remember
correclty.

-- 
[email-masked]

---

From: Eduardo Chappa <[email-masked]>
Date: Thu, 8 Mar 2001 17:57:27 -0800 (PST)

*** Mike A. Harris ([email-masked]) wrote in the pine-info...:

:) I just confirmed my assumptions of pine mail filter bug.
:)
:) If one uses PINE mail filters, one can not have multiple
:) instances of PINE running simultaneously or else every running
:) copy of PINE will each filter incoming mail resulting in as many
:) duplicates as there are PINE processes running.

Mike,

  Take a look at the following discussion in comp.mail.pine that took
place a few weeks ago:

http://groups.google.com/groups?hl=en&lr=&safe=off&ic=1&th=eda394f4d2b7b194

if you are having the same problem reported here, you may be out of luck
for some time, although I like your idea that a "closed inbox" should not
filter messages, which I think would help to reduce this problem, or do
you have the "move-only-if-not-deleted" feature unchecked?

-- 
Eduardo
http://www.math.washington.edu/~chappa/pine/

---

From: "Karl F. Larsen" <[email-masked]>
Date: Thu, 8 Mar 2001 20:11:03 -0700 (MST)

Thanks Nemo, you directed me to the place I have been trying to find since
I got Pine ver 4.31 compiled on my Linux. I will play with this in the
near future and see if I can do what I'm now doing with procmail. I have
had no problem with procmail but there isn't any for the windoz version
and I need some good reason to get co-workers to use Pine as their mail
system.

> > GNU MANA uses procmail in this manner for filtering.

Yours Truly,

  	 - Karl F. Larsen, [email-masked]  (505) 524-3303  -