Git Product home page Git Product logo

dmarc-srg's Introduction

DmarcSrg

A php parser, viewer and summary report generator for incoming DMARC reports.

Features

  • View a table of parsed reports
  • Easily identify potential DMARC related issues through colors;
  • Filter report list by domain, month, reporting organization and more;
  • View DKIM/SPF details for each report;
  • Password protection of the web interface (can be disabled);
  • Receiving and processing incoming DMARC reports from specified mailboxes;
  • Receiving and processing incoming DMARC reports from specified server local directories;
  • Uploading and processing incoming DMARC reports by using the web interface;
  • Ability to configure deletion of old reports from the database and mailboxes;
  • Generation of summary reports for the last week, last month or last N days and sending them to the specified mailbox;
  • Uses AJAX calls to the backend; no external Javascript libraries are needed;

Screenshots

Screenshot: Report List

Report list

Larger version

Screenshot: Report Detail

Report detail

Larger version

Screenshot: Admin Panel

Admin Panel

Larger version

Installation and Configuration

Ensure that all the files are in their own sub-folder.

Requirements

  • MariaDB or MySQL
  • PHP 7.3 or higher
  • Installed php-mbstring, php-mysql, php-xml, php-zip, php-json, and php-imap
  • A working webserver (not necessary)

Create the database

Login as mysql root user to the MariaDB/MySQL server using the shell, run:

# mysql -u root -p

and type the password.

Once you have a MariaDB or MySQL prompt, create a new database, where dmarc is a new database name (you can specify a different database name):

CREATE database dmarc;

Create a new user called dmarc_user for the new database (you can specify a different user name):

GRANT all on dmarc.* to dmarc_user@localhost identified by 'new_user_password';

Remember to replace new_user_password with a more secure one!

Note: If there is a need to use an existing database with other tables, you can specify the table prefix in the conf/conf.php file.

conf.php

Copy conf/conf.sample.php to conf/conf.php and configure it. Learn more by reading the comments in it.

Database initialization

There are two ways to do that: by using the web interface or by running the follow command:

$ php utils/database_admin.php init

Usage

In general, DmarcSrg is designed to automatically receive incoming DMARC reports, process them and send summary reports to the specified e-mail address, so a web interface as well as a web-server is optional. Most of the work is done by periodically running php scripts, which are located in the utils directory.

Utils

  • utils/check_config.php - checks your configuration.
  • utils/database_admin.php - performs some administration functions with the database.
  • utils/fetch_reports.php - fetches DMARC reports from mailboxes and server local directories and saves them to the database.
  • utils/mailbox_cleaner.php - deletes old DMARC report email messages in mailboxes.
  • utils/reportlog_cleaner.php - deletes old log entries.
  • utils/reports_cleaner.php - deletes old reports from the database.
  • utils/summary_report.php - creates a summary report and sends it by email.

You can find more detailed information about each script in the comments to it.

Note: Despite the fact that these scripts can only be run from the console, it is recommended to close access to the utils directory from the web server.

For example, if you want to get a summary report for the last week, you should run a command like this:

$ cd /usr/local/share/dmarc-srg && php utils/summary_report.php domain=example.com period=lastweek

Web interface

Use the public/ directory to access the web interface. You will see the basic Report List view, allowing you to navigate through the reports that have been parsed. Using the menu go to the Admin section and create tables in the database and check the accessibility of the mailboxes if necessary.

If Content Security Policy (CSP) is used on your web server, it is enough to add the following permissions:

  • style-src 'self';
  • img-src 'self';
  • script-src 'self';
  • connect-src 'self';
  • media-src 'self';
  • form-action 'self';

That is, this rather strict policy will work well with the current web interface: Content-Security-Policy: default-src 'none'; style-src 'self'; img-src 'self'; script-src 'self'; connect-src 'self'; media-src 'self'; form-action 'self'; base-uri 'none'; frame-ancestors 'none'

How the report file processing works

