[comp.unix.aix] MAIL on AIX V. 3

moore@emily.uvm.edu (Bryan Moore) (04/03/91)

I am having a problem with the mail system on AIX V. 3.
Previously on AIX 2.2.1 on the RT, when a user was looking at
mail, the system would prompt for a key-press when the screen
filled up ( like it was piped into pg). On the RS/6000, the
information just scrolls through the mail message even if it
is 10 pages long.

Maybe this is a parameter in the .mailrc file, but I don't know
which one.

Thanks!!!

-Bryan

BRYAN R. MOORE          	    |   "Last night I had that same old dream
EMAIL: moore@uvm-gen.uvm.edu	    |    it rocked me in my sleep, it gave me
USMAIL: 12 Waybury Rd. Colchester,  |    the impression the sandman plays for 
  Vermont 05446                     |    keeps..."   Larry Norman

geo@george.austin.ibm.com (George Noren) (04/09/91)

In article <1991Apr2.215813.12245@uvm.edu>, moore@emily.uvm.edu (Bryan
Moore) writes:
> 
> I am having a problem with the mail system on AIX V. 3.
> Previously on AIX 2.2.1 on the RT, when a user was looking at
> mail, the system would prompt for a key-press when the screen
> filled up ( like it was piped into pg). On the RS/6000, the
> information just scrolls through the mail message even if it
> is 10 pages long.
> 
> Maybe this is a parameter in the .mailrc file, but I don't know
> which one.
> 


The parameter is:

	set crt=<x>

where <x> is the number of lines in the crt screen (or x-window).  This
can be put
in $HOME/.mailrc for each user, or in /usr/lib/Mail.rc for system-wide effect.
The entry causes the mail program to feed the message through the pg program if
the message exceeds <x> number of lines.


Sincerely,
George Noren

My opinions, of course...
+-------------------------+--------------------------------+----------------+
|AWD Early Systems Support| AIX : geo@george.austin.ibm.com|PH: 512/838-4930|
|IBM Austin - Zip 2830    | VNET: GEORGE at AUSVMQ         |TL: 678-4930    |
+-------------------------+--------------------------------+----------------+

robin@pensoft.uucp (Robin Wilson) (04/10/91)

In article <6506@awdprime.UUCP> geo@george.austin.ibm.com (George Noren) writes:
>In article <1991Apr2.215813.12245@uvm.edu>, moore@emily.uvm.edu (Bryan
>Moore) writes:
>> Previously on AIX 2.2.1 on the RT, when a user was looking at
>> mail, the system would prompt for a key-press when the screen
>> filled up ( like it was piped into pg). On the RS/6000, the
>
>The parameter is:
>
>	set crt=<x>

Or just "set crt" will cause it to use the pager "at all times".  Since, one
clearly doesn't want to have the pager run for messages less than 1 screen 
full, you can specify that your pager is a shell script something like this:

pg -c -e -s -p "PAGE #%d> " $@

(I have never been able to get this to work by specifying that my "PAGER"
environment variable equals this same string.  But by making this little
shell script, and setting PAGER=$HOME/scripts/pager, in my environment I
can get this to work.)

Lets see if I can remember what all these options do:

	-c	Clears screen, and homes the cursor before displaying
		message.

	-e	Does not "pause" at the end of a message.  This means 
		that when I hit the last page of the mail message I
		automatically get dumped out of "pg" and back into the
		mail reader.

	-s	Puts the "pg" prompt in reverse video.

	-p "<string>"  Uses "<string>" as the prompt at the bottom
		of the page.  The "%d" in my "PAGE #%d> " prompt causes
		the current page number to be displayed in place of the 
		"%d" (this would be much more useful if it told me how
		many pages were left too...).

Of course all this available from the "man" pages on the "pg" command.
The nicest part of this pager command is that the "-e" flag keeps the
pager from being used if the message is not a full screen.  Clearing the
screen makes display faster (since it doesn't have to scroll the 
previous screen of data).


