Mailing List Archive

mail::dmarc report storage fails
# log

Mar 23 05:54:55 localhost spamd[4127]: DMARC: report could not be saved:
DBI connect('dbname=dmarc_reports.sqlite','',...) failed: unable to open
database file at
/usr/lib64/perl5/vendor_perl/5.36/Mail/DMARC/Report/Store/SQL.pm line
551.

# ini file in mail::dmarc

[report_store]
backend = SQL
dsn = dbi:Pg:dbname=dmarc;host=127.0.0.1;port=5432;
user = user
pass = pass
auto_save = 0

mail::dmarc do work with postgres, but the report in spamassassin fails

can it be solved to just ignore the ini file, and do dbi: as other in
spamassassin already does ?, or is mail::dmarc not tested well here ?
Re: mail::dmarc report storage fails [ In reply to ]
On 3/26/23 00:33, Benny Pedersen wrote:
>
> # log
>
> Mar 23 05:54:55 localhost spamd[4127]: DMARC: report could not be saved: DBI connect('dbname=dmarc_reports.sqlite','',...) failed: unable to open database file at /usr/lib64/perl5/vendor_perl/5.36/Mail/DMARC/Report/Store/SQL.pm line 551.
>
> # ini file in mail::dmarc
>
> [report_store]
> backend = SQL
> dsn = dbi:Pg:dbname=dmarc;host=127.0.0.1;port=5432;
> user = user
> pass = pass
> auto_save = 0
>
> mail::dmarc do work with postgres, but the report in spamassassin fails
>
> can it be solved to just ignore the ini file, and do dbi: as other in spamassassin already does ?, or is mail::dmarc not tested well here ?
DMARC reports are working with MySQL, is this one-liner reading the correct file on your setup ?
perl -e 'use Mail::DMARC; use Data::Dumper; my $ds = new Mail::DMARC; print Dumper($ds->config);'

Giovanni
Re: mail::dmarc report storage fails [ In reply to ]
giovanni@paclan.it skrev den 2023-03-27 10:06:
> On 3/26/23 00:33, Benny Pedersen wrote:
>>
>> # log
>>
>> Mar 23 05:54:55 localhost spamd[4127]: DMARC: report could not be
>> saved: DBI connect('dbname=dmarc_reports.sqlite','',...) failed:
>> unable to open database file at
>> /usr/lib64/perl5/vendor_perl/5.36/Mail/DMARC/Report/Store/SQL.pm line
>> 551.
>>
>> # ini file in mail::dmarc
>>
>> [report_store]
>> backend = SQL
>> dsn = dbi:Pg:dbname=dmarc;host=127.0.0.1;port=5432;
>> user = user
>> pass = pass
>> auto_save = 0
>>
>> mail::dmarc do work with postgres, but the report in spamassassin
>> fails
>>
>> can it be solved to just ignore the ini file, and do dbi: as other in
>> spamassassin already does ?, or is mail::dmarc not tested well here ?
> DMARC reports are working with MySQL, is this one-liner reading the
> correct file on your setup ?
> perl -e 'use Mail::DMARC; use Data::Dumper; my $ds = new Mail::DMARC;
> print Dumper($ds->config);'

mx ~ # perl -e 'use Mail::DMARC; use Data::Dumper; my $ds = new
Mail::DMARC; print Dumper($ds->config);'
$VAR1 = bless( {
'organization' => {
'extra_contact_info' =>
'http://www.example.com/dmarc-policy/',
'domain' => 'example.com',
'email' => 'noreply@example.com',
'org_name' => 'My Great Company'
},
'smtp' => {
'cc' => 'set.this@for.a.while.example.com',
'smartuser' => '',
'hostname' => 'mail.example.com',
'smarthost' => '',
'whitelist' =>
'/path/to/etc/dmarc_whitelist',
'smartpass' => ''
},
'report_sign' => {
'domain' => 'signer.example.com',
'algorithm' => 'rsa-sha1',
'method' => 'relaxed',
'keyfile' => '/path/to/private.key',
'selector' => 'dkim'
},
'report_store' => {
'auto_save' => '0',
'backend' => 'SQL',
'pass' => '',
'user' => '',
'dsn' =>
'dbi:SQLite:dbname=dmarc_reports.sqlite'
},
'dns' => {
'public_suffix_list' =>
'share/public_suffix_list',
'timeout' => '5'
},
'imap' => {
'f_done' => 'dmarc.forensic',
'folder' => 'dmarc',
'pass' => '',
'server' => 'mail.example.com',
'user' => '',
'a_done' => 'dmarc.aggregate'
},
'http' => {
'port' => '8080'
},
'dmarc' => {
'backend' => 'perl'
},
'https' => {
'port' => '8443',
'ssl_key' => '',
'ssl_crt' => ''
},
'report_sending' => {}
}, 'Config::Tiny' );
mx ~ #

