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
use_backend nasmail if nas_mail_url

Here it is defined that when a URL is or, 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

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


Turn on synology nas with Siri

I have two Synology NAS at home. One of the Nas for backup is usually turned off. I’m not sure if turning it on and off every day will hurt the machine, but I’m sure if it’s not turned off for 24 hours, it will hurt the hard drive. The hard drive for business is about 5~ It will be replaced in 6 years, and this Nas is usually used for nothing and consumes power. Therefore, at this stage, I only let it automatically turn on at a fixed time to receive backup data.


Change the password of my Synology NAS via the command line

Adjust password by command line synouser --setpw admin <yourpassword>


Sharing about gitlab's docker settings

My friend wants to study the operation of gitlab. I said that it takes less than ten minutes to install it with docker image. There is also a gitlab package on my Synology Nas that can be installed directly. As a result, either the installation failed, or it was being repaired, or it was already started and could not be used. @@ Also choked by friends...