Subject: Linux Electronic Mail HOWTO
From: [email-masked] (Vince Skahan)
Newsgroups: comp.os.linux.announce,comp.os.linux.admin,comp.answers,news.answers

Archive-name: linux/howto/mail
Last-modified:  26 January 1994 

The Linux Electronic Mail HOWTO
by Vince Skahan, <[email-masked]>
v1.4, Last Modified 26 January 1994 
---------------------------------------------------------------------------

This document describes the setup and care+feeding of Electronic Mail
(e-mail) under Linux.

You need to read this if you plan to communicate locally or to remote sites
via electronic mail.

You probably do *not* need to read this document if don't exchange
electronic mail with other users on your system or with other sites.

0.  Introduction

	The intent of this document is to answer some of the questions and
	comments that appear to meet the definition of 'frequently asked
	questions' about e-mail software under Linux.

	This document and the corresponding UUCP and News 'HOWTO' documents
	collectively supersede the UUCP-NEWS-MAIL-FAQ that has previously
	been posted to comp.os.linux.announce.

0.1 New versions of this document

	New versions of this document will be periodically posted to
	comp.os.linux.announce, comp.answers, and news.answers.  They will
	also be added to the various anonymous ftp sites who archive such
	information including sunsite.unc.edu:/pub/Linux/docs/HOWTO.

0.2 Feedback

	I am interested in any feedback, positive or negative, regarding
	the content of this document via e-mail.  Definitely contact me if
	you find errors or obvious omissions.

	I read, but do not necessarily respond to, all e-mail I receive.
	Requests for enhancements will be considered and acted upon based on
	that day's combination of available time, merit of the request, and
	daily blood pressure :-)

	Flames will quietly go to /dev/null so don't bother.

	Feedback concerning the actual format of the document should go to
	the HOWTO coordinator - Matt Welsh ([email-masked]).

0.3 Copyright Information

    The Mail-HOWTO is copyrighted (c)1994 Vince Skahan. 

    A verbatim copy may be reproduced or distributed in any medium physical
    or electronic without permission of the author.  Translations are
    similarly permitted without express permission if it includes a notice
    on who translated it.

    Short quotes may be used without prior consent by the author.
    Derivative work and partial distributions of the Mail-HOWTO must be
    accompanied with either a verbatim copy of this file or a pointer to
    the verbatim copy.

    Commercial redistribution is allowed and encouraged; however, the
    author would like to be notified of any such distributions.

    In short, we wish to promote dissemination of this information through
    as many channels as possible. However, we do wish to retain copyright
    on the HOWTO documents, and would like to be notified of any plans to
    redistribute the HOWTOs.

    We further want that ALL information provided in the HOWTOS is
    disseminated. If you have questions, please contact Matt Welsh, the
    Linux HOWTO coordinator, at [email-masked], or +1 607 256 7372.

0.4 Standard Disclaimer

	Of course, I disavow any potential liability for the contents of this 
	document.  Use of the concepts, examples, and/or other content of this
	document is entirely at your own risk.

0.5 Other sources of information

	LINUX HOWTO Documents:
	======================

	There is plenty of exceptional material provided in the other Linux
	HOWTO documents and from the Linux DOC project.  In particular, you
	might want to take a look at the following:

		- the serial communications HOWTO
		- the ethernet HOWTO
		- the Linux Networking Guide

	USENET:
	=======
	comp.mail.elm			the ELM mail system.
	comp.mail.mh			The Rand Message Handling system.
	comp.mail.mime			Multipurpose Internet Mail Extensions.
	comp.mail.misc			General discussions about computer mail.
	comp.mail.multi-media	Multimedia Mail.
	comp.mail.mush			The Mail User's Shell (MUSH).
	comp.mail.sendmail		the BSD sendmail agent.
	comp.mail.uucp			Mail in the uucp environment.

	Mailing Lists:
	==============

	There is a smail-3.1 mailing list.  

	To join (or get off) the list, send mail to
		[email-masked]

	make sure that you include the address at which you want to receive
	mail in the text of the message.

	To send a message to the list, send it to
		[email-masked].

	Books:
	======

	The following is a non-inclusive set of books that will help...

	'Managing UUCP and USENET' from O'Reilly and Associates is in my
	opinion the best book out there for figuring out the programs and
	protocols involved in being a USENET site.

	'Unix Communications' from The Waite Group contains a nice
	description of all the pieces (and more) and how they fit together.

	'Sendmail' from O'Reilly and Associates looks to like the
	definitive reference on sendmail-v8 and sendmail+IDA.
	It's a "must have" for anybody hoping to make sense out of
	sendmail without bleeding in the process.

	'The Internet Complete Reference' from Osborne is a fine reference
	book that explains the various services available on Internet and
	is a great "one-stop-shopping" source for information on news, mail,
	and various other Internet resources.

