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