/*
**    spasm - The spasm anti-spam milter
**    Copyright (C) 2002 Sean Hanson <aradia@theasylum.org>
**
**    This program is free software; you can redistribute it and/or modify
**    it under the terms of the GNU General Public License as published by
**    the Free Software Foundation; either version 2 of the License, or
**    (at your option) any later version.
**
**    This program is distributed in the hope that it will be useful,
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**    GNU General Public License for more details.
**
**    You should have received a copy of the GNU General Public License
**    along with this program; if not, write to the Free Software
**    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/***** GLOBAL VARIABLES *****/

/* Turn debugging on/off */
#define DEBUGGING 1
/* syslog facility */
#define LOGFACILITY LOG_LOCAL6

/* Database Format */
#define USE_BERKELEY_DB

/*
 * Do not define these!
 * LDAP and SQL support are not
 * finished!
 */
#undef USE_LDAP
#undef USE_MYSQL
#undef USE_PGSQL

/* spasm user */
#define SPASM_USER "spasm"
/* default domain -- usually, domain of server's hostname */
#define DEFAULT_DOMAIN "theasylum.org"
/* Maximum unknown recipients threshold */
#define MAX_UNKNOWN_USERS 5
/* Directory for rejection logs */
#define LOG_DIRECTORY "/var/log/spasm"


/***** Berkeley DB Variables *****/

#ifdef USE_BERKELEY_DB
    /* Directory for spasm files */
    #define SPASM_DIR "/etc/mail/spasm"
    /* Directory for spasm whitelists */
    #define WHITELIST_DIR "/etc/mail/spasm/whitelists"
    /* Directory for spasm blacklists */
    #define BLACKLIST_DIR "/etc/mail/spasm/blacklists"
    /* Blacklist options database */
    #define USERBL_DB "userbl.db"
    /* Local blacklist database */
    #define LOCALFILTERS_DB "localbl.db"
    /* Database for adding ip addresses who've hit the threshold */
    #define MAX_UNKNOWN_USERS_BL "max_unknown_users.db"
    /* Logfile for MAX_UNKNOWN_USERS rejections */
    #define MAX_UNKNOWN_USERS_LOG "max_unknown_users.log"
    /* Database of spamtrap addresses */
    #define SPAMTRAP_DB "spamtraps.db"
    /* Database for adding ip addresses who've hit spamtrap addresses */
    #define SPAMTRAP_BL "spamtrap.db"
    /* Logfile for spamtrap rejections */
    #define SPAMTRAP_LOG "spamtrap.log"
    /* Flatfile of regex envfrom blacklist (SF_LOCALFILTER) */
    #define RE_ENVFROM_BLACKLIST "re_envfrom_bl.txt"
    /* Flatfile of regex envrcpt blacklist (global) */
    #define RE_ENVRCPT_BLACKLIST "re_envrcpt_bl.txt"
#endif

/***** END BERKELEY DB VARIABLES *****/


/***** DO NOT EDIT BELOW THIS LINE *****/

/* Reserved for system enhancements */
#define SF_TAG_ONLY		0x01
#define SF_WHITELIST_ONLY	0x02
#define SF_SPAMTRAP		0x04
#define SF_MAX_UNKNOWN_USERS	0x08

/* User-definable filters */
#define SF_LOCALFILTER          0x10
#define SF_OSIRUSOFT            0x20
#define SF_POSTMASTERRFC        0x40
#define SF_RDNS                 0x80
#define SF_HELO                 0x100
#define SF_ORDB                 0x200
#define SF_DSNRFC               0x400
#define SF_ABUSERFC             0x800
#define SF_WHOISRFC             0x1000
#define SF_IPWHOISRFC           0x2000
#define SF_XBL                  0x4000
#define SF_SPAMCOP              0x8000
#define SF_MAIL_HOST	        0x10000
#define SF_KOREABLACKHOLES      0x20000
#define SF_CHINABLACKHOLES      0x40000
#define SF_BRAZILBLACKHOLES     0x80000
#define SF_JAPANBLACKHOLES      0x100000
#define SF_TAIWANBLACKHOLES     0x200000
#define SF_VERIOBLACKHOLES      0x400000
#define SF_VALUEWEBBLACKHOLES   0x800000
#define SF_RACKSPACEBLACKHOLES  0x1000000
#define SF_INFLOWBLACKHOLES     0x2000000
#define SF_BROADWINGBLACKHOLES  0x4000000
#define SF_XOBLACKHOLES         0x8000000
#define SF_ELIBLACKHOLES        0x10000000

/* Structure to simplify looping through filters */
struct {
    char *name;
    unsigned long int num;
} filters[] = {
  { "SF_TAG_ONLY",		0x01 },
  { "SF_WHITELIST_ONLY",	0x02 },
  { "SF_SPAMTRAP",		0x04 },
  { "SF_MAX_UNKNOWN_USERS",	0x08 },
  { "SF_LOCALFILTER",		0x10 },
  { "SF_OSIRUSOFT",		0x20 },
  { "SF_POSTMASTERRFC",		0x40 },
  { "SF_RDNS",			0x80 },
  { "SF_HELO",			0x100 },
  { "SF_ORDB",			0x200 },
  { "SF_DSNRFC",		0x400 },
  { "SF_ABUSERFC",		0x800 },
  { "SF_WHOISRFC",		0x1000 },
  { "SF_IPWHOISRFC",		0x2000 },
  { "SF_XBL",			0x4000 },
  { "SF_SPAMCOP",		0x8000 },
  { "SF_MAIL_HOST",		0x10000 },
  { "SF_KOREABLACKHOLES",	0x20000 },
  { "SF_CHINABLACKHOLES",	0x40000 },
  { "SF_BRAZILBLACKHOLES",	0x80000 },
  { "SF_JAPANBLACKHOLES",	0x100000 },
  { "SF_TAIWANBLACKHOLES",	0x200000 },
  { "SF_VERIOBLACKHOLES",	0x400000 },
  { "SF_VALUEWEBBLACKHOLES",	0x800000 },
  { "SF_RACKSPACEBLACKHOLES",	0x1000000 },
  { "SF_INFLOWBLACKHOLES",	0x2000000 },
  { "SF_BROADWINGBLACKHOLES",	0x4000000 },
  { "SF_XOBLACKHOLES",		0x8000000 },
  { "SF_ELIBLACKHOLES",		0x10000000 },
  { 0, 0 }
};

#define SPASM_VERSION		"0.25"
