Mail-Decency

 view release on metacpan or  search on metacpan

lib/Mail/Decency/Core/SessionItem/ContentFilter.pm  view on Meta::CPAN


has verify_ttl => ( is => 'rw', isa => 'Int', predicate => 'has_verify_ttl' );


=head2 update_store 

Write store YAML file

=cut

sub update_store {
    my ( $self ) = @_;
    open my $fh, '>', $self->store
        or die "Cannot open store file ". $self->store. " for write: $!";
    my %create = ();
    $create{ from } = $self->from if $self->from;
    $create{ to } = $self->to if $self->to;
    print $fh YAML::Dump( {
        file => $self->file,
        size => $self->file_size,
        %create

lib/Mail/Decency/Core/SessionItem/Policy.pm  view on Meta::CPAN

        message      => $self->message,
    };
}

=head2 update_from_cache

Updates current session from cached session

=cut

sub update_from_cache {
    my ( $self, $hash_ref ) = @_;
    
    $self->spam_score( $self->spam_score + $hash_ref->{ spam_score } )
        if $hash_ref->{ spam_score };
    
    push @{ $self->spam_details }, @{ $hash_ref->{ spam_details } }
        if $hash_ref->{ spam_details };
    
    push @{ $self->spam_details }, @{ $hash_ref->{ message } }
        if $hash_ref->{ message };

lib/Mail/Decency/Core/Stats.pm  view on Meta::CPAN

    }
};


=head1 METHODS

=head2 update_stats

=cut

sub update_stats {
    my ( $self, $module, $type, $weight_diff, $runtime ) = @_;
    
    print Dumper [ $type => $weight_diff, $runtime ];
    
    my $now = DateTime->now( time_zone => $self->stats_time_zone );
    my @intervals = map {
        my $iv = $now->clone->truncate( to => $_ );
        [ $_, $iv->epoch ];
    } grep {
        /^(hour|day|week|month|year)$/

lib/Mail/Decency/Helper/Database.pm  view on Meta::CPAN


=cut


=head2 update_data

Transforms flat (scalar) values into { data => $value } hashrefs

=cut

sub update_data {
    my ( $self, $data ) = @_;
    return $data if ref( $data );
    return { data => $data };
}

=head2 parse_data $data_ref

Transforms hashref values in an array context from { value => $value } to ( $value )

In array-context, it will return the content of the "data" field, if any

lib/Mail/Decency/Helper/Database/MongoDB.pm  view on Meta::CPAN

    }
    
    return 1;
}


=head2 update_query

=cut

sub update_query {
    my ( $self, $ref ) = @_;
    $ref = $self->next::method( $ref );
    
    my %op_match = (
        '>'  => '$gt',
        '<'  => '$lt',
        '>=' => '$gte',
        '<=' => '$lte',
        '!=' => '$ne',
    );

lib/Mail/Decency/Policy/Greylist.pm  view on Meta::CPAN

    }
}


=head2 update_pass

Add counters to pass databases

=cut

sub update_pass {
    my ( $self, $attrs_ref ) = @_;
    
    my $pass = 0;
    
    # use host and domain whitelisting only if we don't care for hosting
    #   or the score of the mail looks like hame
    #   remark: in context with SPF beforehand we will not add sender
    #   domains or hosts to the whitelist if the look somewhat bogus
    if ( ! $self->scoring_aware || $self->session_data->spam_score >= 0 ) {
        

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.578 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )