diff -r -C 2 mailx-8.1.1/cmd1.c mailx-8.1.1-mio/cmd1.c
*** mailx-8.1.1/cmd1.c	Tue Sep  4 11:11:20 2001
--- mailx-8.1.1-mio/cmd1.c	Wed Sep  5 01:12:08 2001
***************
*** 207,212 ****
--- 207,216 ----
  	sprintf(wcount, "%3d/%-5ld", mp->m_lines, mp->m_size);
  	subjlen = screenwidth - 50 - strlen(wcount);
+ /* inserire di bruta forza se bruteforce_show-rcpt == 1 il campo show-rcpt
+    oppure il campo showto */
+ 
  	name = value("show-rcpt") != NOSTR ?
  		skin(hfield("to", mp)) : nameof(mp, 0);
+ 	if (bruteforce_show_rcpt == 1) name = skin(hfield("to", mp));
  	if (subjline == NOSTR || subjlen < 0)		/* pretty pathetic */
  		printf("%c%c%3d %-20.20s  %16.16s %s\n",
***************
*** 263,267 ****
  {
  	int *msgvec = v;
! 	return (type1(msgvec, 1, 1));
  }
  
--- 267,271 ----
  {
  	int *msgvec = v;
! 	return (type1(msgvec, 0, 1));
  }
  
***************
*** 287,291 ****
  	int *msgvec = v;
  
! 	return(type1(msgvec, 1, 0));
  }
  
--- 291,295 ----
  	int *msgvec = v;
  
! 	return(type1(msgvec, 0, 0));
  }
  
diff -r -C 2 mailx-8.1.1/cmd2.c mailx-8.1.1-mio/cmd2.c
*** mailx-8.1.1/cmd2.c	Tue Sep  4 11:11:20 2001
--- mailx-8.1.1-mio/cmd2.c	Thu Sep  6 22:17:48 2001
***************
*** 136,139 ****
--- 136,153 ----
  
  /*
+  * Print a message to default printer usind a2ps
+  *
+  */
+ int
+ psprint(v)
+ 	void *v;
+ {
+ char *str = v;
+ 
+         return save10(str, 0, "print", saveignore);
+ }
+ 
+ 
+ /*
   * Save a message in a file.  Mark the message as saved
   * so we can discard when the user quits.
***************
*** 219,222 ****
--- 233,319 ----
  	printf("%s\n", disp);
  	return(0);
+ }
+ 
+ /*
+  * stampa mediante a2ps il messaggio completo di header e non marcare
+  * il messaggio come salvato...
+  */
+ int
+ save10(str, mark, cmd, ignore)
+         char str[];
+         int mark;
+         char *cmd;
+         struct ignoretab *ignore;
+ {
+         register int *ip;
+         register struct message *mp;
+         char *file, *disp;
+         int f, *msgvec;
+         FILE *obuf;
+ 	
+ /* dichiarazioni per il file temporaneo	*/
+ 
+ char *defaultprinter = "";
+ char template[256], comando_stampa[256] ;
+ char * temporaneo, *printer;
+ FILE * prn_file;
+ 
+ /* apertura del file temporaneo	*/
+ 
+ sprintf(template, "/tmp/mailx_prn.XXXXXX");
+ temporaneo = mktemp(template);
+ if (temporaneo == NULL) {
+ 			printf("No temporary filename\n");
+                         return(1);
+ 			}
+ prn_file = fopen(template,"a");
+ if (prn_file == NULL) {
+                         printf("Error opening temporary file\n");
+                         return(1);
+                         }
+ chmod(template,0600);
+ /* codice originale modificato */
+ 	f = strlen(str);
+         msgvec = (int *) salloc((msgCount + 2) * sizeof *msgvec);
+         if (!f) {
+ 		 *msgvec = first(0, MMNORM);
+                  if (*msgvec == 0) {
+                         printf("No messages to Print \n");
+ 			fclose(prn_file);
+ 			unlink(template);
+                         return(1);
+                  }
+                 msgvec[1] = 0;
+ 	}
+ 	if (f && (getmsglist(str, msgvec, 0) < 0) ) {
+ 		fclose(prn_file);
+ 		unlink(template);	
+ 		return(1);
+ 		}
+         
+         fflush(stdout);
+ 
+         for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++) {
+                 mp = &message[*ip - 1];
+ /*                touch(mp); */
+ 
+                 if (send(mp, prn_file, 0, NOSTR) < 0) {
+                         fclose(prn_file);
+ 			unlink(template);
+ 			return(1);
+                 }
+ 	}
+         fflush(prn_file);
+ /* stampa del file */
+ 
+ fclose(prn_file);
+ /* stampante di default o scelta nel .mailrc come printer	*/
+ if (( printer = value("printer")) == NOSTR) 
+ sprintf(comando_stampa,"/usr/bin/a2ps -R --columns=1 --center-title=MAIL %s ; /bin/rm %s \n",template,template);
+ else 
+ sprintf(comando_stampa,"/usr/bin/a2ps -R --columns=1 --center-title=MAIL -P %s %s ; /bin/rm %s \n",printer,template,template);
+ system(comando_stampa);
+ 
+         return(0);
  }
  
