2 # INSTALL -- installation instructions
5 --------------------------------
6 Installing nmh, guided by script
7 --------------------------------
8 For routine installation on popular platforms, the shell script in
9 docs/contrib/build_nmh can be used to guide you through configuration.
10 It will then build and optionally (with -i) install in the configured
14 ------------------------
15 Installing nmh, manually
16 ------------------------
17 Please read all of the following instructions before you begin
20 You should check the MACHINES file to see if there are any specific
21 build instructions for your operating system. To build nmh, you will
22 need an ANSI C compiler such as gcc.
24 0) If you have obtained nmh by checking it out of the git repository,
25 you will need to run the GNU autotools to regenerate some files.
26 (If your directory already contains a file 'config.h.in' then this
27 has already been done and you do not need to do it.) You can
28 regenerate the files by running the command
32 (Note that if you're doing nmh development, you should look at
33 docs/README.developers, since there is other developer-friendly
34 advice there as well.)
36 If you have obtained nmh in the form of a tar archive and are
37 trying to unpack it with cpio: due to an apparent bug in cpio, it
38 might fail with "Malformed number" error messages. Try another
39 tool to unpack, such as tar or pax.
41 1) From the top-level source directory, run the command
45 This will check the configuration of your OS, and create the
46 include file config.h, as well as the Makefile.
48 The configure script accepts various options. The options of
49 most interest are listed in a section below. To see the list
50 of all available options, you can run
56 3) (Optional) make check
58 This takes a bit of time, around one minute on a modern machine,
59 but is highly recommended.
61 test/inc/test-deb359167 uses valgrind, which detects use of an
62 uninitialized variable on older Linux distributions such as
63 Mandriva 2007.0 and CentOS 5.4. That particular failure is
64 beyond the scope of nmh and can be ignored.
68 Note that if you have [n]mh files in your install directories with
69 the same names as the files being installed, the old ones will get
70 overwritten without any warning. The only directory that isn't
71 true for is the `etc' directory -- in that directory, the previous
72 copy of each <file> will be backed up as <file>.prev if it differs
73 from the newly-installed copy. Watch for any diff output while
74 make is processing that directory to see if you need to merge
75 changes from *.prev files into the new versions.
77 5) Edit the file `mts.conf' (installed in the nmh `etc' directory)
78 and make any necessary changes for the mail transport interface
81 The default `mts.conf' file assumes you retrieve new mail from
82 a local (or NFS mounted) maildrop, and send outgoing mail by
83 injecting the message to a mail transfer agent (such as sendmail)
84 on the local machine via SMTP.
86 If, instead, all your mail sending and receiving occurs on a
87 remote POP/SMTP server, you will need to look at the values of the
88 variables "localname", "pophost", and "servers":
90 a) "localname" defines the hostname that nmh considers local.
91 If not set, then nmh queries your OS for this value. You will
92 want to change this if you wish your e-mail to appear as if it
93 originated on the POP server.
95 b) "pophost" defines the server that runs the POP daemon, and to
96 which `inc' and `msgchk' will always query for new mail.
98 c) "servers" defines the server to which you send outgoing SMTP
99 traffic. See the discussion of the --with-smtpserver configure
102 If you don't want to hardcode pophost in `mts.conf', you can use
103 the `-host' and `-user' options to `inc' and `msgchk'.
105 Check the `mh-tailor' man page for a list of all the available options
108 6) Edit the file `mhn.defaults' (installed in the nmh `etc' directory).
109 This file contains the default profile entries for the nmh command
110 `mhn' and is created by the script `mhn.defaults.sh'. This script
111 will search a generic path (essentially your $PATH) for programs to
112 handle various content types (for example, xv to display images).
113 You can re-run this script and give it a more tailored path. You may
114 want to re-run this script later if you install new programs to
115 display content. An example of this is:
118 % ./mhn.defaults.sh /usr/local/bin:/usr/X11/bin:/usr/ucb > mhn.defaults
120 and then move `mhn.defaults' into the nmh `etc' directory.
122 The `mhn.defaults.sh' script only searches for a simple set of programs.
123 If you have specialized programs to handle various types, you will need
124 to edit the `mhn.defaults' file manually. The syntax of this file is
125 described in the man page for `mhn', and in section 9.4 of the book
126 "MH & xmh: Email for Users and Programmers", 3rd edition, by Jerry Peek,
127 on the Internet at <http://rand-mh.sourceforge.net/book/mh/confmhn.html>.
129 7) Add an optional global mh.profile, if desired. This profile should be
130 placed in the nmh `etc' directory with the name `mh.profile'. This
131 file will be used to construct the initial .mh_profile of a new nmh
132 user, but will not be consulted after that.
134 -----------------------------------------------
135 Compiler options, or using a different compiler
136 -----------------------------------------------
138 By default, configure will use the "gcc" compiler if found. You can
139 use a different compiler, or add unusual options for compiling or
140 linking that the "configure" script does not know about, by giving
141 "configure" initial values for these on its command line or in its
142 environment. For example,
144 ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
146 If you wish to add options that are only used at compile time instead of
147 link time, you can use the CPPFLAGS variable:
149 ./configure CPPFLAGS='-Wextra -Wno-sign-compare'
151 If you want to add to both compile and link flags at build time
152 without putting them in the configuration, you can use the AM_CFLAGS
155 make AM_CFLAGS=--coverage
157 ----------------------------------------
158 Building nmh on additional architectures
159 ----------------------------------------
160 To build nmh on additional architectures, you can do a "make distclean".
161 This should restore the nmh source distribution back to its original
162 state. You can then configure nmh as above on other architectures in
163 which you wish to build nmh. Or alternatively, you can use a different
164 build directory for each architecture.
166 ---------------------------------
167 Using a different build directory
168 ---------------------------------
169 You can compile the nmh in a different directory from the one containing
170 the source code. Doing so allows you to compile it on more than one
171 architecture at the same time. To do this, you must use a version of
172 "make" that supports the "VPATH" variable, such as GNU "make". "cd" to
173 the directory where you want the object files and executables to go and
174 run the "configure" script. "configure" automatically checks for the
175 source code in the directory that "configure" is in. For example,
177 cd /usr/local/solaris/nmh
178 /usr/local/src/nmh-1.5/configure
181 ---------------------
182 Options for configure
183 ---------------------
184 --prefix=DIR (DEFAULT is /usr/local/nmh)
185 This will change the base prefix for the installation location
186 for the various parts of nmh. Unless overridden, nmh is installed
187 in ${prefix}/bin, ${prefix}/etc, ${prefix}/lib, ${prefix}/man.
189 --bindir=DIR (DEFAULT is ${prefix}/bin)
190 nmh's binaries (show, inc, comp, ...) are installed here.
192 --libdir=DIR (DEFAULT is ${prefix}/lib)
193 nmh's support binaries (post, slocal, mhl, ...) are installed here.
195 --sysconfdir=DIR (DEFAULT is ${prefix}/etc)
196 nmh's config files (mts.conf, mhn.defaults, ...) are installed here.
198 --mandir=DIR (DEFAULT is ${prefix}/man)
199 nmh's man pages are installed here.
202 Enable debugging support.
204 --with-editor=EDITOR (DEFAULT is vi)
205 specify the full path of the default editor to use. If this
206 option is not given, then the configuration process will search
207 for the `vi' command and use it as the default. If you wish to
208 specify an interface which is compatible with MH, then use the
209 nmh command `prompter'. If you specify `prompter', then you don't
210 need to give the full pathname.
212 --with-locking=LOCKTYPE (DEFAULT is dot)
213 Specify the locking mechanism when attempting to "inc" or
214 "msgchk" a local mail spool. Valid options are "dot",
215 "fcntl", "flock", and "lockf". Of the four, dot-locking
216 requires no special kernel or filesystem support, and simply
217 creates a file called "FILE.lock" to indicate that "FILE" is
220 In order to be effective, you should contact the site
221 administrator to find out what locking mechanisms other
222 mail delivery and user programs respect. The most common
223 reason not to use dot-locking is if the mail spool directory
224 is not world- or user-writeable, and thus a lock file cannot
227 --enable-lockdir=DIR (DEFAULT is disabled)
228 If dot locking is being used, store all dot-lock files in "DIR".
229 The default is to store them in the directory of the file being
232 --with-mts=MTS (DEFAULT is smtp)
233 Specify the default mail transport system you want to use. The two
234 acceptable options are "smtp" (which is the default), and
235 "sendmail". This value will be put into the mts.conf file. You
236 may find it convenient to specify a value at configure-time,
237 however, so that each time nmh is reinstalled, the right value will
240 If you use "smtp", this will enable a direct SMTP (simple mail
241 transport protocol) interface in nmh. When sending mail, instead
242 of passing the message to the mail transport agent, `post' will
243 open a socket connection to the mail port on the machine specified
244 in the `mts.conf' file (default is localhost), and speak SMTP
247 If you use "sendmail", then `post' will send messages by forking a
248 local copy of sendmail. Currently it will still speak SMTP with
249 this local copy of sendmail.
251 If you wish to use a transport agent other than sendmail, you will
252 need to use a `sendmail wrapper'.
254 --with-ndbm=LIB (DEFAULT is to autodetect)
255 --with-ndbmheader=HEADER (DEFAULT is to autodetect)
256 Specify the header file (eg ndbm.h) and library (eg ndbm) to use
257 to compile against the ndbm database library. By default, configure
258 will try various possibilities until it finds one that works; this
259 option only needs to be specified if the autodetection fails or
260 makes the wrong choice.
262 If either of these options is given then the other must also be
265 --with-pager=PAGER (DEFAULT is more)
266 Specify the default pager (file lister) to use. If this option
267 is not given, then the configuration process will search for the
268 command `more' and use it as the default.
270 --with-smtpservers='SMTPSERVER1[ SMTPSERVER2...]' (DEFAULT is localhost)
271 If this option is not specified, the mts.conf file will contain
272 the line "servers: localhost", which may be manually edited later.
273 You may find it convenient to specify a value at configure-time,
274 however, so that each time nmh is reinstalled, the right value will be
277 See the mh-tailor(5) man page for full documentation of "servers:".
279 --with-cyrus-sasl (DEFAULT is without)
280 Enable SASL support for SMTP and POP via the Cyrus SASL library.
281 This is used for the POP AUTH and SMTP AUTH protocols. This supports
282 a wide variety of security mechanisms, including Kerberos/GSSAPI.
283 Session encryption via SASL is supported for both POP and SMTP
284 (depending on server-side support and the security mechanism in use).
286 --with-tls (DEFAULT is without)
287 Enable TLS session encryption support for SMTP via the STARTTLS command.
289 --with-readline (DEFAULT is to autodetect)
290 Enable support for readline functionality (command history/editing) at
295 nmh-workers@nongnu.org