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

postgreyreport failing subnet lookups #72

Open
johannessen opened this issue Apr 29, 2019 · 1 comment
Open

postgreyreport failing subnet lookups #72

johannessen opened this issue Apr 29, 2019 · 1 comment

Comments

@johannessen
Copy link

postgreyreport doesn't seem to work with subnet IP lookup. (I haven’t tried with the postgrey --lookup-by-host option enabled.)

The source of the problem seems to be that postgreyreport::do_client_substitutions differs from postgrey::do_client_substitutions. Specifically, the current version of postgrey appends /24 (or whatever the value of ipv4cidr is) to the subnet address, while postgreyreport does not.

As a result, postgreyreport::is_fatal_triplet fails to match the subnet keys in the database and always returns 1.

This might be a regression from #25.

@abpei
Copy link

abpei commented Feb 15, 2021

After several hours of troubleshooting I found this, so thanks for this post. I believe the issue noted here causes no match with the postgrey.db, therefore time difference calculated is always 0. Consequently, the postgreyreport always considers everything a fatal, no matter what the delay is set to.

image

In case anyone still uses postgreyreport (like myself and I find it extremely useful), editing line 205 and adding the /24/ seems to be a quick but dirty fix. Hopefully the author finds some some time in the future for adjusting this the proper way.

my $subkey = lc "$subnet/24/$sender/$recipient"; # subnet key 1.2.3.0/sender/recipient

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

2 participants