Mail-DMARC
view release on metacpan or search on metacpan
lib/Mail/DMARC/Base.pm view on Meta::CPAN
# Check for wildcard match
my @labels = split /\./, $zone;
if ( @labels > 1 ) {
my $wildcard = join '.', '*', (@labels)[ 1 .. scalar(@labels) - 1 ];
return 1 if $public_suffixes->{$wildcard};
}
return 0;
}
sub update_psl_file( $self, $dryrun = undef ) {
my $psl_file = $self->find_psl_file();
die "No Public Suffix List file found\n" if ( !$psl_file );
die "Public suffix list file $psl_file not found\n" if ( !-f $psl_file );
die "Cannot write to Public Suffix List file $psl_file\n" if ( !-w $psl_file );
my $url = 'https://publicsuffix.org/list/effective_tld_names.dat';
if ($dryrun) {
print
"Will attempt to update the Public Suffix List file at $psl_file (dryrun mode)\n";
lib/Mail/DMARC/Report/Store/SQL/Grammars/MySQL.pm view on Meta::CPAN
sub insert_into( $self, $table, $cols ) {
my $columns = join ', ', @$cols;
return "INSERT INTO $table ($columns) VALUES (??)";
}
sub replace_into( $self, $table, $cols ) {
my $columns = join ', ', @$cols;
return "REPLACE INTO $table ($columns) VALUES (??)";
}
sub update( $self, $table, $cols ) {
my $columns = join( ' = ?, ', @$cols ) . ' = ?';
return "UPDATE $table SET $columns WHERE 1=1";
}
sub delete_from( $self, $table ) {
return "DELETE FROM $table WHERE 1=1";
}
1;
lib/Mail/DMARC/Report/Store/SQL/Grammars/PostgreSQL.pm view on Meta::CPAN
$colStr = join( ', ', @cols );
}
return "SELECT $colStr FROM \"$table\" WHERE 1=1";
}
sub insert_into( $self, $table, $cols ) {
my $columns = '"' . join( '", "', @$cols ) . '"';
return "INSERT INTO \"$table\" ($columns) VALUES (??)";
}
sub update( $self, $table, $cols ) {
my $columns = '"' . join( '" = ?, "', @$cols ) . '" = ?';
return "UPDATE \"$table\" SET $columns WHERE 1=1";
}
sub delete_from( $self, $table ) {
return "DELETE FROM \"$table\" WHERE 1=1";
}
sub replace_into( $self, $table, $cols ) {
my $insertColumns = '"' . join( '", "', @$cols ) . '"';
lib/Mail/DMARC/Report/Store/SQL/Grammars/SQLite.pm view on Meta::CPAN
sub select_from( $self, $columns, $table ) {
my $colStr = join( ', ', @$columns );
return "SELECT $colStr FROM $table WHERE 1=1";
}
sub insert_into( $self, $table, $cols ) {
my $columns = join ', ', @$cols;
return "INSERT INTO $table ($columns) VALUES (??)";
}
sub update( $self, $table, $cols ) {
my $columns = join( ' = ?, ', @$cols ) . ' = ?';
return "UPDATE $table SET $columns WHERE 1=1";
}
sub replace_into( $self, $table, $cols ) {
my $columns = join ', ', @$cols;
return "REPLACE INTO $table ($columns) VALUES (??)";
}
sub delete_from( $self, $table ) {
( run in 1.016 second using v1.01-cache-2.11-cpan-bbe5e583499 )