[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

368.0. "new-mail-counter reset?" by PHENIX::SMITH (William P.N. (Wookie::) Smith) Thu Dec 11 1986 10:47

    I've just brought up a microvax, and one of the accounts tells
    you you have one more new mail message than you really do, but can
    never find it.  How do I set the 'new mail' counter back to correspond
    with reality?
    
    Willie
    
T.RTitleUserPersonal
Name
DateLines
368.1READ/NEWSTAR::PIPERDerrell Piper - VMS developmentThu Dec 11 1986 10:491
     I believe a "READ/NEW" will do it.
368.2thought I already did, guess notPHENIX::SMITHWilliam P.N. (Wookie::) SmithThu Dec 11 1986 12:554
    Sure does, many thanks,
    
    Willie
    
368.3READ/NEW won't work if you move systemsPEANO::GLASERSteve Glaser DTN 226-7646 LKG1-2/A19Tue Jan 13 1987 23:1810
    This only works if you have a mailbox area for the account.
    
    If you move your directory to another machine but leave the account
    behind (probably with a mail forwarding address set), you can't
    get the stupid number zeroed.
    
    Thus is you had outstanding mail when you area got moved, you will
    forever get the message on login.  Only way to clear the number
    is to have the sysadmin point your account at some disk space so
    you can get mail up enough for "READ/NEW" to do its thing.
368.4MARVIN::WARWICKOh No - it's the Pathetic Sharks !!!Wed Jan 14 1987 06:035
    
    	Doesn't SYS$EXAMPLES:MAILUAF.COM give you some way of munging
    new mail counts ?
    
    Trev
368.5Changing the count to whateverECCGY4::COURTSEdwin Courts, ECC MunichWed Jan 14 1987 06:2965
    The newmail count, along with other junk like personal name, forwarding
    address, etc., etc., that is specific to each user is held in the
    indexed file SYS$SYSTEM:VMSMAIL.DAT Assuming to you are sufficiently
    privileged to read/write to it, and know the record layout therein,
    it's not difficult to change any field relevant to a specific VAXmail
    account. It is this file that is referred to at login to display
    the 'xx New Mail messages' message.
    
    I just knocked up the following command file to examine the newmail
    count for a specific user and optionally change it to whatever value
    you like. This does not affect the contents of mail folders (esp.
    NEWMAIL) etc., in the actual users mail directory. Needless to say,
    you'd usually simply change it to zero to clear the newmail count).
    
    I have other command files that also play with VMSMAIL.DAT, for
    example I change my Personal name, automatically when I enter Mail
    each time to a string randomly taken from a list of over 300 personal
    name strings.
    
    If anyone wants to know more about the structure of VMSMAIL.DAT,
    or my other command files, mail me direct.
    
    Edwin.

    BTW, no apologies for untidiness or poor structure...I just threw
    it together in a few minutes!
        
==========================cut here===================================
$!
$! Command file SET_NEWMAIL_COUNT.COM to examine and optionally change
$! the 'newmail' counter for a VAXmail user.
$!
$! Edwin Courts, ECC Munich, January, 1987
$!
$! 	check for sufficient privs to do this
$old_priv=f$setpriv("BYPASS")
$if .not. f$privilege("BYPASS") then $goto nopriv
$! 	if here then we're powerful enough
$inquire user "Enter User name to change "		!get username to change
$user=f$edit(user,"trim,compress,upcase")		!tidy up input
$open/share=write/read/write file sys$system:vmsmail.dat	!open file
$read/index=0/key="''user'"/error=none_such file record	!get current mail record
$new_cnt=f$cvui(33*8,16,record)			!determine count from record
$write sys$output "User ''user' has ''new_cnt' new messages"
$inquire cnt "Enter new count <ret> to leave untouched " !get count to insert
$if cnt.nes."" then $goto modify
$!	if here then no input, so no change
$write sys$output "Count unchanged"
$goto xit
$modify:
$!	if here, we want to alter record, and re-insert it.
$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:
$!		tidy up and exit
$close file                  
$set_priv=f$setpriv(old_priv)
$exit
$nopriv:
$write sys$output "Not enough privileges...."
$exit
368.6(-: :-)VAXUUM::DYERSpot the DifferenceWed Jan 14 1987 09:114
> I just knocked up the following command file . . .

Funny, it doesn't look pregnant . . .
 <_Jym_>
368.7VMSMAIL May change..MOTHRA::DUTKONestor Dutko, VMS/VAXclusters CSSEWed Jan 14 1987 09:236
    Please beware, the structure of VMSMAIL.DAT is always subject to
    change, and therefore the reason why the record layout is not
    documented anywhere.  I believe that the file format will change
    with V5.0.
    
    -- Nestor
368.8ERIS::CALLASSo many ratholes, so little timeWed Jan 14 1987 11:004
    The file format *will* change. As a matter of fact, it has already done
    so. 
    
    	Jon
368.9Life is an ever changing recordECCGY4::COURTSEdwin Courts, ECC MunichWed Jan 14 1987 13:2621
    Re .6
    	I had a funny feeling when I wrote that that 'knocked up' meant
    	something other than what *I* meant to an American. Oh well,
    	must just go to the toilet to wash my hands :-)
    
    Re .7
    	Credit where credit is due, Nestor gave me the record definitions I
    	used to knock up that command file. MAILUAF.COM helped alot
    	too.                                           
    
    Re .8
    	To the best of my knowlege that command file works ok for VMS
    	V4.0 - V4.4, I've not tried it beyond that. I've come to expect
    	changes to any system file like that between any VMS       
    	updates/versions, and echo Nestors comments that the record
    	descriptions used are not public, and subject to change without
        warning.
    	Could someone tell me what the current changes are, and when
    	they took effect ?
        
    E
