MTA Zimbra : SpamAssassin | Mail DMARC (Filter) + Email Reporting

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
User avatar
LAB3W.ORJ
Advanced member
Advanced member
Posts: 76
Joined: Sat Feb 19, 2022 3:16 pm
Location: InterNet
ZCS/ZD Version: 8.8.15.GA.4179.UBUNTU20.64 FOSS P44
Contact:

MTA Zimbra : SpamAssassin | Mail DMARC (Filter) + Email Reporting

Post by LAB3W.ORJ »

Hy,

I'm trying to add the Perl module :

Code: Select all

Mail::DMARC
https://metacpan.org/dist/Mail-DMARC to my Zimbra Open Source MTA server / so in this directory : /opt/zimbra/common/lib/perl5/Mail/DMARC/

Code: Select all

zimbra@mail:~ # zmcontrol -v
Release 8.8.15.GA.4179.UBUNTU20.64 UBUNTU20_64 FOSS edition, Patch 8.8.15_P39.

Code: Select all

zimbra@mail:~ # uname -a
Linux mail 5.4.0-149-generic #166-Ubuntu SMP Tue Apr 18 16:51:45 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
First in the file /opt/zimbra/.bashrc, after these lines :

Code: Select all

[...]
eval `/usr/bin/perl -V:archname`
PERLLIB=/opt/zimbra/common/lib/perl5/$archname:/opt/zimbra/common/lib/perl5
export PERLLIB

PERL5LIB=$PERLLIB
export PERL5LIB
[...]
I added these environment variables to the /opt/zimbra/.bashrc so that the installation of the modules installs in the right place.

Good configuration to add to .bashrc file (modification Sunday 4 Juin 2023 at 19h p.m GMT+2) :

Code: Select all

PERL_LOCAL_LIB_ROOT=$PERL5LIB; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/opt/zimbra/common\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/opt/zimbra/common"; export PERL_MM_OPT;
I unfixed the rights on the directories /opt/zimbra/common/lib/perl5 (To put back the right rights/users → Fix the Zimbra Collaboration Permissions: /opt/zimbra/libexec/zmfixperms) :

Code: Select all

/etc/init.d/zimbra stop
chown -R zimbra:zimbra /opt/zimbra
To compile without error :

Code: Select all

apt install make build-essential gcc
Then I launched the installation of the Perl module Mail::DMARC in this way :

Code: Select all

cpan -i Mail::DMARC
But it doesn't work - I have dependencies errors → List of dependencies on the page Mail::DMARC

The Perl version is :

Code: Select all

zimbra@mail:~ # which perl
/usr/bin/perl
zimbra@mail:~ # perl -v
This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-multi
(with 57 registered patches, see perl -V for more detail)

Copyright 1987-2019, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Code: Select all

zimbra@mail:~ $ perl -V
[....]
  Compiled at May 23 2023 17:17:48
  %ENV:
    PERL5LIB="/opt/zimbra/common/lib/perl5/x86_64-linux-gnu-thread-multi:/opt/zimbra/common/lib/perl5"
    PERLLIB="/opt/zimbra/common/lib/perl5/x86_64-linux-gnu-thread-multi:/opt/zimbra/common/lib/perl5"
    PERL_LOCAL_LIB_ROOT="/opt/zimbra/common/lib/perl5/x86_64-linux-gnu-thread-multi:/opt/zimbra/common/lib/perl5"
    PERL_MB_OPT="--install_base "/opt/zimbra/common""
    PERL_MM_OPT="INSTALL_BASE=/opt/zimbra/common"
  @INC:
    /opt/zimbra/common/lib/perl5/x86_64-linux-gnu-thread-multi
    /opt/zimbra/common/lib/perl5/x86_64-linux-gnu-thread-multi
    /opt/zimbra/common/lib/perl5
    /etc/perl
    /usr/local/lib/x86_64-linux-gnu/perl/5.30.0
    /usr/local/share/perl/5.30.0
    /usr/lib/x86_64-linux-gnu/perl5/5.30
    /usr/share/perl5
    /usr/lib/x86_64-linux-gnu/perl/5.30
    /usr/share/perl/5.30
    /usr/local/lib/site_perl
    /usr/lib/x86_64-linux-gnu/perl-base
