by Devin Yang
(This article was automatically translated.)

Published - 1 year ago ( Updated - 1 year ago )

This article explains the version of DSM7.
The Package Center of Synology Nas provides two Mail Servers, one is Synology Mail Server and the other is Synology MailPlus.
For me, the advantage of Synology MailPlus is that he can easily specify a domain name in the login portal, but it is limited to a maximum of five accounts, and if there are more accounts, you will have to buy a license.
If you use Synoloyg Mail Server, there will be no limit on the number of accounts, but it does not have an integrated login portal. If you install the webmail of Mail Station,
There will be a path of /mail in the directory of the website. Although it is not in the way, I just don't like it.

Good news, my Synology Nas is not directly external, I have a HAProyx to guide related services.
So through a simple setting, I can remove /mail, and automatically fill in the /mail folder when sending the request to the backend through the Proxy.
As shown in the picture below, have you noticed that the URL does not have a /mail path:

After logging in, you can see that the URL path below is also without /mail path:p

Sending letters to Gmail also looks normal😛

How do I set up HAProxy?
1. First, define the domain name of my WebMail: (The following is the relevant setting of my HAProxy)

acl nas_mail_url hdr_beg(host) -i mail.e-course.app mail.ccc.tc
use_backend nasmail if nas_mail_url

Here it is defined that when a URL is mail.e-course.app or mail.ccc.tc, the backend of nasmail is used.

2. In the backend of HAProxy, I did this. Here acl and http-request are the focus of this article.

    backend nasmail
       mode http
       balance roundrobin
       fullconn   10000
       cookie SITEID insert indirect nocache
       acl mail_folder path_beg -i /mail/
       http-request set-path /mail/%[path] if !mail_folder
       server nasmail 192.168.99.130:80

The meaning of http-request set-path here means that if there is no /mail/ in the path of the URL, /mail/ will be added.
If you have made the relevant settings, but the result still automatically ran out of the /mail folder, it is speculated that the possible reason is caused by the browser cache.
You can try to clear the browser data, or verify with another browser to see if the settings are correct.

Tags: Synology haproxy

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


docker,Synology

How to modify the logging driver of Docker on Synolog NAS

On my Synolog Nas, a strange logging driver named db is running by default, how to modify it to a normal json-file? In Synolog's Nas, his Daemon config file is special, and it is placed in the /var/packages/Docker/etc/ directory. Called dockerd.json.

ssl,haproxy,certbot

Perfect SSL certificate automatic update environment (HAProxy plus certbot)

HAProxy's reloading speed is very fast, and I don't feel that there is a restart. It is really convenient for all credentials to be handled by HAProxy. Host environment requirements, please confirm that you have the following two instructions (How to install Ubuntu? apt-get install -y haproxy cerbot, I guess, if not, please Google)

laravel,letsencrypt,haproxy

PHPENV's HAProxy environment is set up with free SSL certificate application

PHPENV has added the support of haproxy.yml. If you have an external IP and domain name, it should be quite simple to get HAProxy and certificate application through deviny/phpenv. In this article, let us see how to use HAProxy in the HAProxy environment setting in PHPENV.