[comp.os.vms] Getting rid of phantom NEW MAIL msgs upon login...

LIVINGSTONE@bert.chem.wisc.EDU (Gonzo Fibes) (04/21/88)

A MAIL.MAI file was accidently erased before two new mail msgs were

read.  The MAIL.MAI file was re-CREATEd, but now everytime the user 

logs on, he receives a "You have 2 new MAIL messages" when he doesn't.

Real mail sent to this user increments the number from 2 to three and so

on, but the baseline always stays 2.  My guess is that somewhere, in 

some file there were some bits set which need to be un-set.  Anyone

out there know the infrastructure of the MAIL utility well enough to

help me get rid of this msg?  My SYSOP is stumped.

Thanks.

Jeff Livingstone
U of Wisconsin - Madison
Chemistry Dept.
-------

craig@csdgwy.unsw.edu.au (05/18/88)

In article <11957897978315001@bert.chem.wisc.edu>, LIVINGSTONE@bert.chem.wisc.EDU (Gonzo Fibes) writes:
> A MAIL.MAI file was accidently erased before two new mail msgs were
> read.  The MAIL.MAI file was re-CREATEd, but now everytime the user 
> logs on, he receives a "You have 2 new MAIL messages" when he doesn't.
> Real mail sent to this user increments the number from 2 to three and so
> on, but the baseline always stays 2.  My guess is that somewhere, in 
> some file there were some bits set which need to be un-set.  Anyone
> out there know the infrastructure of the MAIL utility well enough to
> help me get rid of this msg?  My SYSOP is stumped.

This problem was described in a PAGESWAPPER a couple of years back.
I seem to recall (I haven't checked) that the solution was to go into MAIL
and type READ/NEW.
                                                                   
						Craig McGregor

bengtb@erix.UUCP (Bengt Baeverman) (05/19/88)

Getting rid of a bogus "You have new mail" messages is easy. Use the command:

	READ/NEW

in mail and your problem is solved.

Bengt Baverman, bengtb@erix.se
Opiab Digitech, Stockholm, Sweden.

MCGEE@NUACC.ACNS.NWU.EDU (Randy McGee) (05/20/88)

This is documented in "VAX/VMS Mail Utility Reference Manual" (V4.0, order no.
AA-Z421A-TE) on pp MAIL-15:

   "If the number of new (unread) mail messages displayed on your screen is 
   inconsistent with the actual number of new messages, enter the READ/NEW
   command whne there is no new mail." 

Randy McGee (MAGOO) <mcgee@nuacc.acns.nwu.edu>     Phone:    (312) 491 4079
Academic Computing and Network Services            USPost:   2129 Sheridan Road
Northwestern University                                      Evanston, IL  60208

mst@csun.UUCP (Mike Temkin) (05/20/88)

In article <400@csdgwy.unsw.edu.au> craig@csdgwy.unsw.edu.au writes:
>In article <11957897978315001@bert.chem.wisc.edu>, LIVINGSTONE@bert.chem.wisc.EDU (Gonzo Fibes) writes:
>> A MAIL.MAI file was accidently erased before two new mail msgs were
>> read.  The MAIL.MAI file was re-CREATEd, but now everytime the user 
>> logs on, he receives a "You have 2 new MAIL messages" when he doesn't.
>> Real mail sent to this user increments the number from 2 to three and so
>> on, but the baseline always stays 2.  My guess is that somewhere, in 
>> some file there were some bits set which need to be un-set.  Anyone
>> out there know the infrastructure of the MAIL utility well enough to
>> help me get rid of this msg?  My SYSOP is stumped.
>
I had the same problem about 2 months ago.  Someone was posted a response
that I followed and it worked beautifully.
	1.  Mail yourself two messages, you now should see 4 new messages
	2.  Copy the mail.mai file to a temporary file
	3.  Delete the two messages from the mail.mai file,
		this leave you back where you started from.
	4.  Copy the temporary file to mail.mai
	5.  Delete the two messages and your count will be correct. :-)

Hope this helps!
-- 
Mike Temkin
...!{ihnp4,sdcrdcf,hplabs,psivax,ttidca}!csun!mst
Cal. State U. Northridge, School of Engineering and Computer Science

