From:	RTPUX1::RTPUX1::"MCNC!UVADM.UVCC.EDU!COLEVE@RTPARK.GE.COM" 15-JUN-1989 08:44
To:	vmsnet@falcon.aamrl.af.mil
Subj:	Here is a DCL program to look inside MAIL_PROFILE.DATA

Mitch Collinsworth commented:
 
>Bob Tinkelman points out a change in the functionality of VMS MAIL and asks:
>
>>How can I get VMS MAIL to accept the lowercase characters?
>
>Quite interesting.  I hadn't noticed this before, but it gets even more
>interesting than that.  We use a similar syntax for mail forwards here
>for users who want their mail forwarded to a unix system.  I just tried
>a few tests and discovered that the part within the quotes gets mapped
>to upper case if you do a SET FORWARD/USER= , but not when you do a
>SET FORWARD for your own account! 
 
By golly!  DEC has outdone themselves with this one.  Mitch is quite correct.
I checked it both with MAIL and by using the following DCL command file.
 
It made me think that if someone did a little editing on my mail file reader
so it would massage a user record and do a WRITE/UPDATE on it one could set
whatever he wanted in the way of a forwarding address.
 
The implementation is left as an exercise for the student.
vvvvvvvvvvvvvvvvvvvvvvvv cut along dotted line vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
$ ! LIST_MAIL_FILE.COM -- lists contents of VMSMAIL_PROFILE.DATA
$ ! correct next line and remove all "!!!" comments if you have GETUAF.
$ getuaf = "$DECUS:GETUAF"
$ last = ""
$ acc  = ""
$ on control_y then goto ex
$ on error then goto ex
$ open/read/SHARE v sys$system:vmsmail_profile.data
$next_name:
$    inquire name "Username [* for all]"
$    if name .eqs. "" then goto ex
$    if name .nes. "*" then goto one_name
$!
$!      perform wildcard print, then exit
$loop2:
$	read/end_of_file=ex v rec
$	name   = f$extract(0,20,rec)
$	on warning then goto badname
$	!!! getuaf/last=last/account=acc 'name'
$	gosub report
$	goto loop2
$
$one_name:
$	read/end_of_file=unknown/key='name'/error=unknown v rec
$	  name   = f$extract(0,20,rec)
$	  on warning then goto unknown
$	  !!! getuaf/last=last/account=acc 'name'
$	  gosub report
$	  goto r2
$unknown:
$	   write sys$output "No record of ""''name'""."
$r2:
$	goto next_name
$ex:
$close v
$exit
$
$badname:
$ last = "***********"
$ acc = "NO ENTRY"
$ gosub report
$ goto loop
$
$report:
$ count = f$cvui(280,15,rec)
$ write sys$output "''name' ''acc' ''last' ''Count'"
$ field_finder = 0
$gf_loop:
$   gosub getfield
$   if field_type .eq. 0  then return
$   if field_type .eq. 3  then write sys$output "    Mail directory ""''field'"""
$   if field_type .eq. 4  then write sys$output "    Forward to " + field
$   if field_type .eq. 5  then write sys$output "    Personal name: ""''field'"""
$   if field_type .eq. 8  then write sys$output "    Editor: " + field
$   if field_type .eq. 9  then write sys$output "    Queue : " + field
$   if field_type .eq. 14 then write sys$output "    Form  : " + field
$   goto gf_loop 
$
$getfield:
$   if field_finder .lt. 37 then field_finder = 37
$   if f$length(rec) .le. field_finder
$     then
$	field_type = 0
$	field = ""
$	return
$     endif
$   field_type = f$cvui(8 * field_finder,15,rec)
$   if field_type .ne. 0 
$     then
$	field_finder = field_finder + 2
$	field_length = f$cvui(8 * field_finder,15,rec)
$	field_finder = field_finder + 2
$	field = f$extract(field_finder,field_length,rec)
$	field_finder = field_finder + field_length
$     endif
$   return
$! Documentation for the contents of VMSMAIL_PROFILE.DATA:
$! Reverse engineered by V. Cole 17-APR-1989.
$! Records are variable length indexed by USERNAME.
$! Bytes 0..30	USERNAME - text.
$! Word @31	Seems to always be one.
$! Word @33	Seems to always be two.
$! Word @35	Newmail count - binary.
$! Starting with Word @37 is a pattern of field_type,length,field where
$!    field type is one of:
$!	0002 flags
$!	0003 mail directory
$!	0004 forwording address
$!	0005 personal name
$!	0008 editor
$!	0009 queue
$!	000D form
$!    length is length of field in bytes.
$!    field is an ascii string, unless field type is two, in which case length
$!      will be 0002 and the field is a bit encoded WORD of:
$!	0001 copy_self send
$!	0002 copy_self reply
$!	0004 noauto_purge
$!	0008 copy_self forward
$!	0010 cc_prompt
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Vern Cole -- Systems Manager -- Utah Valley Community College
snailmail: 800 W. 1200 South, Orem, UT 84058
Voice: (801)222-8000 ext 160
Bitnet: VCOLE@UTAHCCA
Internet: COLEVE@UVADM.UVCC.EDU
