Subject: mailagent and MH

From: "Susan G. Kleinmann" <[email-masked]>
Date: Mon, 19 Aug 1996 08:24:09 -0400

I have just begun using mailagent, and am hoping for some enlightenment
regarding its behaviour.

I fetch mail from my ISP using a line like:
popclient -3 -P ~/.my_password_file my_ISPs_mailhost

This mail is processed by my ~/.rules file, and messages which aren't 
automatically refiled as a result of matching one of the rules are then
stored in the file ~/mbox.sgk, which has the same format as 
/var/spool/mail/sgk.

Then I try to fetch mail messages from mbox.sgk into my MH inbox,
by executing:   
   inc -file ~/mbox.sgk

What's odd is that I often have to execute inc more than 1 time -- sometimes
2 times, to get all the files from mbox.sgk into +inbox.  For example, 
as a result of running popclient, I might see that 4 messages are being
obtained from my ISP.  Then if I run inc -file ~/mbox.sgk, I might see
one mail message (and none have been added to any of the folders that
match my ~/.rules).  If I run inc -file ~/mbox.sgk again, I might see
that same message, plus another 3 messages.  

Another confusing point is that even though my ~/.mh_profile says
   inc: -norpop -truncate -audit audit-file
the file mbox.sgk is not zero'd after I fetch the files in it.

Seeking advice,
Susan Kleinmann

---

From: Michael Harnois <[email-masked]>
Date: 19 Aug 1996 11:56:54 -0500

> I have just begun using mailagent, and am hoping for some enlightenment

I am, too, so I hope if you receive private replies you will enlighten me.
> Then I try to fetch mail messages from mbox.sgk into my MH inbox,
 
I'm certain I'm more confused than you are, but is it not true that by
using mailagent wisely one should be able to avoid the use of inc
altogether?

-- 
+ Michael D. Harnois              + Christianity has not been tried +
+ Clergy, computer nerd,          + and found wanting. It has been  +
+ Linux user, Havanese owner      + found difficult and not tried.  + 
+ [email-masked]                +          --G. K. Chesterton     +

---

From: "Susan G. Kleinmann" <[email-masked]>
Date: Mon, 19 Aug 1996 13:27:12 -0400

Hi Michael --

You said:
> ... is it not true that by using mailagent wisely one should be able 
> to avoid the use of inc altogether?

I've been tip-toeing my way forward with mailagent.  My ~/.rules file
currently disposes of only a few of the mailing lists I'm on,
and only those for which I don't get much mail, and I have already
learned from some mistakes I made in it.  As you probably know,
mailagent places messages that aren't matched by anything in ~/.rules
into a mailbox-style file, which must be inc'd in order to be used by MH.  

Yes, I can now write a ~/.rules file that would automatically move 
otherwise-unmatched files into +inbox.  But the fact that I've now seen
mailagent + MH do at least one simple operation in an unexpected and 
unpredicatble way suggests to me that simply refiling unmatched messages
just papers over a flaw which will reveal itself later as a loss of mail.

Dubious (but marginally open-minded),
Susan

---

From: Lars Wirzenius <[email-masked]>
Date: Tue, 20 Aug 1996 05:14:23 +0300

"Susan G. Kleinmann":
> 2 times, to get all the files from mbox.sgk into +inbox.  

Are you sure the mbox.sgk has all the messages? If you route them via
sendmail (or smail or whatever MTA you have), it may take a few moments
for them to arrive. I think popclient automatically routes them via
sendmail, but I haven't checked.

"mail -f mbox.sgk < /dev/null" is an easy way to check the contents of
a mailbox, or use "from -f mbox.sgk" if you wimpy.

My own setup does not make the mails go via sendmail, but pipes them
directly to procmail. Actually, not directly, but one by one:

formail -b -s sh -c < $temp \
"/home/liw/bin/qpdecodemail | /usr/bin/procmail /home/liw/.procmailrc; sleep 2"

($temp is the mailbox, qpdecodemail is my stupid filter to remove all
quoted-printable encodings from mail)

> the file mbox.sgk is not zero'd after I fetch the files in it.

As far as I can tell, what happens is that inc first read the profile,
and sets -truncate. Then it reads the command line, and -file automatically
sets -notruncate. If you have both -truncate and -file in the profile,
the file is truncated.

-- 
Rural sizes win <[email-masked]> <http://www.iki.fi/liw/>
Please don't Cc: me when replying to my message on a mailing list.

---

From: Manoj Srivastava <[email-masked]>
Date: 20 Aug 1996 00:19:54 -0400

Hi,

	Umm, could you send a few messages to your isp, susan, such
 that the messages fall through your mailagent .rules file, and see if
 the ~/mbox.sgk file looks ok? (if you mail it to me, I could have a
 look). Are you annotating the mail message in any way?

	I haven't used MH, but I routinely use VM (under emacs) to
 read mail that escapes mailagent (which is my personal mail), and
 have never had problems ...

	manoj
-- 
9 more days in the frozen northlands.
Manoj Srivastava               Systems Research Programmer, Project Pilgrim,
Phone: (413) 545-3918               A143B Lederle Graduate Research Center,
Fax:   (413) 545-3203         University of Massachusetts, Amherst, MA 01003
<[email-masked]> <URL:http://www.pilgrim.umass.edu/%7Esrivasta/>

---

From: "Susan G. Kleinmann" <[email-masked]>
Date: Wed, 21 Aug 1996 10:55:28 -0400