0.6 Where *NOT* to look for help

	There is nothing 'special' about configuring and running mail under
	Linux (any more).  Accordingly, you almost certainly do *NOT* want
	to be posting generic mail-related questions to the comp.os.linux.*
	newsgroups.

	Unless your posting is truly Linux-specific (ie, "please tell me
	what routers are already compiled into the SLS1.03 version of
	smail3.1.28") you should be asking your questions in one of the
	newsgroups or mailing lists referenced above.

    Let me repeat that.

    There is virtually no reason to post anything mail-related in the
    comp.os.linux hierarchy any more.  There are existing newsgroups in
    the comp.mail.* hierarchy to handle *ALL* your questions.

1.0 Hardware Requirements

	There are no specific hardware requirements for mail under Linux.

	You'll need some sort of 'transport' software to connect to remote
	systems, which means either tcp-ip or uucp.   This could mean that
	you need a modem or ethernet card (depending on your setup).

2.0 Getting the software

	In general, I grab my sources from ftp.uu.net and the other fine
	archive sites on Internet.  In addition, Linux-specific binary ports
	are found in the usual Linux distrbutions and on the usual Linux
	anonymous ftp sites (sunsite.unc.edu and tsx-11.mit.edu in
	particular).

	The newspak-2.0.tar.z distribution contains config files and readme
	files related to building uucp, news, and mail software under Linux
	from the various freely-available sources.  It can usually be found 
	on sunsite.unc.edu in the directory /pub/Linux/system/Mail.

3.0 Mail 'Transport Agents'

	This section contains information related to 'transport agents',
	which means the underlying software that connects your local system
	to remote systems.

3.1 Smail v3.1

	Smail3.1 seems to be a de-facto standard transport agent for uucp-only
	sites and for some smtp sites.  It compiles without patching from
	the sources.  In addition, smail is provided in binary form in the
	SLS distribution of Linux.

	The newspak distribution contains config files for smail3.1.28 under
	Linux that you can use to start with.
	
	If you're building smail from sources, you need to have
	CASE_NO_NEWLINES=true in your os/linux file so that 'sed' gives
	you shell scripts that work properly.
	
	For a uucp-only system that has a MX-record and that wants a
	domainized header (who goes through a smart-host for everything),
	these are the entire config files you'll need:

	replace 'subdomain.domain' with your domain name
	replace 'myhostname' with you un-domainized hostname
	replace 'my_uucp_neighbor' with the uucp name of your upstream site

	#-------- /usr/local/lib/smail/config -----------------
	#
	# domains we belong to
	visible_domain=subdomain.domain:uucp
	#
	# who we're known as (fully-qualified-site-name)
	visible_name=myhostname.subdomain.domain
	#
	# who we go through
	smart_path=my_uucp_neighbor
	#
	#---------- /usr/local/lib/smail/paths --------------
	#
	# we're a domainized site, make sure we accept mail to both names
	myhostname        %s
	myhostname.subdomain.domain      %s
	#
	#-------------------------------------------------------------------

	To run smail as a smtp daemon, add the following to /etc/inetd.conf:
		smtp stream tcp nowait  root  /usr/bin/smtpd smtpd

	Outgoing mail gets sent automatically, when using elm. If your
	internet link is down when you send mail, then the mail sits in 
	'/usr/spool/smail/input'. When the link next comes up, 'runq' is
	run which causes the mail to be sent.

3.2 Sendmail+IDA

	There is a nice binary distribution of sendmail5.65c+IDA on sunsite
	in pub/Linux/system/Mail that I highly recommend.  I run a uucp-only
	site and use sendmail5.65c+IDA instead of smail3.1.28 due to the
	incredible ease of use.

   To install it...
	- you'll probably want to remove (or rename) all the files from
		smail (see the /install/installed directory if you are SLS)
		to be safe.
	- cd to / then 'gunzip -c sendmail5.65c+IDA.tpz | tar xvf -'
	- cd to /usr/local/src/sendmail5.65c+IDA/ida/cf and copy the example
		local.m4 file to 'yourhostname.m4'.  Edit out the distributed
		hostname, aliases, and smarthost and put in the correct one
		for your site.  The default file is for a uucp-only site
		who has domainized headers.  Then 'make yourhostname.cf'
		and move the resulting file to /etc/sendmail.cf
	- if you are uucp-only, you do *NOT* need to create any of the 
		tables mentioned in the README.linux file.  Just edit
		the .m4 file, make sendmail.cf, and start testing it.
	- if you're uucp-only and you talk to sites in addition to your
		'smart-host', you'll need to add uucpxtable entries for
		each (or mail to them will also go through the smart host)
		and run dbm against the revised uucpxtable.
	- if you change your .cf file, be sure to refreeze your config
		with /usr/lib/sendmail -bz to make the changes take effect.

	Another nice thing is that if you have mail.debug set and you
	run syslogd, your incoming and outgoing mail messages will get 
	logged.  See the /etc/syslog.conf file for details.

	There's a new version of sendmail5.67b+IDA1.5 out at ftp.uiuc.edu
	that also compiles and runs fine under Linux.  Grab the older 
	version from sunsite and look in the sources provided there for
	Linux-specific config files. Rich Braun has done a great job in
	'blazing the trail' so getting the current version to compile and
	run properly is as easy as typing 'make'.

	If you're going to run sendmail+IDA, I strongly recommend you go
	to the sendmail5.67b+IDA1.5 version since all required Linux-specific
	patches are now in the vanilla sources and several security holes
	have been plugged.

	I'm planning to put out an integrated mailx+sendmail5.67b+IDA1.5
	binary kit as soon as I can get around to it (stealing Ian's mailx
	and the new sendmail version based on Rich's original patches).
	Stay tuned...

3.3 Sendmail 8.6

	Sendmail 8.6.5 from Berkeley is the latest major revision after
	sendmail5.  It has wonderful built-in support for building under
	Linux.  Just 'make linux' and you'll be all set.

3.4 Other 'transport agents'

	The following also are known to run under Linux.  Consult
	'archie' for details regarding how to find them...

		smail2.5 - very simple UUCP-based smail

4.0 Mail 'User Agents'
	
	This section contains information related to 'user agents', which
	means the software the user sees and uses.  This software relies on
	the 'transport agents' mentioned above.

4.1 Elm

	Elm compiles, installs, and runs flawlessly under Linux.  For more
	information, see the elm sources and installation instructions.

	The only thing to know is that Elm's Configure script incorrectly
	sets the 'ranlib' variable in config.sh.  When Configure gives you
	the chance to edit config.sh before proceeding, please do so and
	set "ranlib='ranlib'" or the binaries will compile but not link.

	Elm and filter need to be mode 2755 (group mail) with
	/usr/spool/mail mode 775 and group mail.

	If you use a binary distribution like the one in SLS, you'll need
	to create a /usr/local/lib/elm/elm.rc file to override the compiled-in
	hostname and domain information:
	
	replace 'subdomain.domain' with your domain name
	replace 'myhostname' with you un-domainized hostname
	replace 'my_uucp_neighbor' with the uucp name of your upstream site

	#---------- /usr/local/lib/elm/elm.rc ------------------
	#
	# this is the unqualified hostname
	hostname = myhostname
	#
	# this is the local domain
	hostdomain = subdomain.domain
	#
	# this is the fully qualified hostname
	hostfullname = myhostname.subdomain.domain
	#
	#--------------------------------------------------------

	One thing you want to be aware of is that if you have Elm compiled
	to be MIME-able, you need metamail installed and in your path or
	Elm will not be able to read MIME mail you've received.  Metamail
	is available on thumper.bellcore.com and of course via 'archie'.

4.2 Mailx

	There is a fine binary implementation of mailx located on the various
	Linux archive sites.  Make sure you grab version 5.3b or later since
	there are security problems in v5.3a.

	The only potential problem I'm aware of is that it seems to be
	compiled in a way that requires /usr/lib/smail rather than
	/usr/lib/sendmail as a transport agent.  You probably need a link
	if you run sendmail on your system.

	I strongly recommend removing the old 'edmail' stuff from SLS
	and replacing it with mailx.  This is rumored to be done already
	in the current SLS.

4.3 Other user agents

	The following also are known to run under Linux.  Consult
	'archie' for details regarding how to find them...

	Pine      - from the Univ. of Washington
	Metamail  - allows MIME support
	mh	  - yet another way to handle mail
	deliver   - file/process mail based on rules 
	procmail  - file/process mail based on rules
	Majordomo - manages e-mail lists
	Mserv     - provide files-by-mail

5.0 Acknowledgements

	The following people have helped in the assembly of the information
	(and experience) that helped make this document possible:

		Steve Robbins, Ian Kluft, Rich Braun, Ian Jackson, 
		Syd Weinstein, Ralf Sauther, Martin White, Matt Welsh

	If I forgot anybody, my apologies...