# $Id: cgpsa.conf,v 1.31 2010/02/05 22:16:23 dmz Exp $

# CGPSA - A Spam Filter for CommuniGate Pro - Version 1.7b1
# Copyright (C) 2002-2010 TFF Enterprises
# Written by Daniel M. Zimmerman
# All Rights Reserved

# This is an example of a configuration file for CGPSA. The various
# configuration options are explained, and their default values are
# provided. To change a configuration option, uncomment the corresponding
# line of the configuration file and modify it as you see fit.
#
# This file must be installed as "/var/CommuniGate/Settings/cgpsa.conf", 
# unless you have changed the definitions of $cgp_base, $config_directory, 
# or $config_pathname in the cgpsa filter itself. The filter will not run if 
# it cannot find its configuration file. More accurately, it will run, but 
# it just won't process any mail (and mail will just build up in the queue).
#
# Files with configuration options can also be installed as 
# "cgpsa.domainconf" in the "Settings" folders of CommuniGate Pro domains 
# (for example, a path to a secondary domain configuration file might be 
# "/var/CommuniGate/Domains/mydomain.com/Settings/cgpsa.domainconf"). These
# will override certain settings for mail sent to that particular domain.
# Settings that can be overridden by domain configuration files appear under 
# a special heading in this file.
#
# In addition, files with configuration options can be installed as 
# ".cgpsa.conf" in the "account.web" directories of individual users. Such 
# a file control various aspects of CGPSA's operation for a single user, 
# overriding the system and domain settings. Settings that can be overridden 
# by user configuration files appear under a special heading in this file.
#
# Boolean options (such as "debug") understand "yes", "on", "true", and "1"
# as "true" and the obvious alternatives as "false".


#
# Options You Will Almost Certainly Want To Change
# (if you're going to turn CLI usage off, you can ignore these)
#

# The CommuniGate Pro username to use for CLI access. This user must have
# at least the "Can Modify All Domains and Account Settings" access right,
# and it is highly recommended that the user have only the "PWD" service
# enabled (so as to minimize the possibility of security issues). 
#
# cgp_username = username

# The password for the username specified in "cgp_username". This is plain
# text, but it's hidden inside /var/CommuniGate (just like all your users'
# email and account settings, which are also in plain text). If somebody
# gets access to your email server using this, you likely have larger
# problems to worry about. 
#
# cgp_password = password


#
# Options You Might Want To Change
#

# A flag that determines whether or not the filter tries to handle multiple
# requests simultaneously. Simultaneous handling of requests may not work on
# all platforms with the current implementation, and is known not to work
# with ActiveState Perl 5.6.1 on Win32. It is disabled by default on
# Windows, and enabled by default on all other platforms. It is highly
# recommended that you run with parallel_requests on if they work on your 
# platform, because it prevents various SpamAssassin-related memory issues.
#
# This setting cannot be overridden by a domain configuration file.
#
# parallel_requests = (platform-dependent)

# The maximum number of requests to be handled by the filter before it 
# stops execution. This is useful on platforms where parallel_requests can
# not be used (such as Win32), to cause the filter to exit periodically
# and prevent the memory usage of SpamAssassin from growing without bound.
# A value of 0 causes the filter to handle requests forever (that is, it
# won't exit until it is told to by CommuniGate). If you set this option to
# a positive value, you _must_ set the "Auto-Restart" parameter of the
# CGPSA entry on CommuniGate Pro's "Content Filtering" configuration page
# to something other than "disabled", or your mail queue will stop
# altogether when CGPSA exits. This option can be enabled in conjunction 
# with parallel_requests, but it is not particularly useful to do so.
#
# max_requests = 0

# The maximum message length (in bytes) to have SpamAssassin scan. If a 
# message longer than this is passed to CGPSA, CGPSA will only have 
# SpamAssassin scan this much of the message (by truncating the rest). The
# message itself will remain intact.
#
# max_scan_length = 131072

