Skip to content

Commit

Permalink
DBM: add SDBM_File ODBM_File
Browse files Browse the repository at this point in the history
- add deps
  • Loading branch information
msimerson committed Apr 17, 2024
1 parent 7cd1296 commit ca96e51
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 351 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on:
pull_request:

jobs:

test:
strategy:
matrix:
os: ["ubuntu-latest"]
perl: ["5.16", "5.32"]
fail-fast: false
runs-on: ubuntu-latest
Expand All @@ -23,4 +23,45 @@ jobs:
with:
perl-version: ${{ matrix.perl }}
- run: cpanm --installdeps -n -f .
- run: prove -lv t
- run: prove -lv t


perl_tester:
runs-on: ubuntu-latest

strategy:
matrix:
os: ["ubuntu-latest"]
perl-version:
- "5.16"
- "5.26"
- "5.32"
fail-fast: false

services:
redis:
image: redis
ports:
- 6379:6379

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Perl Modules with cpanm
uses: perl-actions/install-with-cpanm@v1
continue-on-error: true
with:
install: |
Mail::Header
Mail::SPF
Mail::DKIM
Mail::DMARC
Net::IP
Redis
Regexp::Common
Test::More
Test::Output
- run: sudo cpanm --installdeps -n -f .
- run: prove -lv t
10 changes: 9 additions & 1 deletion META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,24 @@ no_index:
- t
- inc
requires:
CDB_File: 0
Data::Dumper: 0
Date::Parse: 0
File::NFSLock: 0
File::Tail: 0
File::Temp: 0
GeoIP2: 0
IO::Socket::SSL: 0
MIME::Base64: 0
Mail::DKIM: 0
Mail::DMARC: 0
Mail::Header: 0
Mail::SPF: 0
Net::DNS: 0.39
Net::IP: 0
Redis: 0
Time::HiRes: 0
Time::TAI64: 0
version: 0.91
Test::More: 0
Test::Output: 0
version: 1.00
13 changes: 7 additions & 6 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ WriteMakefile(
'Test::Output' => 0,
# modules for specific features
'Mail::DKIM' => 0.40,
'Mail::DMARC' => 0,
'File::Tail' => 0, # log/summarize, log/watch
'Time::TAI64' => 0, # log2sql
# 'DBI' => 0, # auth_vpopmail_sql and
# 'DBD::mysql' => 0, # log2sql
# 'DBIx::Simple' => 0, # log2sql
# modules that cause Travis build tests to fail
# 'Mail::SpamAssassin' => 0,
# 'GeoIP2' => 2,
# 'Geo::IP' => 1,
# 'Math::Complex' => 0, # geodesic distance in Geo::IP
# 'PerlIO::gzip' => 0, # gunzip GeoIP databases
# 'Mail::SPF' => 0,
'Mail::SpamAssassin' => 0,
'GeoIP2' => 2,
'Math::Complex' => 0, # geodesic distance in Geo::IP
'PerlIO::gzip' => 0, # gunzip GeoIP databases
'Redis' => 2,
'Mail::SPF' => 0,
},
ABSTRACT => 'Flexible smtpd daemon written in Perl',
AUTHOR => 'Ask Bjoern Hansen <[email protected]>',
Expand Down
3 changes: 0 additions & 3 deletions bin/install_deps.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
my $apps = [
{ app => 'daemontools', info => { } },
{ app => 'ucspi-tcp', info => { } },
# { app => 'dspam', info => { } },
# { app => 'mysql-server-55', info => { port => 'mysql55-server', dport=>'mysql5', yum =>'mysql-server'} },
# { app => 'apache22' , info => { port => 'apache22', dport=>'', yum => 'httpd' } },
];

$EUID == 0 or die "You will have better luck if you run me as root.\n";
Expand Down
4 changes: 2 additions & 2 deletions config.sample/plugins
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ hosts_allow
# connection / informational plugins
#connection_time
#karma penalty_box 1 reject naughty
ident/geoip
#ident/geoip
#ident/p0f /tmp/.p0f_socket version 3
fcrdns

Expand Down Expand Up @@ -90,7 +90,7 @@ spamassassin reject 12
# spamassassin reject 20 munge_subject_threshold 10

# dspam must run after spamassassin for the learn_from_sa feature to work
dspam autolearn spamassassin reject 0.95
#dspam autolearn spamassassin reject 0.95

# run the clamav virus checking plugin (max size in Kb)
# virus/clamav
Expand Down
2 changes: 1 addition & 1 deletion lib/Qpsmtpd/DB/File/DBM.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use warnings;

use parent 'Qpsmtpd::DB';

BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File) }
BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File SDBM_File ODBM_File) }
use AnyDBM_File;
use Fcntl qw(:DEFAULT :flock LOCK_EX LOCK_NB);

Expand Down
8 changes: 4 additions & 4 deletions plugins/ident/geoip
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ sub load_geoip1 {

$self->open_geoip_db();

# Note that opening the GeoIP DB only in register has caused problems before:
# https://github.com/smtpd/qpsmtpd/commit/29ea9516806e9a8ca6519fcf987dbd684793ebdd#plugins/ident/geoip
# Opening the DB anew for every connection is horribly inefficient.
# Instead, attempt to reopen upon connect if the DB connection fails.
# Note that opening the GeoIP DB only in register has caused problems before:
# https://github.com/smtpd/qpsmtpd/commit/29ea9516806e9a8ca6519fcf987dbd684793ebdd#plugins/ident/geoip
# Opening the DB anew for every connection is horribly inefficient.
# Instead, attempt to reopen upon connect if the DB connection fails.
$self->init_my_country_code();

$self->register_hook('connect', 'geoip_lookup');
Expand Down
8 changes: 4 additions & 4 deletions t/config/plugins
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ content_log
hosts_allow

# information plugins
ident/geoip
#ident/geoip
ident/p0f /tmp/.p0f_socket version 3
connection_time
fcrdns
Expand Down Expand Up @@ -83,11 +83,11 @@ spamassassin
# spamassassin reject_threshold 20 munge_subject_threshold 10

# dspam must run after spamassassin for the learn_from_sa feature to work
dspam learn_from_sa 7 reject 1
#dspam learn_from_sa 7 reject 1

# run the clamav virus checking plugin
virus/clamav
virus/clamdscan
#virus/clamav
#virus/clamdscan

# You must enable a queue plugin - see the options in plugins/queue/ - for example:

Expand Down
46 changes: 0 additions & 46 deletions t/plugin_tests/dmarc

This file was deleted.

96 changes: 0 additions & 96 deletions t/plugin_tests/dspam

This file was deleted.

4 changes: 2 additions & 2 deletions t/plugin_tests/helo
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ sub test_invalid_localhost {
my $self = shift;

my ($err, $why);
foreach my $ip ( undef, '', '192.0.99.5' ) {
foreach my $ip ( '', '192.0.99.5' ) {
$self->qp->connection->remote_ip(undef);
($err, $why) = $self->invalid_localhost('localhost' );
($err, $why) = $self->invalid_localhost('localhost');
ok($err, "host: localhost, remote ip ($ip)");

$self->qp->connection->remote_ip(undef);
Expand Down
Loading

0 comments on commit ca96e51

Please sign in to comment.