General rules for processing report files

  • Only files of the following formats are accepted: zip, gzip, xml.
  • Reports that do not have required fields (domain, time, org, id, records, and so on) are rejected.
  • Reports that have already been accepted are also rejected.
  • Reports for domains that are not listed in the database as allowed for processing are rejected. The first domain is automatically added to the database from the first correct report.
  • For any attempt to download a report file, an entry is added to the internal log that can be viewed in the web interface (Administration --> Logs).

Mailboxes

An IMAP connection is sequentially established to each mailbox, and the following actions are performed:

  • Obtaining a list of unread messages.
  • Checking the content of each message (number of attachments, attachment size, file extension).
  • Extracting a report file from the message and parsing it and adding the report data to the database.
  • If the report is successfully added to the database, the message is set as SEEN.
  • If the report is rejected, the message remains marked as UNSEEN and is moved to the failed folder of the current mailbox. If the folder does not exist, it will be created.

Note: The total number of processed messages depends on the limit specified in the configuration file. The limitation is valid for each mail box separately.

Local directories of the server

Each directory specified in the configuration file is scanned for presence of files in it (not recursively). Each file in each directory is processed as follows:

  • Parsing the report file and adding the report data to the database.
  • If the report is successfully added to the database, the file is removed from the directory.
  • If the report is rejected, the file is moved to the failed subdirectory of the directory in which the file is currently located. If the subdirectory does not exist, it will be created.

Note: The total number of processed report files depends on the limit specified in the configuration file. The limitation is valid for each directory separately.

Uploaded report files from the web interface

Uploading report files via the web interface is pretty standard. The upload result can be seen in a popup message and in the internal log. The number of simultaneously uploaded files and their size are limited only by the settings of your server (See upload_max_filesize and post_max_size in your php.ini file).

dmarc-srg's People

Contributors

liuch avatar nbwpuk avatar ovidiumorariu avatar rmontagud avatar robdewit avatar smeinecke avatar williamdes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dmarc-srg's Issues

Unable to process reports that contain directories

Hello! I have noticed that the process of parsing and importing the emails from the IMAP connection fails if the attachment file contains a directory within the file archive.

Is it within the development roadmap to implement functionality to process both unnested and nested report formats -- it's something that I don't have control over, of course, and I'd like to be able to include the report contents in the system.

Thank you!

Failed Google reports

Your script created a folder called "failed" and it's full of Google reports. I'm assuming these are reports that couldn't be parsed. Not all Google reports are moved to the failed folder, but many are. Is there anything that can be done about this. Thanks!

Can not fetch reports from imap

I can't get dmarc-srg to retrieve the reports from imap.
The connection is correct on the panel, but when I run the fetch_reports I get this:

/php utils/fetch_reports.php PHP Fatal error: Uncaught Error: Call to undefined function Liuch\DmarcSrg\Mail\imap_utf8_to_mutf7() in /public_html/dmarc/classes/Mail/MailBox.php:230 Stack trace: #0 /public_html/dmarc/classes/Mail/MailBox.php(171): Liuch\DmarcSrg\Mail\MailBox->ensureConnection() #1 /public_html/dmarc/classes/Sources/MailboxSource.php(88): Liuch\DmarcSrg\Mail\MailBox->sort('SORTDATE', 'UNSEEN', false) #2 /public_html/dmarc/classes/Report/ReportFetcher.php(68): Liuch\DmarcSrg\Sources\MailboxSource->rewind() #3 /public_html/dmarc/utils/fetch_reports.php(117): Liuch\DmarcSrg\Report\ReportFetcher->fetch() #4 {main} thrown in /public_html/dmarc/classes/Mail/MailBox.php on line 230