+-----------------------------------------------------------------------------+
|The views expressed herein, are the sole responsibility of the typist at hand|
+-----------------------------------------------------------------------------+
|UUCP:     pensoft!robin                                                      |
|USNail:   701 Canyon Bend Dr.                                                |
|          Pflugerville, TX  78660                                            |
|          Home: (512)251-6889      Work: (512)343-1111                       |
+-----------------------------------------------------------------------------+

mike@bria.UUCP (Michael Stefanik) (04/11/91)

In an article, emily.uvm.edu!moore (Bryan Moore) writes:
|I am having a problem with the mail system on AIX V. 3.
|Previously on AIX 2.2.1 on the RT, when a user was looking at
|mail, the system would prompt for a key-press when the screen
|filled up ( like it was piped into pg). On the RS/6000, the
|information just scrolls through the mail message even if it
|is 10 pages long.
|
|Maybe this is a parameter in the .mailrc file, but I don't know
|which one.

To have Mail page through long messages, add the following line in
your ~/.mailrc file:

	set crt=20

For a complete list of Mail options, you can refer to "Communication Concepts
and Procedures, Volume 1" section 8, pages 6-8.

-- 
Michael Stefanik, MGI Inc, Los Angeles | Opinions stated are never realistic
Title of the week: Systems Engineer    | UUCP: ...!uunet!bria!mike
-------------------------------------------------------------------------------
If MS-DOS didn't exist, who would UNIX programmers have to make fun of?

ericm@ibmpa.awdpa.ibm.com (Eric Murray) (04/12/91)

In article <6506@awdprime.UUCP> geo@george.austin.ibm.com (George Noren) writes:
>In article <1991Apr2.215813.12245@uvm.edu>, moore@emily.uvm.edu (Bryan
>Moore) writes:
>> 
>> I am having a problem with the mail system on AIX V. 3.
>> Previously on AIX 2.2.1 on the RT, when a user was looking at
>> mail, the system would prompt for a key-press when the screen
>> filled up ( like it was piped into pg). On the RS/6000, the
>> information just scrolls through the mail message even if it
>> is 10 pages long.
>> 
>> Maybe this is a parameter in the .mailrc file, but I don't know
>> which one.
>> 
>
>
>The parameter is:
>
>	set crt=<x>
>
>where <x> is the number of lines in the crt screen (or x-window).  This
>can be put
>in $HOME/.mailrc for each user, or in /usr/lib/Mail.rc for system-wide effect.
>The entry causes the mail program to feed the message through the pg program if
>the message exceeds <x> number of lines.


Even better, you can get the page size to automagically change when you
change your window size:

set crt=`${HOME}/bin/ttylines`




and here's ttylines.c:
(god, I love programs that port directly from BSD!)


/* issue an TIOCGWINSZ ioctl on our pty tp get the window size */
#include <sys/file.h>
#include <sys/ioctl.h>
/*struct winsize { 
**	unsigned short	ws_row;
**	unsigned short	ws_col;
**	unsigned short	ws_xpixel;
**	unsigned short	ws_ypixel;
};*/

main(argc,argv)
int argc;
char **argv;
{
	register int fp, new;
	struct winsize ws;

	fp = open("/dev/tty",O_RDWR,0);

	ioctl(fp,TIOCGWINSZ,&ws);

	if (argc > 1 && ((new = atoi(argv[1])) != ws.ws_row)) {
		/* user wants to set size & it's not right */
		ws.ws_row = new;
		ioctl(fp,TIOCSWINSZ,&ws);
	}

	/* print out rows */
	printf("%d\n",ws.ws_row);

	close(fp);
}
 eric murray         ericm@angst.awdpa.ibm.com      ericm@ibminet.awdpa.ibm.com
 the lawyers make me say: this posting doesn't represent official ibm policy