Subversion Repositories greylisting

Rev

Rev 152 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed


#############################################################################
#
# File: relaydelay.conf
#
# *** Copyright 2003 by Evan J. Harris --- All Rights Reserved ***
# *** No warranties expressed or implied, use at your own risk ***
#
# Notes:
#   The default location for this file is /etc/mail.  If you 
#   decide to store it elsewhere, you must either change the $config_file 
#   variable in the main script, or specify the location of this file as
#   the command line parameter to the milter.
#
#############################################################################

use strict;

#################################################################
# Our global settings that may be overridden from the config file
#################################################################

# If you do/don't want to see debugging messages printed/logged,
#   then set this appropriately.
$verbose = 1;

# To run as a daemon rather than a standalone script, set this.
# The default is to run standalone.
$run_as_daemon = 0;

# This specifies where status messages are printed.  If set to an empty
# string (the default), they will go to STDOUT.
# If $run_as_daemon (above) is set, this should be changed to be a file
# or /dev/null.
$log_file = '';
#$log_file = '/var/log/relaydelay.log';

# Database connection params
$database_type = 'mysql';
$database_name = 'relaydelay';
$database_host = 'localhost';
$database_port = 3306;
$database_user = 'db_user';
$database_pass = 'db_pass';

# Set this if you want to check for stale db connections at the entry to
#   every callback that accesses the db.  If your db is not close to you 
#   network-wise, this may add a fair amount of latency.  If your database 
#   is reliable, it's probably not necessary.  Disabled by default.
$check_stale_db_handles = 0;

# Set this to indicate the milter "name" that this milter will be 
#   identified by.  This must match the first parameter from the 
#   INPUT_MAIL_FILTER definition in the sendmail.mc configuration.
$milter_filter_name = 'relaydelay';

# This parameter determines how the milter interfaces with the libmilter
#   API.  Normally, if using a milter on the same machine that is running
#   sendmail, it will be something like 'local:/var/run/relaydelay.sock', 
#   but if you want to run the milter on a different machine than is running 
#   sendmail, you will need to specify how to connect to that copy of 
#   sendmail by setting this to indicate the machine and port that the 
#   remote sendmail is listening for connections on with something 
#   similar to 'inet:2526@sendmail.server.org'.
# This parameter must match the S= option in the INPUT_MAIL_FILTER
#   definition in the sendmail.mc file.
$milter_socket_connection = 'local:/var/run/relaydelay.sock';

# This config option specifies where sendmail's access.db file is located.  
#   If you don't want the milter to check the access.db, just set this equal 
#   to undef.
# If enabled, the access db will be checked to see if there are matching
#   ip or address entries that should make us bypass the greylist checks.
# NOTE: These checks assume that the sendmail FEATURE(`relay_hosts_only') 
#   is not enabled.  If you do have that enabled, the checks in the milter
#   will be more permissive than you want.
#   In addition, the milter will heed entries in the access db even if
#   your sendmail configuration doesn't check certain types, so make sure
#   you don't have any entries that sendmail will ignore unless you want 
#   to suffer the consequences.
#   For more information on access db options, see:
#     http://www.sendmail.org/~ca/email/doc8.12/cf/m4/anti_spam.html
#   For additional information, please also see the README file.
#
#my $sendmail_accessdb_file = undef;
$sendmail_accessdb_file = '/etc/mail/access.db';

# Where the pid file should be stored for relaydelay
$relaydelay_pid_file = '/var/run/relaydelay.pid';

# Set this if you want to check mail that would be handled by ALL 
#   sendmail's defined mailers, rather than just the smtp and esmtp mailers.
# If you have custom mailers defined that handle smtp traffic, you will
#   probably want to enable this.  If you have special non-smtp mailers
# you may want to disable this.  Default is disabled.
$force_all_mailer_checks = 0;

# Set this to something nonzero to limit the number of children that the 
#   milter will spawn.  Since children are never recycled (there seems 
#   to be a problem doing that with Sendmail::Milter), threads,
#   once created, will exist until the milter is shutdown.  Each thread
#   also consumes a database connection, so limiting db connections and
#   memory footprint are both good reasons to set this.
# If your mail server handles a large amount of mail, you may need to 
#   increase this limit to avoid blocking, but the default limit is
#   already pretty high, and should be sufficient for all but very 
#   large sites.
# Setting to zero makes the number of threads unlimited.
$maximum_milter_threads = 40;