# A simplified mode of operation for the filter. If this setting is "true", 
# the filter uses the default SpamAssassin preferences for all messages and 
# uses the ADDHEADER functionality of CommuniGate to add SpamAssassin 
# headers to the messages it processes. In "headers-only" mode, the 
# settings relating to user preferences and state are completely ignored 
# (only global preferences and state are used), and so are the settings 
# related to the CGP CLI and remote addresses (the CLI is not used, and 
# local and remote addresses are not distinguished). The default setting is 
# "false" - that is, the filter normally runs in "full-featured" mode.
#
# headers_only = false

# A flag that indicates whether or not the CommuniGate Pro CLI should be 
# used for any purpose. If this is set to false, CGPSA will never attempt
# to use the CommuniGate Pro CLI. The default setting is to enable the CLI.
#
# use_cli = true

# A flag that determines whether or not to use the CommuniGate Pro CLI
# for user account information and message delivery. If true, the CLI is 
# used to determine whether recipient addresses are local or remote, to 
# locate user preferences (if they're being used), and to create/verify DMA 
# spam mailboxes. If false, the CLI is not used for these purposes, and all 
# settings that depend on user account information (in particular, those 
# having to do with user prefs, state files, and DMA delivery) are ignored. 
# The filter then scans messages to all recipients (not just local ones), 
# and uses default preferences and state. The only reason you would ever 
# want to disable CLI usage for these purposes is if you are running in 
# full-featured mode because you want SpamAssassin to rewrite messages, but 
# you don't want the CLI overhead; if you're running in headers-only mode, 
# CLI usage for account information and message delivery is disabled 
# automatically regardless of this configuration option. The default
# setting is to use the CLI for account information and message delivery.
#
# cli_account_info = true

# The port to use for the CommuniGate Pro CLI. If you have changed the PWD
# port of your CommuniGate server, you must specify the new port number 
# here. If you haven't changed the PWD port of you CommuniGate server, the
# default setting will work. A notable exception to this is CommuniGate
# running on Mac OS X Server, where the default PWD port is 8106 (and should
# be changed here accordingly).
#
# cgp_port = 106

# A header that will be added to emails, in addition to the standard
# SpamAssassin headers (if they're enabled), to prevent loops. If you choose 
# to run all email through the filter without performing any tests on its
# content (such as looking for an X-Spam-Status), the filter will still work
# properly because of this. The primary motivation for any change to this
# parameter is aesthetic.
#
# loop_prevention_header = X-TFF-CGPSA-Filter

# A list of domain names, separated by spaces, for which CGPSA should scan
# all email. This is useful in cases where you want CGPSA to use the CLI 
# (which causes it to only scan email for addresses local to the CGP server)
# but also want to perform spam filtering for some non-local domains to 
# which the CGP server relays. The default setting is to not scan mail for
# any specific domain names. An example of a setting to scan all mail 
# destined for the domains tffenterprises.com and tffenterprises.net is
# "scan_domains = tffenterprises.com tffenterprises.net".
#
# scan_domains = 

# A flag that determines whether debugging output is turned on. If you're
# concerned about speed, it may be (minimally) advantageous to turn
# debugging output off.
#
# debug = true
 
# The debugging level of the filter. This determines how verbose its output
# is, which in turn determines (in concert with CommuniGate's log level) how
# large your CommuniGate logs will be. The valid range is 0-9, where 0 means
# to output as little as possible and 9 means to output as much as possible.
# The default of 8 provides sufficient debugging output for most purposes.
#
# debug_level = 8

# An option that determines whether SpamAssassin will output debugging
# information to standard error. If it is "true" or "false", it turns
# SpamAssassin's debugging output entirely on or entirely off; turning
# it entirely on generates a very large amount of output, so it should only 
# be done to gather information when problems arise with message processing.
# If it is a comma-separated list (such as "spf,check"), it will be passed
# directly to SpamAssassin as a list of facilities to log, and debugging
# output will be generated for only those facilities.
#
# sa_debug = false

