Subject: Mail Readers? (and elm)

From: Ari Kornfeld <[email-masked]>
Date: Sun, 31 Jul 1994 13:00:58 -0700 (PDT)

Ok folks, hopefully this is my last message for now:

  After reading previous discussions, it seems that elm may not be
ideally suited for use with procmail (or even with elm!) because it
does not lock folders while they are in use.  Same + worse seems to
hold for RMAIL (emacs).  So.. what's the "most appropriate" or perhaps
"safest" mail reader for working with multiple folders??  Please
explain why.  Ease of use counts for something too so how about
easiest+safest? 

  On a related topic, elm will mark new messages as "N" if the message
is put into the main mail folder but not if the message is put in any
other folder, even though it was never read.  Is there any solution or
formail work-around for this?  To be fair, elm has this problem with
mail sorted through its own filter program as well.

  Thanks.

-ari

---

From: "Joshua A. Laff" <[email-masked]>
Date: Sun, 31 Jul 1994 15:30:41 -0500 (CDT)

In our previous episode, Ari Kornfeld said:
:)   After reading previous discussions, it seems that elm may not be
:) ideally suited for use with procmail (or even with elm!) because it
:) does not lock folders while they are in use.  Same + worse seems to

There really is no reason to lock your folder while reading it, assuming
the folder is normally kept in standard mail-file format. I've been using
procmail and elm both for a few years now and have never had any problems with
normal folder. The only time I've ever had a problem is with folders I normally
keep in a compressed state, and have to uncompress to read them.

:)   On a related topic, elm will mark new messages as "N" if the message
:) is put into the main mail folder but not if the message is put in any
:) other folder, even though it was never read.  Is there any solution or

I think Stephen should put this in the FAQ...   :)

This is completely dependant on elm, not procmail. Elm makes the (silly, IMHO)
assumption that if mail is not in your spool file, the 'new/old/read' status
is irrelevant. What you need to do is modify the source code for elm before
compiling it. The following directions will accomplish this. This is taken
from the note I wrote on compiling elm on our system.

----------------/ug/src/elm/COMPILER-NOTE--------------
I've made a modification that allows the "New/Old/Read" headers to work on
folders *other* than the spool folder. Here's the change in case anyone
for any reason decides to reverse it:
==========================================================================

in the file src/newmbox.c, look for the lines:

                /* set default status - always 'visible'  - and
                 * if a spool file, presume 'new', otherwise
                 * 'read', for the time being until overridden
                 * by a Status: header.
                 * We presume 'read' for nonspool mailfile messages
                 * to be compatible messages stored with older versions of elm,
                 * which didn't support a Status: header.
                 */
                if(folder_type == SPOOL)
                  current_header->status = VISIBLE | NEW | UNREAD;
                else
                  current_header->status = VISIBLE;

about 660 lines down. (Just search for the symbol NEW)
Ok, now see that if statement.... well, just delete it and use the
true part as in

                current_header->status = VISIBLE | NEW | UNREAD;

Thats it.
========================================================================
					-Josh Laff
------------------end------------------

      Joshua A. Laff    (217)      //  Disclaimer: If I was important enough
    CRL Head Operator     333-    //  that the UofI would let me speak for it,
  University of Illinois   7408  //  the *last* thing I'd be doing would be
email to: [email-masked]      //  sitting in front of a computer all day.
===============================================================================
Since they were born on the same day, the Michaelangelo Virus is being 
replaced with the Ed McMahon virus. Every March 6, when the user boots up
his pc, a greeting will appear:
    ***  Congratulations!  Your computer may already be infected!  ***

---

From: [email-masked] (David W. Tamkin)
Date: Sun, 31 Jul 1994 16:09:11 -0500 (CDT)

Ari Kornfeld and asked the familiar question,

|   On a related topic, elm will mark new messages as "N" if the message
| is put into the main mail folder but not if the message is put in any
| other folder, even though it was never read.

The Elm Development Group maintain that any letter that has been sent to
another folder, even without human intervention, has been handled and
therefore doesn't meet their concept of "new".  Almost all users disagree.

Josh Laff has posted the modification to the source code that prevents Elm
from checking whether the current folder is the main spool before deciding
whether to display the N for a letter with no Status: header.  (I say "modi-
fication" and not "patch" because the Elm Development Group insist that it
not be called a patch; they say that calling it a patch would imply that the
current behavior is a bug.  Most users see it as a bug, but I guess the Elm
Development Group consider it a housepet with a few extra legs.)  Thus Elm
can display the N on the index screen of any folder and will position the
pointer accordingly.

| Is there any solution or formail work-around for this?  To be fair, elm has
| this problem with mail sorted through its own filter program as well.

Precisely; it's a problem with Elm, not with procmail, as Josh has already
said.

You can cure it by recompiling Elm as Josh described.  If that is
impracticable, you can, indeed, work around it with formail.  When procmail
delivers mail to a folder other than your spool, instead of

    :flags
    * conditions
    foldername

try this:

    :flags
    * conditions
    | formail -a "Status: O" >> foldername

Elm, as distributed, will honor the "O" status in all folders.  (Note that
there is no "N" status in the headers themselves: Elm uses an "N" for mail in
your main spool that has no Status: header.  Outside your main spool, unless
you recompile Elm with the change Josh posted here, Elm thinks that a letter
with no Status: header is the same as one with "Status: RO".)  The "O" will
show on the index screen and Elm's pointer will start at the first message
that has an O.

Don't add the header to mail that will go to your main spool, however, be-
cause then you lose the distinction between "N" and "O"; "O" is supposed to
indicate a letter you've seen on the index screen before but not yet dis-
played.

It's preferable to recompile Elm if you can.  If disk space quotas or other
considerations rule that out, using formail is the second best thing.

David W. Tamkin  P. O. Box 3284  Skokie IL  60076-6284
[email-masked]   MCI Mail: 426-1818   +1 312 714 5610