Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opendmarc-report issue using GROUP BY #249

Open
tuxtuxdm opened this issue Oct 21, 2023 · 0 comments
Open

opendmarc-report issue using GROUP BY #249

tuxtuxdm opened this issue Oct 21, 2023 · 0 comments

Comments

@tuxtuxdm
Copy link

tuxtuxdm commented Oct 21, 2023

Hi,

it seems for mysql backend there is a problem with this query:

$dbi_s = $dbi_h->prepare("SELECT repuri, adkim, aspf, requests.policy, spolicy, pct, UNIX_TIMESTAMP(lastsent), domains.name FROM requests JOIN messages ON messages.from_domain=requests.domain LEFT JOIN domains ON messages.policy_
domain = domains.id WHERE domain = ? GROUP BY policy_domain");

See:

https://dev.mysql.com/doc/refman/8.0/en/group-by-handling.html

I've fixed it with:

445c445
<       $dbi_s = $dbi_h->prepare("SELECT repuri, adkim, aspf, requests.policy, spolicy, pct, UNIX_TIMESTAMP(lastsent), domains.name FROM requests JOIN messages ON messages.from_domain=requests.domain LEFT JOIN domains ON messages.policy_domain = domains.id WHERE domain = ? GROUP BY policy_domain,repuri,adkim,aspf,requests.policy,spolicy,pct,domains.name,lastsent");
---
>       $dbi_s = $dbi_h->prepare("SELECT repuri, adkim, aspf, requests.policy, spolicy, pct, UNIX_TIMESTAMP(lastsent), domains.name FROM requests JOIN messages ON messages.from_domain=requests.domain LEFT JOIN domains ON messages.policy_domain = domains.id WHERE domain = ? GROUP BY policy_domain");

Best regards,

Dani.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant