#!/usr/bin/perl

use strict;
use Mail::POPRelay;


# main
# ---------
my %options = (
	mailRelayPeriod    => 86400, # in seconds

	# redhat 7.0 w/ access db
	mailRelayFile      => '/etc/mail/access',

	# redhat 7.0 w/o access db
#	mailRelayFile      => '/etc/mail/ip_allow',
#	mailProgramRestart => 1,

	# debian
#	mailRelayFile      => '/etc/mail/relay-domains',
#	mailProgramRestart => 1,
);

my $popRelay = new Mail::POPRelay(\%options);
$popRelay->cleanRelayDirectory();
$popRelay->generateRelayFile();


__END__


=head1 NAME

poprelay_cleanup - Perform Cleanup on the Mail Relay Directory


=head1 SYNOPSIS

./poprelay_cleanup


=head1 DESCRIPTION

Run this script in a crontab to cleanup the mail relay directory
and perform other necessary actions such as restarting the mail server and/or
recreating the access database.  Base the trigger interval on your
mail relay period.


=head1 DIAGNOSTICS

die().  Will write to syslog eventually.


=head1 AUTHOR

Keith Hoerling <keith@hoerling.com>


=head1 SEE ALSO

Mail::POPRelay::Daemon(3pm), Mail::POPRelay(3pm), poprelay_cleanup(1p), poprelay_ipop3d(1p), cron(8), crontab(5).

=cut

# $Id: poprelay_cleanup,v 1.1.1.1 2001/10/16 23:45:25 keith Exp $
