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

synology,log center,rsyslog,syslog

Use the Synology Log Center to centrally view the logs of the host

This article introduces how I use the Synology Log Center to record all the logs of my home host. In Synolog's log center, we can search through its UI. In this way, we can centrally view our logs, such as the scheduled execution status of Linux hosts. It can also send messages to the log center through commands, and we can check the daily backup tasks of the Linux host at any time, whether the backup is successful or failed, etc.


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.


Remove IP of Synology NAS Block via command line

In some cases, your IP may be locked by the Synology NAS, for example, the email host is installed on the Synology NAS, and the email password is incorrectly set. Or Synology did not correctly set the forward header of the real IP on the internal network. No matter what the reason is, we want to remove the locked IP through the command line.