1

Topic: Problem with Fail2ban and SOGo

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: Debian Jessie
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Ldap
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue: /var/log/sogo/sogo.log
====
Hello and thanks for your excellent job.
I need help to resolve this problem

I have a fresh install of debian and iRedMail 0.9.5-1

When i try to connect on Sogo page with bad login or password. Fail2ban do nothing. When i look at /var/log/sogo/sogo.log, i see this:

SOGoRootPage Login from 'localhost' for user 'aaa' might not have worked - password policy: 65535  grace: -1  expire: -1  bound: 0

I never see the real IP, it's always localhost, and fail2ban do nothing. The others fail2ban's rules work fine.

-Another problem with Sogo:

I have many errors with Microsoft-server-Active-Sync

[ERROR] <0x0x7f305fa81820[WOHttpTransaction]> client disconnected during delivery of response for <WORequest[0x0x7f305fa48eb0]: method=POST uri=/SOGo/Microsoft-Server-ActiveSync?User=XXXXXX@XXXXXX&DeviceId=Appl7003488GA4S&DeviceType=iPhone&Cmd=Ping app=SOGo rqKey=Microsoft-Server-ActiveSync rqPath=(null)> (len=13): the socket was shutdown.

Thanks in advance

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Problem with Fail2ban and SOGo

kilroy83 wrote:

I never see the real IP, it's always localhost, and fail2ban do nothing. The others fail2ban's rules work fine.

Try this:

Comment out 3 lines in /etc/nginx/templates/sogo.tmpl:

    #proxy_set_header X-Real-IP $remote_addr;
    #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #proxy_set_header Host $host;

Then restart Nginx service and try again.

3

Re: Problem with Fail2ban and SOGo

ZhangHuangbin wrote:
kilroy83 wrote:

I never see the real IP, it's always localhost, and fail2ban do nothing. The others fail2ban's rules work fine.

Try this:

Comment out 3 lines in /etc/nginx/templates/sogo.tmpl:

    #proxy_set_header X-Real-IP $remote_addr;
    #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #proxy_set_header Host $host;

Then restart Nginx service and try again.


It work fine now, thank you very much.

4

Re: Problem with Fail2ban and SOGo

This fix will be covered in iRedMail upgrade tutorial for iRedMail-0.9.5-1. And thanks for buying me a cup of coffee. smile