Seems I need to have imap_utf8_to_mutf7 on the system, but this is only provided if libcclient exports utf8_to_mutf7 (explained here: https://www.php.net/manual/en/function.imap-utf8-to-mutf7.php)

imap ssl connection is not working

If you want a ssl connection to an imap server the host entry in config.php of a mailbox
should be appended with :993

host = imap.yourdoain.com:993

But that is not sufficient, in classes/Mail/Mailbox.php the server string is created to be used in the imap_open call,
in case of a ssl connection it should end with '/ssl'
A simple fix:
$flags = '';
if (isset($params['novalidate-cert']) && $params['novalidate-cert'] === true) {
$flags = '/ssl/novalidate-cert';
}
else {
$flags = '/ssl';
}
$this->server = sprintf('{%s/imap%s}', $this->host, $flags);

"Mark all read" feature

Hello,

first of all, thank you for this very useful tool. Installed version 1.2 yesterday on Debian Buster with PHP 8.0.13 and it worked out of the box.

Because I don't really want to open every report in the GUI, I would like to have a button, which is marking all these reports as read.

Thanks anyway!

Feature Request - Reporting Statistics When Filtered

Hello! I have noticed that when filtering reports to view, the global number of emails and the percentage of DMARC compliant emails, partially compliant emails, etc, does not update when only viewing a specific domain's records. Would it be possible to update this tool so that when filtering to view DMARC reports for just a single domain name, the global statistics are updated to reflect the compliance and percent of compliance out of just the individual domain's reports?

Thank you!

Two errors with PHP8.2 (fix included)

dmarc-srg [error]: ErrorException: Creation of dynamic property Liuch\DmarcSrg\Report\Report::$db is deprecated in /var/www/html/classes/Report/Report.php:36

Solution declare "private db;" in class

dmarc-srg [error]: ErrorException: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/classes/Database/Mariadb/ReportMapper.php:598

Solution place dollar sign $ inside the curly braces

Local timezone setting (not server side)

As discussed, I think it would be great to have the time setting set local and not server side, this would help with reading reports and a better 'out of the box' experience with the average user.

You mentioned using browser local which I think is a fantastic idea!

Uncaught Error: Undefined constant "Liuch\DmarcSrg\Sources\SORTDATE"

New user here. I've installed and configured dmarc-srg and trying to populate the database from an mbox with a history of DMARC emails and attachments. I've initialized the database, but when I run fetch_reports.php, there is an error about SORTDATE not being defined.

$ php utils/fetch_reports.php source=email
PHP Fatal error:  Uncaught Error: Undefined constant "Liuch\DmarcSrg\Sources\SORTDATE" in /var/www/orion.mydomain.com-443/html/dmarcreports/dmarc-srg/classes/Sources/MailboxSource.php:91
Stack trace:
#0 /var/www/orion.mydomain.com-443/html/dmarcreports/dmarc-srg/classes/Report/ReportFetcher.php(68): Liuch\DmarcSrg\Sources\MailboxSource->rewind()
#1 /var/www/orion.mydomain.com-443/html/dmarcreports/dmarc-srg/utils/fetch_reports.php(139): Liuch\DmarcSrg\Report\ReportFetcher->fetch()
#2 {main}
  thrown in /var/www/orion.mydomain.com-443/html/dmarcreports/dmarc-srg/classes/Sources/MailboxSource.php on line 91

What am I missing?

How can I clear all reports currently fetched?

Hi, Thanks for the nice work on such a useful interface!

I managed to import some reports from mail and now I'm looking for a command (syntax) for cleaning up the current state.

But I can't find the right command or syntax.

Thanks for some suggestions and feedback.

/G

Filter report entries

Right now its only possible to filter the report list by status of SPF + DKIM, but not entries inside of the report itself.

Additional it would help if there is some kind of "show only failed validation" checkbox to filter all reports + listings to only show invalid entries.

Logging out with no password set gets you locked out of the app

Not trying to bug you... (..crickets...)

If you run the setup with the default admin settings in config.php

$admin = [
    // Set this value to null or remove this parameter to disable authentication
    'password' => '',
];

and then logout of the app, you get locked out

image

json support

Is it possible to support .json files?

Best Regards

How can I auto create domain name by upload?

I try to upload report via .zip file with new domain name, but how can I set it to auto create a new domain name without I need to create it first? because when I setting this dmarc system, I will not open for all , just me, but if I need to create new domain one by one, and it not user friendly.

thanks

Feature : all domains in one email or multuple domains

Hi,

I have some domains , and i like to get whole report in one email only.

Maybe add some solution to allow : all domains or a lits of domains ?

php utils/summary_report.php period=lastmonth
Chcek all know domains

php utils/summary_report.php domain=example.com;example.org period=lastmonth
For a lits of domains

I can create the pull requets (when i have time)

Call to underfined function Liuch\DmarcSrg\Mail\imap_errors()

Hello,

I am trying to setup the tool. I don't plan to connect it to my mailbox. Instead, I want to upload DMARC reports manually or point it to a directory where my reports are saved. I keep getting this error message every time I refresh the page or try to do anything in the GUI.
[Sun Mar 26 15:46:04 2023] dmarc-srg [error]: Error: Call to undefined function Liuch\DmarcSrg\Mail\imap_errors() in C:\Users\**********\dmarc-srg\classes\Mail\MailBox.php:307
image
Is there something I am missing. Like I mentioned, I don't plan to use the email integration portion of the tool.

Thank you in advance,

Suggested cron schedule?

Hey brother... first of all, great job! Been looking for a solid DMARC parser for use with with a LAMP stack for a while. Good stuff!

I'm using the email option as the source for our reports. The utilities are running fine via terminal but before setting them up as crons I wanted to see if there is a recommendation for the settings? i.e. fetching reports 1 per day, mailbox cleaner (1 per day?), DB admin, reportlog/reports cleaner?

Send summary report as HTML

Is it possible to send the summary report via email the same as the HTML report available in the dashboard?

I have had a read through the code and can't see a way to achieve this.

PHP Fatal Error on connection error

Just spotted this mail from my cron. The connection error itself was a problem by my mailserver, but that Fatal error seems to be some kind of bug.

Can't connect to mx.mydomain.de,993: No route to host
PHP Fatal error:  Uncaught TypeError: imap_close(): Argument #1 ($imap) must be of type IMAP\Connection, bool given in /var/customers/webs/mydomain/dmarc-view.mydomain.de/classes/Mail/MailBox.php:87
Stack trace:
#0 /var/customers/webs/mydomain/dmarc-view.mydomain.de/classes/Mail/MailBox.php(87): imap_close()
#1 [internal function]: Liuch\DmarcSrg\Mail\MailBox->__destruct()
#2 {main}
  thrown in /var/customers/webs/mydomain/dmarc-view.mydomain.de/classes/Mail/MailBox.php on line 87

Will check this tomorrow.

Creation of dynamic property - DirectorySource::$path is deprecated

Running into this issue now.
image
I saw the closed cases and it looks like this issue happens with many components of the scripts but none of them mention it happening with DirectorySource::$path. Any thoughts? Would really love to get this tool up and running.

Thank you,

Problems with php7.4

dmarc-srg was working ok with php7.3. For other reasons, I've had to upgrade to php7.4 and now I get a load of deprecated messages (which i can live with), but finally "SQLSTATE[HY000] [2002] No such file or directory"
Steps to debug that would be appreciated. Thanks.

PHP Deprecated: Return type of Liuch\DmarcSrg\Sources\Source::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/dmarc-srg-master/classes/Sources/Source.php on line 60

Deprecated: Return type of Liuch\DmarcSrg\Sources\Source::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/dmarc-srg-master/classes/Sources/Source.php on line 60
PHP Deprecated: Return type of Liuch\DmarcSrg\Sources\Source::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/dmarc-srg-master/classes/Sources/Source.php on line 61

Deprecated: Return type of Liuch\DmarcSrg\Sources\Source::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/dmarc-srg-master/classes/Sources/Source.php on line 61
PHP Deprecated: Return type of Liuch\DmarcSrg\ReportFile\ReportGZFileCutFilter::filter($in, $out, &$consumed, $closing) should either be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/dmarc-srg-master/classes/ReportFile/ReportGZFileCutFilter.php on line 33

Deprecated: Return type of Liuch\DmarcSrg\ReportFile\ReportGZFileCutFilter::filter($in, $out, &$consumed, $closing) should either be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/dmarc-srg-master/classes/ReportFile/ReportGZFileCutFilter.php on line 33
SQLSTATE[HY000] [2002] No such file or directory

fetching reports from mailbox

Hi,

First, I think you are running the only php based DMARC project that I've come across that is solid.

Second, although the web interface admin panel says it connects to the mailbox for dmarc reports and lists the number of unseen reports in green, the reports are not loaded automatically into the database. I have set up a CRON-job to run the scripts listed in the readme file like so:

cd /var/www/dir/htdocs/dmarc && /usr/bin/php utils/fetch_reports.php

I have enabled debug messages, and the mailbox cleaner script results in the error No such host as host.domain.de (-1)"
Previously, when I set the mail server to localhost, I received the message Certificate failure for localhost: Hostname mismatch: /CN=host.domain.de (-1)"

Can you help getting the reports imported automatically?

Kind regards,

Mark

Failed to fetch the status

Looks like a DB connection problem.

I edited the config/conf.php file, and double checked on the command line that the DB user has full access to the database, and I configered a dmarc_ prefix, so there shouldn't be conflicts. The directory is also readable/writeable by the scripts. I hardly have experience with PDO, otherwise I'd dig deeper myself before asking here.

Using PHP 7.4.33 on Linux, '--with-pdo-mysql=shared,mysqlnd', Server version: 5.5.65-MariaDB MariaDB Server.

Looks like a brilliant tool, if I can get it to work :) Ideas anyone?

