From:	CSBVAX::MRGATE!info-vax-request@kl.sri.com@SMTP 27-MAY-1988 03:09
To:	ARISIA::EVERHART
Subj:	Re: Getting rid of phantom NEW MAIL msgs upon login...


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