diff -r -C 2 mailx-8.1.1/cmdtab.c mailx-8.1.1-mio/cmdtab.c
*** mailx-8.1.1/cmdtab.c	Tue Sep  4 11:11:20 2001
--- mailx-8.1.1-mio/cmdtab.c	Thu Sep  6 12:12:28 2001
***************
*** 55,62 ****
  	{ "next",	next,		NDMLIST,	0,	MMNDEL },
  	{ "alias",	group,		M|RAWLIST,	0,	1000 },
! 	{ "print",	type,		MSGLIST,	0,	MMNDEL },
  	{ "type",	type,		MSGLIST,	0,	MMNDEL },
  	{ "Type",	Type,		MSGLIST,	0,	MMNDEL },
! 	{ "Print",	Type,		MSGLIST,	0,	MMNDEL },
  	{ "visual",	visual,		I|MSGLIST,	0,	MMNORM },
  	{ "top",	top,		MSGLIST,	0,	MMNDEL },
--- 55,62 ----
  	{ "next",	next,		NDMLIST,	0,	MMNDEL },
  	{ "alias",	group,		M|RAWLIST,	0,	1000 },
! 	{ "print",	psprint,	STRLIST,	0,	MMNDEL },
  	{ "type",	type,		MSGLIST,	0,	MMNDEL },
  	{ "Type",	Type,		MSGLIST,	0,	MMNDEL },
! 	{ "Print",	psprint,	STRLIST,	0,	MMNDEL },
  	{ "visual",	visual,		I|MSGLIST,	0,	MMNORM },
  	{ "top",	top,		MSGLIST,	0,	MMNDEL },
***************
*** 111,120 ****
  	{ "endif",	endifcmd,	F|M|RAWLIST,	0,	0 },
  	{ "alternates",	alternates,	M|RAWLIST,	0,	1000 },
! 	{ "ignore",	igfield,	M|RAWLIST,	0,	1000 },
  	{ "discard",	igfield,	M|RAWLIST,	0,	1000 },
! 	{ "retain",	retfield,	M|RAWLIST,	0,	1000 },
! 	{ "saveignore",	saveigfield,	M|RAWLIST,	0,	1000 },
  	{ "savediscard",saveigfield,	M|RAWLIST,	0,	1000 },
! 	{ "saveretain",	saveretfield,	M|RAWLIST,	0,	1000 },
  /*	{ "Header",	Header,		STRLIST,	0,	1000 },	*/
  	{ "core",	core,		M|NOLIST,	0,	0 },
--- 111,120 ----
  	{ "endif",	endifcmd,	F|M|RAWLIST,	0,	0 },
  	{ "alternates",	alternates,	M|RAWLIST,	0,	1000 },
! /*	{ "ignore",	igfield,	M|RAWLIST,	0,	1000 },*/
  	{ "discard",	igfield,	M|RAWLIST,	0,	1000 },
! /*	{ "retain",	retfield,	M|RAWLIST,	0,	1000 },*/
! /*	{ "saveignore",	saveigfield,	M|RAWLIST,	0,	1000 },*/
  	{ "savediscard",saveigfield,	M|RAWLIST,	0,	1000 },
