Courier-Filter

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN

  + The switch to Mail::SPF and Net::Address::IP::Local brings IPv6 support!
  ! Deprecated the "unknown" and "error" SPF result codes in favor of the new
    "permerror" and "temperror" ones defined in RFC 4408.  The old result codes
    induce a warning when specified in the "match_on" option but are still
    supported for now.
  * Ignore messages with an empty identity of the configured scope (esp. empty
    MAIL FROM, i.e., bounces) or with an identity in the form of an IP address
    literal ("[<ip-address>]").

  SpamAssassin filter module:
  + Added a "prefs_file" option for easy configuration of Courier::Filter
    specific SpamAssassin preferences.  SpamAssassin now will not read any
    preferences besides its default configuration files unless this option is
    specified.
  * Eliminated memory leak by properly cleaning up Mail::SpamAssassin::Message
    objects.

  BlankBody filter module:
  + Added for matching blank message bodies (a stupid spammer symptom).

  FakeDate filter module:

debian/changelog  view on Meta::CPAN

  + The switch to Mail::SPF and Net::Address::IP::Local brings IPv6 support!
  ! Deprecated the "unknown" and "error" SPF result codes in favor of the new
    "permerror" and "temperror" ones defined in RFC 4408.  The old result codes
    induce a warning when specified in the "match_on" option but are still
    supported for now.
  * Ignore messages with an empty identity of the configured scope (esp. empty
    MAIL FROM, i.e., bounces) or with an identity in the form of an IP address
    literal ("[<ip-address>]").

  SpamAssassin filter module:
  + Added a "prefs_file" option for easy configuration of Courier::Filter
    specific SpamAssassin preferences.  SpamAssassin now will not read any
    preferences besides its default configuration files unless this option is
    specified.
  * Eliminated memory leak by properly cleaning up Mail::SpamAssassin::Message
    objects.

  BlankBody filter module:
  + Added for matching blank message bodies (a stupid spammer symptom).

  FakeDate filter module:

examples/courier-filter-perl.conf.full  view on Meta::CPAN

        # Filter messages with blank bodies:
        Courier::Filter::Module::BlankBody->new(
            trusting    => TRUE
        ),
        
        # ClamAV daemon filter:
        Courier::Filter::Module::ClamAVd->new(),
        
        # SpamAssassin filter:
        Courier::Filter::Module::SpamAssassin->new(
            prefs_file  => '/etc/courier/filters/courier-filter-spamassassin.cf'
        ),
        
        # Reject various virm:
        Courier::Filter::Module::Parts->new(
            max_message_size    => 1024*1024,
            max_part_size       =>  200*1024,
            views       => ['raw', 'zip'],
            signatures  => [
                {
                    file_name   => qr/\.(com|exe|lnk|pif|scr|vbs)$/i,

lib/Courier/Filter/Module/SpamAssassin.pm  view on Meta::CPAN

use Mail::SpamAssassin;

use constant TRUE   => (0 == 0);
use constant FALSE  => not TRUE;

=head1 SYNOPSIS

    use Courier::Filter::Module::SpamAssassin;

    my $module = Courier::Filter::Module::SpamAssassin->new(
        prefs_file  => '/etc/courier/filters/courier-filter-spamassassin.cf',
        sa_options  => {
            # any Mail::SpamAssassin options
        },
        
        logger      => $logger,
        inverse     => 0,
        trusting    => 0,
        testing     => 0,
        debugging   => 0
    );

lib/Courier/Filter/Module/SpamAssassin.pm  view on Meta::CPAN


=item B<new(%options)>: returns I<Courier::Filter::Module::SpamAssassin>

Creates a new B<SpamAssassin> filter module.

%options is a list of key/value pairs representing any of the following
options:

=over

=item B<prefs_file>

The path of a SpamAssassin preferences file.  If this option is specified, its
value is passed to L<< the Mail::SpamAssassin constructor's C<userprefs_filename>
option | Mail::SpamAssassin/userprefs_filename >>.  If B<undef>, SpamAssassin
is instructed not to read any preferences besides its default configuration
files.  Defaults to B<undef>.

=item B<sa_options>

A hash-ref specifying options for the Mail::SpamAssassin object used by this
filter module.  See L<Mail::SpamAssassin/new> for the supported options.

=back

All options of the B<Courier::Filter::Module> constructor are also supported.
Please see L<Courier::Filter::Module/new> for their descriptions.

=cut

sub new {
    my ($class, %options) = @_;
    
    my $use_user_prefs = defined($options{prefs_file});
    $options{sa_options}->{userprefs_filename} = $options{prefs_file};

    my $spamassassin = Mail::SpamAssassin->new( $options{sa_options} );
    $spamassassin->compile_now($use_user_prefs);
    
    my $self = $class->SUPER::new(
        %options,
        spamassassin    => $spamassassin
    );
    
    return $self;
}

=back



( run in 0.643 second using v1.01-cache-2.11-cpan-2aafcb1aa8b )