Subject: Re: "Folder is corrupt!!"

From: Pete Tedder <[email-masked]>
Date: Mon, 16 Jan 1995 10:20:02 +0100

> Dave Mandl asked,
> 
> | I've just installed procmail at one of my sites, and though it seems to be
> | working fine (all the recipes are working and I'm not losing any mail), I
> | sometimes get the following message when reading my mail in Elm:
> | 
> | Folder is corrupt!! I can't read it!!
> 
> Two things can cause that:

One other thing can cause it.  elm gives this message if the 'From '
line that separates mail messages (as distinct from the 'From:' line
in the message's header) is incomplete.  It should look like this:

>From pwt42@miranda Thu May 26 09:50:28 1994

with a sender and a unix-format date'n'time.  But if, as sometimes
happens, the sender gets omitted:

>From  Thu Dec 22 13:33:31 1994

elm crashes.  Pine, looking at the same folder accepts it.  So I believe
this is an elm problem though presumably procmail can actually create
such a situation.

--
Pete Tedder
User Services Manager
UMDS Information Systems Department

---

From: [email-masked] (David Mandl)
Date: Mon, 16 Jan 1995 00:24:28 -0500

Hi Folks--

I've just installed procmail at one of my sites, and though it seems to be
working fine (all the recipes are working and I'm not losing any mail), I
sometimes get the following message when reading my mail in Elm:

Folder is corrupt!! I can't read it!!

I know this is technically an Elm problem, but something in my procmail
script is definitely causing it.  What I'm doing is sending myself mail
that will trigger one of the recipes, which sends me the requested file.  I
send the message, wait a couple of seconds, then press Ctrl-L to refresh
the screen.  That's when I get the error message and get kicked out of Elm.
If I go back into Elm, the file I requested is in my mailbox, as is the
confirmation file I send to myself.  Any ideas?

Thanks.

   --Dave.

--------------------------------------------

.procmailrc:

PATH=/usr/local/bin:/usr/bin:/usr/ucb:/usr/etc:/etc:$HOME/bin:.
MAILDIR=$HOME/Mail
FILEDIR=$HOME
DEFAULT=$MAIL
LOGFILE=$MAILDIR/logfile
VERBOSE=yes
NOTIFY_ADDR=[email-masked]    # this is my own address
:0
* ^Subject: [   ]*HELP
{
   FILENAME="$FILEDIR/helpfile"
   :0c
      | (formail -r -I "Subject: Results of your help request" ; \
      cat $FILENAME) | $SENDMAIL -t
   :0
      | (echo "File $FILENAME sent to " `formail -x From: ` \
      "at: `/bin/date`" ) | Mail -s "Help Sent" $NOTIFY_ADDR
}
:0
* ^Subject: [   ]*SEND SCHEDULE
{
   FILENAME="$FILEDIR/schedule"
   :0c
      | (formail -r -I "Subject: Results of your help request" ; \
      cat $FILENAME) | $SENDMAIL -t
   :0
      | (echo "File $FILENAME sent to " `formail -x From: ` \
      "at: `/bin/date`" ) | Mail -s "Help Sent" $NOTIFY_ADDR
}
:0
* ^Subject: [   ]*SEND PLAYLIST
{
   FILENAME="$FILEDIR/playlist"
   :0c
      | (formail -r -I "Subject: Results of your help request" ; \
      cat $FILENAME) | $SENDMAIL -t
   :0
      | (echo "File $FILENAME sent to " `formail -x From: ` \
      "at: `/bin/date`" ) | Mail -s "Help Sent" $NOTIFY_ADDR
}
:0:
   $DEFAULT

--------------------------------------------

logfile:

procmail: [5814] Sun Jan 15 23:57:10 1995
procmail: Assigning "NOTIFY_ADDR=[email-masked]"
procmail: Match on "^Subject: [         ]*HELP"
procmail: Assigning "FILENAME=/home/davem/helpfile"
procmail: Assigning "LASTFOLDER= (formail -r -I "Subject: Results of your
help request" ; \
      cat $FILENAME) | $SENDMAIL -t"
procmail: Assigning "LASTFOLDER= (echo "File $FILENAME sent to " `formail
-x From: ` \
      "at: `/bin/date`" ) | Mail -s "Help Sent" $NOTIFY_ADDR"
>From davem  Sun Jan 15 23:57:10 1995
 Subject: HELP
  Folder:  (echo "File $FILENAME sent to " `formail -x From: ` \            438
procmail: Notified comsat: "davem@: (echo "File $FILENAME sent to "
`formail -x From: ` \
      "at: `/bin/date`" ) | Mail -s "Help Sent" $NOTIFY_ADDR"
procmail: Executing " (formail -r -I "Subject: Results of your help request" ; \
      cat $FILENAME) | $SENDMAIL -t"
procmail: Executing " (echo "File $FILENAME sent to " `formail -x From: ` \
      "at: `/bin/date`" ) | Mail -s "Help Sent" $NOTIFY_ADDR"
procmail: [5827] Sun Jan 15 23:57:12 1995
procmail: Assigning "NOTIFY_ADDR=[email-masked]"
procmail: No match on "^Subject: [      ]*HELP"
procmail: No match on "^Subject: [      ]*SEND SCHEDULE"
procmail: No match on "^Subject: [      ]*SEND PLAYLIST"
procmail: Locking ".lock"
procmail: Assigning "LASTFOLDER="
procmail: Opening ""
procmail: Error while writing to ""
procmail: Assigning "LASTFOLDER=/usr/spool/mail/davem"
procmail: Opening "/usr/spool/mail/davem"
procmail: Acquiring kernel-lock
procmail: [5829] Sun Jan 15 23:57:12 1995
procmail: Assigning "NOTIFY_ADDR=[email-masked]"
procmail: No match on "^Subject: [      ]*HELP"
procmail: No match on "^Subject: [      ]*SEND SCHEDULE"
procmail: No match on "^Subject: [      ]*SEND PLAYLIST"
procmail: Locking ".lock"
procmail: [5827] Sun Jan 15 23:57:13 1995
procmail: Unlocking ".lock"
>From davem  Sun Jan 15 23:57:12 1995
 Subject: Results of your help request
  Folder: /usr/spool/mail/davem                                            1586
procmail: Notified comsat: "davem@6328:/usr/spool/mail/davem"
procmail: [5829] Sun Jan 15 23:57:20 1995
procmail: Locking ".lock"
procmail: Assigning "LASTFOLDER="
procmail: Opening ""
procmail: Error while writing to ""
procmail: Assigning "LASTFOLDER=/usr/spool/mail/davem"
procmail: Opening "/usr/spool/mail/davem"
procmail: Acquiring kernel-lock
procmail: [5829] Sun Jan 15 23:57:21 1995
procmail: Unlocking ".lock"
>From davem  Sun Jan 15 23:57:12 1995
 Subject: WFMU Help Sent
  Folder: /usr/spool/mail/davem                                             411
procmail: Notified comsat: "davem@7914:/usr/spool/mail/davem"

--
Dave Mandl
[email-masked]

---

From: [email-masked] (David W. Tamkin)
Date: Mon, 16 Jan 1995 00:29:20 -0600 (CST)

Dave Mandl asked,

1. Lack of sufficient locking is letting text from two or more letters mix
   together, or, based on Dave's additional comments:

| I know this is technically an Elm problem, but something in my procmail
| script is definitely causing it.  What I'm doing is sending myself mail
| that will trigger one of the recipes, which sends me the requested file.  I
| send the message, wait a couple of seconds, then press Ctrl-L to refresh
| the screen.  That's when I get the error message and get kicked out of Elm.
| If I go back into Elm, the file I requested is in my mailbox, as is the
| confirmation file I send to myself.  Any ideas?

2. Procmail writes a letter to a folder by depositing an F, pausing one
   second, and then writing "rom " and the rest of the head and the body.
   (See NFS_ATIME_HACK in procmail's config.h, but don't ask me to explain
   it.)  If you are reading that same folder with Elm and try to refresh the
   index screen -- or return to the index screen from reading a letter or
   viewing options -- during that second, Elm finds the text ending with no
   newline and complains that the folder is corrupt.

A second later, procmail writes out the rest of the text; then Elm can read
the folder again.

This doesn't happen in the main spool folder because there Elm recognizes and
honors procmail's locks; for other folders Elm doesn't care about locks, so
it doesn't realize that another process is writing to the folder while you're
viewing it with Elm.

The only recommendations I have are to tolerate it or to use some of the 
reader wrappers in procmail's examples directory to keep procmail from
delivering to a folder while you're reading it.

---

From: "Mark A. Fullmer" <[email-masked]>
Date: Mon, 16 Jan 1995 21:19:29 -0500 (EST)

>delivering to a folder while you're reading it.

A quick hack I've lived with until I get around to writing a zsh completion
thing for it.

cd ~Mailbox
export MAIL=procmail-list
elm

replace export with setenv as appropiate.

-- 
mark
[email-masked]