368.10PASTIS::MONAHANThu Jan 15 1987 03:394
    re: .6   ....yet another case of being divided by a common language.
    If he had used a pencil to write the note instead of electronic
    means you could have disposed of the offending word with a rubber.
    :-)
368.11Time for the definition to go Public?IOSG::PYEGraham - ALL-IN-1 Sorcerer&#039;s ApprenticeThu Jan 15 1987 04:5912
Re .8

In view of the number of hackers and *gasp* applications (including ALL-IN-1) 
that actually read VMSMAIL.DAT, isn't it time the definition of it for any 
particular version was included in some suitable VMS file?

E.g. SYS.STB or STARLET or something?????

Or at least made available to developers without having to go through the 
contortions that Edwin describes.

Graham Pye.
368.12Hear, hear.ECCGY4::COURTSEdwin Courts, ECC MunichThu Jan 15 1987 11:340
368.13A callable interface is preferable.ERIS::CALLASSo many ratholes, so little timeThu Jan 15 1987 11:4819
    re format of VMSMAIL.DAT:
    
    The file will change in V5.0. There are some people running a
    pre-release of V5.0 MAIL around the Enet. I'm running it myself on
    ERIS. For these people, the mail file format has changed. As a matter
    of fact, the file name has changed to VMSMAIL_PROFILE.DATA. 
    
    I'm not a MAIL devo, just a field test site, so feel free to flame at
    me for these opinions, as it won't change a thing: no, I don't think
    the format of the file should be documented. I really don't think it's
    any business of an application what the format of the file is. In V5.0,
    there will also be callable mail, which will give you access to the
    mail profile so that your programs won't break when it changes again.
    The format of the mail profile is the mail system's business. Once you
    have a supported way to change parameters in it, you shouldn't be
    dinking the file yourself. 
    
	Jon Callas
	VMS development
368.14Share The Code - Reap The BenefitsVAXUUM::DYERSpot the DifferenceThu Jan 15 1987 16:353
{RE .13} - If everyone thought like that, TOPS-20 would never have had MM and
 MS.  Yup, we'd've been stuck with RDMAIL and SEND, which were supported.
  <_Jym_>
368.15ERIS::CALLASSo many ratholes, so little timeFri Jan 16 1987 11:1611
    Sorry, but that's what supported interfaces are for. You'll be able to
    do with callable mail anything you can do without it. What's the big
    deal, anyway? It's *exactly* like saying, "Don't do I/O to SYSUAF, use
    $GETUAI/$SETUAI instead." It's real desireable (at least to me, anyway)
    to make interfaces that don't break. But then, I forget that this is
    the hacker file, and not the software engineering file.  ;-) 
    
    The poor MAIL devos are so beleagured as it is, it will be real nice
    for them to have the file format to themselves. 

    	Jon
368.16Hacking is more fun with a Chainsaw!MOTHRA::DUTKONestor Dutko, VMS/VAXclusters CSSEFri Jan 16 1987 11:5317
    RE:.-1
    
>    Sorry, but that's what supported interfaces are for. You'll be able to
>    do with callable mail anything you can do without it. What's the big
>    deal, anyway? It's *exactly* like saying, "Don't do I/O to SYSUAF, use
>    $GETUAI/$SETUAI instead." It's real desireable (at least to me, anyway)
>    to make interfaces that don't break. But then, I forget that this is
>    the hacker file, and not the software engineering file.  ;-) 

    True, but too many times there are certain things that would be
    nice to be done, but are NOT provided.  For example, consider the
    case you gave of $GETUAI.  There is NO way supplied to go through
    the file sequentially!  Yet, the feature may appear in V5.0 (saw
    it in some notesfile), but as an interrim till the supported interface
    is available, others have to hack...
    
    -- nestor