Also, on Perl modules for example :

Code: Select all

cpan -i IO::Compress::Gzip --> Error:  Compress::Raw::Zlib version 2.204 required--this is only version 2.103 at /opt/zimbra/.cpan/build/IO-Compress-2.204-0/blib/lib/Compress/Zlib.pm line 11
cpan -i IO::Compress::Zip --> Error:  Compress::Raw::Zlib version 2.204 required--this is only version 2.103 at /opt/zimbra/.cpan/build/IO-Compress-2.204-1/blib/lib/Compress/Zlib.pm line 11.
cpan -i IO::Uncompress::Gunzip --> Error:  Compress::Raw::Zlib version 2.204 required--this is only version 2.103 at /opt/zimbra/.cpan/build/IO-Compress-2.204-2/blib/lib/Compress/Zlib.pm line 11.
cpan -i IO::Uncompress::Unzip --> Error:  Compress::Raw::Zlib version 2.204 required--this is only version 2.103 at /opt/zimbra/.cpan/build/IO-Compress-2.204-2/blib/lib/Compress/Zlib.pm line 11.
What do you recommend ?

If a charitable soul wants to try with "me" :D
Adding comment to 31 May :

I think a possible solution would be to upgrade the perl version to 5.36.1 while keeping the "zimbra perl directory configuration"?

How to do ? I'm in a test environment, it's to advance the community, no risk.
What would be the best way to proceed ?

Who is an experienced Perl user and could give me the solution ?
THANKS.

Cheers,
Romain

For French people, I opened a discussion topic here, but it's not a forum dedicated to Zimbra.

If you want to analyze your DMARC reports, my DMARC report viewing page that I receive from the recipient mail servers, with my PHP script that you can to use.
Last edited by LAB3W.ORJ on Sat Jun 10, 2023 7:24 am, edited 4 times in total.
LAB3W : O.R.J
Freelance | LAMP Consultant (W3C.Master: Analyst.SSI/Dev.OpS/WebDev)
Web and Networks Lab - Internet Engineering - Creator ZW3B [EU|FR|TV|NET|COM|SITE|BLOG]
User avatar
LAB3W.ORJ
Advanced member
Advanced member
Posts: 76
Joined: Sat Feb 19, 2022 3:16 pm
Location: InterNet
ZCS/ZD Version: 8.8.15.GA.4179.UBUNTU20.64 FOSS P44
Contact:

Re: MTA Zimbra : SpamAssassin | Mail DMARC (Filter) + Email Reporting

Post by LAB3W.ORJ »

Hi,

Following these errors :

Code: Select all

cpan -i IO::Compress::Gzip --> Error:  Compress::Raw::Zlib version 2.204 required--this is only version 2.103 at /opt/zimbra/.cpan/build/IO-Compress-2.204-0/blib/lib/Compress/Zlib.pm line 11
cpan -i IO::Compress::Zip --> Error:  Compress::Raw::Zlib version 2.204 required--this is only version 2.103 at /opt/zimbra/.cpan/build/IO-Compress-2.204-1/blib/lib/Compress/Zlib.pm line 11.
cpan -i IO::Uncompress::Gunzip --> Error:  Compress::Raw::Zlib version 2.204 required--this is only version 2.103 at /opt/zimbra/.cpan/build/IO-Compress-2.204-2/blib/lib/Compress/Zlib.pm line 11.
cpan -i IO::Uncompress::Unzip --> Error:  Compress::Raw::Zlib version 2.204 required--this is only version 2.103 at /opt/zimbra/.cpan/build/IO-Compress-2.204-2/blib/lib/Compress/Zlib.pm line 11.
I managed to upgrade to version 2.204.

For this, I installed the modules from the “root” user account.

In this way :

Code: Select all

