Subject: Extra mail? Deleted mail?

From: Brian Larkin <[email-masked]>
Date: Thu, 25 Aug 94 11:29:45 -0500

We have pine 3.89 here (can't wait for 3.90....), and have been
experiencing some problems with messages.  My purpose to posting this
here is to see if any of you have experienced similar things.

Several of my users complain that after printing their message (with
the Y command using the lpr setting) the message gets deleted in their
mailbox.  For the most part this seems to happen in mailboxes that are
_NOT_ the INBOX.  

Several others have mentioned that sometimes they get "extra" copies
of messages.  I have checked the maillogs (every message gets logged
into a file) and only one message was sent, therebye leading me to
believe that this problem is related to Pine's handling of mail
connections.  

If anybody has any thoughts or pointers for tracking down this problem
please email to [email-masked].  My experience to pine is mostly
related to installing it, as I do not use it as my primary mail-agent.
Most of my users, though, are not very experienced with UNIX,
nevermind, Pine, so I tend to think that this is due to the old
faithful crutch "operator error". :)

For the record:

	Sequent S27's
	DYNIX V3.1.2
	Pine Clients  running only on the Sequents.

-- Brian

-----------------------------------------------------------------------
Brian D. Larkin       			     TEL:  (217) 398 - 2060
[email-masked]	    		     Publication Services, Inc.	
Programming Supervisor                       1802 South Duncan Road
Research & Development                       Champaign, IL 61820 U.S.A.
-----------------------------------------------------------------------

---

From: Dave King <[email-masked]>
Date: Fri, 26 Aug 1994 09:13:08 GMT

Brian, I'll comment on the part of your message that looks familiar to me...

On Thu, 25 Aug 1994, Brian Larkin wrote:

[printing question deleted...]

> believe that this problem is related to Pine's handling of mail

Have you checked syslog? This is where multiple mailings will show up.
 
> 	Pine Clients  running only on the Sequents.

I have also had/have this problem (multiple copies), and know what the
cause is on Sequent's DYNIX/ptx. This problem may or may not be the same
as the one you are experiencing. The problem is caused by orphaned mail 
.lock files.

/bin/mail and mailbox locking
-----------------------------
Sequent's implementation of the "mail" program (the program that actually
delivers mail messages to /usr/mail (/usr/spool/mail on DYNIX 3.1.2?) does
not handle mailings very well to more than one person (multiple names in
To: CC: or Bcc:) *if* one of the destination usernames has a .lock file
existing when /bin/mail tries to write to that person's mailbox. 

A typical sequence of events is:

+  A mail .lock file becomes orphaned (for example after a user crashes 
   Elm2.3).
+  Another local user uses Pine (or Elm, or any other mailer), to mail a 
   message to one than one user on the local computer (including the user 
   with the .lock file).
+  sendmail "collects" the message from Pine (or another mailer), and 
   "hands over" the messages to "mail" if the messages are destined for 
   the local computer.
+  mail successfully writes the message into the mail files (in /usr/mail 
   or /usr/spool/mail) for all users up to the user who has a .lock file.
+  sendmail thinks the entire delivery has failed, and therefore puts the 
   entire recipient list and message text into the mailqueue.
+  sendmail then reprocesses the entire message again (15mins or so 
   later, depending on how often sendmail is configured to process its 
   queue. For example, "/usr/lib/sendmail -bd -q15m".
+  The entire loop starts again.

Which leads to:

+  The user with the .lock file not getting the message, until the .lock 
   file is removed.
+  All users in the list *prior* to the user with the .lock file getting 
   several copies.
+  All users *after* the user with the .lock file not getting the message 
   at all.

If this happens, I check for orphaned lock files by doing: "ls -l
/usr/mail/*.lock", and delete any lock files that are orphans, but *not*
those that are _really_ being used! 

Then, I either manually delete the repeated files from the mail queue
spool area (use /usr/lib/mailq to check, and only do this if you know
exactly what you are doing), or clear the sendmail queue with
"/usr/lib/sendmail -q" (or wait 15mins). 

Sequent know that /bin/mail has lots of bugs (not just the one I've 
mentioned) but it's not a high priority for fixes.

The ideal behaviour in the case of orphaned .lock files would be for 
sendmail and mail to work cooperatively along the lines of "10 out of 12 
users can recieve the mail (no .lock file), so deliver the 10, and only 
put the remaining two recipients in the mail queue".

Finally, on one occassion, several users recieved 76 copies of a message, 
until the offending lock file (caused by an Elm2.3 crash) was removed.

I think the moral of this (lengthy?) story is, that the moment a user 
complains about getting several copies of a message, check for .lock 
files belong to all of the recipients and zap them if not genuine.

Dave
___________________________________________________________________
Dave King  Admin. Computing Services Manager, University of Bristol
RFC-822:   [email-masked]
X.400:     G=Dave;S=King;O=bristol;P=UK.AC;C=GB 
Telephone: 0117 9303961

---

From: [email-masked]
Date: 29 Aug 1994 22:17:17 GMT

Dave King <[email-masked]> suggests that multiple copies of mail
>  existing when /bin/mail tries to write to that person's mailbox.

If that is the problem, there's an *easy* fix.  Just edit the sendmail.cf
file and change the "local delivery mailer" description from

        Mlocal, P=/bin/mail, F=lsDFMmnP, S=10, R=20, A=mail -r $f -d $u
to
        Mlocal, P=/bin/mail, F=lsDFMnP, S=10, R=20, A=mail -r $f -d $u

The "m" flag in the mailer description tells sendmail that this mailer
is able to deliver to multiple users in one transaction.  If you take
out the "m" flag, sendmail will run /bin/mail separately for each user
who's getting mail.

Andy

-- 
Practice random kindness and senseless acts of beauty.        (Anne Herbert)

Andy Behrens
Burlington Coat Factory, Schoolhouse Lane, Etna, N.H. 03750   (603) 643-2800