! /*	{ "saveretain",	saveretfield,	M|RAWLIST,	0,	1000 },*/
  /*	{ "Header",	Header,		STRLIST,	0,	1000 },	*/
  	{ "core",	core,		M|NOLIST,	0,	0 },
diff -r -C 2 mailx-8.1.1/collect.c mailx-8.1.1-mio/collect.c
*** mailx-8.1.1/collect.c	Tue Sep  4 11:11:20 2001
--- mailx-8.1.1-mio/collect.c	Wed Sep  5 12:19:34 2001
***************
*** 94,97 ****
--- 94,99 ----
  	char getsub;
  	sigset_t oset, nset;
+ 	char *defaultsig = "";
+ 
  #if __GNUC__
  	/* Avoid longjmp clobbering */
***************
*** 394,397 ****
--- 396,412 ----
  			mesedit(collf, c);
  			goto cont;
+ /* aggiunta delle stringhe della firma	*/
+ 		case 'A':
+ 		case 'a':
+                        /*
+                         * Insert signature ("autograph").
+                         * 'A' means to use Sign
+                         * 'a' means to use sign
+                         */
+                        if ((cp = value(c == 'A' ? "Sign" : "sign")) == NOSTR)
+                          cp = defaultsig;
+                        printf("%s\n", cp);
+                        putline(collf, cp);
+ 
  		}
  	}
diff -r -C 2 mailx-8.1.1/extern.h mailx-8.1.1-mio/extern.h
*** mailx-8.1.1/extern.h	Tue Sep  4 11:11:20 2001
--- mailx-8.1.1-mio/extern.h	Tue Sep  4 23:20:37 2001
***************
*** 217,221 ****
--- 217,223 ----
  int	 run_command __P((char *, sigset_t *, int, int, char *, char *, char *));
  int	 save __P((void *));
+ int	psprint __P((void *));
  int	 save1 __P((char [], int, char *, struct ignoretab *));
+ int      save10 __P((char [], int, char *, struct ignoretab *));
  void	 savedeadletter __P((FILE *));
  int	 saveigfield __P((void *));
diff -r -C 2 mailx-8.1.1/glob.h mailx-8.1.1-mio/glob.h
*** mailx-8.1.1/glob.h	Tue Sep  4 11:11:20 2001
--- mailx-8.1.1-mio/glob.h	Wed Sep  5 00:55:06 2001
***************
*** 93,96 ****
--- 93,97 ----
  _E gid_t	effectivegid;		/* Saved from when we started up */
  _E gid_t	realgid;		/* Saved from when we started up */
+ _E int bruteforce_show_rcpt;		/* se 1 impone show-rcpt	*/
  
  #include <setjmp.h>
diff -r -C 2 mailx-8.1.1/mail.1 mailx-8.1.1-mio/mail.1
*** mailx-8.1.1/mail.1	Tue Sep  4 11:11:20 2001
--- mailx-8.1.1-mio/mail.1	Thu Sep  6 18:39:48 2001
***************
*** 41,45 ****
  .Sh SYNOPSIS
  .Nm mail
! .Op Fl iInv
  .Op Fl s Ar subject
  .Op Fl c Ar cc-addr
--- 41,45 ----
  .Sh SYNOPSIS
  .Nm mail
! .Op Fl iInvz
  .Op Fl s Ar subject
  .Op Fl c Ar cc-addr
***************
*** 47,59 ****
  .Ar to-addr...
  .Nm mail
! .Op Fl iInNv
  .Fl f
  .Op Ar name
  .Nm mail
! .Op Fl iInNv
  .Op Fl u Ar user
  .Sh INTRODUCTION
  .Nm Mail
! is an intelligent mail processing system, which has
  a command syntax reminiscent of
  .Xr \&ed 1
--- 47,59 ----
  .Ar to-addr...
  .Nm mail
! .Op Fl iInNvz
  .Fl f
  .Op Ar name
  .Nm mail
! .Op Fl iInNvz
  .Op Fl u Ar user
  .Sh INTRODUCTION
  .Nm Mail