root@mail:~ # cpan -i IO::Compress::Gzip
This made it possible to switch to CPAN.pm v2.36 formerly v2.22

I'm upgrading from the "root" account.

Code: Select all

root@mail:~ # perl -MCPAN -e 'upgrade'
to update all modules. And I will install the dependencies in the system (and not from the "zimbra" user)

Then I would just install Mail::DMARC from user "zimbra" -- I'll let you know.

PS : It's always less risky than installing the perl5.36.1 sources on top of the system Perl.

Romain.
Last edited by LAB3W.ORJ on Mon Jun 05, 2023 12:36 pm, edited 1 time in total.
LAB3W : O.R.J
Freelance | LAMP Consultant (W3C.Master: Analyst.SSI/Dev.OpS/WebDev)
Web and Networks Lab - Internet Engineering - Creator ZW3B [EU|FR|TV|NET|COM|SITE|BLOG]
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: MTA Zimbra : Mail DMARC (Filter) + Email Reporting

Post by JDunphy »

LAB3W.ORJ wrote: Thu Jun 01, 2023 2:34 pm
to update all modules. And I will install the dependencies in the system (and not from the "zimbra" user)

Then I would just install Mail::DMARC from user "zimbra" -- I'll let you know.

Romain.
Hi Romain,

Really nice work.

Do you need to install DMARC as the zimbra user or can it be installed in locations that will not be affected by Zimbra updates?

Jim
User avatar
LAB3W.ORJ
Advanced member
Advanced member
Posts: 76
Joined: Sat Feb 19, 2022 3:16 pm
Location: InterNet
ZCS/ZD Version: 8.8.15.GA.4179.UBUNTU20.64 FOSS P44
Contact:

Re: MTA Zimbra : SpamAssassin | Mail DMARC (Filter) + Email Reporting

Post by LAB3W.ORJ »

Hi Jim,

Thank you for your reply.

Good question.. I don't know at all.

They have nothing planned in Zimbra (via the admin (7071)) for the Perl Mail::DMARC module.

I'm just testing to see if I can configure and interact the Mail::DMARC module with Zimbra MTA.
Last edited by LAB3W.ORJ on Mon Jun 05, 2023 12:35 pm, edited 1 time in total.
LAB3W : O.R.J
Freelance | LAMP Consultant (W3C.Master: Analyst.SSI/Dev.OpS/WebDev)
Web and Networks Lab - Internet Engineering - Creator ZW3B [EU|FR|TV|NET|COM|SITE|BLOG]
User avatar
LAB3W.ORJ
Advanced member
Advanced member
Posts: 76
Joined: Sat Feb 19, 2022 3:16 pm
Location: InterNet
ZCS/ZD Version: 8.8.15.GA.4179.UBUNTU20.64 FOSS P44
Contact:

Re: MTA Zimbra : SpamAssassin | Mail DMARC (Filter) + Email Reporting

Post by LAB3W.ORJ »

I'm almost there :D

I installed all dependent modules except 1 -- haha.

XML::LibXML https://metacpan.org/pod/XML::LibXML → check dependencies surely :D

However, I have installed:

Code: Select all

apt search XML::LibXML
apt install libxml2-dev zlib1g-dev libxml-simple-perl libxml-libxml-simple-perl libxml-libxml-perl libxml-libxml-iterator-perl libxml-libxml-debugging-perl libxml-simpleobject-libxml-perl libxml-libxml-lazybuilder-perl libxml-hash-lx-perl libxml-dom-xpath-perl libxml-rss-libxml-perl
For your information for Net::SSLeay and IO::Socket::SSL

Code: Select all

apt-cache search Net::SSLeay
apt install libssl-dev perl-openssl-defaults ibcrypt-ssleay-perl libpoe-filter-ssl-perl libio-socket-ssl-perl
:)

I'm going to the café - citoyen to see if there's a Task Force... to do :)

See you later.