> 2 times, to get all the files from mbox.sgk into +inbox.  

I applied Michael Harnois suggestion to have all messages automatically
processed by .rules, so messages which don't match any other rule go
straight to +inbox without my having to execute 'inc'.  That removes
a complication from the above story, but does not eliminate the problem.

Witness the following:

$ popclient -3 -P ~/.tiac pop1.tiac.net
QUALCOMM Pop server derived from UCB (version |214r3+TIAC|) at mailserver1 starting.
1 messages in folder
reading message 1...
$ scan last
4955  08/20 Michael Meskes     Re: Shadow vss PAM<<Patrick W
$ scan last
4956  08/21 To:[email-masked]  monitor info<<Hi Janice -- Yo

Notice that:
-- the popclient finished before I executed the 'scan' command,
-- the first of the two "scan last" commands finished before I executed
   the second.
-- the second "scan last" yielded a different result the second time
   I invoked it.  

This must certainly be a bug.  I don't know if it is in popclient, 
mailagent, or possibly MH.

I'm hesitant to submit a bug report til I know which one it is.
Comments welcome (but of course, I can't guarantee I'll see them!).

Susan Kleinmann

---

From: "Susan G. Kleinmann" <[email-masked]>
Date: Wed, 21 Aug 1996 12:59:39 -0400

I discovered (more or less) what was happening, by a fluke experience!

I have another account at another ISP on which I had never previously
checked my mail til today.  My user name at the other ISP is just "susan".  
Now, the likelihood that they've had (in the past) another user named susan 
is not small.  When I executed popclient with user name 'susan' to my
alternate ISP, I got a flood of 904 mail messages!  Apparently, the 
ghost-of-susan-past had subscribed to a very active mailing list 
(majordomo), and then never unsubscribed.

This gave an opportunity to check where the messages were going:

popclient calls sendmail.
The messages being received seem to go first into /var/spool/mqueue.
Then the messages go from there to ~/var/mailagent/queue.
Since the last line of my ~/.rules file is "{ SAVE +inbox };", files that
don't match any preceding rules go from ~/var/mailagent/queue to +inbox.
Apparently, mailagent doesn't finish dumping its queue (either to 
mbox.username or to +inbox) before it lets the user start reading the results.

I don't know if this is the planned procedure, but it seems both 
inefficient (3 boxes for each message) and confusing (the user isn't 
notified when mailagent is finished its work).

Sorry for using so much bandwidth over this problem; I hope some of it
is useful to somebody.

Susan Kleinmann

---

From: [email-masked] (Brian Mays)
Date: 22 Aug 1996 11:54:04 -0400

>>>>> Regarding Re: mailagent and MH ; "Susan G. Kleinmann"
	<[email-masked]> adds:

    Susan> $ popclient -3 -P ~/.tiac pop1.tiac.net
    Susan> QUALCOMM Pop server derived from UCB (version |214r3+TIAC|)
    Susan> at mailserver1 starting.
    Susan> 1 messages in folder
    Susan> reading message 1...
    Susan> $ scan last
    Susan> 4955  08/20 Michael Meskes     Re: Shadow vss PAM<<Patrick W
    Susan> $ scan last
    Susan> 4956  08/21 To:[email-masked]  monitor info<<Hi Janice -- Yo

    Susan> Notice that:
    Susan> -- the popclient finished before I executed the 'scan'
    Susan>    command,
    Susan> -- the first of the two "scan last" commands finished
    Susan>    before I executed the second.
    Susan> -- the second "scan last" yielded a different result the
    Susan>    second time I invoked it.

    Susan> This must certainly be a bug.  I don't know if it is in
    Susan> popclient, mailagent, or possibly MH.

Last time I checked, the popclient program simply retrieves each
message from the server and mails it, using the generic `mail'
program, to the user's local account.  Then the MTA, such as sendmail
or smail, actually delivers the message, sending it to mailagent if
instructed to in the user's .forward file.  The delay that you have
observed is the time required for the local MTA to deliver the
message.

--
Brian Mays

---

From: "Susan G. Kleinmann" <[email-masked]>
Date: Fri, 23 Aug 1996 06:00:28 -0400

Hi Brian --

> observed is the time required for the local MTA to deliver the

You are exactly right.  I think what confused me is that popclient
sends messages to the terminal saying "reading message <N>", then
"reading message <N+1>", which I took to mean that it had finished
reading message N, and had therefore made it available for me to read.  
That was wrong, and the delay was long enough to have caused the
confusion.

This is a case of files being shifted between several buckets.
ISP -> /var/spool/mqueue -> mailagent's spool -> MH's folders.
 #1           #2                 #3                   #4

I suppose what's confusing is that what I used to do was to call MH's
'inc' command directly, which was equivalent to saying "please put my
mail messages in bucket #4".  What happened before the messages were
dumped into #4 was invisible to me.  By calling popclient directly,
which is what's required in order to cause the MTA to divert messages
through mailagent, I'm saying "please put my messages into bucket #2".
Lacking any notification that mailagent is in the process of 
moving messages from #2 to #4, I just assumed that the completion of 
the only task I executed from the command line (popclient) implied 
the completion of the whole process.  (Hmm. Somehow the fact that
this doesn't happen, and yet the user isn't notified, still 
seems non-optimum.)

Meanwhile, your interpretation is very much appreciated.  Am beginning 
to "get it."

Thanks,
Susan Kleinmann