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

Suggestion: Filter messages into subfolders #47

Closed mayall closed 1 year ago

mayall commented 1 year ago

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

Shnoulle commented 1 year ago

Unsure on easy, but cool for sure :)

Only done and failed. Not dmarc must not be updated.

liuch commented 1 year ago

Hi, To me, all the email messages in the mailbox that do not content a correct DMARC report are either spam or failed DMARC reports. Spam, ideally, must not reach the mailbox. As for "done", it's easy to implement. As for the "other", I have no idea how to separate them from "failed." The message subject? Its attachment? The number of its attachments? In my opinion only the last one more or less guarantees the correct separation. Do you have any ideas?

Shnoulle commented 1 year ago

done only seems OK, or better : option in config ('moveto' => '') maybe ?

mayall commented 1 year ago

I'd see processing work like this:

if (processing was successful) move to done elseif (the message appears to be a DMARC message but there was an error) move to failed elseif (all the other messages) move to other

Ideally, I view this as a preference.

liuch commented 1 year ago

@Shnoulle I already thought about a similar option, because I came across a case where the creation of a subfolder in the folder where the dmarc reports are located is prohibited. As an option, either move it to another mailbox (folder), or mark it in some other way. Optionally, of course. It may be IMAP custom keywords if they are allowed on a server, but I'm not sure if php-imap library supports them, I should check it before.

liuch commented 1 year ago

@mayall The main problem is this phrase: "the message appears to be a DMARC message" :(

liuch commented 1 year ago

By the way, I'm just curious: what is the difference between messages in the done folder and messages marked as seen and not moved to the failed folder? Just to keep the mailbox clean?

mayall commented 1 year ago

I move anything with the phrase DMARC into the folder to be processed. I do it that way because I'm lazy. For example, the messages from this thread end up there. Basically, I want anything to do with DMARC to end up in that folder and the subfolders.

I understand that my needs may not be shared by others but it seems like the basic filtering idea would be useful for some and not hurt anything.

liuch commented 1 year ago

Believe it or not, I'm also a lazy person. But I don't move my email messages. This work is for a sieve script on my server, I only periodically update the rules. I like the unix way - each program should only do one job and do it well. It seems to me that sorting incoming mail messages is not my project's job. However, I promise to consider your suggestion.

Shnoulle commented 1 year ago

@Shnoulle I already thought about a similar option, because I came across a case where the creation of a subfolder in the folder where the dmarc reports are located is prohibited. As an option, either move it to another mailbox (folder), or mark it in some other way. Optionally, of course. It may be IMAP custom keywords if they are allowed on a server, but I'm not sure if php-imap library supports them, I should check it before.

osticket have some code for this. By default settings is set to INBOX.done

liuch commented 1 year ago

I've already implemented this feature and even more. Now I'm thinking about what to do with the mailbox cleaner: it's necessary to somehow take into account this variety of settings.

liuch commented 1 year ago

Done: 5e8614a. Could you check it out?