Romain
Last edited by LAB3W.ORJ on Mon Jun 05, 2023 12:35 pm, edited 1 time in total.
LAB3W : O.R.J
Freelance | LAMP Consultant (W3C.Master: Analyst.SSI/Dev.OpS/WebDev)
Web and Networks Lab - Internet Engineering - Creator ZW3B [EU|FR|TV|NET|COM|SITE|BLOG]
User avatar
LAB3W.ORJ
Advanced member
Advanced member
Posts: 76
Joined: Sat Feb 19, 2022 3:16 pm
Location: InterNet
ZCS/ZD Version: 8.8.15.GA.4179.UBUNTU20.64 FOSS P44
Contact:

Re: MTA Zimbra : SpamAssassin | Mail DMARC (Filter) + Email Reporting

Post by LAB3W.ORJ »

Hello,

As I said in my previous message, I can't install the XML::LibXML module https://metacpan.org/pod/XML::LibXML → I think you have to install the dependencies surely :D

Following this type of "error" (instead of forcing the install of the module).

Code: Select all

root@mail:~ # cpan -i warnings
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/root/.cpan/Metadata'
  Database was generated on Sun, 04 Jun 2023 11:29:02 GMT
Running install for module 'warnings'
The most recent version "1.58" of the module "warnings"
is part of the perl-5.36.1 distribution. To install that, you need to run
  force install warnings   --or--
  install SHAY/perl-5.36.1.tar.gz

Who can give me a simple solution to install Perl version 5.36.1 on system version 5.30.0 ?

Big thanks.

Romain.

//---

Note from Myself 5:15 p.m. GMT+2:

Well, I force one of the modules and it compiles "perl-5.36.1-0" -> I left the default values except the install prefix that I configured in /usr at the instead of /usr/local (as the default, although according to my installation the result of the perl -V command returns -Dprefix=/usr in the "config_args=" variable)

I don't know if this will work. I will see well.

Well this works:

Code: Select all

[.......]
SHAY/perl-5.36.1.tar.gz
   /usr/bin/make install --OK
root@mail:/home/orj #
root@mail:/home/orj # which perl
/usr/bin/perl
17:29:18 root@mail:/home/orj # perl -v

This is perl 5, version 36, subversion 1 (v5.36.1) built for x86_64-linux

Copyright 1987-2023, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.
//----

I'll think about doing, in another try, or maybe advise ;) :

Install a machine (so with an old perl style version 5.30.0), install the latest version, for example 5.36.1 from the sources, then install Zimbra -- it will be easier -- to have a "stable" version from zimbra -- to finally install the Perl module Mail::DMARC.

Cheers,
Romain
Last edited by LAB3W.ORJ on Mon Jun 05, 2023 12:35 pm, edited 1 time in total.
LAB3W : O.R.J
Freelance | LAMP Consultant (W3C.Master: Analyst.SSI/Dev.OpS/WebDev)
Web and Networks Lab - Internet Engineering - Creator ZW3B [EU|FR|TV|NET|COM|SITE|BLOG]
User avatar
LAB3W.ORJ
Advanced member
Advanced member
Posts: 76
Joined: Sat Feb 19, 2022 3:16 pm
Location: InterNet
ZCS/ZD Version: 8.8.15.GA.4179.UBUNTU20.64 FOSS P44
Contact:

Re: MTA Zimbra : SpamAssassin | Mail DMARC (Filter) + Email Reporting

Post by LAB3W.ORJ »

I managed to install Mail::DMARC from the "root" user -- who installed it for me from here:

Code: Select all

    root@mail:/home/orj # cpan -i Mail::DMARC
    [.....]
    Result: PASS
      MBRADSHAW/Mail-DMARC-1.20230215.tar.gz
      ./Build test -- OK
    Running Build install for MBRADSHAW/Mail-DMARC-1.20230215.tar.gz
    Building Mail-DMARC
    [.....]
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Base.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Policy.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/HTTP.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/PurePerl.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/ConfigData.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Result.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Result/Reason.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Test/Transport.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Sender.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Receive.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Aggregate.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/URI.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Store.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Send.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Send/HTTP.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Send/SMTP.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Store/SQL.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Store/SQL/Grammars/MySQL.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Store/SQL/Grammars/SQLite.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Store/SQL/Grammars/PostgreSQL.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Aggregate/Record.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Aggregate/Metadata.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Aggregate/Record/Auth_Results.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Aggregate/Record/Row.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Aggregate/Record/Identifiers.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Aggregate/Record/Row/Policy_Evaluated.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Aggregate/Record/Auth_Results/SPF.pm
    Installing /usr/lib/perl5/site_perl/5.36.1/Mail/DMARC/Report/Aggregate/Record/Auth_Results/DKIM.pm
    Installing /usr/share/man/man3/Mail::DMARC::Result.3
    [.....]
    Installing /usr/share/man/man3/Mail::DMARC::Report::Receive.3
    Installing /usr/bin/dmarc_view_reports
    Installing /usr/bin/dmarc_receive
    Installing /usr/bin/dmarc_send_reports
    Installing /usr/bin/dmarc_lookup
    Installing /usr/bin/dmarc_update_public_suffix_list
    Installing /usr/bin/dmarc_httpd
    Installing /usr/bin/dmarc_http_client
      MBRADSHAW/Mail-DMARC-1.20230215.tar.gz
      ./Build install  -- OK
    root@mail:/home/orj #
On the other hand since the user "Zimbra" nothing in the Mail::DMARC tree which is normal.

Code: Select all

    zimbra@mail:~ # cpan -i Mail::DMARC
    Loading internal logger. Log::Log4perl recommended for better logging
    Reading '/opt/zimbra/.cpan/Metadata'
      Database was generated on Sun, 04 Jun 2023 11:29:02 GMT
    Mail::DMARC is up to date (1.20230215).
    zimbra@mail:~ #
I have just uninstalled Mail::DMARC from "root" and therefore restarted the installation of the module from the "zimbra" user.

And that fucked me up -- this must be my configuration of:

Code: Select all

    %ENV:
        PERL5LIB="/opt/zimbra/common/lib/perl5/x86_64-linux:/opt/zimbra/common/lib/perl5"
        PERLLIB="/opt/zimbra/common/lib/perl5/x86_64-linux:/opt/zimbra/common/lib/perl5"
        PERL_LOCAL_LIB_ROOT="/opt/zimbra/common/lib/perl5/x86_64-linux:/opt/zimbra/common/lib/perl5"
        PERL_MB_OPT="--install_base "/opt/zimbra/common/lib/perl5"
        PERL_MM_OPT="INSTALL_BASE=/opt/zimbra/common/lib/perl5"
Which must be configured like this (I was wrong) -- I edited my comment on variables PERL_MB_OPT and PERL_MM_OPT to add to .bashrc here. :

Code: Select all

    %ENV:
        PERL5LIB="/opt/zimbra/common/lib/perl5/x86_64-linux:/opt/zimbra/common/lib/perl5"
        PERLLIB="/opt/zimbra/common/lib/perl5/x86_64-linux:/opt/zimbra/common/lib/perl5"
        PERL_LOCAL_LIB_ROOT="/opt/zimbra/common/lib/perl5/x86_64-linux:/opt/zimbra/common/lib/perl5"
        PERL_MB_OPT="--install_base "/opt/zimbra/common"
        PERL_MM_OPT="INSTALL_BASE=/opt/zimbra/common"
Below are the "logs" of the installation from the "zimbra" user :

