2018-04-26 12:42  guenther

	* fio.c:

	Use <fcntl.h> instead of <sys/file.h> for open() and friends.
	Delete a bunch of unnecessary #includes and sort to match style(9)
	while doing the above cleanup.

	ok deraadt@ krw@

2018-03-16 16:58  schwarze

	* mail.1:

	improve markup quality in the cases found by the new "--" style message

2017-06-28 14:58  anton

	* tty.c:

	Replace usage of TIOCSTI in mail while editing headers using a more common
	IO-loop where ICANON is disabled and a single char of input is read at a time.
	This requires the line editing capabilities provided when ICANON is enabled to
	be implemented.

	ok deraadt@

2017-05-29 12:50  jmc

	* mail.1:

	tweak previous to read a little better;

2017-05-29 12:15  tedu

	* mail.1:

	remove mention of Berknet and mailaddr.7

2017-03-28 09:14  natano

	* edit.c:

	Prevent edit'ing a message from corrupting the mailbox. In an mbox file
	every message is terminated by an empty line, so we have to make sure it
	is preserved. Otherwise the message is combined with the next one.

	joint effort with deraadt and millert

2016-07-28 21:37  tedu

	* mail.1, temp.c:

	these programs probably do not need to use TMPDIR. ok florian

2016-07-19 06:43  deraadt

	* quit.c, v7.local.c:

	Cleanup close(open idioms.
	ok krw

2016-03-30 06:38  jmc

	* Makefile:

	for some time now mandoc has not required MLINKS to function
	correctly - logically complete that now by removing MLINKS from base;

	authors need only to ensure there is an entry in NAME for any function/
	util being added. MLINKS will still work, and remain for perl to ease
	upgrades;

	ok nicm (curses) bcook (ssl)
	ok schwarze, who provided a lot of feedback and assistance
	ok tb natano jung

2015-11-24 00:08  deraadt

	* main.c:

	missing pledge "getpw"

2015-11-16 21:20  deraadt

	* main.c:

	pledge "stdio rpath wpath cpath tmppath fattr tty flock proc exec"

2015-11-11 01:12  deraadt

	* quit.c, v7.local.c:

	creat() -> open equiv; from Frederic Nowak

2015-10-16 18:21  mmcc

	* fio.c:

	Cast isspace() argument to unsigned char.

	ok jca@

2015-10-16 17:56  mmcc

	* aux.c, cmd2.c, cmd3.c, fio.c, lex.c, list.c, names.c, popen.c,
	  strings.c, temp.c, vars.c:

	Modernize allocation by:

	 * removing unneeded casts of void* return values
	 * replacing varied and creative error messages with the allocation
	   function's name
	 * replacing errx() with err() so that the errno string is reported

	ok beck@, jung@, millert@

2015-10-13 08:49  guenther

	* aux.c, def.h:

	To alter just the atime of the mailspool, use utimensat()+UTIME_OMIT instead
	of stat()+utimes().  Prefer clock_gettime() over gettimeofday() to avoid
	timeval->timespec conversion

	ok millert@

2015-09-07 15:28  sobrado

	* mail.1:

	add missing file system path (.Pa) macros.

2015-02-08 23:40  deraadt

	* main.c:

	in getopt() blocks, stop incrementing flag variable which are supposed
	to just be 0/1
	ok miod florian

2015-01-24 20:32  millert

	* main.c:

	Fix getopt string; the -N flag doesn't take an argument.
	From Matthew Clarke

2015-01-22 16:25  millert

	* main.c:

	Only allow the -r flag when sending a message; from Martin Brandenburg

2015-01-20 19:20  jmc

	* mail.1:

	tweak previous;

2015-01-20 16:59  millert

	* cmd3.c, def.h, extern.h, mail.1, main.c, names.c, send.c:

	Add support for the "-r fromaddr" flag now that we don't support
	sendmail flags on the command line.
	Also allow "from" to be set in mailrc.
	Use sendmail's "-t" flag when executing sendmail instead of specifying
	the list of recipients in argv.  The "-f" flag will be used to set
	the from address if specified.

2015-01-16 06:40  deraadt

	* aux.c, def.h, main.c, popen.c:

	Replace <sys/param.h> with <limits.h> and other less dirty headers where
	possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
	to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
	MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
	sensible to avoid pulling in the pollution.  These are the files confirmed
	through binary verification.
	ok guenther, millert, doug (helped with the verification protocol)

2015-01-07 17:08  millert

	* mail.1:

	It is the copy command that is abbreviated as 'c', not chdir.
	Also document that cd is an alias for chdir.  From Kaspars Bankovskis.

2015-01-07 17:01  millert

	* mail.1:

	Document the '=' command; from trondd at gmail

2014-12-16 18:37  millert

	* mail.1, main.c:

	Don't pass options after the to address to sendmail.  The only
	legitiate use of this is to set the sender name which should be
	handled specifically by a different option.

2014-12-16 18:36  millert

	* mail.1, names.c:

	Add new "expandaddr" flag (disabled by default) to enable recipient
	address expansion and document it.  Previously, this behavior was
	always enabled.  Also document how address expansion is performed,
	which used to only be described in the (no longer installed) Mail
	Reference Manual.  CVE-2014-7844

2014-12-16 18:31  millert

	* fio.c:

	Use glob() to expand filenames instead of passing it to the shell's
	echo command for expansion which could result in arbitrary command
	execution.  CVE-2004-2771

2014-11-24 22:30  millert

	* mail.1:

	Change "will write" back to "writes" in -f description.  From jmc@

2014-11-24 20:03  millert

	* mail.1, main.c:

	The handling of the -f option is a hack.  Instead of fooling around
	with argv behind getopt()'s back we can just treat the remainder
	of argv[] after option processing as the file name for -f.  It is
	not possible to use -f in sending mode so there is no ambiguity.
	OK tobias@

2014-11-24 20:01  millert

	* glob.h, mail.1, main.c, quit.c:

	Remove undocumented and obsolete -T option.  It was intended for
	use with old netnews.  OK sobrado@ tobias@

2014-10-26 20:38  guenther

	* lex.c:

	Prefer mkostemp(O_CLOEXEC) over mkstemp()+fcntl(F_SETFD)
	Prefer fopen("re") over fopen("r")+fcntl(F_SETFD)

	ok otto@ millert@

2014-08-15 03:51  guenther

	* names.c:

	Use O_CLOEXEC wherever we open a file and then call fcntl(F_SETFD, FD_CLOEXEC)
	on it, simplifying error checking, reducing system calls, and improving
	thread-safety for libraries.

	ok miod@

2014-07-22 17:05  deraadt

	* Makefile:

	Repair two deep targets mistakenly called as afterinstall, rather
	than distribution. These would modify files in /etc, part of the base
	set, but still... that makes it harder to discern their sets placement.

2014-05-20 01:25  guenther

	* lex.c:

	Use errc/warnc to simplify code.
	Also, in 'ftp', always put the error message last, after the hostname/ipaddr.

	ok jsing@ krw@ millert@

2014-03-27 13:08  jmc

	* mail.1:

	make this page less sendmail-centric; ok gilles

2014-03-16 18:38  guenther

	* cmd2.c:

	lint is dead (long live the lint!), so stop using it as a cpp conditional
	(namespace pollution!) or talking about its opinion on code.

	ok krw@

2014-03-10 11:17  jmc

	* mail.1:

	pedantic word change;

2014-01-20 05:07  schwarze

	* mail.1:

	Obvious .Xr fixes, found while testing mandocdb(8).

2014-01-17 18:42  okan

	* aux.c, cmd2.c, collect.c, fio.c, head.c, lex.c, list.c, send.c,
	  tty.c:

	ctype and other sign extension fixes.

	with deraadt and millert, ok millert

2014-01-08 16:19  jmc

	* mail.1:

	flesh out STANDARDS somewhat; help/ok sobrado
	this was also ok millert some time ago

2013-07-18 07:11  jmc

	* mail.1:

	document the :c selectors; from Sunil Nimmagadda

2013-04-29 00:28  okan

	* lex.c, names.c, popen.c:

	use FD_CLOEXEC instead of 1; from David Hill

	ok otto

2012-11-14 13:22  gsoares

	* cmd2.c:

	use F_OK macro instead of 0 in access() when checking by file existence. make the code easier to read.
	no functional change.

	OK millert@

2011-04-06 11:36  miod

	* cmd1.c, cmd2.c, cmd3.c, collect.c, lex.c:

	Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'
	for chars.

2010-11-07 08:05  jmc

	* mail.1:

	more EXIT STATUS bits; from Daniel Dickman

2010-01-10 10:53  jmc

	* mail.1:

	remove references to docs we no longer install;

2010-01-04 17:50  deraadt

	* Makefile:

	Stop installing many of the incredibly dated and un-authoritative share/doc
	files.  If any information found in these documents is worthwhile and you
	miss it, please make the time to work it into the manual pages (which people
	actually do read).
	ok guenther

2009-10-27 23:59  deraadt

	* aux.c, cmd1.c, cmd2.c, cmd3.c, cmdtab.c, collect.c, edit.c,
	  fio.c, getname.c, head.c, lex.c, list.c, main.c, names.c,
	  popen.c, quit.c, send.c, strings.c, temp.c, tty.c, v7.local.c,
	  vars.c, version.c:

	rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
	unmaintainable).  these days, people use source.  these id's do not provide
	any benefit, and do hurt the small install media
	(the 33,000 line diff is essentially mechanical)
	ok with the idea millert, ok dms

