/*
**    spasm - The spasm anti-spam milter
**    Copyright (C) 2002-2004 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
*/

#ifndef _SPASM_H
#define _SPASM_H

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

/* Turn debugging on/off */
#define DEBUGGING 0

/* syslog facility */
#define LOGFACILITY LOG_LOCAL6

/* Where is sendmail? */
#define SENDMAIL_PATH "/usr/sbin/sendmail"

/* Enable virus scanning */
#define VIRUS_SCAN
#define VIRUS_BIN "/etc/iscan/vscan"
#define VIRUS_NAME "vscan"
#define VIRUS_ARG1 "-l/etc/mail/spasm/logs/virus.log"
#define VIRUS_FOUND		1

/* Use domain logging/quarantining for non-default domains */
#define USE_DOMAIN_LOGGING	1

/* Database Format */
#define USE_BERKELEY_DB		1

/* Where are blacklist settings stored? */
#define FILTER_DB_TYPE USE_BERKELEY_DB

/* Where are whitelists stored? */
#define WHITELIST_DB_TYPE USE_BERKELEY_DB

/* Where are blacklists stored? */
#define BLACKLIST_DB_TYPE USE_BERKELEY_DB

/* Where are regexes stored? */
#define REGEX_DB_TYPE USE_BERKELEY_DB

/* How should we verify users? */
#undef VERIFY_USERS		/* Turn user lookups on/off */
#define VERIFY_USERS_IN_PASSWD	/* Check /etc/passwd */
#define VERIFY_USERS_IN_ALIASES	/* Check /etc/mail/aliases */

/* Not currently implemented -- don't bother */
/*#define VERIFY_USERS_IN_SPASM*/

/* spasm user */
#define SPASM_USER "spasm"
/* Directory for spasm */
#define SPASM_DIR "/etc/mail/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 "/etc/mail/spasm/logs"
/* Directory for log archives */
#define LOG_ARCHIVE_DIR "/etc/mail/spasm/logs/archives"
/* Name of local blacklist */
#define LOCAL_BL "localbl"
/* Name of max_unknown_users blacklist */
#define MAX_UNKNOWN_USERS_BL "max_unknown_users"
/* Directory for max_unknown_users logs */
#define MAX_UNKNOWN_USERS_LOG "max_unknown_users.log"
/* Name of spamtrap blacklist */
#define SPAMTRAP_BL "spamtrap"
/* Directory for spamtrap logs */
#define SPAMTRAP_LOG "spamtrap.log"

/* Name of regex spamtraps database */
#define SPAMTRAPS_DB "spamtraps"
/* Name of regex envfrom database */
#define ENVFROM_DB "envfrom"

/* Name of global IP whitelist database */
#define GLOBAL_IP_WL "global_ip_wl"

/* Name of quarantine directory */
#define QUARANTINE_DIR "/etc/mail/spasm/quarantine"

/* SpamAssassin */
#define SPAMASSASSIN	/* Turn SA on or off */
#define SA_PORT 783
#define SA_HOST "127.0.0.1"
#define SA_REQUIRED_HITS "SA_REQUIRED_HITS"

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

#ifdef USE_BERKELEY_DB
    #define DB_FILTER_DIR "/etc/mail/spasm/filters"
    #define DB_WHITELIST_DIR "/etc/mail/spasm/whitelists"
    #define DB_BLACKLIST_DIR "/etc/mail/spasm/blacklists"
    #define DB_REGEX_DIR "/etc/mail/spasm"
#endif

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

#define SPASM_OFF		0
#define SPASM_TAG		1
#define SPASM_QUARANTINE 	2
#define SPASM_REJECT		3

#define SPASM_VERSION		"1.00-pre4"

#define NIPQUAD(addr) \
        ((unsigned char *)&addr)[0], \
        ((unsigned char *)&addr)[1], \
        ((unsigned char *)&addr)[2], \
        ((unsigned char *)&addr)[3]

#define RNIPQUAD(addr) \
        ((unsigned char *)&addr)[3], \
        ((unsigned char *)&addr)[2], \
        ((unsigned char *)&addr)[1], \
        ((unsigned char *)&addr)[0]

#endif /* _SPASM_H */
