in reply to REMOTE_ADDR not working

This is probably caused by a proxy server, so check the content of $ENV{HTTP_X_FORWARDED_FOR}