2009-09-05 10:49  tobias

	* cmd3.c:

	Fixed typo in comment.

	ok millert

2009-07-29 18:15  martynas

	* mail.1, USD.doc/mail9.nr, misc/mail.tildehelp:

	- ~<, ~_ are undocumented aliases of ~r, ~:
	- missing documentation for ~.
	- use compact list, and .Pp.  so that aliases could be listed
	- reformat to fit aliases in tilde help
	with help & ok jmc@, sobrado@, millert@

2009-07-28 16:05  martynas

	* cmd2.c, cmdtab.c, collect.c, extern.h:

	remove core / tilde C.  it's useless, doesn't work, never has been
	documented, ^\ should be used instead.  ok millert@

2009-07-23 20:06  martynas

	* cmd3.c:

	elide a little bit later, the final list, after From has been
	appended.  properly removes if there's a dup in from & to.
	ok millert@

2009-04-23 19:12  deraadt

	* misc/mail.help:

	document the "more" command in the help page; ok millert

2009-02-10 19:27  jmc

	* mail.1:

	mark these utilities as being largely posix compliant or, in the case of
	nm, as not being posix compliant;

2008-11-03 20:07  jmc

	* USD.doc/mail9.nr, misc/mail.tildehelp:

	...and then sync tildehelp and mail9.nr;

2008-11-03 18:50  jmc

	* mail.1, misc/mail.tildehelp:

	update the tilde escapes for both these files,
	and try and keep them in a similar format/order;

2008-11-03 18:20  jmc

	* USD.doc/: mail4.nr, mail5.nr, mail9.nr:

	poor USD docs, we always forget you! ...document ~x

2008-11-03 15:42  martynas

	* collect.c, mail.1:

	add ~x;  which is quite handy sometimes.  per posix
	man page tweak&ok jmc@.  ok millert@

2008-10-09 06:48  jmc

	* main.c:

	- add -d to usage
	- sync -f arg name with man page synopsis

2008-10-08 21:05  martynas

	* mail.1:

	document -d.  ok millert@

2008-08-05 17:15  sobrado

	* misc/mail.help:

	fix description of the mail(1) "p" command; from Aaron W. Hsu.

	ok martynas@

2008-08-03 14:30  martynas

	* cmdtab.c:

	make U (abbreviation of unread) work as man page says
	ok millert@, jmc@.  sure theo

2008-07-16 15:14  martynas

	* send.c:

	'no subject' check is never triggered.  check if it's actually empty
	ok millert@

2008-07-16 15:11  martynas

	* mail.1, main.c, send.c:

	add -E flag and 'skipempty' option to skip sending messages with
	empty bodies.  useful for sending mails from crontabs.
	from rivo nurges <rix at estpak dot ee>, with missing 'skipempty'
	documentation and usage update from me
	ok millert@

2008-07-16 14:56  martynas

	* mail.1:

	man page tweaks:
	- for argument of -f flag, name -> file
	- document TMPDIR, better description from millert@
	ok millert@

