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