! is a simple mail processing system, which has
  a command syntax reminiscent of
  .Xr \&ed 1
***************
*** 65,68 ****
--- 65,73 ----
  The details of
  delivery are displayed on the user's terminal.
+ .It Fl z
+ Show-To mode.
+ Useful when reading outgoing mailboxes.
+ The field To: is shown in the messages list,
+ instead of the default field From: .
  .It Fl i
  Ignore tty interrupt signals.
***************
*** 133,142 ****
  is given no arguments and checks your mail out of the
  post office, then
! prints out a one line header of each message found.
  The current message is initially the first message (numbered 1)
! and can be printed using the
! .Ic print
  command (which can be abbreviated
! .Ql Ic p ) .
  You can move among the messages much as you move between lines in
  .Xr \&ed 1 ,
--- 138,147 ----
  is given no arguments and checks your mail out of the
  post office, then
! types out a one line header of each message found.
  The current message is initially the first message (numbered 1)
! and can be displayed using the
! .Ic type
  command (which can be abbreviated
! .Ql Ic t ) .
  You can move among the messages much as you move between lines in
  .Xr \&ed 1 ,
***************
*** 172,178 ****
  .Ss Specifying messages
  Commands such as
! .Ic print
  and
  .Ic delete
  can be given a list of message numbers as arguments to apply
  to a number of messages at once.
--- 177,185 ----
  .Ss Specifying messages
  Commands such as
! .Ic type
  and
  .Ic delete
+ and
+ .Ic print
  can be given a list of message numbers as arguments to apply
  to a number of messages at once.
***************
*** 189,195 ****
  the last message; thus the command
  .Ic top
! which prints the first few lines of a message could be used in
  .Dq Li top \&*
! to print the first few lines of all messages.
  .Pp
  .Ss Replying to or originating mail.
--- 196,202 ----
  the last message; thus the command
  .Ic top
! which types the first few lines of a message could be used in
  .Dq Li top \&*
! to type the first few lines of all messages.
  .Pp
  .Ss Replying to or originating mail.
***************
*** 303,307 ****
  .Bl -tag -width delete
  .It Ic \&\-
! Print out the preceding message.
  If given a numeric
  argument
--- 310,314 ----
  .Bl -tag -width delete
  .It Ic \&\-
! Types out the preceding message.
  If given a numeric
  argument
***************
*** 309,313 ****
  goes to the
  .Ar n Ns 'th
! previous message and prints it.
  .It Ic \&?
  Prints a brief summary of commands.
--- 316,320 ----
  goes to the
  .Ar n Ns 'th
! previous message and types it.
  .It Ic \&?
  Prints a brief summary of commands.
***************
*** 319,332 ****
  .Xr csh 1 )
  command which follows.
! .It Ic Print
! .Pq Ic P
! Like
! .Ic print
! but also prints out ignored header fields.
! See also
! .Ic print ,
! .Ic ignore
! and
! .Ic retain .
  .It Ic Reply
  .Pq Ic R
--- 326,334 ----
  .Xr csh 1 )
  command which follows.
! .It Ic Type
! .Pq Ic T
! Identical to the
! .Ic type 
! command.
  .It Ic Reply
  .Pq Ic R
***************
*** 334,341 ****
  Does not reply to other
  recipients of the original message.
! .It Ic Type
! .Pq Ic T
  Identical to the
! .Ic Print
  command.
  .It Ic alias
--- 336,343 ----
  Does not reply to other
  recipients of the original message.
! .It Ic Print
! .Pq Ic P
  Identical to the
! .Ic print
  command.
  .It Ic alias
***************
*** 388,392 ****
  (also
  .Ic dt )
! Deletes the current message and prints the next message.
  If there is no next message,
  .Nm mail
--- 390,394 ----
  (also
  .Ic dt )
! Deletes the current message and types the next message.
  If there is no next message,
  .Nm mail
***************
*** 459,480 ****
  .Ic delete
  command.