2008-07-16 14:53  martynas

	* aux.c, cmd3.c, collect.c, head.c, send.c:

	- use strncmp/strncasecmp instead of comparing by character
	- simplify istrlcpy, no need to check for isupper
	- line[0] is redundant, because strcasecmp will take care of it
	ok millert@

2008-07-16 14:49  martynas

	* edit.c, fio.c:

	- err with the pathbuf, if we know it
	- use tmpdir instead of /tmp
	ok millert@

2008-07-15 19:23  martynas

	* aux.c, extern.h, list.c:

	- chraise can be replaced with toupper;  no need to check for islower
	- remove quite some code, use strcasestr instead of reimplementing
	it each time
	- use strncasecmp, instead of comparing through each character
	"looks fine" millert@

2008-07-15 19:13  martynas

	* cmd1.c:

	set cp to the value of PAGER, so that type1 doesn't try to use it
	uninitialized (page=1), or use wrong previously-set value of crt
	(page=0).  ok millert@

2007-10-17 20:02  deraadt

	* edit.c:

	- Be more careful about pre-existing SIGCHLD handlers (or SIG_IGN) by
	  temporarily restoring default behaviour.  This is not 100% ideal.
	  But this fixes editor handling in mail... bah, it is really unfortunate
	  that got broken
	- refactor the restoration code as well, to make it simpler
	ok ray

2007-10-05 14:39  chl

	* fio.c:

	check if it's really a newline before removing it

	with the help of ray@ "Looks OK" millert@

2007-09-10 14:29  tobias

	* collect.c, edit.c, fio.c, quit.c:

	Proper use of fseek/fseeko macros.

	OK joris@, otto@

2007-08-31 23:14  ray

	* edit.c:

	Copy editit() from sendbug, synchronizing editor calling code.

	OK otto, millert, beck, mbalmer, deraadt.

2007-08-06 19:16  sobrado

	* mail.1, main.c:

	the ellipsis is not an optional argument; while here, sync the usage
	and synopsis of commands

	lots of good ideas by jmc@

	ok jmc@

2007-06-19 05:47  ray

	* vars.c:

	Grammar-o.

	OK jmc

2007-05-31 19:20  jmc

	* mail.1:

	convert to new .Dd format;

2007-05-25 21:27  krw

	* fio.c:

	"interupt" -> "interrupt" in various comments. Mostly from Diego Casati.

2007-04-03 18:01  martynas

	* cmd1.c:

	make it work with height 4 (division by zero)
	ok millert@

2007-03-20 21:01  millert

	* send.c:

	Set umask to 077 when saving messages in the outbox (not enabled
	by default).  From veenhuizen at users dot sourceforge dot net

2007-02-26 13:38  jmc

	* mail.1:

	more small fixes from Igor Sobrado, tweaked by myself;

2007-02-26 13:17  jmc

	* mail.1:

	some small fixes from Igor Sobrado;

2007-02-25 20:26  jmc

	* mail.1:

	remove bad comma; from Igor Sobrado

2006-11-16 00:16  ray

	* fio.c:

	Fix undefined behavior (var = --var).

	From Alexey Dobriyan <adobriyan at gmail dot com>.

	OK moritz@ and jaredy@.

2006-10-10 21:38  cloder

	* edit.c:

	fgets(3) returns NULL on error, not 0. No functional change, but it makes
	the code easier to read.
	OK deraadt

2006-05-02 05:28  hugh

	* extern.h:

	Nuke a couple orphaned prototypes.
	quoth deraadt: no problem

2006-04-02 00:51  deraadt

	* fio.c:

	use SEEK_* for lseek()

2006-03-04 16:18  miod

	* USD.doc/mail6.nr:

	the the

2006-02-01 19:01  otto

	* quit.c:

	double semicolon; from Daniel Matic in PR 4929

2006-01-06 18:53  millert

	* extern.h:

	Adapt things to use __type_t instead of _BSD_TYPE_T_
	Add new sys/_types.h header
	Include machine/_types.h or sys/_types.h where applicable

2005-07-11 14:08  millert

	* list.c, tty.c:

	Fix off-by-one bug in readtty() and don't assume BUFSIZ == 1024.
	Based on a patch from Ulf Harnhammar.

2004-12-07 22:30  jmc

	* mail.1:

	remove unsupported paths;
	from okan demirmen;

2004-09-15 22:21  deraadt

	* aux.c, cmd2.c, cmdtab.c, extern.h, list.c:

	avoid aliasing against libc symbols

2004-09-15 22:21  deraadt

	* popen.c:

	unused variable

2004-06-04 00:07  jmc

	* mail.1:

	sync w/ usd docs;
	ok millert@

2004-06-04 00:04  jmc

	* USD.doc/: mail0.nr, mail1.nr, mail2.nr, mail3.nr, mail4.nr,
	  mail5.nr, mail6.nr, mail8.nr, mail9.nr:

	update mail docs w/ reality;
	help and ok millert@

2004-05-10 15:25  deraadt

	* edit.c, fio.c, lex.c:

	delint; millert ok

2004-05-10 12:10  millert

	* cmd2.c, cmdtab.c, extern.h, lex.c:

	Get rid of the ancient "clobber" command.  It was really only for debugging
	purposes.  Noticed and OK by deraadt@

2004-04-30 06:52  jmc

	* mail.1:

	missing full stop;

2004-04-19 10:17  jmc

	* mail.1, main.c:

	- sort SYNOPSIS
	- remove a load of unnecessary quoting and some groff cruft
	- sort options list
	- add usd doc to SEE ALSO
	- sync usage()

2004-02-01 15:19  jmc

	* USD.doc/Makefile:

	add paper.txt target;

2004-01-03 20:26  millert

	* cmdtab.c:

	Silence a gcc warning: "initialization from incompatible pointer type"
	The problem is that while ANSI C allows initialization of unions,
	the initializer must be valid for the first member of the union.
	Therefore, add a cast to quiet the compiler.  Noticed and Ok pvalchev@

2004-01-03 20:06  millert

	* collect.c:

	Fix format type mismatch (int vs. ssize_t).

2003-12-03 20:59  millert

	* cmd1.c:

	Change how the line output from the 'h' command is formatted.
	Previously if you had an ungodly number of messages the line could
	wrap the screen.  We now format the line in a buffer and then only
	print as many characters as will fit instead of printing the parts
	piecemeal.

