config.h - bmf - bmf (Bayesian Mail Filter) 0.9.4 fork + patches
 (HTM) git clone git://git.codemadness.org/bmf
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       config.h (2333B)
       ---
            1 /* $Id: config.h,v 1.8 2002/10/20 07:16:57 tommy Exp $ */
            2 
            3 /*
            4  * Copyright (c) 2002 Tom Marshall <tommy@tig-grr.com>
            5  *
            6  * This program is free software.  It may be distributed under the terms
            7  * in the file LICENSE, found in the top level of the distribution.
            8  */
            9 
           10 #ifndef _CONFIG_H
           11 #define _CONFIG_H
           12 
           13 /**************************************
           14  * Standard headers
           15  */
           16 #include <stdlib.h>
           17 #include <stdio.h>
           18 #include <string.h>
           19 #include <errno.h>
           20 #include <math.h>
           21 #include <ctype.h>
           22 
           23 /**************************************
           24  * System headers
           25  */
           26 #include <err.h>
           27 #include <fcntl.h>
           28 #include <limits.h>
           29 #include <time.h>
           30 #include <unistd.h>
           31 
           32 /* pledge(2) and unveil(2) */
           33 #ifndef __OpenBSD__
           34 #define pledge(a,b) 0
           35 #define unveil(a,b) 0
           36 #endif
           37 
           38 #include <sys/file.h>
           39 #include <sys/stat.h>
           40 #include <sys/types.h>
           41 
           42 /**************************************
           43  * For convenience
           44  */
           45 typedef unsigned char byte;
           46 typedef const char* cpchar;
           47 typedef const byte* cpbyte;
           48 typedef const void* cpvoid;
           49 typedef enum { false, true } bool_t;
           50 
           51 #define min(a,b)        ( (a)<(b) ? (a) : (b) )
           52 #define max(a,b)        ( (a)<(b) ? (b) : (a) )
           53 #define minmax(v,a,b)   ( (v)<(a)?(a) : (v)>(b)?(b) : (v) )
           54 
           55 /* XXX: need to figure out MH and any others (MMDF?) */
           56 typedef enum { detect, mbox, maildir } mbox_t;
           57 
           58 /**************************************
           59  * Tweakables
           60  */
           61 
           62 #define MSGCOUNT_KEY        ".MSGCOUNT"
           63 #define MSGCOUNT_KEY_LEN    (sizeof(MSGCOUNT_KEY)-1)
           64 
           65 #define IOBUFSIZE       4096    /* chunk size for file buffers */
           66 #define MAXWORDLEN      20      /* max word length, inclusive */
           67 #define MAXFREQ         4       /* max times to count word per email */
           68 #define GOOD_BIAS       2.0     /* give good words more weight */
           69 #define DEF_KEEPERS     15      /* how many extrema to keep by default */
           70 #define MINIMUM_FREQ    5       /* min word count for consideration in filter */
           71 #define UNKNOWN_WORD    0.4     /* odds that unknown word is spammish */
           72 #define SPAM_CUTOFF     0.9     /* if it's spammier than this... */
           73 
           74 /*
           75  * If NON_EQUIPROBABLE is defined, use ratio of spamcount/goodcount instead
           76  * of UNKNOWN_WORDS, and as a factor in the known word calculation.  This is
           77  * merely copied from bogofilter.  I didn't write it and I cannot explain the
           78  * relative merits of using it or not.  Please don't ask.  :-)
           79  */
           80 
           81 #endif /* ndef _CONFIG_H */