# A flag that determines whether CGPSA will print spamd-style log lines to
# standard error when messages are scanned. This allows for log analysis
# with certain tools that are compatible with spamd-style logs.
#
# spamd_style_log = false

# A flag that determines whether spam tests that depend on the network
# (such as Razor scans and blacklist checks) will be performed. You might
# want to disable this if you find that your messages are taking too long to
# be processed, or if SpamAssassin uses too much bandwidth (or other 
# resources). Note that it is possible to disable network tests only for
# certain domains (or certain users) by modifying the appropriate 
# SpamAssassin configuration file in a domain (or user) settings
# directory.
#
# do_network_tests = true

# A flag that determines whether SpamAssassin will stop a message scan once
# it hits the spam threshold for that message. You usually won't want to 
# enable this, but it may improve efficiency for very high email traffic.
#
# stop_at_threshold = false


#
# Options Related to Temporary Blacklisting
#

# A flag indicating whether temporary blacklisting is enabled. If true,
# suspected spam sources will be added to the CommuniGate Pro temporary
# blacklist, which will cause them to receive 4xx reject responses from
# CommuniGate Pro's SMTP server for a limited amount of time. In order to
# enable temporary blacklisting, the CLI must also be enabled (see "use_cli"
# above); if the CLI is not enabled, the temporary blacklisting settings
# are ignored.
#
# use_temp_blacklist = false

# The threshold score for temporary blacklisting. If a message receives
# a SpamAssassin score at or above this threshold, the host that sent it 
# will be added to the temporary blacklist.
#
# temp_blacklist_threshold = 8.0

# The time (in seconds) for which a host is temporarily blacklisted when it 
# receives a SpamAssassin score at or above temp_blacklist_threshold.
#
# temp_blacklist_duration = 900


#
# Options Related to Headers-Only Mode
# (you might want to change these if you don't use SpamAssassin's default
# header behavior, or have issues with CommuniGate Pro rejecting the added
# headers)
#

# The maximum length (in bytes) of a response that CGPSA can send to 
# CommuniGate Pro. By default, this is 4K (minus a few bytes for the 
# response command itself), as the limit has been 4K in every version of 
# CommuniGate Pro released to date; however, if a future version of 
# CommuniGate Pro increases the limit, changing this parameter will adapt 
# CGPSA to it.
#
# cgp_max_response_length = 4078

# If the length of the full set of headers generated by SpamAssassin exceeds 
# cgp_max_response_length, CGPSA tries two different ways to shorten the
# headers. The first is to truncate a single SpamAssassin header to a size
# such that the full set of headers will fit within the length limit. The
# default is to do this to the "X-Spam-Status" header, which lists the 
# various tests performed by SpamAssassin and their scores. This setting
# allows you to change the header to be truncated, if you have customized 
# your SpamAssassin configuration to put the test information in a different
# header. Note that "X-Spam-" should not be included in this setting.
#
# header_to_reduce = Status

# If the length of the header set after truncating the header specified in
# header_to_reduce still exceeds cgp_max_response_length, CGPSA will then
# build the new set of headers by adding SpamAssassin headers in the order
# specified in this option. The added headers will always include the CGPSA
# version and loop prevention headers, and the SpamAssassin version header;
# additional SpamAssassin headers will be added in the order specified here
# until the addition of a header would cause the new headers to exceed the
# length limit. This list of header names should be space-separated, and 
# their names should not include "X-Spam-"
#
# headers_to_include = Flag Level Status


#
# Options Related to SpamAssassin Installation Paths
# (you probably won't need to change these unless you're running Windows)
#

# The prefix where SpamAssassin is installed. This will, on UNIX machines,
# usually be /usr or /usr/local. Do not change this setting unless you are
# having problems with SpamAssassin finding its data files and rule sets
# (as is often reported with SpamAssassin 2.60 on Windows systems). If you
# change this setting, you will most likely want to set it to the value 
# assigned to "my $PREFIX" at the top of the "spamassassin" script on your 
# system.
#
# sa_prefix = <default value is empty>

