"Fossies" - the Fresh Open Source Software Archive

Member "s-nail-14.9.19/mx-config.h" (26 Apr 2020, 7051 Bytes) of package /linux/misc/s-nail-14.9.19.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "mx-config.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 14.9.18_vs_14.9.19.

    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.
    5  *
    6  * Copyright (c) 2012 - 2020 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
    7  * SPDX-License-Identifier: ISC
    8  *
    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.
   12  *
   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.
   20  */
   21 #ifndef mx_CONFIG_H
   22 # define mx_CONFIG_H
   23 
   24 #define ACCOUNT_NULL "null" /* Name of "null" account */
   25 #define n_ALIAS_MAXEXP 25 /* Maximum expansion of aliases */
   26 
   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"
   31 
   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 */
   35 
   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) */
   39 
   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 */
   46 
   47 #define n_IMAP_DELIM "/." /* Directory separator ([0] == replacer, too) */
   48 
   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"
   52 
   53 #define n_MAILDIR_SEPARATOR ':' /* Flag separator character */
   54 #define n_MAXARGC 512 /* Maximum list of raw strings TODO dyn vector! */
   55 
   56 #define n_PATH_DEVNULL "/dev/null" /* Note: manual uses /dev/null as such */
   57 
   58 #define n_QUOTE_INJECT_HEAD "%f wrote:\n\n" /* DOC! */
   59 #define n_QUOTE_INJECT_TAIL NIL /* DOC! */
   60 
   61 #define REFERENCES_MAX 20 /* Maximum entries in References: */
   62 
   63 /* *bind-inter-byte-timeout* default -- update manual on change! */
   64 #define mx_BIND_INTER_BYTE_TIMEOUT "200"
   65 
   66 #define mx_VEXPR_REGEX_MAX 16 /* Maximum address. `vexpr' regex(7) matches */
   67 
   68 /* * */
   69 
   70 /* Default log level */
   71 #define n_LOG_LEVEL su_DBGOR(su_LOG_WARN, su_LOG_CRIT)
   72 
   73 /* * */
   74 
   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
   90 
   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
   98 
   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 */
  103 
  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))
  111 
  112 /* Default *mime-encoding* as enum mime_enc; one of _B64, _QP, _8B */
  113 #define MIME_DEFAULT_ENCODING MIMEE_QP
  114 
  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)
  119 
  120 /* Ditto, SHOULD */
  121 #define MIME_LINELEN 78 /* Plus CRLF */
  122 
  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
  126 
  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
  135 
  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"
  143 
  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
  147 
  148 /* How much spaces a <tab> counts when *quote-fold*ing? (power-of-two!) */
  149 #define n_QUOTE_TAB_SPACES 8
  150 
  151 /* Smells fishy after, or asks for shell expansion, dependent on context */
  152 #define n_SHEXP_MAGIC_PATH_CHARS "|&;<>{}()[]*?$`'\"\\"
  153 
  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
  158 
  159 /* Maximum size of a message that is passed through to the spam system */
  160 #define SPAM_MAXSIZE 420000
  161 
  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
  167 
  168 /* ... */
  169 
  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
  180 
  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
  190 
  191 #ifdef O_NOCTTY
  192 # define mx_O_NOCTTY O_NOCTTY
  193 #else
  194 # define mx_O_NOCTTY 0
  195 #endif
  196 /*
  197 #ifdef O_NOFOLLOW
  198 # define mx_O_NOFOLLOW O_NOFOLLOW
  199 #else
  200 # define mx_O_NOFOLLOW 0
  201 #endif
  202 */
  203 #define mx_O_NOXY_BITS (mx_O_NOCTTY /*| mx_O_NOFOLLOW*/)
  204 
  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
  211 
  212 #endif /* mx_CONFIG_H */
  213 /* s-it-mode */