1 /* $Id: options.h 10382 2020-05-24 10:24:37Z iulius $ 2 ** 3 ** Compile-time INN configuration. 4 ** 5 ** This header contains all the definitions of compile-time constants that 6 ** aren't generated by configure. This is the file that has to be edited by 7 ** hand to change the more obscure options. Ideally, most if not all of the 8 ** contents of this file should move elsewhere or be replaced with configure 9 ** flags or run-time configuration. 10 */ 11 12 #ifndef INN_OPTIONS_H 13 #define INN_OPTIONS_H 1 14 15 /* 16 ** GENERAL SETTINGS 17 ** 18 ** Look over these settings and make sure they're correct for your site. 19 ** These values don't come from configure and therefore may need manual 20 ** editing. The defaults normally should be fine. 21 ** 22 ** For boolean #defines, uncomment and change #undef to #define to enable, 23 ** do the reverse to disable. 24 */ 25 26 /* A null-terminated list of uwildmat(3) patterns matching illegal 27 distributions. inews and nnrpd will reject posts with a distribution 28 matching one of these patterns. */ 29 #define BAD_DISTRIBS "*.*", NULL 30 31 /* Default timeout period for ctlinnd, overridden by the -t flag. If set to 32 zero, ctlinnd will never time out, but will check every two minutes to 33 see if the server is still running so it won't hang forever on a dead 34 server. */ 35 #define CTLINND_TIMEOUT 0 36 37 /* Reject articles posted more than this many seconds in the future. */ 38 #define DATE_FUZZ (24L * 60L * 60L) 39 40 /* innd will flush the history and active file after this many seconds. */ 41 #define DEFAULT_TIMEOUT 300 42 43 /* Define if inews should put hostnames into the Path: header itself. */ 44 #define DO_INEWS_PATH 45 46 /* Define if inews should munge the GECOS entry of the passwd file when 47 attempting to determine a poster's real name. Use this if your GECOS 48 entries have other stuff after trailing commas or before dashes, things 49 in parenthesis that aren't part of the name, etc. See frontends/inews.c 50 for the full algorithm. */ 51 #define DO_MUNGE_GECOS 52 53 /* Value to pass to dbzincore() inside innd. Under some bizarre low memory 54 circumstance, you may want this not to be 1, but normally you always want 55 to load the full history indexes into innd's memory. Has no effect if 56 using tagged hash (which is always in core). */ 57 #define INND_DBZINCORE 1 58 59 /* A null-terminated list of unknown commands that, when seen by innd, 60 shouldn't be logged to syslog. Normally innd logs all unknown commands, 61 but sometimes some are so frequent that it's not worth it. */ 62 #define INND_QUIET_BADLIST NULL 63 64 /* innd will throttle itself after this many I/O errors. The count is reset 65 on a ctlinnd go. (ENOSPC is special and will always cause an immediate 66 throttle.) */ 67 #define IO_ERROR_COUNT 50 68 69 /* Length of listen queue for innd. */ 70 #define MAXLISTEN 25 71 72 /* The standard NNTP port. */ 73 #define NNTP_PORT 119 74 75 /* What to use for a Path: tail for local posts. */ 76 #define PATHMASTER "not-for-mail" 77 78 79 /* 80 ** BUFFER SIZES AND DATA LENGTHS 81 ** 82 ** You shouldn't need to change any of the following, and changing some of 83 ** them may cause other things to break. Some standard buffer sizes and 84 ** lengths of data types for various different things. 85 */ 86 87 /* The data type to use for article numbers. This probably can't be 88 increased without a lot of work due to assumptions about the active file 89 format, etc. */ 90 typedef unsigned long ARTNUM; 91 92 /* Input buffers start at START_BUFF_SIZE. While reading input, if we have 93 less than LOW_WATER bytes left free in the buffer, use the current 94 buffersize as input to GROW_AMOUNT to determine how much to realloc. 95 Growth must be at least NNTP_MAXLEN_COMMAND bytes! The default settings provide 96 aggressive, exponential buffer growth. */ 97 #define START_BUFF_SIZE (4 * 1024) 98 #define LOW_WATER (1 * 1024) 99 #define GROW_AMOUNT(x) ((x) < 128 * 1024 ? (x) : 128 * 1024) 100 101 /* The maximum length of a single header or body line, including CRLF. */ 102 #define MAXARTLINELENGTH 1000 103 104 /* String length of high/low watermark. Currently for 32-bit article numbers. */ 105 #define ARTNUMPRINTSIZE 10 106 107 /* The size of a small buffer. */ 108 #define SMBUF 256 109 110 /* The size of a medium buffer. It should be greater than MAXARTLINELENGTH 111 * because it is sometimes used as a good guess at a buffer size for some 112 * header parsing code.*/ 113 #define MED_BUFFER 1024 114 115 /* The size of a large buffer. Free dynamically allocated buffers larger 116 than this when we're done with them. */ 117 #define BIG_BUFFER (2 * START_BUFF_SIZE) 118 119 /* Default buffer size for outgoing feeds from innd. */ 120 #define SITE_BUFFER_SIZE (16 * 1024) 121 122 /* Maximum size of a pathname in the spool directory. */ 123 #define SPOOLNAMEBUFF 512 124 125 126 /* 127 ** LEGACY 128 ** 129 ** Everything below this point is here so that parts of INN that haven't 130 ** been tweaked to use more standard constructs don't break. Don't count 131 ** on any of this staying in this file. If you have a chance, consider 132 ** following the comments before each item and fixing it. 133 */ 134 135 /* Used to send commands to exploders. Should be moved into a more specific 136 header file; used by innd/site.c and backends/buffchan.c. */ 137 #define EXP_CONTROL '!' 138 139 /* Only used by innd and cvtbatch, should be moved to a more specific header 140 file. */ 141 #define FEED_BYTESIZE 'b' 142 #define FEED_FULLNAME 'f' 143 #define FEED_HASH 'h' 144 #define FEED_HDR_DISTRIB 'D' 145 #define FEED_HDR_NEWSGROUP 'N' 146 #define FEED_MESSAGEID 'm' 147 #define FEED_FNLNAMES '*' 148 #define FEED_HEADERS 'H' 149 #define FEED_NAME 'n' 150 #define FEED_STOREDGROUP 'G' 151 #define FEED_NEWSGROUP 'g' 152 #define FEED_OVERVIEW 'O' 153 #define FEED_PATH 'P' 154 #define FEED_REPLIC 'R' 155 #define FEED_SITE 's' 156 #define FEED_TIMEEXPIRED 'e' 157 #define FEED_TIMERECEIVED 't' 158 #define FEED_TIMEPOSTED 'p' 159 160 /* Maximum number of flags for a feed in newsfeeds. Only used in innd, 161 should be moved there (or made dynamic). */ 162 #define FEED_MAXFLAGS 20 163 164 /* Maximum length of argv vectors used in innd/site.c. This should be moved 165 out of here into that file, or even better hard-coded rather than 166 defined; this value isn't affected by user data and the right value can 167 be determined by looking at the code and seeing how big of an argv it 168 will attempt to construct. */ 169 #define MAX_BUILTIN_ARGV 20 170 171 /* active file flags. Should be moved to a more specific header file. */ 172 #define NF_FLAG_ALIAS '=' 173 #define NF_FLAG_JUNK 'j' 174 #define NF_FLAG_MODERATED 'm' 175 #define NF_FLAG_OK 'y' 176 #define NF_FLAG_NOLOCAL 'n' 177 #define NF_FLAG_IGNORE 'x' 178 179 #define NF_FLAG_ALIAS_STRING "=" 180 #define NF_FLAG_JUNK_STRING "j" 181 #define NF_FLAG_MODERATED_STRING "m" 182 #define NF_FLAG_OK_STRING "y" 183 #define NF_FLAG_NOLOCAL_STRING "n" 184 #define NF_FLAG_IGNORE_STRING "x" 185 186 /* Used for parsing the Newsgroups: header. Should be rolled into a library 187 for parsing headers, combining all the code that's currently scattered 188 all over INN for doing that. */ 189 #define NG_SEPARATOR "," 190 #define NG_ISSEP(c) ((c) == ',') 191 192 /* There's no reason to make all of these #defines except possibly for 193 L_CC_CMD and even that's a stretch. Since we're logging to our own 194 distinguished log facility, provided that we spread things out between a 195 reasonable variety of log levels, the sysadmin shouldn't have to change 196 any of this. (Some of this is arguably wrong; L_NOTICE should be 197 LOG_NOTICE, for example.) */ 198 199 /* Flags to use in opening the logs; some programs add LOG_PID. */ 200 #define L_OPENLOG_FLAGS (LOG_CONS | LOG_NDELAY) 201 202 /* Fatal error, program is about to exit. */ 203 #define L_FATAL LOG_CRIT 204 205 /* Log an error that might mean one or more articles get lost. */ 206 #define L_ERROR LOG_ERR 207 208 /* Informational notice, usually not worth caring about. */ 209 #define L_NOTICE LOG_WARNING 210 211 /* A protocol trace. */ 212 #define L_TRACE LOG_DEBUG 213 214 /* All incoming control commands (ctlinnd, etc). */ 215 #define L_CC_CMD LOG_INFO 216 217 #endif /* !INN_OPTIONS_H */ 218