# The path to SpamAssassin's default rule set. This will, on UNIX machines,
# usually be /usr/share/spamassassin or /usr/local/share/spamassassin. Do 
# not change this setting unless you are having problems with SpamAssassin
# finding its data files and rule sets (as is often reported with
# SpamAssassin 2.60 on Windows systems). If you change this setting, you
# will most likely want to set it to the value assigned to "my 
# $DEFAULT_RULES_DIR" at the top of the "spamassassin" script on your 
# system.
#
# sa_default_rules_dir = <default value is empty>

# The path to SpamAssassin's local rule set. This will, on UNIX machines,
# usually be /etc/mail/spamassassin or /usr/local/etc/mail/spamassassin. Do
# not change this setting unless you are having problems with SpamAssassin
# finding its data files and rule sets (as is often reported with 
# SpamAssassin 2.60 on Windows systems). If you change this setting, you
# will most likely want to set it to the value assigned to "my 
# $LOCAL_RULES_DIR" at the top of the "spamassassin" script on your system.
#
# sa_local_rules_dir = <default value is empty>


# 
# Options Related to SpamAssassin's Helper Applications
# (Razor, Pyzor, DCC, etc.)
#

# A list of directories in which SpamAssassin's helper applications 
# reside. This will usually include components such as "/usr/local/bin"
# or "/usr/bin" (on UNIX-like systems). Separators should be colons on
# UNIX-like systems, and semicolons on Windows systems. For example, 
# "/usr/bin:/usr/local/bin" for UNIX, or "c:/usr/bin;c:/usr/local/bin" 
# for Windows. Note that if you do not specify a helper path, Razor will
# likely still work, but other helper applications, such as Pyzor and DCC,
# will certainly not. 
#
# helper_path = <default value is empty>

# The directory used by SpamAssassin's helper applications to store their 
# state files. By default, this is the same as the default home directory.
# Unlike the default home directory, this cannot be changed in domain
# configurations; the rationale behind this is that SpamAssassin's helper
# applications operate independently of individual SpamAssassin settings,
# so there is no need for multiple helper state directories.
#
# helper_state_dir = (default_home_dir)


# 
# Options You Will Almost Certainly Not Want To Change
#

# A flag that determines whether or not CGPSA will use the "C" locale when 
# reading text. When true, the "C" locale is used regardless of what your 
# system locale is; when false, your system locale is used. This should
# help to work around problems that SpamAssassin has with certain locales.
# The default is to always use the "C" locale.
#
# use_c_locale = true

# A flag that determines whether or not CGPSA will direct messages that
# would normally be output on the standard error stream to a file instead.
# This prevents CGPSA from hanging on certain operating systems. Note that
# CGPSA error messages appear in the CommuniGate Pro log (if the filter
# log level is high enough) in addition to this error file, but SpamAssassin 
# error messages never appear in the CommuniGate Pro log. The output appears 
# in the file "cgpsa.err", in the default home directory. The default is to 
# direct error messages to the file (and not standard error).
#
# Note that currently there is no log rotation or other mechanism to keep
# this file from growing without bound. 
#
# redirect_stderr = true

# The hostname to use for the CommuniGate Pro CLI. There's almost no 
# conceivable reason for you to to change this.
#
# cgp_hostname = localhost


#
# Options That Can Be Overridden By A Domain Configuration File
# 
# The default value for each option in a given domain is the value assigned
# to the option in the systemwide configuration file. Essentially, each
# domain inherits the options from the systemwide configuration.
#

# A flag that determines whether or not the use of CGPSA to process mail
# for the domain is permitted. This setting has no effect if the filter is
# running in "headers-only" mode.
#
# allow_cgpsa = true