- .It Ic ignore
- Add the list of header fields named to the
- .Ar ignored list .
- Header fields in the ignore list are not printed
- on your terminal when you print a message.
- This
- command is very handy for suppression of certain machine-generated
- header fields.
- The
- .Ic Type
- and
- .Ic Print
- commands can be used to print a message in its entirety, including
- ignored fields.
- If
- .Ic ignore
- is executed with no arguments, it lists the current set of
- ignored fields.
  .It Ic mail
  .Pq Ic m
--- 461,464 ----
***************
*** 505,509 ****
  .It Ic print
  .Pq Ic p
! Takes a message list and types out each message on the user's terminal.
  .It Ic quit
  .Pq Ic q
--- 489,498 ----
  .It Ic print
  .Pq Ic p
! Takes a message list and prints it out on the printer via the a2ps filter.
! It uses the default printer of the system, unless the Option String 
! .Ic printer
! is assigned via the 
! .Ic set
! command to a different printer in the .mailrc file.
  .It Ic quit
  .Pq Ic q
***************
*** 538,556 ****
  A synonym for
  .Ic reply  .
- .It Ic retain
- Add the list of header fields named to the
- .Ar retained list
- Only the header fields in the retain list
- are shown on your terminal when you print a message.
- All other header fields are suppressed.
- The
- .Ic Type
- and
- .Ic Print
- commands can be used to print a message in its entirety.
- If
- .Ic retain
- is executed with no arguments, it lists the current set of
- retained fields.
  .It Ic save
  .Pq Ic s
--- 527,530 ----
***************
*** 571,607 ****
  quote blanks or tabs, i.e.
  .Dq Li "set indentprefix=\*q->\*q"
- .It Ic saveignore
- .Ic Saveignore
- is to
- .Ic save
- what
- .Ic ignore
- is to
- .Ic print
- and
- .Ic type  .
- Header fields thus marked are filtered out when
- saving a message by
- .Ic save
- or when automatically saving to
- .Ar mbox  .
- .It Ic saveretain
- .Ic Saveretain
- is to
- .Ic save
- what
- .Ic retain
- is to
- .Ic print
- and
- .Ic type  .
- Header fields thus marked are the only ones saved
- with a message when saving by
- .Ic save
- or when automatically saving to
- .Ar mbox  .
- .Ic Saveretain
- overrides
- .Ic saveignore  .
  .It Ic shell
  .Pq Ic sh
--- 545,548 ----
***************
*** 623,628 ****
  .It Ic type
  .Pq Ic t
! A synonym for
! .Ic print  .
  .It Ic unalias
  Takes a list of names defined by
--- 564,568 ----
  .It Ic type
  .Pq Ic t
! Takes a message list and types out each message on the user's terminal.
  .It Ic unalias
  Takes a list of names defined by
***************
*** 762,765 ****
--- 702,708 ----
  .It Ic \&~w Ns Ar filename
  Write the message onto the named file.
+ .It Ic \&~a
+ .It Ic \&~A
+ Autograph (insert 'sign','Sign' variable).
  .It Ic \&~\&| Ns Ar command
  Pipe the message through the command as a filter.
***************
*** 982,985 ****
--- 925,932 ----
  .Ic top
  command; normally, the first five lines are printed.
+ .It Ar printer
+ If defined, gives the name of the printer to be used in the
+ .Ic print
+ command; if not defined, the default printer will be selected.
  .El
  .Sh ENVIRONMENT
diff -r -C 2 mailx-8.1.1/main.c mailx-8.1.1-mio/main.c
*** mailx-8.1.1/main.c	Tue Sep  4 11:11:20 2001
--- mailx-8.1.1-mio/main.c	Wed Sep  5 01:13:06 2001
***************
*** 122,126 ****
  	smopts = NIL;
  	subject = NOSTR;
