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.
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.