Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!metro!sunaus.oz!richb From: richb@sunaus.oz (Rich Burridge) Newsgroups: comp.sources.bugs Subject: Official patch #10 for faces v1.4 (Part 1 of 2). Message-ID: <1991Jan7.075853.15847@sunaus.oz> Date: 7 Jan 91 07:58:53 GMT Organization: Sun Microsystems - Australia Lines: 752 This is official patch #10 for faces v1.4. CONTENTS: 1. What is faces? 2/ Changes made in this patch. 3/ How to install this patch. 4/ How to get previous patches. --------------- 1/ What is faces? Faces is a program for monitoring a list visually. Typically this is a list of incoming mail messages, jobs in the print queue or users on a system. Faces has the ability to read compressed faces images embedded in your mail headers, uncompressing them and displaying them on-the-fly. There are graphical interfaces for X11, XView, SunView and NeWS. ---------------- 2/ Changes made in this patch. - Faces now only looks for X-Face: lines in the mail header, now that there is a simple method for everybody to get their X-Face: lines into the mail header (see below). This fixes up the following problems (which have been removed from the TODO file): If an X-Face is found inside a piece of mail that has been forwarded inside another mail item, and the -U option is set, then it is possible to update the wrong face in the faces database. The only clean solution to this, is if faces only recognises X-Face lines in the mail header. From Pat Lashley The problem with finding an X-Face: entry in an included message can be resolved by a flag which would restrict X-Face: recognition to the header or the first non-blank line of the body. - From John Mackin The code in mon.c recognises From: lines in the body of the mail. This is an error. From: lines should only be recognised before the first blank line. - From John Mackin A small shell script called faces.sendmail has been written, which will automatically add X-Face: compressed image lines to a mail header. This is used in conjunction with the set sendmail entry in a user's ~/.mailrc file. See the README file and the faces manual pages for more details. This method is known to work with Berkeley Mail, Open Windows mailtool and mush. It should work with other mailers too. The special patch to mush is no longer needed; in fact if it has been applied, it should be un-applyed otherwise you will get two sets of X-Face: lines in your mail headers. The mush.xface.patch file can be removed from the faces distribution. FILES, MANIFEST, Makefile, README and faces.1 have been updated. - From John Mackin The manual entry makes no mention of X-Face: lines. - From Mike Khaw The "install" target for the Makefile is missing a "/" between $(MANSECT) and face_update; i.e., the last line should be $(MANDIR)/man$(MANSECT)/face_update.$(MANSECT) - From Chris Mackerell Changes to faces to get it compile in the BSD4.3 environment of Mips RISCos 4.5 (beta). - From brew%qa@tplrd.tpl.oz.au There is a problem parsing the address from which mail comes if the address looks like From: person@machine ie: no "(comment)" after it. You parse this so that the machine name has a trailing '\n'. Although I sometimes get mail like this, perhaps this is not correct RFC822 syntax. - From Chris Maltby It the user had cleared the faces window by hitting the Del key, the icon wasn't being reset to the "no mail" icon. - From Howard Pelling Modifications to allow faces to recognise partial domains in the machine.tab file. Eg. mail from bristol.ac.uk and edinburgh.ac.uk will come from the same community. - From Graham Dumpleton From Alan Skea If the From: line just had a username (no hostname), then the trailing newline was not being removed (in parsefrom.c). - A plain text version of the faces manual pages is now included with the faces distribution. It's called faces.man.text. - From Gregory Dudek In process_info() in mon.c, don't do anything if the mailbox hasn't changed since the last look. - From Gregory Dudek In process_from() in mon.c, I've added an UGLY hack so that mailing lists could be recognized as such, rather than causing zillions of different unknown's to appear. It expects an ugly ugly magic trick in people.tab. The mailing list must appear as listplace/list@listplace eg. ics.UCI.EDU/fa.think-c-outbound-request@ics.UCI.EDU ---------------- 3/ How to install this patch. This patch comes in two parts. The first part contains this introductory test, followed by a shar file. The shar file contains the two new files introduced with this patch. These are faces.man.text and faces.sendmail. The second part is the actual faces patch. You should apply these changes using Larry Walls patch program, then recompile and reinstall. For example: # Save the second part of this patch in a file called "patch10" cd faces_src patch faces.man.text <<'Funky_Stuff' FACES(1) USER COMMANDS FACES(1) NAME faces - visual mail, user and print face server. SYNOPSIS faces [ -H hostname ] [ -MH ] [ -P printer ] [ -S spooldir ] [ -U ] [ -a ] [ -b background ] [ -c columns ] [ -d display ] [ -e program ] [ -f facedir ] [ -g geometry ] [ -h height ] [ -iconic ] [ -i ] [ -n ] [ -p period ] [ -s spoolfile ] [ -t ] [ -u ] [ -v ] [ -w width ] [ -Wi ] [ -Wp x y ] [ -WP x y ] DESCRIPTION faces is a window based tool for visual monitoring lists. Typically it is used to monitor mail, print queues or users on a system. It contains graphical interfaces for NeWS, Sun- View, XView and X11. It has five different modes of opera- tion: The default (no -a, -H, -P or -e arguments) will monitor for new mail. By default, only the last ten messages are displayed. Using the left mouse button it is possible to toggle the text in the faces window. This will either be the username or the time the mail message arrived. You can clear this area to the background pattern by hitting the Delete key (but see below, under set button1clear). The icon shows the image of the last message to arrive. The second choice (-a) is to monitor the whole of a mail file. The open window will automatically adjust its size to correctly show the face icons. The open window options are the username or the timestamp and number of message from that user. The icon will display the image of the last mes- sage, and a count of the total number of messages in the spool file or mail folder. The third option (-P) allows this program to monitor a given print queue. This will generate a single face icon showing the job at the top of the print queue, and the text message will display the printer name plus the number of jobs to be printed. Opening the window will show images of all the jobs in the queue. The text on each image can be toggled, choices being the owner's name and the size of the job in bytes. With the fourth mode (-H), you can monitor who is logged in a machine. For each user, a face image is displayed. Text can be either the username or the time they logged on. The iconic form displays the total number of users. Finally you can specify a program or shell script to run (-e). The standard output from this program will be read by the faces program, and the appropriate faces displayed using the information provided. The format of this face Sun Release 4.1 Last change: 4 January 1991 1 FACES(1) USER COMMANDS FACES(1) information is given in the faces manual page. There are special displays for no mail, no faces found, no print jobs, no paper in the printer, and no users logged into a machine. OPTIONS -H hostname Name of the machine to monitor. Faces will be displayed for each user logged in. -MH Used when the user is using MH to read mail. MH can shrink the mail spoolfile and the default mail monitoring facility within faces adjusts accordingly. -P printer Printer name to monitor. If this and a mail spool file are given with the -s option, faces will monitor the print queue. -S spooldir Specify an alternate mail spool directory. The folder that will be monitored will then be spooldir/username where username is the name of the user currently logged in. -U Automatically send mail to a special mail alias, to update the faces database when a new X-Face: record is read. By default this special alias is facemaker. This should be aliased (see aliases(7)) to: facemaker: "|/usr/local/bin/face_update" By default the face_update shell script will not overwriting existing ikons in the faces data- base. Overwriting will take place if the -w option is specified. You should also note that the installation of this mail alias is not done automatically, as this might be considered a security risk on some systems. -a Monitor the whole of the specified mail file. The icon and open window display the appropriate faces, and dynamically change size as a new check is made and if the mail file has altered size. -b background Sun icon file containing an alternate background pattern. The default is root grey. -c columns Number of columns of face images in each row. By default this is 10. -d display Used with the X11 variant of faces to give the Sun Release 4.1 Last change: 4 January 1991 2 FACES(1) USER COMMANDS FACES(1) display name. -e program Name of the user program to run. This program or shell script will generate lines which the faces program will read, and then display the appropriate face images. The format of these input records is described in a later section. -f facepath If specified, this is a colon-separated list of paths to be searched for face images. A null entry in the path will be replaced by the com- piled in default face directory. If not speci- fied, the directories specified by the FACEPATH environment variable will be used. If there is no FACEPATH environment variable, the default face directory will be searched. The default face directory is normally /usr/local/faces. -g geometry Used with the X11 variant of faces to give geometry information. -h height The height of each face image in pixels. Note that this is the height of the area allocated to each image, and not necessarily the height of the displayed image inside. -iconic Start the faces program up in iconic form. -i Invert the faces images before displaying them. For use by people who started SunView with the -i option. -n Do not display the number of messages from this person. The default is to display, and a count is shown at the bottom right corner of the face for this person. -p period The period in seconds before the mail spool file or the print queue is scanned again for new mail. The default is 60 seconds. -s spoolfile Use an alternate mail spool file to monitor. The default is /var/spool/mail/username where user- name is the name of the user currently logged in. -t Do not display a timestamp of the last message from this person. The default is to display, and a timestamp is shown at the bottom left corner of the face for this person. Sun Release 4.1 Last change: 4 January 1991 3 FACES(1) USER COMMANDS FACES(1) -u Do not display the username on the face icon. The default is to display, and the username will appear over the face icon, when the window is opened. -v Print the version number of this release of the faces program. -w width The width of each face image in pixels. Note that this is the width of the area allocated to each image, and not necessarily the width of the displayed image inside. -Wi Start the faces program up in iconic form. Sun- View automatically uses this flag, but the NeWS version will also. -Wp x y Start the open window position at x y -WP x y Start the icon position at x y FACE FORMATS There is a special faces directory containing a fixed three-level hierarchy, which by default is /usr/local/faces. The first level is a machine name, the second level a user name, and the third level is the actual face image, which can be stored in four formats. If the file is named 48x48x1 then it is a Blit ikon, if it is called sun.icon then the image is stored in Sun icon format, if the file is named face.xbm then it is an X11 xbm formatted image, and if the file is called face.ps then it contains executable NeWS code. Multiple formats can be stored in the same username directory, and the one used will depend upon which graphics interface is currently being used. If the username level is a plain file (not a directory) it is assumed to be a Blit icon. To access the face for the mail name machine.dom.ain!uid take the result of the first successful open from the fol- lowing list of files (where $DIR represents iteration over the list of directories in FACEPATH): $DIR/machine.dom.ain/uid/iconname $DIR/dom.ain/uid/iconname $DIR/ain/uid/iconname $DIR/misc./uid/iconname $DIR/machine.dom.ain/unknown/iconname $DIR/dom.ain/unknown/iconname $DIR/ain/unknown/iconname $DIR/misc./unknown/iconname If the -f argument is specified the given directory is searched instead of /usr/local/faces. The iconname above, consists of the following choices, in the given order: Sun Release 4.1 Last change: 4 January 1991 4 FACES(1) USER COMMANDS FACES(1) NeWS - face.ps, sun.icon, 48x48x1, face.xbm SunView - sun.icon, 48x48x1, face.xbm X11 - face.xbm, sun.icon, 48x48x1 Domain names are now fully supported. For example, if mail arrives from foo@a.b.c then faces will use the directories a.b.c, b.c and c for the machine name. The directory misc. hold faces for generic users such as root and uucp. If the faces directory hierarchy is not found, then a blank face image will be used. Faces information is administered by a pair of ASCII files in the faces directory that associate related machines and faces. The machine table machine.tab attaches machines to communities; the line stard=sunaus puts the machine stard in community sunaus. The machine table may be used to alias entire communities; the line wseng.sun.com=eng.sun.com will cause the wseng.sun.com domain to be mapped to the eng.sun.com community. The people table associates a community/alias pair, with a real username. sunaus/rburridge=richb causes the alias rburridge to be translated into the real username richb for the community sunaus Note that you still need to use mailtool or some other mail reading utility to actually read the mail that this program monitors; faces simply displays who the mail is from. When new mail arrives, faces will beep and flash appropri- ately, depending upon the set parameters in the user's faces startup file. This is looked for in the user's home direc- tory; first the file .facesrc is tried, and if that file is not found, .mailrc is looked for. The file, if found, will be examined for lines in the following form: set bell = number Give the number of times faces will ring the bell when new mail arrives. set flash = number Give the number of times faces will flash the window when new mail arrives. set raise faces will raise the window when new mail arrives. set button1clear For those who liked the behaviour of previous versions of faces, this causes button 1 to clear the window (like typing Delete). The ``toggling'' function of button 1 is moved to button 2 if this option is set. Sun Release 4.1 Last change: 4 January 1991 5 FACES(1) USER COMMANDS FACES(1) If you are using the NeWS version and creating face images of the face.ps form, then the following points should be noted: All graphics operations should be performed on the unit square; and the final image will be translated to a 64 x 64 square image at the appropriate position in the faces display. If you are using the -e option, then the user program or shell script should firstly generate a single record with the following fixed format, beginning at column 1: Cols=mm Rows=nn where mm is the size in columns for the faces window and icon, and nn is the size in rows. A window will be generated with these dimensions. This record is followed by the face information records, which are again in fixed format. As well as providing the username and hostname, there are four other fields which can be filled in, which denote what is displayed on the left or the right sides of the bottom area of the window and icon displays. The format for these records is: __________________________________________________ |_________________________________________________| | username 1 20 | | hostname 21 20 | | window left 41 10 | | window right 51 10 | | icon left 61 10 | | icon right 71 10 | |_________________________________________________| Any of these fields may be left blank. There are also four special usernames, which will display the appropriate stan- dard icons. These are NOMAIL, NOPAPER, NOPRINT and NOUSERS. XFACE SUPPORT Faces is capable of recognising a compressed face image in the mail message header. It uses special X-Face: lines to do this. It is very simple to add your compressed face image to a mail header. The following method works for Berkeley Mail (aka /usr/ucb/mail), Open Windows mailtool and mush. It probably works for others too. It is suggested that each user store the compressed image (generated by compface ) in a file called .face in their home directory. See the compface manual page for more infor- mation on how to generate the compressed face image. The first line should have the X-Face: prepended; second and subsequent lines should have a preceding tab, and there should be a trailing blank line. Here is a typical .face file: Sun Release 4.1 Last change: 4 January 1991 6 FACES(1) USER COMMANDS FACES(1) X-Face: *7O.<19S{MCsaxxe=iCc*y5!i:>e,K40m^btp"<`~gNx5>o?eJMzUng=j]%KybY /VaZ/3a4pD%#rGu7D4@L Each user should add the line: set sendmail=/usr/local/bin/faces.sendmail to their ~/.mailrc file, where /usr/local/bin is the direc- tory where your faces binaries were installed. A similar method exists with the Elm mailer. The user's compressed face image should be setup in a ~/.face file, but without the initial "X-Face:", and leading spaces removed from each line. There is also no trailing blank line. Here's an example: *7O.<19S{MCsaxxe=iCc*y5!i:>e,K40m^btp"<`~gNx5>o?eJMzUng=j]%KybY /VaZ/3a4pD%#rGu7D4@L To automatically include this into a header into an Elm mail message, just add the following line to your .elm/elmheaders file: X-Face: `cat $HOME/.face` SEE ALSO mail(1), elm(1), mush(1), aliases(7). FILES /var/spool/mail directory for system mailboxes $HOME/.facesrc faces startup file $HOME/.mailrc mail startup file (examined if .facesrc doesn't exist) /usr/local/faces main directory containing the face icons. /usr/local/faces/people.tab people/file equivalences /usr/local/faces/machine.tab machine/community equivalences ENVIRONMENT VARIABLES DISPLAY The X11 server to be used by the XView or X11 faces program to display the face icons on. Sun Release 4.1 Last change: 4 January 1991 7 FACES(1) USER COMMANDS FACES(1) FACEPATH A colon separated list of directory paths to search for machine/user face icons. HOME The home directory of the current user. Used to locate the .facesrc or .mailrc file. MAIL The complete pathname of the mail spool file to monitor. WINDOW_PARENT Used to verify that the program is executing under a valid SunView environment. HISTORY faces is based on the Bell Labs Edition 8 program vismon(9). This program is not derived from vismon source. BUGS The machine and people table lookup is hopelessly ineffi- cient and will need to be improved as the faces database gets larger. AUTHOR Rich Burridge, Internet: richb@Aus.Sun.COM PHONE: +61 2 413 2666 ACSnet: richb@sunaus.sun.oz.au Sun Release 4.1 Last change: 4 January 1991 8 Funky_Stuff len=`wc -c < faces.man.text` if [ $len != 18890 ] ; then echo error: faces.man.text was $len bytes long, should have been 18890 fi fi # end of overwriting check if [ -f faces.sendmail ] then echo shar: will not over-write existing file faces.sendmail else echo shar: extracting 'faces.sendmail', 873 characters cat > faces.sendmail <<'Funky_Stuff' #!/bin/sh # # @(#)faces.sendmail 1.1 91/01/01 # # Small script to automatically add X-Face: compressed image lines to a # mail message header. This shell script should be run by adding a line # similar to: # # set sendmail=/usr/local/bin/faces.sendmail # # to your ~/.mailrc file. See the faces manual pages for more details, and # how to setup yout ~/.face file. # # Copyright (c) John Mackin - All rights reserved. # # Permission is given to distribute these sources, as long as the # copyright messages are not removed, and no monies are exchanged. # # No responsibility is taken for any errors or inaccuracies inherent # either to the comments or the code of this program, but if # reported to me then an attempt will be made to fix them. # sed -n -e '/^$/!{p;d;}' \ -e "r $HOME/.face" -e n \ -e ': copy' -e p -e n -e 'b copy' | /usr/lib/sendmail "$@" Funky_Stuff len=`wc -c < faces.sendmail` if [ $len != 873 ] ; then echo error: faces.sendmail was $len bytes long, should have been 873 fi fi # end of overwriting check