Roundcube Community Forum

 

geoip blocking apache2 on debian bookworm

Started by broerman, April 21, 2025, 06:56:50 AM

Previous topic - Next topic

broerman

Helle ,
I stuck in configuring geoip blocking for roundcube access. I tried maxminddb_module, where lookup fails. geoip_module examines country code, but fails in defining condition.



DocumentRoot /var/lib/roundcube/
...

GeoIPEnable On
GeoIPDBFile /usr/share/GeoIP/GeoIP.dat

<Directory "/var/lib/roundcube">

    Header set X-Country-Code "%{GEOIP_COUNTRY_CODE}e"
    SetEnvIf GEOIP_COUNTRY_CODE ^(DE|AT)$ AllowCountry

    Options +FollowSymLinks
    AllowOverride None

    #1 fail  Require env AllowedCountry


    #2 fail Deny from all
    #2 fail Allow from env=AllowCountry

    #3 fail <If "-n %{ENV:AllowCountry}" >
    #3 fail     Require all granted
    #3 fail </If>

    Require all granted

</Directory>


Can somebody point me out to bock ips by country code for roundcubemail?

ii  apache2              2.4.62-1~deb12u2     amd64        Apache HTTP Server
ii  libapache2-mod-geoip 1.2.10-1+b1          amd64        GeoIP support for apache2
ii  roundcube            1.6.5+dfsg-1+deb12u4 all          skinnable AJAX based webmail solution for IMAP servers - metapackage