Fixed make_bcc_file () to use contents of From: in draft, if draft_from masquerade...
[mmh] / docs / README.developers
1 #
2 # README.developers
3 #
4 # $Id$
5 #
6
7 This file is intended to provide a few tips for anyone doing development on nmh.
8 Developers who learn things "the hard way" about the nmh codebase (as opposed to
9 local info best encoded in a comment) are encouraged to share their wisdom here.
10
11 The topics are organized alphabetically.
12
13
14 --------------
15 autoconf files
16 --------------
17
18 If you wish to change the `configure' script or its related files, you'll need
19 to first install GNU m4, available from <ftp://ftp.gnu.org/pub/gnu/m4/> and then
20 GNU autoconf (<ftp://ftp.gnu.org/pub/gnu/autoconf/>).  Nmh is currently using
21 a minimum of autoconf 2.54.
22
23 Most of the configure-related files are automatically generated.  The only files
24 you should need to manually edit are acconfig.h and configure.in.  Don't, for
25 instance, edit config.h.in.  Though it is an input file from the point of view
26 of the users (and the configure script) it is an output file from the point of
27 view of the developers (and the autoconf script).
28
29 Note that the automatically generated autoconf files (such as config.h.in,
30 stamp-h.in, and configure), are NOT kept in CVS.  Thus, when you check out
31 a CVS tree, you need to do the following things before you can build
32 anything:
33
34         % autoheader
35         % autoconf
36         % date > stamp-h.in
37
38 -------------------
39 directory structure
40 -------------------
41
42 Following is a list of nmh's directories along with a brief description of the
43 purpose of each one.  Meanings are given for the abbreviations, but note that
44 these meanings are just informed guesses as to what the MH developers were
45 thinking. 
46
47 ./
48     The top-level directory.  Contains files like README and INSTALL.
49
50 config/
51     Contains utility files for the `configure' process.  Ordinarily nothing in
52     here needs to be messed with.
53
54 doc/
55     Contains more specialized documentation, such as this file and
56     the FAQ.
57
58 etc/
59     Contains files, file templates, and scripts to generate files that will be
60     installed in the ${prefix}/etc directory.  Stuff like replcomps.
61
62 h/
63     Most of nmh's header (.h) files are kept not in the individual source
64     directories, but in this central location.
65
66 man/
67     Contains all the input files that are processed to generate nmh's manual
68     pages.
69
70 mts/
71     "mts" stands for "Message Transfer Service".  Source files specific to the
72     different MTSs go in the subdirectories.
73
74 mts/mmdf/ (deprecated)
75     "mmdf" stands for "Multichannel Memorandum Distribution Facility".  It is an
76     alternative to sendmail used primarily on SCO UNIX.
77
78 mts/sendmail/ (deprecated: handled by mts.conf)
79     When nmh is configured --with-mts=sendmail, the files in this directory are
80     used. 
81
82 mts/smtp/
83     When nmh is configured to just talk to an SMTP server over TCP/IP, the
84     source in this directory is compiled.
85
86 sbr/
87     "sbr" stands for "subroutine(s)".  For the most part, each source file in
88     this directory contains a single function with the same name as the source
89     file.  These functions are of general use and are called from throughout
90     nmh.  
91
92 uip/
93     "uip" stands for "User Interface Programs".  Most nmh commands have a file
94     in this directory named <command>.c containing the code for that command
95     (e.g. repl.c).  In some cases there is also an auxiliary file called
96     <command>sbr.c which contains additional subroutines called from <command>.c
97     (which would contain not much else besides main()).
98
99 zotnet/ (deprecated)
100     Files in this hierarchy were either written by or moved here by UCI
101     (University of California, Irvine) after they took over MH from the Rand
102     Corporation.  "Zot!" is the sound effect made by the anteater in the "B.C."
103     comic strip when its tongue lashes out at ants.  The anteater is UCI's
104     official mascot.  Not sure whether UCInet was once called ZotNet...
105
106 zotnet/bboards/ (deprecated)
107     UCI added Bulletin Board functionality to MH with the `bbc' command.  This
108     functionality has been removed from nmh but apparently files in this
109     directory are still needed for other purposes.
110
111 zotnet/mf/ (deprecated, now in sbr/)
112     "mf" stands for "Mail Filter".  The filtering in this case apparently refers
113     to translation between different address and mailbox formats.
114
115 zotnet/mts/ (deprecated, now in sbr/)
116     MTS code not specific to any single MTS apparently goes here.
117
118 zotnet/tws/ (deprecated, now in sbr/)
119     "tws" apparently stands for "time with structure", a rather odd phrase.
120     This directory used to be the place for date and time manipulation code, but
121     currently nothing in here is compiled.  There are new, more portable
122     versions of the key files in h/ and sbr/, and this directory will soon go
123     away completely.
124
125
126 -------------------------------------------------------
127 nmh-local functions to use in preference to OS versions
128 -------------------------------------------------------
129
130 For some system functions whose availability or behavior varies from OS to OS,
131 nmh conditionally uses a local definition with the same name as the OS function
132 (e.g. snprintf()).  For other functions, developers need to avoid the OS
133 versions and always use the nmh-supplied function.  Here is a list of such
134 functions: 
135
136 OS function  nmh-local version to use instead
137 ===========  ================================
138 getpass()    nmh_getpass()
139
140
141 -------------
142 releasing nmh
143 -------------
144
145 To make a public release of nmh (we'll use version 1.0.4 and my mhost.com
146 account, danh, as examples here):
147
148  1. % echo 1.0.4 > VERSION
149     % date +"%e %B %Y" > DATE
150     (DATE should contain something like "30 December 2000")
151
152  2. Put a comment like "Released nmh-1.0.4." in the ChangeLog.
153
154  3. % cvs commit ChangeLog VERSION DATE
155
156  4. % cvs tag nmh-1_0_4
157     (cvs treats dots specially, so underscores are substituted here.)
158
159  5. % make nmhdist
160
161  6. Untar nmh-1.0.4.tar.gz and `diff -r' it vs. your CVS tree.  Make sure no
162     files got left out of the distribution that should be in it (due to someone
163     forgetting to update the DIST variables in the Makefiles).
164
165  7. If you have root access on your machine, it's good at this point to do:
166
167     % chown -R 0:0 nmh-1.0.4
168     % tar cvf nmh-1.0.4.tar nmh-1.0.4
169     % gzip nmh-1.0.4.tar
170
171     If you leave the files in the archive as being owned by yourself, your UID
172     may coincide with one of a user on a machine where nmh is being installed,
173     making it possible for that user to Trojan the nmh code before the system
174     administrator finishes installing it.
175
176  8. Make sure your new tarball uncompresses and untars with no problem.  Make
177     sure you can configure, make, and install nmh from it.
178
179  9. If all is well and your tarball is final, go back to your CVS tree and do:
180
181     % echo 1.0.4+dev > VERSION
182
183 10. Put a comment like "Upped the version number to 1.0.4+dev until the next nmh
184     release." in the ChangeLog.
185
186 11. % cvs commit ChangeLog VERSION
187
188 12. If possible, make an MD5 hash and/or a PGP signature of nmh-1.0.4.tar.gz.
189
190 13. % scp -p nmh-1.0.4.tar.gz* danh@mhost.com:/var/ftp/pub/nmh
191
192 14. Send an announcement to exmh-users@redhat.com, exmh-workers@redhat.com,
193     mh-users@ics.uci.edu, and nmh-announce@mhost.com.  If the release fixes
194     significant security holes, also send an announcement to
195     bugtraq@securityfocus.com.  The exmh lists require you to be subscribed in
196     order to post.  Note that you don't need to post separately to comp.mail.mh,
197     as the mh-users mailing list is apparently bidirectionally gatewayed to it.
198
199     Preferably, the announcement should contain the MD5 hash generated above,
200     and should be PGP-signed.  It should include the FTP URL for the tarball as
201     well as the URL of the website.  It should contain a brief summary of
202     visible changes, as well as the URL of the cvsweb diff page that would show
203     a detailed list of changes.  The changes between 1.0.3 and 1.0.4 would be
204     shown by:
205
206         http://www.mhost.com/cgi-bin/cvsweb/nmh/ChangeLog?r1=1.40&r2=1.71