seems no

mx ~ # eix --nocolor -e Mail-DMARC
[I] dev-perl/Mail-DMARC
Available versions: 1.202.109.270-r1^t (~)1.202.302.150^t {minimal
test}
Installed versions: 1.202.302.150^t(22:56:24 03/20/23)(-minimal
-test)
Homepage: https://metacpan.org/release/Mail-DMARC
Description: Perl implementation of DMARC

>
> Giovanni
Re: mail::dmarc report storage fails [ In reply to ]
On 3/27/23 10:20, Benny Pedersen wrote:
> giovanni@paclan.it skrev den 2023-03-27 10:06:
>> On 3/26/23 00:33, Benny Pedersen wrote:
>>>
>>> # log
>>>
>>> Mar 23 05:54:55 localhost spamd[4127]: DMARC: report could not be saved: DBI connect('dbname=dmarc_reports.sqlite','',...) failed: unable to open database file at /usr/lib64/perl5/vendor_perl/5.36/Mail/DMARC/Report/Store/SQL.pm line 551.
>>>
>>> # ini file in mail::dmarc
>>>
>>> [report_store]
>>> backend = SQL
>>> dsn = dbi:Pg:dbname=dmarc;host=127.0.0.1;port=5432;
>>> user = user
>>> pass = pass
>>> auto_save = 0
>>>
>>> mail::dmarc do work with postgres, but the report in spamassassin fails
>>>
>>> can it be solved to just ignore the ini file, and do dbi: as other in spamassassin already does ?, or is mail::dmarc not tested well here ?
>> DMARC reports are working with MySQL, is this one-liner reading the
>> correct file on your setup ?
>> perl -e 'use Mail::DMARC; use Data::Dumper; my $ds = new Mail::DMARC;
>> print Dumper($ds->config);'
>
> mx ~ # perl -e 'use Mail::DMARC; use Data::Dumper; my $ds = new Mail::DMARC; print Dumper($ds->config);'
> $VAR1 = bless( {
>                  'organization' => {
>                                      'extra_contact_info' => 'http://www.example.com/dmarc-policy/',
[...]
> mx ~ #
>
> seems no
>
File read by Mail::DMARC is /etc/mail-dmarc.ini, do you have that file ?
Otherwise Mail::DMARC will search the same file into /usr/share.
Regards
Giovanni


> mx ~ # eix --nocolor -e Mail-DMARC
> [I] dev-perl/Mail-DMARC
>      Available versions:  1.202.109.270-r1^t (~)1.202.302.150^t {minimal test}
>      Installed versions:  1.202.302.150^t(22:56:24 03/20/23)(-minimal -test)
>      Homepage:            https://metacpan.org/release/Mail-DMARC
>      Description:         Perl implementation of DMARC
>
>>
>>  Giovanni
Re: mail::dmarc report storage fails [ In reply to ]
giovanni@paclan.it skrev den 2023-03-27 10:43:

> File read by Mail::DMARC is /etc/mail-dmarc.ini, do you have that file
> ?
> Otherwise Mail::DMARC will search the same file into /usr/share.

ah, in gentoo i have /etc/dmarc with have all config files and data for
mail-dmarc

if possible to define path for mail-dmarc.ini in plugin, then remove
dmarc_save_reports in dmarc plugin, then let it use auto-save in the ini
file ?

will this work ?

ifplugin Mail::SpamAssassin::Plugin::DMARC
path = /etc/dmarc/mail-dmarc.ini
endif

for upstream its more specific path to ini file
Re: mail::dmarc report storage fails [ In reply to ]
On 3/27/23 11:00, Benny Pedersen wrote:
> giovanni@paclan.it skrev den 2023-03-27 10:43:
>
>> File read by Mail::DMARC is /etc/mail-dmarc.ini, do you have that file ?
>> Otherwise Mail::DMARC will search the same file into /usr/share.
>
> ah, in gentoo i have /etc/dmarc with have all config files and data for mail-dmarc
>
> if possible to define path for mail-dmarc.ini in plugin, then remove dmarc_save_reports in dmarc plugin, then let it use auto-save in the ini file ?
>
> will this work ?
>
> ifplugin Mail::SpamAssassin::Plugin::DMARC
>   path = /etc/dmarc/mail-dmarc.ini
> endif
>
> for upstream its more specific path to ini file
This might be possible, not sure if it's worth doing it, could you open a request on Bugzilla (https://bz.apache.org/SpamAssassin/) please ?
Thanks
Giovanni