mime.c:mime_write_tohdr(): complete rewrite (Peter Hofmann)..
[s-mailx.git] / INSTALL
blob5e1506d99628f3292a7c4095f541a2feabe56d63
1 I n s t a l l i n g  S - n a i l
2 ================================
4 1. Compilation
5 2. Notes for S-nail(1) v14.7*
6 3. Current codebase state
8 1. Compilation
9 --------------
11 System specific notes can be found in the next section.
12 Any (optional) feature is adjustable and documented in `make.rc'.
13 Adjustments may also take place, and are usually done, from the command
14 line, overriding those made in `make.rc' (if any):
16   $ [make &&] make install
17   $ make uninstall          # Won't remove the system wide startup file!
18   $ make distclean          # *Completely* cleanup working directory
20 With adjustments:
22   $ make WANT_IMAP=no WANT_SMTP=require install
23   $ make WANT_NCL=false PREFIX=/some/nasty/prefix install
25 There are also some predefined restricted configuration sets available,
26 which take precedence over anything else:
28 . CONFIG=MINIMAL
29   This is the most plain mailx(1)-alike mode, but with MIME support and
30   (if available) character set conversion builtin.  That's it.
32 . CONFIG=MEDIUM
33   Like MINIMAL, but with documentation strings, and regular expression
34   support as well as the builtin command line editor will be included if
35   that is possible, the latter with history but without tabulator
36   expansion support.
38   Possibly what people want who need nothing but a MIME-capable mailx(1)
39   and don't regret improved usability for the rare interactive use
40   occasions.
42 . CONFIG=NETSEND
43   WANT_SMTP as a requirement.
44   NETSEND also tries to add SSL/TLS, GSSAPI, IDNA, .netrc file parsing
45   as well as external password *agent-lookup*.
47   Sending messages directly to the mail provider via the SMTP protocol,
48   instead of requiring a local mail-transfer-agent (MTA) who does.
50 . CONFIG=MAXIMAL
51   Anything on (though none of which as a requirement).
53   S-nail(1) gains mail fetching capabilities and heads more toward being
54   a full-featured mail-user-agent (MUA) with this.
56 E.g.:
58   $ make CONFIG=MINIMAL DESTDIR=xtest install
60 would create a `s-nail' binary and install a `s-nail' manual etc.
61 under the prefix `/usr/local' but rooted under [./]`xtest', i.e., the
62 binary would be installed as `[./]xtest/usr/local/bin/s-nail'.
63 The following make(1) target exists, and note that you can use
64 a VERBOSE=true command line option to gain more (or a different kind of)
65 verbosity:
67 . all         Create / check and update configuration, build.
68 . install     Create / check and update configuration, build, install.
69 . clean       Remove anything which can be rebuild.
70 . distclean   Remove anything which can be rebuild or reconfigured.
71 . uninstall   Uninstall (if configured).
73 . config      Only create or check and update the configuration.
74 . build       Only build (using the existing configuration).
75 . test        Run ./cc-test.sh in --check-only mode on the built binary.
76 . packager-install
77               Only install using the built files of the existing
78               configuration.  It is possible to overwrite DESTDIR= when
79               using this target nonetheless (a following `uninstall'
80               won't know about that overwritten value, however).
82 If some libraries are missing that you know are installed on your
83 system, or if other errors occur due to missing files but which you know
84 exist, please ensure that the environment variable `C_INCLUDE_PATH'
85 includes the necessary `include/' paths and the environment variable
86 `LD_LIBRARY_PATH' includes the necessary `lib/'rary paths.
88 The S-nail make system will inspect these two environment variables and
89 *automatically* convert them to cc(1) (c99(1)) -I and -L options (since
90 these environment variables are, different to the command line options,
91 not part of the POSIX standard).
92 To set these environment variables, the following can be done in
93 a Bourne/Korn/POSIX compatible shell:
95   $ C_INCLUDE_PATH="${C_INCLUDE_PATH}:/usr/local/include"
96   $ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
97   $ export C_INCLUDE_PATH LD_LIBRARY_PATH
98   $ make install
100 The S-nail make system will also automatically integrate pkgsrc(7) paths
101 into this mechanism.  pkgsrc(7) is used to handle building (compilation),
102 installation and removal of software packages on a lot of operating
103 systems, including all BSD systems, Linux, Solaris ...
104 And if all else fails you can also pass in prefilled $LIBS and $INCS:
106   $ INCS=-I/mypath/lib LIBS=-l/mypath/iconv make install
108 2. Notes for S-nail(1) v14.7*
109 -----------------------------
111 S-nail(1) has been or is used regulary on these systems (`uname -srm').
112 It is assumed that S-nail(1) should work practically everywhere.
114 . All 32-bit systems:
115   - There _may_ be warnings about format strings, like, e.g.,
116       auxlily.c:1610:10: warning: format '%lu' expects type 'long
117       unsigned int', but argument 3 has type 'size_t'
118     The S-nail codebase is ISO C89, so we have no %z printf(3) format.
119     However, `nail.h' tries hard to detect the real type size and
120     defines the `PRI[du]Z' macro which ends up with the correct size,
121     which is also compile-time asserted via PRIxZ_FMT_CTA() in main.c.
123     You can completely overcome this situation by forcing ISO C99 mode
124     when compiling, e.g., with gcc(1) and clang(1): if you use
125     WANT_AUTOCC then also pass "ADDCFLAGS=-std=c99", otherwise ensure
126     -std=c99 is set in your $CFLAGS.
128 . Mac OS X <https://www.apple.com/>
129   (Snow Leopard) Darwin 10.8.0 i386
130   - gcc-mp-4.8 (MacPorts gcc48 4.8.2_0) 4.8.2.
131     + The known -Wstrict-overflow warnings (this code is address of
132       change in v14.8)
133   - clang version 3.4 (branches/release_34 197314)
134     Target: x86_64-apple-darwin10.8.0
135     Thread model: posix.
136   - i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666)
137     (dot 3).
138   - Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM
139     2.9svn).
141 . ArchLinux <https://www.archlinux.org/>
142   Linux 3.15.5-1-ARCH x86_64
143   - gcc (GCC) 4.9.0 20140604 (prerelease) [gcc 4.9.0-5]
144     + I think faulty message on longjmp() clobbering on a const variable?
145     + The known -Wstrict-overflow warnings (this code is address of
146       change in v14.8)
148 . CRUX Linux <http://www.crux.nu/>
149   CRUX 3.1 (rc1) Linux 3.12.17 x86_64.
150   - gcc (CRUX) 4.8.2.
151     + The known -Wstrict-overflow warnings (this code is address of
152       change in v14.8)
153     + (The HOT BEVERAGE error doesn't occur, even today.)
155   CRUX 3.0 Linux 3.6.11 #1 SMP Sun Sep 15 17:47:31 UTC 2013 x86_64.
156   - gcc (CRUX-x86_64-multilib) 4.7.2.
157     + For rememberance:
158       In a very special test mailbox the character `☕' (U+2615 HOT
159       BEVERAGE) is displayed as `[3m<98><95>' (`set PAGER='cat -vet''
160       prints `M-bM-^XM-^U').  Because this is the only system i have
161       seen this, and only in this single mailbox, i suspect a problem
162       in the character conversion environment.  (I hope v14.888888888ngs
163       sole usage of mbrtowc(3) instead of mbtowc(3) and per-message
164       multibyte states.  Let's see if that fixes this problem.  I'll
165       keep the VM around.)
167 . Void Linux <http://www.voidlinux.eu/>
168   Linux 3.10.19_1 i686.
169   - gcc (GCC) 4.7.3.
170     + A single warning on 'signed overflow'.
171     + `devel'opment target: warnings on format strings -- as above.
173 . NetBSD <https://www.netbsd.org/>
174   NetBSD 6.99.40 i386 (201404092030Z)
175   - gcc (NetBSD nb2 20140304) 4.8.3
176     + Warnings on format strings -- as above.
177     + Faulty message on longjmp() clobbering (on a const variable).
179   NetBSD 6.99.24 NetBSD 6.99.24 (GENERIC) #0: Tue Oct 29 08:23:21 UTC
180   2013 amd64.
181   - gcc (NetBSD nb1 20120916) 4.5.4.
182     + Faulty message on longjmp() clobbering (on a const variable).
184   NetBSD 6.?
185   - Ok.
187 . FreeBSD <https://www.freebsd.org/>
188   FreeBSD 10.0-STABLE #0 r268038: Mon Jun 30 17:00:39 UTC 2014
189   - FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
191 . DragonFly BSD <https://www.dragonflybsd.org/>
192   DragonFly 3.6-RELEASE x86_64
193   - gcc 4.7.3 [DragonFly] Release/2013-04-11.
194     + A single warning on 'signed overflow'.
195     + Harmless iconv(3) warning again (as if we didn't have had to
196       treat it specially already).
198 . OpenBSD <http://www.openbsd.org/>
199   OpenBSD 5.6 (current as of 2014-05-25) i386,
200   OpenBSD 5.4 i386.
201   - gcc (GCC) 4.2.1 20070719.
202     + Faulty message on longjmp() clobbering (on a const variable).
204 . UnixWare 7.1.4.
205   + Note: it is no longer possible to use the `install' rule -- mk-mk.in
206     uses shell functions to ease the task of directory creation etc.
207     (especially useful due to VERBOSE=), and that won't work due to bugs.
208   + You'll see some harmless and ignorable warnings (the problematic
209     looking warning `"openssl.c", line 88: initialization type mismatch'
210     refers to a cast from non-const to const, which shouldn't matter).
212 3. Current codebase state
213 -------------------------
215 Since i've forked Heirloom mailx(1) (for real) as S-nail(1) on
216 2012-09-18 i make my way through the codebase, and i'm getting more
217 and more used to it as time goes by -- of course, i'm thinking object
218 and thus this codebase and i are antipodes.
219 I'll hope to be able to release S-nail v20 on 2018-03-25, the 40th
220 anniversary of Berkeley Mail, as a good one.  Also see `TODO'.
222 For S-nail, v15.0 (not before 2016) is dedicated to a Send- and
223 MIME-layer rewrite that will bring the possibility to access each
224 message part individually. Because the Berkeley codebase and its nail
225 fork have design flaws in respect to mailbox handling and non-local code
226 jumps (due to / and signals), whereas the (MIME capable) NetBSD and
227 OpenBSD forks have instead addressed this problem, more or less
228 complete, in one or the other way, v15.0 will also have to address
229 signal handling, because only like that we have the possibility to ever
230 reach a clean state from which we can actually think about re-extending
231 this MUA. It is not unlikely that IMAP support will be dropped
232 temporarily, leaving only the plain mailx(1) plus Maildir, SMTP and POP3
233 functionality. It has to move under the headline reduce to the max.
235 # s-ts-mode