* h/mh.h: raised NAMESZ from 128 to 999. RFC 2822 limits line
[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 0) If you have obtained nmh by checking it out of CVS, you will
18    need to run the GNU autotools to regenerate some files.
19    (If your directory already contains a file 'config.h.in'
20    then this has already been done and you do not need to do it.)
21    You can regenerate the files by running the command
22
23    ./autogen.sh
24
25    (Note that if you're doing nmh development, you should look at
26    docs/README.developers, since there is other developer-friendly
27    advice there as well.)
28
29 1) From the top-level source directory, run the command
30
31    ./configure [options]
32
33    This will check the configuration of your OS, and create the 
34    include file config.h, as well as the various Makefiles.
35
36    The configure script accepts various options.  The options of 
37    most interest are listed in a section below.  To see the list 
38    of all available options, you can run
39
40    ./configure --help
41
42 2) Look through the user configuration section at the beginning
43    of the generated include file `config.h'. You may
44    want to customize some #defines for your environment.
45
46 3) make
47
48 4) make install
49
50    Note that if you have [n]mh files in your install directories with
51    the same names as the files being installed, the old ones will get
52    overwritten without any warning.  The only directory that isn't
53    true for is the `etc' directory -- in that directory, the previous
54    copy of each <file> will be backed up as <file>.prev if it differs
55    from the newly-installed copy.  Watch for any diff output while
56    make is processing that directory to see if you need to merge
57    changes from *.prev files into the new versions.
58
59 5) Edit the file `mts.conf' (installed in the nmh `etc' directory)
60    and make any necessary changes for the mail transport interface
61    you are using.
62
63    The default `mts.conf' file assumes you retrieve new mail from
64    a local (or NFS mounted) maildrop, and send outgoing mail by
65    injecting the message to a mail transfer agent (such as sendmail)
66    on the local machine via SMTP.
67
68    If, instead, all your mail sending and receiving occurs on a 
69    remote POP/SMTP server, you will need to look at the values of the 
70    variables "localname", "pophost", and "servers":
71
72     a) "localname" defines the hostname that nmh considers local.
73        If not set, then nmh queries your OS for this value.  You will
74        want to change this if you wish your e-mail to appear as if it
75        originated on the POP server.
76
77     b) "pophost" defines the server that runs the POP daemon, and to
78        which `inc' and `msgchk' will always query for new mail.
79
80     c) "servers" defines the server to which you send outgoing SMTP
81        traffic.
82
83    If you compile with POP support, but don't want to use it exclusively,
84    you can use the `-host' and `-user' options to `inc' and `msgchk'
85    rather than hardcoding pophost in `mts.conf'.
86
87    Check the `mh-tailor' man page for a list of all the available options
88    for this file ("masquerade" may be of particular interest).
89
90 6) If you have enabled POP support, make sure that `pop3' (or more
91    precisely the value of the define POPSERVICE in config.h) is defined
92    in the /etc/services file (or its NIS/NIS+ equivalent) on the client
93    machine.  It should be something equivalent to "110/tcp".  This might
94    have already been done when the POP daemon was installed.
95
96 7) Edit the file `mhn.defaults' (installed in the nmh `etc' directory).
97    This file contains the default profile entries for the nmh command
98    `mhn' and is created by the script `mhn.defaults.sh'.  This script
99    will search a generic path (essentially your $PATH) for programs to
100    handle various content types (for example, xv to display images).
101    You can re-run this script and give it a more tailored path.  You may
102    want to re-run this script later if you install new programs to
103    display content.  An example of this is:
104
105     % cd support/general
106     % ./mhn.defaults.sh /usr/local/bin:/usr/X11/bin:/usr/ucb > mhn.defaults
107
108    and then move `mhn.defaults' into the nmh `etc' directory.
109
110    The `mhn.defaults.sh' script only searches for a simple set of programs.
111    If you have specialized programs to handle various types, you will need
112    to edit the `mhn.defaults' file manually.  The syntax of this file is
113    described in the man page for `mhn', and in section 9.4 of the book
114    "MH & xmh: Email for Users and Programmers", 3rd edition, by Jerry Peek,
115    on the Internet at <http://www.ics.uci.edu/~mh/book/mh/confmhn.htm>.
116
117 9) Add an optional global mh.profile, if desired.  This profile should be
118    placed in the nmh `etc' directory with the name `mh.profile'.  This
119    file will be used to construct the initial .mh_profile of a new nmh
120    user, but will not be consulted after that.
121
122 -----------------------------------------------
123 Compiler options, or using a different compiler
124 -----------------------------------------------
125 By default, configure will use the "gcc" compiler if found.  You can use a
126 different compiler, or add unusual options for compiling or linking that
127 the "configure" script does not know about, by either editing the user
128 configuration section of the top level Makefile (after running configure)
129 or giving "configure" initial values for these variables by setting them
130 in the environment.  Using a Bourne-compatible shell (such as sh,ksh,zsh),
131  
132 you can do that on the command line like this:
133     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
134  
135 Or on systems that have the "env" program, you can do it like this:
136     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
137
138 ----------------------------------------
139 Building nmh on additional architectures
140 ----------------------------------------
141 To build nmh on additional architectures, you can do a "make distclean".
142 This should restore the nmh source distribution back to its original
143 state.  You can then configure nmh as above on other architectures in
144 which you wish to build nmh.  Or alternatively, you can use a different
145 build directory for each architecture.
146  
147 ---------------------------------
148 Using a different build directory
149 ---------------------------------
150 You can compile the nmh in a different directory from the one containing
151 the source code.  Doing so allows you to compile it on more than one
152 architecture at the same time.  To do this, you must use a version of
153 "make" that supports the "VPATH" variable, such as GNU "make".  "cd" to
154 the directory where you want the object files and executables to go and
155 run the "configure" script.  "configure" automatically checks for the
156 source code in the directory that "configure" is in.  For example,
157  
158     cd /usr/local/solaris/nmh
159     /usr/local/src/nmh-1.0/configure
160     make
161
162 ---------------------
163 Options for configure
164 ---------------------
165 --prefix=DIR     (DEFAULT is /usr/local/nmh)
166      This will change the base prefix for the installation location
167      for the various parts of nmh.  Unless overridden, nmh is installed
168      in ${prefix}/bin, ${prefix}/etc, ${prefix}/lib, ${prefix}/man.
169
170 --bindir=DIR     (DEFAULT is ${prefix}/bin)
171      nmh's binaries (show, inc, comp, ...) are installed here.
172
173 --libdir=DIR     (DEFAULT is ${prefix}/lib)
174      nmh's support binaries (post, slocal, mhl, ...) are installed here.
175
176 --sysconfdir=DIR     (DEFAULT is ${prefix}/etc)
177      nmh's config files (mts.conf, mhn.defaults, ...) are installed here.
178
179 --mandir=DIR     (DEFAULT is ${prefix}/man)
180      nmh's man pages are installed here.
181
182 --enable-debug
183      Enable debugging support.
184
185 --enable-masquerade[='draft_from mmailid username_extension']    
186      If this option is disabled, the mts.conf file will contain the
187      line "masquerade: " (with no value), which may be manually edited
188      later.  You may find it convenient to specify a value at
189      configure-time, however, so that each time nmh is reinstalled,
190      the right value will be there.  By default, it is enabled.
191
192      The above usage shows the default, with all three masquerade
193      options being specified.  Any subset of the three may be
194      specified.
195
196      See the mh-tailor(5) man page for full documentation of "masquerade:".
197
198 --enable-mhe    (DEFAULT)
199      Add support for the Emacs front-end `mhe'.
200
201 --enable-pop
202      Enable client-side support for pop.
203
204 --enable-apop
205      Enable client-side support for apop (Authenticated POP).
206
207 --with-editor=EDITOR  (DEFAULT is vi)
208      specify the full path of the default editor to use.  If this
209      option is not given, then the configuration process will search
210      for the `vi' command and use it as the default.  If you wish to
211      specify an interface which is compatible with MH, then use the
212      nmh command `prompter'.  If you specify `prompter', then you don't
213      need to give the full pathname.
214
215 --with-hesiod=PREFIX
216      Specify the location of Hesiod.
217
218 --with-krb4=PREFIX
219      Specify the location of Kerberos V4 for KPOP support. After
220      running configure, you will need to change the POPSERVICE #define in
221      config.h if you want to use KPOP exclusively (rather than being able
222      to switch between KPOP and normal POP3).  See the comments inside
223      config.h for details.
224
225 --with-locking=LOCKTYPE    (DEFAULT is dot)
226      Specify the locking mechanism when attempting to "inc" or
227      "msgchk" a local mail spool. Valid options are "dot",
228      "fcntl", "flock", and "lockf". Of the four, dot-locking
229      requires no special kernel or filesystem support, and simply
230      creates a file called "FILE.lock" to indicate that "FILE" is
231      locked.
232
233      In order to be effective, you should contact the site
234      administrator to find out what locking mechanisms other
235      mail delivery and user programs respect. The most common
236      reason not to use dot-locking is if the mail spool directory
237      is not world- or user-writeable, and thus a lock file cannot
238      be created.
239
240 --with-mts=MTS   (DEFAULT is smtp)
241      Specify the default mail transport system you want to use.  The two
242      acceptable options are "smtp" (which is the default), and
243      "sendmail".  This value will be put into the mts.conf file.  You
244      may find it convenient to specify a value at configure-time,
245      however, so that each time nmh is reinstalled, the right value will
246      be there.
247
248      If you use "smtp", this will enable a direct SMTP (simple mail
249      transport protocol) interface in nmh.  When sending mail, instead
250      of passing the message to the mail transport agent, `post' will
251      open a socket connection to the mail port on the machine specified
252      in the `mts.conf' file (default is localhost), and speak SMTP
253      directly.
254
255      If you use "sendmail", then `post' will send messages by forking a
256      local copy of sendmail.  Currently it will still speak SMTP with
257      this local copy of sendmail.
258
259      If you wish to use a transport agent other than sendmail, you will
260      need to use a `sendmail wrapper'.
261
262 --with-ndbm=LIB    (DEFAULT is to autodetect)
263 --with-ndbmheader=HEADER     (DEFAULT is to autodetect)
264      Specify the header file (eg ndbm.h) and library (eg ndbm) to use
265      to compile against the ndbm database library. By default, configure
266      will try various possibilities until it finds one that works; this
267      option only needs to be specified if the autodetection fails or
268      makes the wrong choice.
269
270      If either of these options is given then the other must also be
271      specified.
272
273 --with-pager=PAGER    (DEFAULT is more)
274      Specify the default pager (file lister) to use.  If this option
275      is not given, then the configuration process will search for the
276      command `more' and use it as the default.
277
278 --with-smtpservers='SMTPSERVER1[ SMTPSERVER2...]'    (DEFAULT is localhost)
279      If this option is not specified, the mts.conf file will contain
280      the line "servers: localhost", which may be manually edited later.
281      You may find it convenient to specify a value at configure-time,
282      however, so that each time nmh is reinstalled, the right value will be
283      there.
284
285      See the mh-tailor(5) man page for full documentation of "servers:".
286
287 --
288 The nmh team
289 nmh-workers@nongnu.org