view release on metacpan or search on metacpan
lib/Mail/Decency/ContentFilter/Core.pm view on Meta::CPAN
=cut
has timeout => ( is => 'rw', isa => 'Int', default => 30 );
=head2 ArrayRef[Str] : Int
For easy module initialization, developers can set array of the config params. They will be set if they are defined.
# do this
has config_params => ( is => 'ro', isa => 'ArrayRef[Str]', default => sub { [ qw/ something / ] } );
# an it will be initialized
$self->something( $self->config->{ something } )
if defined $self->config->{ something };
=cut
has config_params => ( is => 'ro', isa => 'ArrayRef[Str]', predicate => 'has_config_params' );
=head1 METHODS
=head2 init
=cut
sub init {
my ( $self ) = @_;
lib/Mail/Decency/Core/Stats.pm view on Meta::CPAN
'hour',
'day',
'week',
'month',
'year',
]
} );
has stats_time_zone => ( is => 'ro', isa => 'DateTime::TimeZone', default => sub {
DateTime::TimeZone::Local->TimeZone();
} );
has schema_definition => ( is => 'ro', isa => 'HashRef[HashRef]' );
=head1 MODIFIER
=head2 init
Update schema definition of this module
=cut
lib/Mail/Decency/Helper/Logger.pm view on Meta::CPAN
Helper modules for Decency policies or content filters
=cut
has prefix => ( is => 'rw', isa => 'Str', default => '' );
has syslog => ( is => 'rw', isa => 'Bool' );
has console => ( is => 'rw', isa => 'Bool' );
has directory => ( is => 'rw', isa => 'Str' );
has log_level => ( is => 'rw', default => 0 );
has disabled => ( is => 'rw', isa => 'Bool', default => 0 );
has _log_level => ( is => 'ro', isa => 'HashRef', default => sub { {
error => 0,
info => 1,
verbose => 2,
debug0 => 3,
debug1 => 4,
debug2 => 5,
debug3 => 6,
} } );
has _log_file_handles => ( is => 'rw', isa => 'HashRef', default => sub { {} } );
has _log_file_inodes => ( is => 'rw', isa => 'HashRef', default => sub { {} } );
lib/Mail/Decency/LogParser/Aggregator.pm view on Meta::CPAN
Integer (timestamp) .. last time updated
=back
=back
=back
=cut
has schema_definition => ( is => 'ro', isa => 'HashRef[HashRef]', default => sub {
{
aggregator => {
ip => {
ip => [ varchar => 39 ],
type => [ varchar => 25 ], # bounced, sent, reject
interval => [ varchar => 25 ],
format => [ varchar => 25 ],
counter => 'integer',
transfer => 'integer',
last_update => 'integer',
lib/Mail/Decency/LogParser/GeoSource.pm view on Meta::CPAN
=cut
has enable_per_recipient => ( is => 'rw', isa => 'Bool', default => 0 );
=head2 schema_definition : HashRef[HashRef]
Schema for database
=cut
has schema_definition => ( is => 'ro', isa => 'HashRef[HashRef]', default => sub {
{
geo => {
source => {
from_domain => [ varchar => 255 ],
to_domain => [ varchar => 255 ],
country => [ varchar => 2 ],
type => [ varchar => 25 ],
interval => [ varchar => 25 ],
counter => 'integer',
last_update => 'integer',
lib/Mail/Decency/Policy/CBL.pm view on Meta::CPAN
sender_address varchar( 255 )
);
CREATE UNIQUE INDEX cbl_addresses_uk ON cbl_addresses( recipient_domain, sender_address );
=cut
=head1 CLASS ATTRIBUTES
=cut
has schema_definition => ( is => 'ro', isa => 'HashRef[HashRef]', default => sub {
{
cbl => {
ips => {
recipient_domain => [ varchar => 255 ],
client_address => [ varchar => 39 ],
-unique => [ 'recipient_domain', 'client_address' ]
},
domains => {
recipient_domain => [ varchar => 255 ],
sender_domain => [ varchar => 255 ],
lib/Mail/Decency/Policy/CWL.pm view on Meta::CPAN
sender_address varchar( 255 )
);
CREATE UNIQUE INDEX cwl_addresses_uk ON cwl_addresses( recipient_domain, sender_address );
=cut
=head1 CLASS ATTRIBUTES
=cut
has schema_definition => ( is => 'ro', isa => 'HashRef[HashRef]', default => sub {
{
cwl => {
ips => {
recipient_domain => [ varchar => 255 ],
client_address => [ varchar => 39 ],
-unique => [ 'recipient_domain', 'client_address' ]
},
domains => {
recipient_domain => [ varchar => 255 ],
sender_domain => [ varchar => 255 ],
lib/Mail/Decency/Policy/GeoWeight.pm view on Meta::CPAN
=cut
has geo_ip => ( is => 'ro', isa => 'Geo::IP', default => sub { Geo::IP->new( GEOIP_STANDARD ) } );
=head2 schema_definition
Database schema
=cut
has schema_definition => ( is => 'ro', isa => 'HashRef[HashRef]', default => sub {
{
geo => {
stats => {
country => [ varchar => 2 ],
interval => [ varchar => 25 ],
counter => 'integer',
-unique => [ 'country', 'interval' ]
},
}
};
lib/Mail/Decency/Policy/Greylist.pm view on Meta::CPAN
=cut
has scoring_aware => ( is => 'rw', isa => 'Bool', default => 0 );
=head2 schema_definition : HashRef[HashRef]
Database schema
=cut
has schema_definition => ( is => 'ro', isa => 'HashRef[HashRef]', default => sub {
{
greylist => {
client_address => {
client_address => [ varchar => 39 ],
counter => 'integer',
last_seen => 'integer',
-unique => [ 'client_address' ]
},
sender_domain => {
sender_domain => [ varchar => 255 ],
lib/Mail/Decency/Policy/Honeypot.pm view on Meta::CPAN
=cut
has pass_for_collection => ( is => 'rw', isa => 'Bool', default => 0 );
=head2 schema_definition : HashRef[Bool]
List of addresses used as honeyport targets
=cut
has schema_definition => ( is => 'ro', isa => 'HashRef[HashRef]', default => sub {
{
honeypot => {
addresses => {
client_address => [ varchar => 39 ],
created => 'integer',
-unique => [ 'client_address' ],
-index => [ 'created' ]
},
}
};
lib/Mail/Decency/Policy/Throttle.pm view on Meta::CPAN
=cut
has require_sasl_username => ( is => 'rw', isa => 'Bool', default => 0 );
=head2 schema_definition
Database ..
=cut
has schema_definition => ( is => 'ro', isa => 'HashRef[HashRef]', default => sub {
{
throttle => {
client_address => {
client_address => [ varchar => 39 ],
interval => 'integer',
maximum => 'integer',
account => [ varchar => 100 ],
-unique => [ 'client_address', 'interval' ]
},
sender_domain => {