# The "default home directory". This is where the default SpamAssassin 
# preferences (inside a ".spamassassin" directory), as well as the helper
# state files (such as razor's logs and config files), for the domain
# (or in the case of the main configuration file, the system) will be 
# located.
# 
# Note that the filter actually uses the values of "$cgp_base" and
# "$config_directory" in place of "/var/CommuniGate/" and "Settings/" in 
# creating the default value for this setting, so if you change those, the 
# value below will no longer accurately reflect the default. This setting 
# should not be quoted (or escaped, if it has spaces). On Win32, the 
# location should have a drive letter and use forward slashes (not 
# backslashes) as separators: for example, C:/CommuniGate Files/SpamAssassin 
#
# default_home_dir = /var/CommuniGate/Settings/SpamAssassin

# A flag that determines whether or not the use of individual user 
# SpamAssassin is permitted in the domain.
#
# allow_user_prefs = true

# A flag that determines whether or not individual user SpamAssassin
# preferences are required to run SpamAssassin for users in the domain. This 
# is an easy way to ensure that SpamAssassin is only run for those users 
# that explicitly enable it; SpamAssassin is not run for any user that 
# doesn't have a SpamAssassin prefs file in their account directory when 
# this setting is turned on. It is off by default.
#
# require_user_prefs = false

# A flag that determines whether or not individual user SpamAssassin state
# files are permitted in the domain.
#
# allow_user_state = true

# A flag that determines whether or not domain-level SpamAssassin 
# preferences will be used if available. Turning this on for a domain 
# enables the use of the preferences in the ".spamassassin" directory inside
# that domain's default home directory, in circumstances when no user
# preferences for a user in the domain are available (or when use_user_prefs
# is off for the domain). 
#
# use_domain_prefs = true

# A flag that determines whether domain-level state files are maintained by
# SpamAssassin. This allows each domain to have its own auto-whitelist and 
# Bayes files, and can therefore make SpamAssassin more effective; however,
# it does mean that more disk space will be used for SpamAssassin state. 
# Turning this on for a domain means that the state files for that domain 
# will be used in circumstances when user state is unavailable (if a user 
# has no preferences, or use_user_state is off).
#
# use_domain_state = true

# A flag that determines whether user-level auto-whitelist files are
# permitted in the domain.
#
# allow_auto_whitelist = true

# A flag that determines whether or not CGPSA scans messages destined for
# mailing lists in the domain.
#
# list_scan = false


#
# Options That Can be Overridden By A Domain Or User Configuration File
#
# The default value for each option in a given domain is the value assigned
# to the option in the systemwide configuration file. Effectively, each
# domain inherits the options from the systemwide configuration. The 
# configuration options for a domain are used for all users in that domain 
# unless user options override them.
#
# The default value for each option for a given user is the value assigned
# to the option in the user's domain. Certain options cannot be overridden
# by users without permission to do so being in the domain's configuration;
# for example, a user configuration file cannot turn on "use_cgpsa" if the 
# domain configuration does not allow it.
#

# A flag that determines whether or not CGPSA will process messages. This 
# allows CGPSA to be turned on or off for individual domains. If this flag
# is off in the main domain's configuration file, mail will only be scanned
# in domains with configuration files in which this flag is on. This setting
# has no effect if the filter is running in "headers-only" mode, or if it
# appears in a user configuration and the user's domain does not have the
# "allow_cgpsa" option turned on.
#
# use_cgpsa = true

# A flag that determines whether messages to direct mailbox addresses are
# scanned. If true, messages to a direct mailbox address will be scanned 
# just like messages to regular addresses. If false, messages to direct 
# mailbox addresses will not be scanned (and will instead be delivered to 
# the direct mailbox addresses intact). Local recipients of a message that 
# are not direct mailbox addresses will always be scanned; this setting 
# affects only the direct mailbox addresses. The default is to not scan 
# messages for direct mailbox addresses. 
#
# direct_mailbox_scan = false

