[andy at metropolis.co.za: Update to mailx hint/?]

Jason Gurtz jason at tommyk.com
Thu Aug 23 13:21:33 PDT 2001

K, here's the updated hint  =)


TITLE:		Installation of the 'mail' command
AUTHOR:		Jason Gurtz <jason(at)tommyk(dot)com>

	The 'mail' command is convienient for use in shell scripts and cron
jobs as well as emergent interactive use when dealing with a screwy
terminal or, when you just feel like using a very simple client  ;)

	The mutt MUA also has a way of being invoked at the command line for
non-interactive use, but, nontheless remains a full-screen application
for interactive use.  To send a message with mutt from a script use:
'mutt -x <recipient at addy> [-s "subject"] [-a  "/path/attached_file"] [<
message.txt or "my message"]'

It's a good idea to redirect stderr > /dev/null when using the above.
Sometimes a terminal is screwed up so that full screen apps are
unusable.  The fcron lfs-hint, and sometimes 3rd party scripts and
commercial applications depend on a /usr/bin/mail being available.


z	(NOTE:  The original bsd mail program is no longer supported by anyone
although by searching you can find updated versions at debian.org.  It
is much easier to use the derivative, nail, which also adds support for
MIME attachments.)

1. For most people a simple ./configure --prefix=/usr && make && make
install should work.  The ./configure script should find everything, but
if you have some oddities in your setup then take note of the following
./configure options:

	--with-mailspool=DIR    mail spool directory
	--with-csh=FILE         csh binary
	--with-more=FILE        more binary
	--with-ex=FILE          ex binary
	--with-vi=FILE          vi binary
	--with-sendmail=FILE    sendmail binary

2.  After a successfull installation make the symbolic links:

	cd /usr/bin && ln -s /usr/bin/nail mail && ln -s /usr/bin/nail mailx

3. That's it, you're done!  :)


	The ...src/mailx-8.1.1.orig/debian/README.debian makes for intersting

Hints for interactive use:

	simply typing 'mail' will get you a list of one line headers of
messages in
your mailbox, if any, and the '&' prompt.  'p' prints the current
message to
screen  Just like the 'ed' line editor, you use the '+' and '-' commands
move forwards and backwards through messages, or type the number of the
message to jump around.  While reading a message 'r' reply's 'd'
you can deleat mulitiple messages with a space delimeted list 'd 1 2 4
6' or
by specifing a range 'd 1-7'.  'u 1' undeleats message one.

	composing is semi-non-interactive in that you invoke from the regular
prompt.  Simply type 'mail recipient at domain' it will prompt for subject
you type message.  End by typeing a single dot '.' on a line and hit
It will prompt for a cc: addy and then it'll send.  to attach a file use
'-a /path/to/file'
	'mail -?'
	'man nail' for the rest...!

HTH, and Have fun!

More information about the hints mailing list