liuch / dmarc-srg

A php parser, viewer and summary report generator for incoming DMARC reports.
GNU General Public License v3.0
218 stars 32 forks source link

Feature Request - Reporting Statistics When Filtered #62

Closed andrewhenke closed 1 year ago

andrewhenke commented 1 year ago

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!

liuch commented 1 year ago

Hello. How do you imagine it? After all, these numbers are displayed not only on the report list page where you can use the filter. Do you mean to use the filter when you are on the report list page, and disable filtering when you leave it?

andrewhenke commented 1 year ago

Thank you for the quick response! Here is my example:

On the main page, showing the overview of all DMARC reports within the system, for multiple different domain names, there is the following statistics section, in the upper right corner of the page:

image

When I go to the List display settings menu. and select to the filter domain, and select the domain example.com, the statistics section does not update to show the statistics about the specific domain that is selected -- it still shows the global, system wide statistics for all domains.

I propose adding the feature so that, when filtering by a specific domain, the statistics boxes show only the numbers relevant to the specific domain name that is being filtered, instead of the system-wide details.

For example, if the domain example.com only sent 10000 emails, the Emails processed box would show 10000, instead of, in the case of my system, 178759.

Likewise, if example.com had all of it's emails stating that the domain was fully aligned with the DMARC specifications, then the Fully aligned percentage would update to show 100%, instead of the system-wide value.

Does that make more sense?

Please feel free to ask me to clarify further if I am not coming across clearly.

Thank you!

liuch commented 1 year ago

Perhaps, I didn't express myself clearly enough. I'll try to ask differently. For example, step by step.

  1. The filter by domain now is inactive (all domains). I'm not on the report list page. Let it be the summary reports page. The statistics sections displays numbers X1.X2.X3.X4.
  2. I go to the report list page and set the filter by one domain. Now the statistics sections displays numbers Y1.Y2.Y3.Y4.
  3. Then I return to the summary reports page through the main menu. Which numbers should be displayed in the statistics section, X1.X2.X3.X4 or Y1.Y2.Y3.Y4? At the same time, note that, with the exception of the statistics block, the page at this step doesn't differ in any way from the page at the first step.
  4. Which numbers should be displayed in the statistics section if I go there by clicking the back button in my browser?
  5. Then I go to the report list page again through the main menu. What should be displayed there? Please note that the filter is inactive in this case.

I want to clarify: I am asking these questions not in an attempt to criticize your idea, but in order to better understand it.

mbsouth commented 1 year ago

This thing also caught my eye and I would like to try to explain it in other words:

The filter by domain now is inactive (all domains). I'm not on the report list page. Let it be the summary reports page. The statistics sections displays numbers X1.X2.X3.X4.

This setting is available under Settings -> Advanced -> .....n-days I get it.

I go to the report list page and set the filter by one domain. Now the statistics sections displays numbers Y1.Y2.Y3.Y4.

No, it doesn't. The global values X1.X2.X3.X4 are still displayed. In my example, only 8 messages are supposed to be processed from this domain not 1306.

Feature Request - Reporting Statistics When Filtered 01

Then I return to the summary reports page through the main menu. Which numbers should be displayed in the statistics section, X1.X2.X3.X4 or Y1.Y2.Y3.Y4?

This depends on whether a filter is set or not:

Feature Request - Reporting Statistics When Filtered 02

Which numbers should be displayed in the statistics section if I go there by clicking the back button in my browser?

This depends on whether a filter is set or not:

Feature Request - Reporting Statistics When Filtered 03

In all other cases, i.e. if no filter is set, the global numbers should be displayed. I hope my concern is somewhat understandable. Thank you for your effort.

liuch commented 1 year ago

@mbsouth, You suggest that the filter for those numbers in the statistic section work only on one page (report list) and only when the filter is activated. Any transition to other pages should reset these numbers to the global values? Did I understand you correctly?

No, it doesn't. The global values X1.X2.X3.X4 are still displayed. In my example, only 8 messages are supposed to be processed from this domain not 1306.

All what i wrote in my previous comment was hypothetical (what exactly the tool should do). Perhaps I expressed my thought incorrectly. I just offered to follow the same steps and tell me which numbers you think should be displayed at each step in that block.

Thank you for your reply.

liuch commented 1 year ago

Implemented. Now any filtering parameter affects the top block. I will add an option to the settings later.

mbsouth commented 1 year ago

@liuch

Thanks for the implementation!

Unfortunately it seems there is a small bug: if the filter Month = Any is set, the totals are not correct.

But otherwise exactly as I imagined it. Thx!

liuch commented 1 year ago

If the filter Month = Any is set then the option status.emails-for-last-n-days is used.

mbsouth commented 1 year ago

Ah, thanks!