Updated pop instructions and indicated use of standard "./configure"
[mmh] / INSTALL
1 #
2 # INSTALL -- installation instructions
3 #
4 # $Id$
5 #
6
7 --------------
8 Installing nmh
9 --------------
10 Please read all of the following instructions before you begin
11 building nmh.
12
13 You should check the MACHINES file to see if there are any specific
14 build instructions for your operating system.  To build nmh, you will
15 need an ANSI C compiler such as gcc.
16
17 1) From the top-level source directory, run the command
18
19    ./configure [options]
20
21    This will check the configuration of your OS, and create the 
22    include file config.h, as well as the various Makefiles.
23
24    The configure script accepts various options.  The options of 
25    most interest are listed in a section below.  To see the list 
26    of all available options, you can run
27
28    ./configure --help
29
30 2) Look through the user configuration section at the beginning
31    of the generated include file `config.h'. You may
32    want to customize some #defines for your environment.
33
34 3) make
35
36 4) make install
37
38 5) Edit the file `mts.conf' (installed in the nmh `etc' directory)
39    and make any necessary changes for the mail transport interface
40    you are using.
41
42    The default `mts.conf' file assumes you retrieve new mail from
43    a local (or NFS mounted) maildrop, and send outgoing mail by
44    injecting the message to a mail transfer agent (such as sendmail)
45    on the local machine via SMTP.
46
47    If, instead, all your mail sending and receiving occurs on a 
48    remote POP/SMTP server, you will need to look at the values of the 
49    variables "localname", "pophost", and "servers":
50
51     a) "localname" defines the hostname that nmh considers local.
52        If not set, then nmh queries your OS for this value.  You will
53        want to change this if you wish your e-mail to appear as if it
54        originated on the POP server.
55
56     b) "pophost" defines the server that runs the POP daemon, and to
57        which `inc' and `msgchk' will always query for new mail.
58
59     c) "servers" defines the server to which you send outgoing SMTP
60        traffic.
61
62    If you compile with POP support, but don't want to use it exclusively,
63    you can use the `-host' and `-user' options to `inc' and `msgchk'
64    rather than hardcoding pophost in `mts.conf'.
65
66    Check the `mh-tailor' man page for a list of all the available options
67    for this file ("masquerade" may be of particular interest).
68
69 6) If you have enabled POP support, make sure that `pop3' (or more
70    precisely the value of the define POPSERVICE in config.h) is defined
71    in the /etc/services file (or its NIS/NIS+ equivalent) on the client
72    machine.  It should be something equivalent to "110/tcp".  This might
73    have already been done when the POP daemon was installed.
74
75 7) Edit the file `mhn.defaults' (installed in the nmh `etc' directory).
76    This file contains the default profile entries for the nmh command
77    `mhn' and is created by the script `mhn.defaults.sh'.  This script
78    will search a generic path (essentially your $PATH) for programs to
79    handle various content types (for example, xv to display images).
80    You can re-run this script and give it a more tailored path.  You may
81    want to re-run this script later if you install new programs to
82    display content.  An example of this is:
83
84     % cd support/general
85     % ./mhn.defaults.sh /usr/local/bin:/usr/X11/bin:/usr/ucb > mhn.defaults
86
87    and then move `mhn.defaults' into the nmh `etc' directory.
88
89    The `mhn.defaults.sh' script only searches for a simple set of programs.
90    If you have specialized programs to handle various types, you will need
91    to edit the `mhn.defaults' file manually.  The syntax of this file is
92    described in the man page for `mhn', and in section 9.4 of the book
93    "MH & xmh: Email for Users and Programmers", 3rd edition, by Jerry Peek,
94    on the Internet at <http://www.ics.uci.edu/~mh/book/mh/confmhn.htm>.
95
96 9) Add an optional global mh.profile, if desired.  This profile should be
97    placed in the nmh `etc' directory with the name `mh.profile'.  This
98    file will be used to construct the initial .mh_profile of a new nmh
99    user, but will not be consulted after that.
100
101 -----------------------------------------------
102 Compiler options, or using a different compiler
103 -----------------------------------------------
104 By default, configure will use the "gcc" compiler if found.  You can use a
105 different compiler, or add unusual options for compiling or linking that
106 the "configure" script does not know about, by either editing the user
107 configuration section of the top level Makefile (after running configure)
108 or giving "configure" initial values for these variables by setting them
109 in the environment.  Using a Bourne-compatible shell (such as sh,ksh,zsh),
110  
111 you can do that on the command line like this:
112     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
113  
114 Or on systems that have the "env" program, you can do it like this:
115     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
116
117 ----------------------------------------
118 Building nmh on additional architectures
119 ----------------------------------------
120 To build nmh on additional architectures, you can do a "make distclean".
121 This should restore the nmh source distribution back to its original
122 state.  You can then configure nmh as above on other architectures in
123 which you wish to build nmh.  Or alternatively, you can use a different
124 build directory for each architecture.
125  
126 ---------------------------------
127 Using a different build directory
128 ---------------------------------
129 You can compile the nmh in a different directory from the one containing
130 the source code.  Doing so allows you to compile it on more than one
131 architecture at the same time.  To do this, you must use a version of
132 "make" that supports the "VPATH" variable, such as GNU "make".  "cd" to
133 the directory where you want the object files and executables to go and
134 run the "configure" script.  "configure" automatically checks for the
135 source code in the directory that "configure" is in.  For example,
136  
137     cd /usr/local/solaris/nmh
138     /usr/local/src/nmh-1.0/configure
139     make
140
141 ---------------------
142 Options for configure
143 ---------------------
144 --prefix=DIR     (DEFAULT is /usr/local/nmh)
145      This will change the base prefix for the installation location
146      for the various parts of nmh.  Unless overridden, nmh is installed
147      in ${prefix}/bin, ${prefix}/etc, ${prefix}/lib, ${prefix}/man.
148
149 --bindir=DIR     (DEFAULT is ${prefix}/bin)
150      nmh's binaries (show, inc, comp, ...) are installed here.
151
152 --libdir=DIR     (DEFAULT is ${prefix}/lib)
153      nmh's support binaries (post, slocal, mhl, ...) are installed here.
154
155 --sysconfdir=DIR     (DEFAULT is ${prefix}/etc)
156      nmh's config files (mts.conf, mhn.defaults, ...) are installed here.
157
158 --mandir=DIR     (DEFAULT is ${prefix}/man)
159      nmh's man pages are installed here.
160
161 --enable-debug
162      Enable debugging support.
163
164 --enable-masquerade[='draft_from mmailid username_extension']    
165      If this option is not specified, the mts.conf file will contain the line
166      "masquerade: " (with no value), which may be manually edited later.  You
167      may find it convenient to specify a value at configure-time, however, so
168      that each time nmh is reinstalled, the right value will be there.
169
170      The above usage shows all three masquerade options being specified, but any
171      subset of the three may be specified.  If you do want to enable all three,
172      you can simply use `configure --enable-masquerade' as a shortcut.
173
174      See the mh-tailor(5) man page for full documentation of "masquerade:".
175
176 --enable-mhe    (DEFAULT)
177      Add support for the Emacs front-end `mhe'.
178
179 --enable-pop
180      Enable client-side support for pop.
181
182 --enable-apop
183      Enable client-side support for apop (Authenticated POP).
184
185 --with-editor=EDITOR  (DEFAULT is vi)
186      specify the full path of the default editor to use.  If this
187      option is not given, then the configuration process will search
188      for the `vi' command and use it as the default.  If you wish to
189      specify an interface which is compatible with MH, then use the
190      nmh command `prompter'.  If you specify `prompter', then you don't
191      need to give the full pathname.
192
193 --with-hesiod=PREFIX
194      Specify the location of Hesiod.
195
196 --with-krb4=PREFIX
197      Specify the location of Kerberos V4 for KPOP support. After
198      running configure, you will need to change the POPSERVICE #define in
199      config.h if you want to use KPOP exclusively (rather than being able
200      to switch between KPOP and normal POP3).  See the comments inside
201      config.h for details.
202
203 --with-mts=MTS   (DEFAULT is smtp)
204      Specify the mail transport system you want to use.  The two
205      acceptable options are "smtp" (which is the default), and
206      "sendmail".
207
208      If you use "smtp", this will enable a direct SMTP (simple
209      mail transport protocol) interface in nmh.  When sending
210      mail, instead of passing the message to the mail transport
211      agent, `post' will open a socket connection to the mail
212      port on the machine specified in the `mts.conf' file
213      (default is localhost), and speak SMTP directly.
214
215      If you use "sendmail", then `post' will send messages by
216      passing forking a local copy of sendmail.  Currently it
217      will still speak SMTP with this local copy of sendmail.
218
219      If you wish to use a transport agent other than sendmail, you will
220      need to use a `sendmail wrapper'.
221
222 --with-pager=PAGER    (DEFAULT is more)
223      Specify the default pager (file lister) to use.  If this option
224      is not given, then the configuration process will search for the
225      command `more' and use it as the default.
226
227 --with-smtpservers='SMTPSERVER1[ SMTPSERVER2...]'    (DEFAULT is localhost)
228      If this option is not specified, the mts.conf file will contain
229      the line "servers: localhost", which may be manually edited later.
230      You may find it convenient to specify a value at configure-time,
231      however, so that each time nmh is reinstalled, the right value will be
232      there.
233
234      See the mh-tailor(5) man page for full documentation of "servers:".
235
236 --
237 The nmh team
238 nmh-workers@mhost.com