Skip to content

Conversation

@borutmrak
Copy link

@borutmrak borutmrak commented Jun 6, 2025

policyd-rate-limit uses builtin module imp, which was removed from Python 3.12.

The changes required were minimal as it was only used in one place (first commit)

The second commit was added because without it pip installed the version from pypi. Maybe there is another solution but the invocation in Makefile did not install from the local tar archive until I bumped the version number. You probably do no want to merge it but I'm including it anyway.

Closes: #31

@rhclayto
Copy link

Looks like this repo is umaintained? This breaking bug got included in the Debian package for Debian 13, where python 3.13 is in the package repository. So the Debian package policyd-rate-limit is broken.

Hope this gets merged.

@borutmrak
Copy link
Author

Looks like this repo is umaintained? This breaking bug got included in the Debian package for Debian 13, where python 3.13 is in the package repository. So the Debian package policyd-rate-limit is broken.

Hope this gets merged.

Sure does look like it :) I just fixed this when I needed it and did this PR. I'm actually using my own fork until this gets merged. Do you know of any other solutions for rate limiting with postfix? At the time I was looking for something to limit various deployments that have to be able to send mail (but not much).

@rhclayto
Copy link

I found a policyd-rate-limit written in Go that was recently created: https://github.com/nbari/policyd-rate-limit . I am going to try it out.

@borutmrak
Copy link
Author

We think alike - nbari/policyd-rate-limit#11

@rhclayto
Copy link

rhclayto commented Dec 30, 2025

I was mistaken too, it's Rust, not Go. From a quick look at the code (not a Rust expert though) it doesn't look like multiple rate limits are possible.

https://github.com/nbari/policyd-rate-limit/blob/main/src/cli/actions/run.rs#L149

@rhclayto
Copy link

There's this one too: https://github.com/thc2cat/go-policyd This is the one in Go I saw before.

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

Successfully merging this pull request may close these issues.

Ubuntu 24.04: policyd-rate-limit broken in python3.12: import imp errors on files "policyd.py" and "utils.py": No module named 'imp'

2 participants