mitch@batcomputer.tn.cornell.edu (Mitch Collinsworth) (05/20/88)

>> [the old new mail count > actual new messages problem]

>This problem was described in a PAGESWAPPER a couple of years back.
>I seem to recall (I haven't checked) that the solution was to go into MAIL
>and type READ/NEW.

Better than that, it's in the VAX/VMS Mail Utility Reference Manual.
From page MAIL-15 of the V4.0 manual:

	If the number of new (unread) mail messages displayed on your
	screen is inconsistent with the actual number of new messages,
	enter the READ/NEW command when there is no new mail.


-Mitch Collinsworth
 mitch@tcgould.tn.cornell.edu

cook@tramp.Colorado.EDU (Richard Cook) (05/21/88)

This question pops up on a regular basis (anyone for an `Answers to
Questions Frequently Asked on comp.os.vms' monthly column??), but part
of the answer usually gets left out of responses. READ/NEW when there is
no new is essentially the correct answer, but MAIL.MAI must exist for
this to work...and this is something RingTFM doesn't tell you. If you
have accidentally (or intentionally) deleted MAIL.MAI then you can send
yourself a dummy message and READ/NEW (twice!) to synchronize things.

Richard L. Cook                   443-4809 (H) or 492-2148 (W)

Data Analysis Center, Box 486     cook@tramp.Colorado.EDU
University of Colorado            cook@Colorado.BITNET
Boulder, CO 80309-0486            CUBLDR::COOK_R on CU's DECNET

OPERATOR%WATSCI@watmta.UWaterloo.CA (Allan Fleming) (05/24/88)

It is trivial to reset the new mail counter - unfortunately it takes two days
of digging through the MAIL manual to find out how.

To solve the new mail counter problem:

Go into MAIL
Read all of your new messages
Issue the command SELECT
Issue the command READ/NEW
Your problem should now be solved.

Allan Fleming

fritz@unocss.UUCP (Tim Russell) (05/25/88)

Well, since several people seem to have missed it the first time, (or was it
ever posted here? I forget where I got it..),  I thought I'd post
the final answer to the mail count problem.

    This is MAILCOUNT.COM, a program that updates SYS$SYSTEM:MAILUAF.DAT
with whatever count you want.  The only use I can see for it is to set the
count back to zero, but then, it might be fun to see someone's expression
when they login and see "You have 9999 new mail messages"... :-)

    Anyway, it needs BYPASS, so if you don't have it, give this program to
a manager or someone who does.

------------------------------/ Cut Here /------------------------------------
$!
$! Command file SET_NEWMAIL_COUNT.COM to examine and optionally change
$! the 'newmail' counter for a VAXmail user.
$!
$ OLD_PRIV=F$SETPRIV("BYPASS")
$ IF .NOT. F$PRIVILEGE("BYPASS") THEN $GOTO NOPRIV
$ READ/PROMPT="Enter User name to change: " SYS$COMMAND USER
$ USER=F$EDIT(USER,"TRIM,COMPRESS,UPCASE")
$ OPEN/SHARE=WRITE/READ/WRITE FILE SYS$SYSTEM:VMSMAIL.DAT
$ READ/INDEX=0/KEY="''USER'"/ERROR=NONE_SUCH FILE RECORD
$ NEW_CNT=F$CVUI(33*8,16,RECORD)     ! Determine count from record
$ WRITE SYS$OUTPUT "User ''user' has ''new_cnt' new messages."
$ READ/PROMPT="Enter new count <RETURN> to leave untouched " SYS$COMMAND CNT
$ IF CNT .NES. "" THEN $GOTO MODIFY
$ WRITE SYS$OUTPUT "Count unchanged"
$ GOTO XIT
$MODIFY:
$ RECORD[33*8,16]=F$INTEGER(CNT)  !alter field in record
$ WRITE/UPDATE FILE RECORD	  !put record back
$ GOTO XIT
$NONE_SUCH:
$ WRITE SYS$OUTPUT "User ''user' does not exist"
$XIT:
$ CLOSE FILE                  
$ SET_PRIV=F$SETPRIV(OLD_PRIV)
$ EXIT
$NOPRIV:
$WRITE SYS$OUTPUT "Not enough privileges...."
$ EXIT

-- 
---------------------------------+--------------------------------------------
 Tim Russell, Computer Operator  | Internet: oper06%zeus.dnet@fergvax.unl.edu
 Campus Computing                | Bitnet:   OPER06@UNOMA1, CONSLT32@UNOMA1
 University of Nebraska at Omaha | UUCP:     {ihnp4}!unocss!fritz

info-vax-request%kl.sri.COM%KL.SRI.COM%lbl%sfsu1.hepnet@LBL.GOV (05/28/88)

Received: from KL.SRI.COM by LBL.Gov with INTERNET ;
          Fri, 27 May 88 00:06:41 PDT
Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Wed 25 May 88 09:31:55-PDT
Received: by ucbvax.Berkeley.EDU (5.59/1.28)
	id AA27455; Wed, 25 May 88 01:14:58 PDT
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 24 May 88 17:00:38 GMT
From: btni!hdr!unocss!fritz@uunet.uu.net  (Tim Russell)
Organization: U. of Nebraska at Omaha
Subject: Re: Getting rid of phantom NEW MAIL msgs upon login...
Message-Id: <286@unocss.UUCP>
References: <11957897978315001@bert.chem.wisc.edu>, <400@csdgwy.unsw.edu.au>, <4872@batcomputer.tn.cornell.edu>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com
 
Well, since several people seem to have missed it the first time, (or was it
ever posted here? I forget where I got it..),  I thought I'd post
the final answer to the mail count problem.
 
    This is MAILCOUNT.COM, a program that updates SYS$SYSTEM:MAILUAF.DAT
with whatever count you want.  The only use I can see for it is to set the
count back to zero, but then, it might be fun to see someone's expression
when they login and see "You have 9999 new mail messages"... :-)
 
    Anyway, it needs BYPASS, so if you don't have it, give this program to
a manager or someone who does.
 
------------------------------/ Cut Here /------------------------------------
$!
$! Command file SET_NEWMAIL_COUNT.COM to examine and optionally change
$! the 'newmail' counter for a VAXmail user.
$!
$ OLD_PRIV=F$SETPRIV("BYPASS")
$ IF .NOT. F$PRIVILEGE("BYPASS") THEN $GOTO NOPRIV
$ READ/PROMPT="Enter User name to change: " SYS$COMMAND USER
$ USER=F$EDIT(USER,"TRIM,COMPRESS,UPCASE")
$ OPEN/SHARE=WRITE/READ/WRITE FILE SYS$SYSTEM:VMSMAIL.DAT
$ READ/INDEX=0/KEY="''USER'"/ERROR=NONE_SUCH FILE RECORD
$ NEW_CNT=F$CVUI(33*8,16,RECORD)     ! Determine count from record
$ WRITE SYS$OUTPUT "User ''user' has ''new_cnt' new messages."
$ READ/PROMPT="Enter new count <RETURN> to leave untouched " SYS$COMMAND CNT
$ IF CNT .NES. "" THEN $GOTO MODIFY
$ WRITE SYS$OUTPUT "Count unchanged"
$ GOTO XIT
$MODIFY:
$ RECORD[33*8,16]=F$INTEGER(CNT)  !alter field in record
$ WRITE/UPDATE FILE RECORD	  !put record back
$ GOTO XIT
$NONE_SUCH:
$ WRITE SYS$OUTPUT "User ''user' does not exist"
$XIT:
$ CLOSE FILE                  
$ SET_PRIV=F$SETPRIV(OLD_PRIV)
$ EXIT
$NOPRIV:
$WRITE SYS$OUTPUT "Not enough privileges...."
$ EXIT
 
-- 
---------------------------------+--------------------------------------------
 Tim Russell, Computer Operator  | Internet: oper06%zeus.dnet@fergvax.unl.edu
 Campus Computing                | Bitnet:   OPER06@UNOMA1, CONSLT32@UNOMA1
 University of Nebraska at Omaha | UUCP:     {ihnp4}!unocss!fritz