! 	while ((i = getopt(argc, argv, "INT:b:c:dfins:u:v")) != EOF) {
  		switch (i) {
  		case 'T':
--- 122,127 ----
  	smopts = NIL;
  	subject = NOSTR;
! 	bruteforce_show_rcpt=0;
! 	while ((i = getopt(argc, argv, "INT:b:c:dfins:u:v:z")) != EOF) {
  		switch (i) {
  		case 'T':
***************
*** 210,219 ****
  			bcc = cat(bcc, nalloc(optarg, GBCC));
  			break;
  		case '?':
  			fputs("\
! Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\
              [- sendmail-options ...]\n\
!        mail [-iInNv] -f [name]\n\
!        mail [-iInNv] [-u user]\n",
  				stderr);
  			exit(1);
--- 211,226 ----
  			bcc = cat(bcc, nalloc(optarg, GBCC));
  			break;
+ 		case 'z':
+ 			/*
+ 			 * invert set show-rcpt by brute force 
+ 			 */
+ 			bruteforce_show_rcpt=1;
+ 			break;
  		case '?':
  			fputs("\
! Usage: mail [-iInvz] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\
              [- sendmail-options ...]\n\
!        mail [-iInNvz] -f [name]\n\
!        mail [-iInNvz] [-u user]\n",
  				stderr);
  			exit(1);
diff -r -C 2 mailx-8.1.1/misc/mail.help mailx-8.1.1-mio/misc/mail.help
*** mailx-8.1.1/misc/mail.help	Tue Sep  4 11:11:20 2001
--- mailx-8.1.1-mio/misc/mail.help	Thu Sep  6 16:22:40 2001
***************
*** 2,17 ****
  t <message list>		type messages
  n				goto and type next message
  e <message list>		edit messages
  f <message list>		give head lines of messages
! d <message list>		delete messages
! s <message list> file		append messages to file
! u <message list>		undelete messages
! R <message list>		reply to message senders
! r <message list>		reply to message senders and all recipients
! pre <message list>		make messages go back to /var/spool/mail
  m <user list>			mail to specific users
  q				quit, saving unresolved messages in mbox
! x				quit, do not remove system mailbox
  h				print out active message headers
  !				shell escape
  cd [directory]			chdir to directory or home if none given
--- 2,19 ----
  t <message list>		type messages
  n				goto and type next message
+ p <message list>		send messages to the printer (with headers)
  e <message list>		edit messages
  f <message list>		give head lines of messages
! s <message list> file		append messages to file (with headers)
! w <message list> file		append messages to file (without headers)
! d <message list>                mark for deletion messages
! u <message list>		unmark for deletion messages
! r <message list>		reply to message senders
! R <message list>		reply to message senders and all recipients
  m <user list>			mail to specific users
  q				quit, saving unresolved messages in mbox
! x				quit, do not remove from system mailbox
  h				print out active message headers
+ z+ z-				next or previous listing page
  !				shell escape
  cd [directory]			chdir to directory or home if none given
diff -r -C 2 mailx-8.1.1/misc/mail.rc mailx-8.1.1-mio/misc/mail.rc
*** mailx-8.1.1/misc/mail.rc	Tue Sep  4 11:11:20 2001
--- mailx-8.1.1-mio/misc/mail.rc	Thu Sep  6 00:46:02 2001
***************
*** 1,2 ****
! set asksub append dot save crt=20
! ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via
--- 1 ----
! set asksub append dot save crt=20 Replyall
diff -r -C 2 mailx-8.1.1/misc/mail.tildehelp mailx-8.1.1-mio/misc/mail.tildehelp
*** mailx-8.1.1/misc/mail.tildehelp	Sat Jun 22 06:26:59 1996
--- mailx-8.1.1-mio/misc/mail.tildehelp	Thu Sep  6 00:46:19 2001
***************
*** 17,20 ****
--- 17,21 ----
  ~v		Invoke display editor on message
  ~w file		Write message onto file.
+ ~a,~A           Autograph (insert 'sign','Sign' variable)
  ~?		Print this message
  ~!command	Invoke the shell
diff -r -C 2 mailx-8.1.1/version.c mailx-8.1.1-mio/version.c
*** mailx-8.1.1/version.c	Tue Sep  4 11:11:20 2001
--- mailx-8.1.1-mio/version.c	Tue Sep  4 23:56:01 2001
***************
*** 47,49 ****
   * Load this file first to get a "total" Mail version.
   */
! char	*version = "8.1 6/6/93";
--- 47,49 ----
   * Load this file first to get a "total" Mail version.
   */
! char	*version = "8.1 6/6/93 con modifiche steffe 2001";