2003-10-24 20:32  avsm

	* cmd2.c, collect.c, lex.c:

	dont compare int to NULL, millert@ ok

2003-10-13 00:46  tedu

	* lex.c, list.c:

	better realloc. ok deraadt jose

2003-09-04 22:14  jmc

	* mail.1:

	put escapes in the right place;
	(i.e. stuff I got wrong the first time, or missed)

	this includes some .Cd's with missing quotes and .Nm abuse in man4;

2003-09-04 14:09  jmc

	* mail.1:

	escape in the wrong place;

2003-07-14 09:27  jmc

	* mail.1:

	remove some old groff macros;

2003-07-07 21:36  deraadt

	* fio.c:

	protos

2003-06-28 14:25  jmc

	* mail.1:

	use .Bk/.Ek to align the options in SYNOPSIS;

2003-06-25 15:13  millert

	* def.h:

	Remove unused c_func0; noticed by deraadt@

2003-06-10 09:12  jmc

	* mail.1:

	- section reorder
	- COMPATIBILITY merge
	- macro cleanup
	- kill whitespace at EOL
	- new sentence, new line

	ssh pages ok markus@

2003-06-03 02:56  millert

	* aux.c, cmd1.c, cmd2.c, cmd3.c, cmdtab.c, collect.c, def.h,
	  edit.c, extern.h, fio.c, getname.c, glob.h, head.c, lex.c,
	  list.c, mail.1, main.c, names.c, pathnames.h, popen.c, quit.c,
	  rcv.h, send.c, strings.c, temp.c, tty.c, v7.local.c, vars.c,
	  version.c, USD.doc/mail0.nr, USD.doc/mail1.nr, USD.doc/mail2.nr,
	  USD.doc/mail3.nr, USD.doc/mail4.nr, USD.doc/mail5.nr,
	  USD.doc/mail6.nr, USD.doc/mail7.nr, USD.doc/mail8.nr,
	  USD.doc/mail9.nr, USD.doc/maila.nr:

	Remove the advertising clause in the UCB license which Berkeley
	rescinded 22 July 1999.  Proofed by myself and Theo.

2003-05-15 02:47  pjanzen

	* cmd1.c, def.h, send.c:

	Use vis() on any remotely created input before displaying it on a screen.
	deraadt@ ok

2003-04-09 09:49  jmc

	* misc/mail.help:

	syetem -> system;

	from Marko Cehaja
	closes PR 3187

2003-01-03 19:17  millert

	* mail.1:

	DEL hasn't sent SIGINTR in a looooong time.

2002-11-14 02:57  deraadt

	* mail.1:

	use $ or # before commands in examples

2002-10-07 22:45  vincent

	* getname.c:

	 tyop

	 ok deraadt@

2002-08-12 00:42  aaron

	* cmd3.c, vars.c:

	Swap args to calloc(3) so they are in the correct order; art@ ok.

2002-06-14 21:35  todd

	* head.c:

	spelling; from Brian Poole <raj@cerias.purdue.edu>

2002-06-12 06:07  mpech

	* popen.c:

	a real pid_t cleanup.

	espie@ ok for make/,
	deraadt@ one extra eye,
	millert@ ok

2002-04-13 19:09  millert

	* collect.c:

	Errata #23:
	mail(1) will process tilde escapes even in non-interactive
	mode. This can lead to a local root compromise.
	Don't do tilde escapes unless we are in interactive mode.  Now the
	behavior matches the man page...

2002-04-11 23:33  miod

	* collect.c:

	Errata #23:
	mail(1) will process tilde escapes even in non-interactive
	mode. This can lead to a local root compromise.
	Fix (millert):
	Don't do tilde escapes unless we are in interactive mode.  Now the
	behavior matches the man page...

2002-04-08 20:27  millert

	* collect.c:

	Don't do tilde escapes unless we are in interactive mode.  Now the
	behavior matches the man page...

2002-03-14 06:51  mpech

	* fio.c:

	Remove \n from err/errx/warn/warnx().

	millert@ ok

2002-02-16 21:27  millert

	* def.h:

	Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