Cheers,
Jeroen

Double clicking on a report brings up authentication dialog

Very interesting bug.

When you click a report and bring up the DMARC Report, if you are on a slower connection (or accessing site via external webserver) and click it twice instead of once it will bring up the report and then the authentication dialog. you can click cancel and it will go away.

Can be easily re-produced by throttling the connection in dev mode on chrome/edge etc. and following above.

image

Suggestion: Filter messages into subfolders

As always, I'll start with praise for Aleksey and this project โ€” excellent!

I suggest that filtering processed messages into subfolders would/should be an easy enhancement. I currently do this manually.

There seem to be 3 basic results that could be filtered:

done - No errors processing the message
failed - An error was encountered processing the message [This is currently implemented.]
other - The message does not appear to be a DMARC message

Thanks,

Will Mayall

PHP Notice when try to get email via PLAIN method

Hi,

I use dmarc-srg on same server than email server (iredmail server)

Externaly : i can use starttls but not via localhost,
I set 'encryption' => 'none', for config.

When i try to get email :

$ php utils/fetch_reports.php 
PHP Notice:  Unknown: SECURITY PROBLEM: insecure server advertised AUTH=PLAIN (errflg=1) in Unknown on line 0

Then i try with

'encryption'      => 'starttls',
'novalidate-cert' => true,
$ php utils/fetch_reports.php 
TLS/SSL failure for localhost: SSL negotiation failed