Code: Select all

    zimbra@mail:~ # cpan -i Mail::DMARC
    Loading internal logger. Log::Log4perl recommended for better logging
    Reading '/opt/zimbra/.cpan/Metadata'
      Database was generated on Sun, 04 Jun 2023 11:29:02 GMT
    Running install for module 'Mail::DMARC'
    Checksum for /opt/zimbra/.cpan/sources/authors/id/M/MB/MBRADSHAW/Mail-DMARC-1.20230215.tar.gz ok
    Configuring M/MB/MBRADSHAW/Mail-DMARC-1.20230215.tar.gz with Build.PL
    Created MYMETA.yml and MYMETA.json
    Creating new 'Build' script for 'Mail-DMARC' version '1.20230215'
      MBRADSHAW/Mail-DMARC-1.20230215.tar.gz
      /usr/bin/perl Build.PL --installdirs site -- OK
    Running Build for M/MB/MBRADSHAW/Mail-DMARC-1.20230215.tar.gz
    Building Mail-DMARC
      MBRADSHAW/Mail-DMARC-1.20230215.tar.gz
      ./Build -- OK
    Running Build test for MBRADSHAW/Mail-DMARC-1.20230215.tar.gz
    t/00.Dmarc.t ................................. ok
    t/01.Policy.t ................................ ok
    t/03.Base.t .................................. ok
    t/04.PurePerl.t .............................. ok
    t/06.Result.t ................................ ok
    t/09.HTTP.t .................................. skipped: CGI not available
    t/10.Report.t ................................ ok
    t/11.Report.Store.t .......................... ok
    t/12.Report.Store.SQL.t ...................... ok
    t/13.Report.Aggregate.t ...................... ok
    t/14.Report.Aggregate.Metadata.t ............. ok
    t/15.Report.Aggregate.Record.t ............... ok
    t/16.Report.Aggregate.Record.Auth_Results.t .. ok
    t/17.Report.Aggregate.Schema.t ............... skipped: XML::Validator::Schema not available
    t/20.Report.URI.t ............................ ok
    t/21.Report.Send.t ........................... ok
    t/22.Report.Send.SMTP.t ...................... ok
    t/23.Report.Send.HTTP.t ...................... ok
    t/25.Report.Receive.t ........................ ok
    t/26.Report.Sender.t ......................... ok
    All tests successful.
    Files=20, Tests=709, 486 wallclock secs ( 0.15 usr  0.05 sys +  8.04 cusr  2.32 csys = 10.56 CPU)
    Result: PASS
      MBRADSHAW/Mail-DMARC-1.20230215.tar.gz
      ./Build test -- OK
    Running Build install for MBRADSHAW/Mail-DMARC-1.20230215.tar.gz
    Building Mail-DMARC
    [......]
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Base.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Policy.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/HTTP.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/PurePerl.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/ConfigData.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Result.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Result/Reason.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Test/Transport.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Sender.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Receive.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Aggregate.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/URI.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Store.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Send.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Send/HTTP.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Send/SMTP.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Store/SQL.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Store/SQL/Grammars/MySQL.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Store/SQL/Grammars/SQLite.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Store/SQL/Grammars/PostgreSQL.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Aggregate/Record.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Aggregate/Metadata.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Aggregate/Record/Auth_Results.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Aggregate/Record/Row.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Aggregate/Record/Identifiers.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Aggregate/Record/Row/Policy_Evaluated.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Aggregate/Record/Auth_Results/SPF.pm
    Installing /opt/zimbra/common/lib/perl5/lib/perl5/Mail/DMARC/Report/Aggregate/Record/Auth_Results/DKIM.pm
    Installing /opt/zimbra/common/lib/perl5/man/man3/Mail::DMARC::Result.3
    Installing /opt/zimbra/common/lib/perl5/man/man3/Mail::DMARC::Report::Aggregate::Record::Auth_Results.3
    [.......]
    Installing /opt/zimbra/common/lib/perl5/bin/dmarc_view_reports
    Installing /opt/zimbra/common/lib/perl5/bin/dmarc_receive
    Installing /opt/zimbra/common/lib/perl5/bin/dmarc_send_reports
    Installing /opt/zimbra/common/lib/perl5/bin/dmarc_lookup
    Installing /opt/zimbra/common/lib/perl5/bin/dmarc_update_public_suffix_list
    Installing /opt/zimbra/common/lib/perl5/bin/dmarc_httpd
    Installing /opt/zimbra/common/lib/perl5/bin/dmarc_http_client
So I'm almost there.