2002-01-24 23:01  millert

	* temp.c:

	Fix `necesary' typos; Alexander Yurchenko

	Alas many of these were introduced by yours truly as necessary
	just doesn't look right to me for some reason ;-)

2002-01-24 20:33  mickey

	* mail.1:

	fix the history refs

2001-12-18 16:55  millert

	* fio.c:

	We need to adjust where "dot" points when we realloc(message).
	Problem found by Mike Heffner of the FreeBSD project.

2001-11-28 01:26  millert

	* extern.h, send.c:

	Catch SIGINT in sendmessage() so user can interupt a long message
	that is being output.

	Make statusput() return an int and return -1 if ferror()

2001-11-28 01:04  millert

	* tty.c:

	Fix typo; SIGTTIN where SIGINT meant and rename a variable for clarity.

2001-11-23 00:03  millert

	* popen.c:

	Revert change to Popen() to only wrap command in a shell if it
	contains meta characters since people may expect their aliases to
	work.
	Instead, just remove the "kill(lock_pid, SIGTERM);" since lockspool
	now does the right thing when the pipe is closed.

2001-11-21 20:41  millert

	* cmd1.c, cmd2.c, cmd3.c, lex.c, list.c, names.c, popen.c, tty.c,
	  vars.c:

	o kill strcpy()
	o check return values of malloc and friends
	o use strdup() when sensible

2001-11-21 18:43  millert

	* names.c:

	fix arg reversal that was introduced during ANSIfication

2001-11-21 15:28  millert

	* main.c:

	Fix extern decl of version missed in previous commit.

2001-11-21 15:26  millert

	* aux.c, cmd1.c, cmd2.c, cmd3.c, cmdtab.c, collect.c, def.h,
	  edit.c, extern.h, fio.c, getname.c, glob.h, head.c, lex.c,
	  list.c, main.c, names.c, popen.c, quit.c, send.c, strings.c,
	  temp.c, tty.c, v7.local.c, vars.c, version.c:

	o ANSIfy
	o Style nits
	o Use const to silent stupid -Wall warnings
	o strnc{py,at} -> strlc{py,at}
	o Use strpbrk() instead of homegrown anyof()
	o Use NULL instead of #defines with 0 cast to a pointer
	This still could use a proper audit

2001-11-20 23:19  millert

	* popen.c:

	In private version of popen(), only wrap a command to be run in a
	shell if it contains meta chars.  Sneaky hack to work around a ksh
	bug.

2001-11-20 20:50  millert

	* aux.c, cmd1.c, cmd3.c, collect.c, def.h, edit.c, extern.h, fio.c,
	  glob.h, lex.c, main.c, quit.c, tty.c:

	Major signal overhaul.  We no longer longjmp all over the place.
	Instead, routines responsible to gathering user input (or in some
	cases outputting data) catch the signals and set flags as needed.
	Because of this some handlers are install without the SA_RESTART
	flag so syscalls are not restarted and we can check the flag.  All
	signal handlers are now safe.

	This should make the flow of control a bit more grokable but the
	code is still ugly.

2001-11-17 19:10  deraadt

	* lex.c:

	properly bail out of incfile(); millert ok

2001-11-16 17:10  millert

	* cmd1.c, extern.h:

	Instead of using a longjmp to catch SIGPIPE, just set to SIG_IGN and
	check the return value on writes for error.

	Save and restore terminal modes when piping to a command so we end
	up with a known good state if the command terminates uncleanly.

2001-10-11 20:59  millert

	* main.c:

	missing arg to errx

2001-10-04 04:23  pvalchev

	* pathnames.h:

	Fix path to /bin/ls; ok millert

2001-09-16 16:12  millert

	* aux.c:

	Optimize space-eating loop since we've already checked that the
	first char is a space.  Patch from sacrificial-spam-address@horizon.com

2001-09-16 15:27  millert

	* aux.c:

	1) In skin(), only add a space after a comma if there is actually a space
	in the input buffer.  This prevents a rare buffer overflow on very long
	header lines where one or more entries has a comment in it but the
	entries have no space after the comma *and* the amount of extra space
	needed to add a space after each comma is greater than the length of
	the comments that will be removed.  This is debian bug #108677

	2) In skin(), use a temporary variable in the realloc() and don't
	die if realloc() fails since its only purpose is to shrink the
	buffer, not expand it (and thus is not fatal).

2001-09-07 01:19  millert

	* main.c:

	Sanity check length of -u argument to avoid truncation later on.

2001-09-04 23:16  millert

	* popen.c:

	Fix bogus use of snprintf return value.  Since we know the max
	length of a username we can use that as part of the buffer size.

2001-06-23 23:04  millert

	* cmd1.c, collect.c, lex.c, tty.c:

	Remove evil #ifdef __GNUC__ garbage to avoid longjmp clobbering and
	use volatile instead.

2001-01-19 04:11  millert

	* cmd3.c, edit.c, head.c, popen.c:

	More fixes from Don Beusee:
	- edit and other interactive commands have no stdin (making the
	  command completely broken).
	- messages with "From " line having date format with -0800 type of timezone
	  are not recognized correctly.

2001-01-16 05:36  millert

	* aux.c, cmd1.c, cmd3.c, cmdtab.c, collect.c, def.h, extern.h,
	  fio.c, lex.c, list.c, names.c, pathnames.h, popen.c, quit.c,
	  send.c, vars.c, version.c:

	Changes from Don Beusee:
	o escape From line with a leading '>' when needed
	o only print To: address and Subject lines if actually present
	o new variable 'allnet' to treat user@foo and user@bar as the same "user"
	o folders command now takes an optional argument like ls.
	o new "pipe" (|) command to pipe the message through an arbitrary command
	o make header display format the same as SunOS 4.1.3 /usr/ucb/mail
	o tilde commands work regardless of interactive mode.
	o fix "read: Interrupted system call" error by retrying if EINTR
	o expanded help file
	Changes by me:
	o read the help file via the PAGER as it is now more than 24 lines long

2001-01-16 04:04  millert

	* misc/: mail.help, mail.tildehelp:

	Changes from Don Beusee:
	o escape From line with a leading '>' when needed
	o only print To: address and Subject lines if actually present
	o new variable 'allnet' to treat user@foo and user@bar as the same "user"
	o folders command now takes an optional argument like ls.
	o new "pipe" (|) command to pipe the message through an arbitrary command
	o make header display format the same as SunOS 4.1.3 /usr/ucb/mail
	o tilde commands work regardless of interactive mode.
	o fix "read: Interrupted system call" error by retrying if EINTR
	o expanded help file
	Changes by me:
	o read the help file via the PAGER as it is now more than 24 lines long

2000-11-09 17:52  aaron

	* mail.1:

	Change all option list specifications to ".Bl -tag -width Ds". Most man
	pages just needed their -width parameter tweaked to "Ds", which provides
	a nice width of 6 constant characters. For consistency more than anything.

2000-10-06 21:16  jason

	* cmd1.c, cmd3.c, collect.c, names.c, popen.c, aux.c, edit.c,
	  lex.c, main.c, quit.c, send.c:

	Pull in patch from current (even more to come):
	Fix (millert):
	warnx?/errx? paranoia (use "%s" not a bare string unless it is a
	constant).  These are not security holes but it is worth fixing
	them anyway both for robustness and so folks looking for examples
	in the tree are not misled into doing something potentially dangerous.
	Furthermore, it is a bad idea to assume that pathnames will not
	include '%' in them and that error routines don't return strings
	with '%' in them (especially in light of the possibility of locales).

2000-08-23 21:24  mickey

	* extern.h, names.c, send.c:

	repair sendmail options handling

2000-08-02 04:10  millert

	* cmd3.c, fio.c, temp.c:

	$HOME paranoia: never use getenv("HOME") w/o checking for NULL and non-zero

2000-07-06 06:24  deraadt

	* lex.c:

	printf with % for the prompt

2000-06-30 16:00  millert

	* cmd3.c, names.c, collect.c, aux.c, cmd1.c, edit.c, popen.c,
	  quit.c, send.c, lex.c, main.c:

	warnx?/errx? paranoia (use "%s" not a bare string unless it is a
	constant).  These are not security holes but it is worth fixing
	them anyway both for robustness and so folks looking for examples
	in the tree are not misled into doing something potentially dangerous.
	Furthermore, it is a bad idea to assume that pathnames will not
	include '%' in them and that error routines don't return strings
	with '%' in them (especially in light of the possibility of locales).

2000-06-26 23:18  hugh

	* mail.1:

	fix pasto; noted by art

2000-06-11 21:03  millert

	* mail.1:

	newaliases(1) -> newaliases(8)

2000-05-15 06:55  deraadt

	* mail.1:

	/etc/mail/aliases

2000-04-26 15:47  millert

	* cmd1.c, cmd2.c, collect.c, extern.h, quit.c, send.c:

	Change the name of mail's send() function to sendmessages() to
	avoid shadowing the libc send(2); gadams@avernus.com

2000-04-25 16:42  millert

	* aux.c, cmd1.c, cmd3.c, extern.h, lex.c:

	When incorporating new messages, clear the "new" count before the
	inc so the count of new messages is useful afterwards.  This makes
	mail behave more like the SunOS version in this respect.

2000-04-12 21:47  aaron

	* mail.1:

	Trailing whitespace begone!

2000-03-24 21:41  aaron

	* mail.1:

	Correct the HISTORY section to note that this command appeared in Version 5
	of AT&T UNIX, not Version 6. Verified by strings(1)'ing a .dsk file (PDP-11
	executable) containing the v5 sources, obtainable at gatekeeper.dec.com in the
	directory /pub/DEC/sim/software. Idea from NetBSD PR/4790.

2000-03-23 19:32  millert

	* names.c:

	When calling sendmail, use "--" to indicate end of command line arguments.
	This prevents someone from sneaking arbitrary args to sendmail via
	the Reply-To: or From: lines.

2000-03-10 19:07  aaron

	* mail.1:

	Various cleanups and standardization.

2000-03-04 20:02  aaron

	* mail.1:

	Try to standardize the options list introduction; it should read "The options
	are as follows:", except in special cases.

1999-10-16 20:47  aaron

	* mail.1:

	Formatting fixes.

1999-06-05 01:21  aaron

	* mail.1:

	- remove trailing white space
	- remove arguments from .Os macros
	- remove arguments from .Nm macros, where appropriate
	- some more Dq/Sq/Ql insanity
	- still lots to do in the usr.bin tree... :/

1999-05-12 13:26  aaron

	* mail.1:

	grammar police: do not hyphenate compound words that act as adjectives if the
	first word ends in -ly

	i.e., fully-qualified, newly-created, globally-visible, etc. are wrong

1998-11-19 23:23  aaron

	* mail.1:

	significant cleanup; also s/INTRODUCTION/DESCRIPTION/, in particular for man -h

1998-11-11 23:01  aaron

	* mail.1:

	remove redundant .Pp macros

1998-09-27 21:20  millert

	* mail.1:

	mail -u foo is not really the same as mail -f /var/mail/foo

1998-09-27 21:16  millert

	* glob.h, main.c, popen.c:

	Use new username option to lockspool for 'mail -u'.

1998-09-26 19:55  aaron

	* mail.1:

	usr.bin/ man page fixes, f-m.

1998-09-13 03:50  aaron

	* mail.1:

	typos

1998-09-12 22:55  todd

	* misc/mail.help:

	document reality.

1998-09-10 16:47  millert

	* mail.1:

	.Xr lockspool 1

1998-09-10 16:18  millert

	* popen.c, quit.c:

	Fix comments

1998-09-10 16:06  millert

	* popen.c:

	If a child has not been waited on via the SIGCHLD handler, wait for it
	ourselves instead of playing games with sigsuspend.  This may fix PR 588.

1998-09-10 16:04  millert

	* mail.1:

	make mail.1 nroff'able again

1998-09-08 15:24  millert

	* popen.c:

	repair order of signal blocking that got changed in conversion to POSIX signals

1998-09-08 14:59  millert

	* lex.c:

	Fix comments in .mailrc where there is no space after the hash (#).  Noted by pjanzen@foatdi.harvard.edu

1998-09-07 16:44  aaron

	* mail.1:

	More man page fixes. Particularly fix uses of it's/its, affect/effect,
	then/than and such. Other miscellaneous problems fixed across these source
	files.

1998-09-06 22:23  aaron

	* mail.1:

	More man page fixes. Spelling, grammar, some typos. Lots of double-word
	occurrences squashed as well.

1998-09-01 16:38  deraadt

	* mail.1:

	more man page fixes; aaron@ug.cs.dal.ca

1998-08-15 23:17  millert

	* pathnames.h, popen.c:

	use lockspool for locking, not 'mail.local -H'

1998-07-16 06:05  millert

	* mail.1:

	mention MAIL environment variable

1998-06-25 07:29  deraadt

	* mail.1:

	and mailx too..

1998-06-12 18:07  millert

	* collect.c, lex.c, popen.c:

	back out some signal changes that can cause mail to hang when quitting due to SIGCHLD blockage

1998-06-12 17:51  millert

	* v7.local.c, fio.c, quit.c, popen.c:

	Don't call truncate() directly; have rm() do it if we get EPERM on unlink()
	In popen.c, findchild() may return NULL so catch that case.

1998-06-12 17:15  millert

	* v7.local.c:

	Properly delete messages that the user has deleted in his/her spool.
	I fudged up the logic when I replaced an unlink with a truncate.

1998-06-11 06:20  deraadt

	* fio.c:

	Don't segfault just because a line starts with NUL; ross

1998-05-11 04:15  millert

	* cmd1.c:

	fix scrolling and 'z' command; matt debergalis <deberg@mit.edu>

1998-05-04 05:37  millert

	* collect.c, lex.c, popen.c, v7.local.c:

	Never remove a mail spool, as we may not have proper prics, just truncate.  Also block signals in a few critical areas

1998-04-25 00:41  deraadt

	* mail.1:

	doc startup behaviour; koshy@india.hp.com

1998-04-25 00:19  deraadt

	* mail.1:

	fix usage; ru@ucb.crimea.ua

1998-03-24 05:40  deraadt

	* mail.1:

	prettty

1998-02-15 21:20  niklas

	* popen.c:

	Remove one case of malloc call from sighandler

1997-11-14 00:23  millert

	* aux.c, cmd1.c, cmd2.c, cmd3.c, collect.c, edit.c, extern.h,
	  fio.c, head.c, lex.c, list.c, mail.1, main.c, names.c, popen.c,
	  quit.c, send.c, strings.c, temp.c, tty.c, vars.c:

	NetBSD changes (mostly comsmetic):
	    replace panic() with calls to err()/errx()
	    use S_IS* instead of doing by hand with S_IF*.
	    Use TIMESPEC_TO_TIMEVAL() and gettimeofday instead of time(2)
	    Use _POSIX_VDISABLE, not 0
	    Kill register

1997-11-13 03:30  millert

	* tty.c:

	Add back EXTPROC code now that tty_pty.c has the lite2 fix.

1997-11-04 08:34  deraadt

	* mail.1:

	unbalanced parenthesis around command abbreviation in mail.1; h-nokubi@nmit.tmg.nec.co.jp

1997-09-21 11:49  deraadt

	* Makefile:

	$OpenBSD$

1997-09-04 20:44  millert

	* fio.c:

	Deal with <CR><LF> pairs in mailboxes so we can work with eudora mail
	spools mounted from DOS/Windoze.  From Matt Thomas <matt@3am-software.com>.

1997-08-31 14:32  millert

	* cmd2.c, fio.c, popen.c:

	Kill union wait.

1997-08-05 04:00  deraadt

	* popen.c:

	pull errno.h in

1997-08-04 19:25  deraadt

	* popen.c:

	save errno in sigchld handlers

1997-08-04 17:30  millert

	* aux.c, list.c:

	Fix a problem in skin() that was introduced with the buffer oflow
	fix.  Could end up realloc'ing the wrong thing.

1997-07-31 17:55  millert

	* tty.c:

	Remove TIOCEXT added in lite2 merge for now.  Causes problems when
	mail(1) is used over a telnet session.

1997-07-31 02:48  millert

	* names.c:

	Another static buffer bytes the dust.

1997-07-31 02:36  millert

	* aux.c, list.c:

	Document an assumption and kill a static buffer.

1997-07-30 07:19  millert

	* aux.c, cmd2.c, cmd3.c, collect.c, extern.h, lex.c:

	Make istrcpy() take a size (not length) field, now called istrncpy().
	Change some strcpy() -> strncpy() out of paranoia.

1997-07-30 06:32  millert

	* cmd1.c, cmd3.c, collect.c, extern.h, lex.c, main.c, tty.c,
	  v7.local.c:

	Fix one possible oflow (not exploitable) and do a wee bit of KNF.
	Much more remains to be done.

1997-07-28 15:20  millert

	* aux.c, fio.c:

	Dynamically allocate space for addr header strings instead of using
	BUFSIZ.  We know that the end size will be <= to the start size
	so it is simple to preallocate enough space.  Fixes NetBSD PR#3028

1997-07-28 10:01  deraadt

	* Makefile:

	install mail.rc at distribution time; bug found by explorer@flame.org

1997-07-25 21:05  mickey

	* aux.c:

	#if __STDC__ --> #ifdef __STDC__

1997-07-24 17:27  millert

	* cmd1.c, collect.c, edit.c, extern.h, fio.c, lex.c, names.c,
	  quit.c, send.c, temp.c:

	tempnam(3) goes bye bye.

1997-07-24 16:23  millert

	* extern.h, fio.c, lex.c, quit.c, temp.c:

	Replace 3 tempnam()'s with mkstemp.  The two left look tricky.

1997-07-22 19:13  millert

	* lex.c:

	incfile() needs to lock the mail spool so it doesn't get partial messages.
	Noticed by Theo.

1997-07-22 19:09  deraadt

	* dotlock.c:

	locking is done differently now

1997-07-22 18:54  millert

	* cmd1.c, collect.c, extern.h, send.c, tty.c:

	grabh() now returns SIGINT if it was interrupted (previously always
	    returned 0 and the return val was always ignored).
	Add gethfromtty() to get a header (using grabh) from the tty and
	    quit on two ^C's.
	Use gethfromtty() when getting Subject, Cc, and Bcc headers so
	    we can quit nicely.  Closes PR #291.
	Don't use longs where it doesn't make sense.

1997-07-22 18:26  millert

	* collect.c:

	Only require 2 ^C's at Subject: prompt to quit as it is supposed to.
	Also in Subject: prompt, when we get that first ^C re-prompt for
	the Subject: like SunOS does so the user knows what is going on.

1997-07-22 06:46  millert

	* lex.c:

	Release signals when we get an error condition in incfile().

1997-07-18 18:12  millert

	* glob.h:

	Change jmp_buf to sigjmp_buf that I missed in the last sweep.

1997-07-14 16:09  millert

	* popen.c:

	Don't call it a mask when it is a sigset_t (cosmetic changes only).

1997-07-14 15:56  millert

	* collect.c, main.c, popen.c, send.c, tty.c:

	Convert remaining sigsetmask() -> sigprocmask() (POSIX style)
	in collect.c and fix up some signal botches elsewhere.

1997-07-14 00:24  millert

	* aux.c, cmd1.c, cmd2.c, cmd3.c, collect.c, def.h, edit.c, fio.c,
	  getname.c, head.c, lex.c, list.c, main.c, names.c, popen.c,
	  quit.c, send.c, strings.c, temp.c, tty.c, v7.local.c:

	NOSTR -> NULL
	Use sigsetjmp/siglongjmp instead of sigjmp/longjmp for portability.

1997-07-13 23:53  millert

	* aux.c, cmd1.c, cmd2.c, cmd3.c, collect.c, dotlock.c, edit.c,
	  fio.c, lex.c, main.c, names.c, popen.c, quit.c, send.c,
	  strings.c, tty.c, vars.c:

	bcopy() -> memcpy() and fix some casts.

1997-07-13 23:35  millert

	* USD.doc/: Makefile, mail2.nr, mail4.nr, mail5.nr, mail6.nr,
	  mail8.nr, mail9.nr:

	Update from 44.BSD-lite2

1997-07-13 21:21  millert

	* aux.c, cmd1.c, cmd2.c, cmd3.c, cmdtab.c, collect.c, def.h,
	  dotlock.c, edit.c, extern.h, fio.c, getname.c, head.c, lex.c,
	  list.c, mail.1, main.c, names.c, popen.c, quit.c, send.c,
	  strings.c, temp.c, tty.c, v7.local.c, vars.c:

	Merge in NetBSD and 4.4BSD-lite2 changes as well as some of my own.
	 - handle long lines safely (from NetBSD)
	 - use puts/fputs and putchar/putc when it makes sense
	 - use err/errx and warn/warnx when it makes sense
	 - make return() and sizeof() style consisten
	 - some more buffer safety

1997-06-18 23:52  deraadt

	* version.c:

	crank version number, we have made a few changes...

1997-06-16 20:57  millert

	* v7.local.c:

	Use buflen, not sizeof(buf) as buf is a pointer.

1997-06-02 17:00  dm

	* v7.local.c:

	buflen != sizeof (char *)

1997-05-30 08:51  deraadt

	* aux.c, cmd1.c, cmd3.c, extern.h, fio.c, lex.c, list.c, popen.c,
	  v7.local.c:

	overflows abound

1997-04-27 20:56  millert

	* Makefile:

	COPY -> INSTALL_COPY and STRIP -> INSTALL_STRIP
	This fixes namespace problems where STRIP is sometimes used as
	the name of the strip(1) to use and other times used as
	the flag to send install(1) when stripping (or not).
	COPY doesn't have this problem (yet) but was poorly named.

1997-04-13 20:32  deraadt

	* collect.c:

	single ^C on a pipe

1997-04-13 20:22  deraadt

	* collect.c:

	do not (continue) on a stdin pipe

1997-04-10 15:33  deraadt

	* collect.c:

	how is this for fast bug fixing response! revert to sigblock() since the
	sigprocmask() code was not equivelant. report from grr@shandakor.tharsis.com,
	PR#154

1997-03-29 03:01  millert

	* Makefile, cmd1.c, cmd3.c, def.h, extern.h, fio.c, pathnames.h,
	  popen.c, quit.c, temp.c:

	Use ``mail.local -H'' to do dot locking so we can have mode 755 mail
	spool, change an occurrence of tempnam() to mkstemp(), change some
	longs and shorts to ints.  Mail is now usable again.

1997-02-03 00:25  deraadt

	* def.h:

	use a long line counter, netbsd pr#3083, rhialto@polder.ubc.kun.nl

1997-01-17 07:12  millert

	* aux.c, fio.c, lex.c, list.c, names.c:

	r?index -> strr?chr

1997-01-15 23:42  millert

	* main.c:

	getopt(3) returns -1 when out of args, not EOF, whee!

1997-01-13 20:36  deraadt

	* mail.1:

	doc "more" command; jdc@orthanc.ncl.ac.uk

1996-12-08 14:32  downsj

	* Makefile:

	install -> ${INSTALL}, -c -> ${COPY}

1996-10-28 00:42  millert

	* temp.c:

	Ignore $HOME if > MAXPATHLEN

1996-10-26 05:11  millert

	* mail.1, v7.local.c:

	honor $LOGNAME

1996-09-16 02:26  deraadt

	* main.c, temp.c:

	_PATH_TMP -> _PATH_TMPFILE; avoid /tmp//fooXXXX where possible too

1996-06-26 21:22  dm

	* popen.c:

	Accept NULL nset in prepare child (as run_editor will try to use one).

1996-06-11 12:53  deraadt

	* Makefile, aux.c, cmd1.c, cmd2.c, cmd3.c, cmdtab.c, collect.c,
	  def.h, dotlock.c, edit.c, extern.h, fio.c, getname.c, glob.h,
	  head.c, lex.c, list.c, mail.1, main.c, names.c, pathnames.h,
	  popen.c, quit.c, rcv.h, send.c, strings.c, temp.c, tty.c,
	  v7.local.c, vars.c, version.c, USD.doc/Makefile,
	  USD.doc/mail0.nr, USD.doc/mail1.nr, USD.doc/mail2.nr,
	  USD.doc/mail3.nr, USD.doc/mail4.nr, USD.doc/mail5.nr,
	  USD.doc/mail6.nr, USD.doc/mail7.nr, USD.doc/mail8.nr,
	  USD.doc/mail9.nr, USD.doc/maila.nr:

	from christos;
	- Fix PR/105: Implement dot locking protocol and check return value of flock.
	- Fix PR/2247: Don't call unknown users "ubluit". Issue an error message.
	- Fix/add prototypes.
	- Fix warnings.
	- Use POSIX signal mask calls.

1996-03-27 19:32  niklas

	* Makefile, cmd1.c, cmdtab.c, extern.h, lex.c:

	From NetBSD: merge of 960317

1995-10-18 08:45  deraadt

	* Makefile, aux.c, cmd1.c, cmd2.c, cmd3.c, cmdtab.c, collect.c,
	  def.h, edit.c, extern.h, fio.c, getname.c, glob.h, head.c, lex.c,
	  list.c, mail.1, main.c, names.c, pathnames.h, popen.c, quit.c,
	  rcv.h, send.c, strings.c, temp.c, tty.c, v7.local.c, vars.c,
	  version.c, USD.doc/Makefile, USD.doc/mail0.nr, USD.doc/mail1.nr,
	  USD.doc/mail2.nr, USD.doc/mail3.nr, USD.doc/mail4.nr,
	  USD.doc/mail5.nr, USD.doc/mail6.nr, USD.doc/mail7.nr,
	  USD.doc/mail8.nr, USD.doc/mail9.nr, USD.doc/maila.nr,
	  misc/mail.help, misc/mail.rc, misc/mail.tildehelp:

	Initial revision

1995-10-18 08:45  deraadt

	* Makefile, aux.c, cmd1.c, cmd2.c, cmd3.c, cmdtab.c, collect.c,
	  def.h, edit.c, extern.h, fio.c, getname.c, glob.h, head.c, lex.c,
	  list.c, mail.1, main.c, names.c, pathnames.h, popen.c, quit.c,
	  rcv.h, send.c, strings.c, temp.c, tty.c, v7.local.c, vars.c,
	  version.c, USD.doc/Makefile, USD.doc/mail0.nr, USD.doc/mail1.nr,
	  USD.doc/mail2.nr, USD.doc/mail3.nr, USD.doc/mail4.nr,
	  USD.doc/mail5.nr, USD.doc/mail6.nr, USD.doc/mail7.nr,
	  USD.doc/mail8.nr, USD.doc/mail9.nr, USD.doc/maila.nr,
	  misc/mail.help, misc/mail.rc, misc/mail.tildehelp:

	initial import of NetBSD tree