To allow reading of email : i update debug.php to set ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); and now it work.

SUGESTION: Import domains from webhosting control panels

Would be a nice feature if you can add options to import the domains from the control panels using their API.
Almost all control panels allow to curl the a domain list using their API.
We won't need to type in hundreds or thousands of domains on the control panel or do an export to add these domains to the conf.php. It would simply import them automatically using the cron.

What do you think?

List filter not working

Filter feature isn't working on the Report List. When I click on it, the modal pops up, but the options are grayed out and it says "Error!".

Firefox console says "Failed to get a list of domains" on list.js:486:12

I checked and line 486 is about the error message, so that's not helpful.

I also tried it on Chrome and had the same problem with the same warning message.

Support for application/x-gzip

Some records are encoded as 'application/x-gzip' (Amazon Route 53), but they aren't properly opened and processed.

Adding 'application/x-gzip' to the $mime_type array in classes/Mail/MailMessage.php:82 fixes this error when running utils/fetch_reports.php source=email:

Failed to get incoming report:
Error message:
- Failed to get the list of mailboxes
- Incorrect message: Attachment file type is not valid (application/x-gzip)
Email message metadata:
- From: XXXXXXXXXX [email protected]
- Date: Tue, 25 Oct 2022 13:21:44 -0400

but then it fails in 'classes/ReportFile/ReportFile.php':