;)
Last edited by LAB3W.ORJ on Mon Jun 05, 2023 12:35 pm, edited 2 times in total.
LAB3W : O.R.J
Freelance | LAMP Consultant (W3C.Master: Analyst.SSI/Dev.OpS/WebDev)
Web and Networks Lab - Internet Engineering - Creator ZW3B [EU|FR|TV|NET|COM|SITE|BLOG]
User avatar
LAB3W.ORJ
Advanced member
Advanced member
Posts: 76
Joined: Sat Feb 19, 2022 3:16 pm
Location: InterNet
ZCS/ZD Version: 8.8.15.GA.4179.UBUNTU20.64 FOSS P44
Contact:

Re: MTA Zimbra : SpamAssassin | Mail DMARC (Filter) + Email Reporting

Post by LAB3W.ORJ »

In addition, as @jdunphy reminded me, we will have to modify the Mail::DMARC Hand Configuration Files.

They are not planned in Zimbra (via the admin (7071)) for the Perl Mail :: Dmarc module.

I may have an idea → it's the "test" module of SpamAssassin .. or maybe you will have to add a line:

Code: Select all

my $result = $dmarc->validate();
I must say nonsense -- there is a DMARC plugin to SpamAssassin -- we could use this one :/ It's probably more appropriate :)

The SpamAssassin test module for example written TEST_PLUGIN=1 in the source of the recusal emails :

Code: Select all

X-Spam-Status: No, score=3.986 required=6.6 tests=[ALL_TRUSTED=-1,
	BAYES_40=-0.001, FROM_ADDR_WS=2.996, PP_MIME_FAKE_ASCII_TEXT=1,
	T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, TEST_PLUGIN=1]
And send the DMARC compliance and non-compliance report emails to the sending mail servers.

https://metacpan.org/pod/Mail::DMARC::Report::Aggregate

Do you have an idea you, ladies, gentlemen specialists / developers / administrators of Zimbra :)

I'll let you whip up something quick for us :) Don't forget me :P

How do you think we can make Mail::DMARC interact with Zimbra ?

Romain.
Last edited by LAB3W.ORJ on Mon Jun 05, 2023 12:34 pm, edited 1 time in total.
LAB3W : O.R.J
Freelance | LAMP Consultant (W3C.Master: Analyst.SSI/Dev.OpS/WebDev)
Web and Networks Lab - Internet Engineering - Creator ZW3B [EU|FR|TV|NET|COM|SITE|BLOG]
User avatar
LAB3W.ORJ
Advanced member
Advanced member
Posts: 76
Joined: Sat Feb 19, 2022 3:16 pm
Location: InterNet
ZCS/ZD Version: 8.8.15.GA.4179.UBUNTU20.64 FOSS P44
Contact:

Re: MTA Zimbra : SpamAssassin | Mail DMARC (Filter) + Email Reporting

Post by LAB3W.ORJ »

Hi,

I think after installing Mail::DMARC it is the Mail::SpamAssassin::Plugin::DMARC (Git Hub: https://github.com/bigio/spamassassin-dmarc) that we need to interact with the MTA Zimbra server.
SpamAssassin plugin that checks if an email message respects its domain DMARC policy.

The plugin can save DMARC reports in a database, reports can be sent later to externalmail servers.

The main branch is developed on Apache SpamAssassin 4.x src tree and it will be kept in sync here, the version compatible with Apache SpamAssassin 3.4.x is on the "3.4" branch.

Most updated version will be in Apache SpamAssassin src tree.

See Mail::DMARC::Report for additional documentation about how to configure reporting.
Good day.

Cheers,
Roman
LAB3W : O.R.J
Freelance | LAMP Consultant (W3C.Master: Analyst.SSI/Dev.OpS/WebDev)
Web and Networks Lab - Internet Engineering - Creator ZW3B [EU|FR|TV|NET|COM|SITE|BLOG]
phoenix
Ambassador
Ambassador
Posts: 27272
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: MTA Zimbra : SpamAssassin | Mail DMARC (Filter) + Email Reporting

Post by phoenix »

You can actually get DMARC checking/reporting if you used Rspamd, it's fairly trivial to implement.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
Post Reply