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

Updating the GeoIP database gives error #1287

Closed
dwhile opened this issue Sep 6, 2023 · 1 comment
Closed

Updating the GeoIP database gives error #1287

dwhile opened this issue Sep 6, 2023 · 1 comment

Comments

@dwhile
Copy link

dwhile commented Sep 6, 2023

When updating the GeoIP database from the interface the following is output:

Downloading file, please wait...
Error occurred while downloading GeoIP data file: Response could not be parsed
Download complete, unpacking files...

GeoIP data file successfully unpacked
Process completed!

On investigation it is because the server is using the HTTP2 protocol and in mailscanner/lib/request/Request.php the returned headers are only checked for a 1.{x} response. So an error is generated.

changing line 572 in mailscanner/lib/request/Request.php from:
preg_match('#^HTTP/1.\d[ \t]+(\d+)#i', array_shift($headers), $matches);
to:
preg_match('#^HTTP[/1.\d]|[2][ \t]+(\d+)#i', array_shift($headers), $matches);

Solves this problem and allows the update to work correctly.

@endelwar
Copy link
Member

endelwar commented Sep 6, 2023

Thank you!

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