Topic: HAProxy + iredmail + Sogo
==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.8 (Apr 20th)
- Linux/BSD distribution name and version: FreebSD 11.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? no
====
Hi,
I set up IredMail in a jail. For the installation I used the "LOCAL_ADDRESS='172.16.13.1' bash iRedMail.sh" command.
Everything was installed successfully, except the following warning:
------------------------------------------------------------------------------------------------------------------
WARNING: Clamd was NOT notified: Can't connect to clamd through /var/run/clamav/clamd.sock: No such file or directory.
------------------------------------------------------------------------------------------------------------------
On the host I installed HAProxy with the following configuration:
------------------------------------------------------------------------------------------------------------------
frontend web server
bind :443 ssl crt /zroot/share/certs/
use_backend mail if { ssl_fc_sni -i mail.xxx.yyy }
backend mail
balance roundrobin
mode http
server mail 172.16.13.1:443 weight 1 maxconn 1024 check ssl verify none
listen smtp
bind :25
mode tcp
option tcplog
timeout server 1m
timeout connect 5s
server mail mail.xxx.yyy:25 send-proxy check
------------------------------------------------------------------------------------------------------------------
I also added in the main.cf "postscreen_upstream_proxy_protocol = haproxy".
Receiving mails is no problem, but when I'm trying to send a mail, sogo mentioned, that it could not find a smtp server:
----------
May 05 06:10:40 sogod [778]: [ERROR] <0x0x8124ed0c0[SOGoMailer]> Could not connect to the SMTP server 172.16.13.1 on port 25
----------
The only way to be able to send emails via sogo was to change the "SOGoSMTPServer" in the sogo.conf to the dns name mail.xxx.yyy, which was set during the installation to the IP address.
I mean, it is working now and some kind of logical as the jail does not listen on port 25 as the host is already listening on that, but wouldn't it be better to set the dns name instead of the IP address overall during the installation?
Or is there an other trick regarding haproxy, iredmail and sogo?
Best,
Arne
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.