Failed to get incoming report:
Error message:
- gzopen(): Filename cannot be empty

I'm unsure where to look next in order to fix this issue.

Thank you for this tool!

Reports show error after time-zone update

The reports are no longer listed but instead show: null is not an object (evaluating 'd1.toISOString')

As an aside, thank you so much for creating this tool! It is really fantastic.

Use SMTP to send reports

Ironically, the reports emailed by summary_report.php are getting flagged as non-aligned for me because they're using the built-in PHP mailer which goes out through the hosting server, which I don't have control over on shared hosting, and therefore I can't configure it to sign using my DKIM key. :-) This came up as I was trying to chase down legitimate sources of non-aligned mail.

This could be avoided if it knew how to use SMTP (via the same account it's using for IMAP in my case)

I'm happy to submit a PR for this, but I have questions first to make sure I don't submit something you're not going to like. :-)

It seems like the accepted way to send mail via SMTP from PHP is to use PHPMailer (or another mailer library - I'm open if you have a preference). While you can just drop a copy of PHPMailer into your source, the easiest way to get it is to use composer to install it. Using composer actually gets you security benefits on GitHub: if PHPMailer ever has a security issue, GitHub will automatically file a ticket (and sometimes even a PR) against your project to update the dependency to the fixed version.

So with that said, are you willing for me to add a composer dependency to your project?

Here's what the patch will entail if I do it this way:

  1. Add a .gitignore file that will ignore /vendor because that's where composer will download to, and you don't want the dependencies included in your source control. (Should probably add /config/conf.php to this as well so someone doesn't accidentally commit their production config file)
  2. Add composer.json and composer.lock files to the project. composer.json will describe what the desired dependencies are (i.e. PHPMailer > some version). composer.lock will contain specific references to the version(s) last tested with so that chasing bugs is easier (everyone gets the same version).
  3. End users who check out from source would need to run composer install to pull in PHPMailer.
  4. A GitHub Action can be put in place to generate a zip file or tarball or both on your releases which already contains the results of composer install so the end user doesn't have to do it. I can supply that as part of the PR if you want.
  5. config options for SMTP would be added to the sample config file
  6. summary_report.php will check a) whether those config options are present, and b) whether PHPMailer is installed (in case they installed from source and didn't do composer install), and fall back on the existing mail() code if either check fails. This would ensure an update won't break people in case someone is auto-updating from git and not reading the changelog.

Thoughts?

How IMAP reports are reading

Hi, Can you tell me how the imap will take automatically reports from the " Mailbox " and post into database,
i have to run some Cronjobs or what is the procedure to run " util/fetch_reports.php "

I made a DarkTheme

Hey, great project this app has so much potential!

I have spent the last few days looking under the hood, some very complex stuff, I am by no means a PHP wizard so there is plenty I don't understand...

I created a DarkTheme anyway, mainly for my poor eyes as looking at this on a white screen at night can certainly sting.

Let me know what you think!

https://github.com/kramwell/dmarc-srg_darktheme

Email reports for all domains

Hello,

Now, it works, I would like create a cron job sending a report for each domain, such as:

domains="$(curl https://dmarc.dom.tld/domains.php -u pswd | gawk 'to be defined')" # to capture domains name
for i in domains
do
php utils/summary_report.php domain=$i period=lastmonth
done

My issue is that curl is not working with -u option...
Is there a way to capture domains with php domains.php
This command gives : PHP Fatal error: Uncaught Error: Call to undefined function Liuch\DmarcSrg\getallheaders()

TLS imap-login failed

I would like to use starttls connection to maildir
the error message:
imap-login: Disconnected: Connection closed: SSL_accept() failed: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol (no auth attempts in 0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, TLS handshaking: SSL_accept() failed: error:14209102:SSL routines:tls_early_post_process_client_hello:unsupported protocol, session=<GqC79zvvFpp/AAAB>
Where I should start to correct the issue?
Thank you

Subdomain reports generate: Failed to add an incoming report: unknown domain

When subdomains have different policies, or at least generate their own reports. Things stop working.
Any (easy) fix for this? Can I manually add the subdomains in the DB?

    try {
        $fqdn = $this->data['domain'];
        $domain = new Domain($fqdn);
        if (!$domain->exists()) {
            // The domain is not found.
            // It will automatically added a new domain if there are no domains in the table
            // or will throw an error otherwise.
            if (DomainList::count() !== 0) {
                throw new Exception('Failed to add an incoming report: unknown domain', -1);
            }

Is what errors out.

DB Error on web interface

Thank you for sharing this much needed software!

I'm getting an error message when I try to use the web interface:

DB Error 1045: Access denied for user 'root'@'localhost' (using password: YES)

I have followed the instructions and added the correct creds to the conf.php file.

thanks

Feature request: OAUTH support

Hello, our dmarc reports go to an office365 account and I have been made aware that on October 1, 2022 Microsoft is deprecating the basic auth access method:

https://techcommunity.microsoft.com/t5/exchange-team-blog/basic-authentication-deprecation-in-exchange-online-may-2022/ba-p/3301866

It seems that the only ways to access Outlook365 mail via a script will be using either OAUTH or the Graph API. I am aware of a project here on github which implements OAUTH for php-imap:

https://github.com/javanile/php-imap2

I am unsure if the standard php-imap library has implemented this functionality. "javanile" has claimed in comments responding to this feature request for other projects that his library is a drop-in replacement for the standard php-imap and merely requires changing calls to php2-imap. I hope this is true and would allow quick implementation of this request before Microsoft breaks things.

Thanks for your consideration and for this useful software.

d1 is null

Hi,

After update (via git pull) I'm gotting the error "d1 is null" in Reports list. It seems to fetch mails OK.

Thanks.

Failed to get incoming report

root@h2983452:~# cd /var/www/html && /usr/bin/php utils/fetch_reports.php
Failed to get incoming report:
Error message:
- Creation of dynamic property Liuch\DmarcSrg\Mail\MailAttachment::$encoding is deprecated

Report per domain to different email address

Firstly, great software. ๐Ÿ‘

I was just wondering is it possible to send the report per domain to different email address.
I was thinking maybe as the current report is triggered:
php utils/summary_report.php domain=example.com period=lastndays:10
could this be adapted to
php utils/summary_report.php domain=example.com period=lastndays:10 [email protected]

PHP errors

Hi,

I'm very excited to find this DMARC parsing tool. I just need to get it working :-)

The web interface is working, the database is initialised and the web interface reports the IMAP server is accessible.

Now I'm trying to run php utils/fetch_reports.php from the command line.

Firstly I'm getting a PHP error in utils/MailBoxes.php:
Parse error: syntax error, unexpected 'list' (T_LIST), expecting identifier (T_STRING) in /volume1/web/dmarc-srg/classes/Mail/MailBoxes.php on line 53

It turns out "list" is a reserved keyword in PHP and cannot be used as a function name. So I renamed this private function to mList and this has improved things (although I've not found if/where "list" it is called yet!)

But then with that "fix" I get another PHP error:
Parse error: syntax error, unexpected '?' in /volume1/web/dmarc-srg/classes/Mail/MailBox.php on line 61

I'm wondering why I'm seeing PHP errors, when no one else has reported anything. Do you have any suggestions?
I'm using PHP Version 7.4.9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.