# This determines how many seconds we will block inbound mail that is
#   from a previously unknown [ip,from,to] triplet.  If it is set to
#   zero, incoming mail associations will be learned, but no deliveries
#   will be tempfailed.  Use a setting of zero with caution, as it
#   will learn spammers as well as legitimate senders.
#   If it is set to a negative number (like -1), then the mail will
#   be tempfailed the first time it is seen, but accepted thereafter.
$delay_mail_secs = 58 * 60;  # 58 Minutes

# This determines how many seconds of life are given to a record that is
#   created from a new mail [ip,from,to] triplet.  Note that the window
#   created by this setting for passing mails is reduced by the amount
#   set for $delay_mail_secs.
# NOTE: See Also: update_record_life and update_record_life_secs.
$auto_record_life_secs = 5 * 3600;  # 5 hours

# True if we should update the life of a record when passing a mail
#   This should generally be enabled, unless the normal lifetime
#   defined by $auto_record_life_secs is already a large value.
$update_record_life = 1;

# How much life (in secs) to give to a record we are updating from an
#   allowed (passed) email.  Only useful if update_record_life is
#   enabled.
# The default is 36 days, which should be enough to handle messages that
#   may only be sent once a month, or on things like the first Monday
#   of the month (which sometimes means 5 weeks).  Plus, we add a day
#   for a delivery buffer.
$update_record_life_secs = 36 * 24 * 3600;

# If you have very large amounts of traffic and want to reduce the number of 
#   queries the db has to handle (and don't need these features), then these
#   wildcard checks can be disabled.  Just set them to 0 if so.
# If both are enabled, relay_ip is considered to take precedence, and is 
#   checked first.  A match there will ignore the rcpt checks.
$check_wildcard_relay_ip = 1;
$check_wildcard_rcpt_to = 1;

# Set this to a nonzero value if you want to wait until after the DATA
#   phase before issuing the TEMPFAIL for delayed messages.  If this
#   is undefined or zero, then messages will be failed after the RCPT
#   phase in the smtp session.  Setting this will cause more traffic,
#   which should be unneccessary, but increases the fault tolerance for
#   some braindead mailers that don't check the status codes except at
#   the end of a message transaction.  It does expose a couple of 
#   liabilities, in that the blocking will only occur if the LAST recipient
#   in a multi-recipient message is currently blocked.  If the last
#   recipient is not blocked, the message will go through, even if some
#   recipients are supposed to be blocked.  Generally discouraged.
$tempfail_messages_after_data_phase = 0;

# Set this to a nonzero value if you wish to do triplet lookups disregarding
#   the last octet of the relay ip.  This helps workaround the case of
#   more than one delivering MTA being used to deliver a particular email.
#   Practically all setups that are that way have the pool of delivering
#   MTA's on the same /24 subnet, so that's what we use.
$do_relay_lookup_by_subnet = 1;

# Set this to 0 if you wish to disable the automatic maintenance of the
#   relay_ip -> relay_name reference table.  Could save an insert 
#   and an update, depending on circumstances.
$enable_relay_name_updates = 1;

# Enable this to do some rudimentary syntax checking on the passed mail_from
#   address.  This may exclude some valid addresses, so we leave it as an
#   option that can be disabled.
$check_envelope_address_format = 1;

# Set this to true if you wish to disable checking and just pass
#   mail when the db connection fails.  Otherwise, we will reject
#   all the mail with a tempfail if we are unable to check the 
#   status for it in the db.
# If you are pretty good about keeping your system well maintained, then it is
#   recommended to leave this disabled.  But if it's possible that the db may go
#   down without anyone noticing for a significant amount of time, then this
#   should probably be enabled.
$pass_mail_when_db_unavail = 0;

# Set this to true if you want to try to track locally originated mail
#   so that replies are not delayed.  This adds a couple queries to the
#   db overhead for each local mail processed, so use with caution.
#   Also considers mail sent from whitelisted IP's and authenticated
#   senders as local in case we are acting as a smarthost for them.
$reverse_mail_tracking = 0;
  
# This controls the lifetime of the automatic reverse whitelisting of
#   senders that we have seen locally originated mail sent to.  Only 
#   used if $reverse_mail_tracking is enabled.
$reverse_mail_life_secs = 4 * 24 * 3600;  # 4 Days

#############################################################
# End of options for use in external config file
#############################################################