Mail-MtPolicyd

 view release on metacpan or  search on metacpan

lib/Mail/MtPolicyd/Plugin/Accounting.pm  view on Meta::CPAN

    my $metrics = {};
	my $rcpt_cnt = defined $recipient_count ? $recipient_count : 1;
	$metrics->{'size'} = defined $size ? $size : 0;
    $metrics->{'count'} = 1;
    $metrics->{'count_rcpt'} = $rcpt_cnt ? $rcpt_cnt : 1;
    $metrics->{'size_rcpt'} = $rcpt_cnt ? $size * $rcpt_cnt : $size;

    return( $metrics );
}

sub update_accounting {
    my ( $self, $field, $key, $metrics ) = @_;

    eval {
        $self->update_accounting_row($field, $key, $metrics);
    };
    if( $@ =~ /^accounting row does not exist/ ) {
        $self->insert_accounting_row($field, $key, $metrics);
    } elsif( $@ ) {
        die( $@ );
    }

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

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