# A flag that determines whether or not direct mailbox addresses will be
# rewritten as account details before being scanned. If true, every direct
# mailbox address (mailbox#account) will be converted to an account detail
# (account+mailbox) before scanning - this ensures that it will be processed
# by user-level rules. If false, direct mailbox addresses will be left
# intact. The default is to not rewrite direct mailbox addresses. Note that
# if this setting is true, the setting of "direct_mailbox_scan" is
# effectively ignored (because all rewritten addresses no longer have 
# direct mailbox components, so they are scanned).
#
# direct_mailbox_rewrite = false

# A flag that determines whether or not individual user SpamAssassin 
# preferences will be used if available. Turning this on enables the use of 
# user preferences, but since there is no GUI for this currently, there is 
# no compelling reason to use it unless some people with root access want 
# their own SpamAssassin preferences. This setting has no effect if it 
# appears in a user configuration and the user's domain does not have the 
# "allow_user_prefs" option turned on.
#
# use_user_prefs = false

# A flag that determines whether individual user SpamAssassin preferences
# are handled using SpamAssassin's SQL support. When "sql_user_prefs"
# is enabled, the username passed to SpamAssassin is the fully qualified
# username as reported by CommuniGate Pro; that is, a user named "x" in the
# main domain will have username "x" passed to SpamAssassin, and a user 
# named "y" in a secondary domain "z" will have username "y@z" passed to
# SpamAssassin.
#
# sql_user_prefs = false

# A flag that determines whether individual user state files are maintained
# by SpamAssassin. This allows each user to have their own auto-whitelist 
# and Bayes files, and can therefore make SpamAssassin more effective; 
# however, it does mean that more disk space will be used for SpamAssassin
# state. This setting has no effect if it appears in a user configuration
# and the user's domain does not have the "allow_user_state" option turned
# on.
#
# use_user_state = false

# A flag that determines whether auto-whitelist files will be used. If 
# "use_user_state" is enabled, this will enable individual auto-whitelists;
# if not, it will enable a systemwide auto-whitelist (and domain-level
# auto-whitelists, depending on the "use_domain_state" settings for each
# domain. The auto-whitelist files will be created in users' CommuniGate 
# account directories if "use_user_state" is enabled, the default home
# directory for each domain where "use_domain_state" is enabled, and the
# systemwide default home directory. This setting has no effect if it 
# appears in a user configuration and the user's domain does not have the
# "allow_auto_whitelist" option turned on.
#
# use_auto_whitelist = true

# A flag that determines whether auto-whitelists are handled using
# SpamAssassin's SQL support. When "sql_auto_whitelist"
# is enabled, the username passed to SpamAssassin is the fully qualified
# username as reported by CommuniGate Pro; that is, a user named "x" in the
# main domain will have username "x" passed to SpamAssassin, and a user 
# named "y" in a secondary domain "z" will have username "y@z" passed to
# SpamAssassin.
#
# sql_auto_whitelist = false

# A flag that determines whether messages tagged as spam will be filed
# automatically using direct mailbox addressing. This eliminates the need
# for users to add rules to their accounts to handle spam filtering, but
# only works on systems where direct mailbox addressing is enabled. If
# this setting is enabled, spam will be filed in the mailbox specified by
# the "spam_mailbox_name" setting; the mailbox will be created when needed
# if it does not exist.
#
# use_dma_spam_mailbox = false

# The name of the mailbox to use for direct mailbox addressing when 
# the "use_dma_spam_mailbox" setting is enabled. 
#
# spam_mailbox_name = SPAM

# A flag that determines whether CGPSA will discard spam messages above
# a certain threshold (set in "discard_threshold"). This causes all
# messages rated above the threshold level to be discarded without a
# delivery attempt. 
#
# auto_discard = false

# A threshold score above which CGPSA will discard messages if 
# "auto_discard" is enabled. For instance, with the default setting, any
# message with a SpamAssassin score >= 25.0 will be discarded with no
# delivery attempt if "auto_discard" is enabled.
#
# discard_threshold = 25.0

# End of Configuration File
