Bump S-nail v14.9.19 ("Tufted titmouse (Indianermeise)"), 2020-04-26
[s-mailx.git] / mx-config.h
blob6b0d61b4dea19e4b389f0ad20c1b2e1d24faeefc
1 /*@ S-nail - a mail user agent derived from Berkeley Mail.
2 *@ Some constants etc. for which adjustments may be desired.
3 *@ This is included (as mx/config.h) after all the (system) headers.
4 *@ TODO It is a wild name convention mess, to say the least.
6 * Copyright (c) 2012 - 2020 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
7 * SPDX-License-Identifier: ISC
9 * Permission to use, copy, modify, and/or distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies.
13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 #ifndef mx_CONFIG_H
22 # define mx_CONFIG_H
24 #define ACCOUNT_NULL "null" /* Name of "null" account */
25 #define n_ALIAS_MAXEXP 25 /* Maximum expansion of aliases */
27 #define mx_CONTENT_DESC_FORWARDED_MESSAGE "Forwarded message"
28 #define mx_CONTENT_DESC_QUOTE_ATTACHMENT "Original message content"
29 #define mx_CONTENT_DESC_SMIME_MESSAGE "S/MIME encrypted message"
30 #define mx_CONTENT_DESC_SMIME_SIG "S/MIME digital signature"
32 /* Protocol version for *on-compose-splice** -- update manual on change! */
33 #define mx_DIG_MSG_PLUMBING_VERSION "0 0 2"
34 #define mx_DOTLOCK_TRIES 5 /* Number of open(2) calls for dotlock */
36 #define n_ERROR "ERROR" /* Is-error? Also as n_error[] */
37 #define mx_ERRORS_MAX 8000 /* Error queue size (s32) TODO configurable */
38 #define n_ESCAPE "~" /* Default escape for sending (POSIX standard) */
40 #define mx_FILE_LOCK_TRIES 10 /* Maximum tries before file_lock() fails */
41 #define mx_FILE_LOCK_MILLIS 200 /* If UZ_MAX, fall back to that */
42 #define n_FORWARD_INJECT_HEAD "-------- Original Message --------\n" /* DOC! */
43 #define n_FORWARD_INJECT_TAIL NIL /* DOC! */
44 #define mx_FS_FILETYPE_CAT_PROG "cat" /* cat(1) */
45 #define mx_FS_TMP_OPEN_TRIES 10 /* Maximum number of fs_tmp_open() tries */
47 #define n_IMAP_DELIM "/." /* Directory separator ([0] == replacer, too) */
49 #define n_LINE_EDITOR_CPL_WORD_BREAKS "\"'@=;|:"
50 /* Fallback in case the systems reports an empty hostname (?) */
51 #define n_LOCALHOST_DEFAULT_NAME "localhost.localdomain"
53 #define n_MAILDIR_SEPARATOR ':' /* Flag separator character */
54 #define n_MAXARGC 512 /* Maximum list of raw strings TODO dyn vector! */
56 #define n_PATH_DEVNULL "/dev/null" /* Note: manual uses /dev/null as such */
58 #define n_QUOTE_INJECT_HEAD "%f wrote:\n\n" /* DOC! */
59 #define n_QUOTE_INJECT_TAIL NIL /* DOC! */
61 #define REFERENCES_MAX 20 /* Maximum entries in References: */
63 /* *bind-inter-byte-timeout* default -- update manual on change! */
64 #define mx_BIND_INTER_BYTE_TIMEOUT "200"
66 #define mx_VEXPR_REGEX_MAX 16 /* Maximum address. `vexpr' regex(7) matches */
68 /* * */
70 /* Default log level */
71 #define n_LOG_LEVEL su_DBGOR(su_LOG_WARN, su_LOG_CRIT)
73 /* * */
75 /* Fallback MIME charsets, if *charset-7bit* and *charset-8bit* are not set.
76 * Note: must be lowercase!
77 * (Keep in SYNC: ./nail.1:"Character sets", mx-config.h:CHARSET_*!) */
78 #define CHARSET_7BIT "us-ascii"
79 #ifdef mx_HAVE_ICONV
80 # define CHARSET_8BIT "utf-8"
81 # define CHARSET_8BIT_OKEY charset_8bit
82 #else
83 # ifdef mx_HAVE_ALWAYS_UNICODE_LOCALE
84 # define CHARSET_8BIT "utf-8"
85 # else
86 # define CHARSET_8BIT "iso-8859-1"
87 # endif
88 # define CHARSET_8BIT_OKEY ttycharset
89 #endif
91 #ifndef HOST_NAME_MAX
92 # ifdef _POSIX_HOST_NAME_MAX
93 # define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
94 # else
95 # define HOST_NAME_MAX 255
96 # endif
97 #endif
99 /* Supported [mx_HAVE_]IDNA implementations TODO should not be here!?! */
100 #define n_IDNA_IMPL_LIBIDN2 0
101 #define n_IDNA_IMPL_LIBIDN 1
102 #define n_IDNA_IMPL_IDNKIT 2 /* 1 + 2 */
104 /* Max readable line width TODO simply use BUFSIZ? */
105 #if BUFSIZ + 0 > 2560
106 # define LINESIZE BUFSIZ
107 #else
108 # define LINESIZE 2560
109 #endif
110 #define BUFFER_SIZE (BUFSIZ >= (1u << 13) ? BUFSIZ : (1u << 14))
112 /* Default *mime-encoding* as enum mime_enc; one of _B64, _QP, _8B */
113 #define MIME_DEFAULT_ENCODING MIMEE_QP
115 /* Maximum allowed line length in a mail before QP folding is necessary), and
116 * the real limit we go for */
117 #define MIME_LINELEN_MAX 998 /* Plus CRLF */
118 #define MIME_LINELEN_LIMIT (MIME_LINELEN_MAX - 48)
120 /* Ditto, SHOULD */
121 #define MIME_LINELEN 78 /* Plus CRLF */
123 /* And in headers which contain an encoded word according to RFC 2047 there is
124 * yet another limit; also RFC 2045: 6.7, (5). */
125 #define MIME_LINELEN_RFC2047 76
127 /* TODO PATH_MAX: fixed-size buffer is always wrong (think NFS) */
128 #ifndef PATH_MAX
129 # ifdef MAXPATHLEN
130 # define PATH_MAX MAXPATHLEN
131 # else
132 # define PATH_MAX 1024 /* _XOPEN_PATH_MAX POSIX 2008/Cor 1-2013 */
133 # endif
134 #endif
136 /* Some environment variables for pipe hooks etc. */
137 #define n_PIPEENV_FILENAME "MAILX_FILENAME"
138 #define n_PIPEENV_FILENAME_GENERATED "MAILX_FILENAME_GENERATED"
139 #define n_PIPEENV_FILENAME_TEMPORARY "MAILX_FILENAME_TEMPORARY"
140 #define n_PIPEENV_CONTENT "MAILX_CONTENT"
141 #define n_PIPEENV_CONTENT_EVIDENCE "MAILX_CONTENT_EVIDENCE"
142 #define n_PIPEENV_EXTERNAL_BODY_URL "MAILX_EXTERNAL_BODY_URL"
144 /* Maximum number of quote characters (not bytes!) that will be used on
145 * follow lines when compressing leading quote characters */
146 #define n_QUOTE_MAX 42u
148 /* How much spaces a <tab> counts when *quote-fold*ing? (power-of-two!) */
149 #define n_QUOTE_TAB_SPACES 8
151 /* Smells fishy after, or asks for shell expansion, dependent on context */
152 #define n_SHEXP_MAGIC_PATH_CHARS "|&;<>{}()[]*?$`'\"\\"
154 /* Port to native MS-Windows and to ancient UNIX */
155 #if !defined S_ISDIR && defined S_IFDIR && defined S_IFMT
156 # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
157 #endif
159 /* Maximum size of a message that is passed through to the spam system */
160 #define SPAM_MAXSIZE 420000
162 /* Supported [mx_HAVE_]TLS implementations TODO should not be here!?!
163 * In addition mx_HAVE_XTLS is defined if it is OpenSSL/derivate, and set to
164 * "a version number", then (or 0 if not tested) */
165 #define mx_TLS_IMPL_OPENSSL 1
166 #define mx_TLS_IMPL_RESSL 2
168 /* ... */
170 #ifndef NAME_MAX
171 # ifdef _POSIX_NAME_MAX
172 # define NAME_MAX _POSIX_NAME_MAX
173 # else
174 # define NAME_MAX 14
175 # endif
176 #endif
177 #if NAME_MAX + 0 < 8
178 # error NAME_MAX is too small
179 #endif
181 #ifndef STDIN_FILENO
182 # define STDIN_FILENO 0
183 #endif
184 #ifndef STDOUT_FILENO
185 # define STDOUT_FILENO 1
186 #endif
187 #ifndef STDERR_FILENO
188 # define STDERR_FILENO 2
189 #endif
191 #ifdef O_NOCTTY
192 # define mx_O_NOCTTY O_NOCTTY
193 #else
194 # define mx_O_NOCTTY 0
195 #endif
197 #ifdef O_NOFOLLOW
198 # define mx_O_NOFOLLOW O_NOFOLLOW
199 #else
200 # define mx_O_NOFOLLOW 0
201 #endif
203 #define mx_O_NOXY_BITS (mx_O_NOCTTY /*| mx_O_NOFOLLOW*/)
205 #ifdef NSIG_MAX
206 # undef NSIG
207 # define NSIG NSIG_MAX
208 #elif !defined NSIG
209 # define NSIG ((sizeof(sigset_t) * 8) - 1)
210 #endif
212 #endif /* mx_CONFIG_H */
213 /* s-it-mode */