Reconfiguring webmail URL after install

Dear sirs,

I just installed MIAB, and I’m trying to figure out what to do to achieve below, if possible. My hostname is ‘svr1’.

I observe that:

  • svr1 dot abcde dot com shows the “this is mailinabox, take control of your email…” page
  • svr1 dot abcde dot com fwdslash admin is the admin login page, while
  • svr1 dot abcde dot com fwdslash mail is the webmail login page

I have a domain existing …hosting a website.

I want to add a MIAB server such that user emails can be accessible from a simple url such as fwdslash webmail

I dont see any option in the GUI to make changes to the webmail URL.

How or where do I make necessary changes.

Please help or advise.

Note: when I tried to submit, I get prompted that I can only use 2-links, thats why I used the words instead. Apologies.

Changing the url is an unsupported modification. The search will provide you multiple topics

If you did not modify anything, the mail is also reachable by But you mention an existing website, how are you hosting that?

the website is hosted on a another hosting provider.
I want to user MIAB only for their emails

You probably use a Custom DNS entry to forward the url to the other hosting provider, correct? In that case, is not reachable.
Alternatively, you can setup, which is equally short:

First, create the file STORAGE_ROOT/www/custom.yaml and add to it the following text:

Then, add a mail user or alias:
This should give you access to the webmail using, although you will see the mention of box in the resulting url.

Instead of dealing with miab, I have a logical suggestion.
Install rainloop webmail at

Add maib domains from .

Emails such as gmail outlook yandex and are supported.

Dear sirs,

Thanks for your replies so far.

Maybe let me re-clarify

I setup the server as, therefore webmail URL is
DNS are, This works properly.

For domain2, a new domain, no website, nothing, I set the DNS records for entire domain to the above DNSs, thus webmail is accessible through

For domain3, website is existing already, so it has DNS records already.
I would like to access webmail via domain3/mail.
What should I do.


Hello there,

Just to clarify: do you mean to say I should set up a subdomain then add below code into a custom.yaml

Im lost with custom.yaml.
do I put this code into an index.php file or index.html?

Please clarify.


1 - Let’s add a user for dns.

user added

root@home:~# cd /usr/local/lib/
root@home:/usr/local/lib# cp -r roundcubemail webmail
root@home:/usr/local/lib# cd webmail/config/
root@home:/usr/local/lib/webmail/config# nano


////$config['session_path'] = '/mail/';
$config['session_path'] = '/';

save and close

root@home:~# nano /etc/nginx/conf.d/webmail.conf

Paste it into webmail.conf.
Edit the domain name!

## Cum 19 Oca 2024 00:15:46 
server {
	listen 80;
	listen [::]:80;

	root /tmp/invalid-path-nothing-here;

	# Improve privacy: Hide version an OS information on
	# error pages and in the "Server" HTTP-Header.
	server_tokens off;

	location / {
		# Redirect using the 'return' directive and the built-in
		# variable '$request_uri' to avoid any capturing, matching
		# or evaluation of regular expressions.
		return 301$request_uri;


	location /.well-known/acme-challenge/ {
		# This path must be served over HTTP for ACME domain validation.
		# We map this to a special path where our TLS cert provisioning
		# tool knows to store challenge response files.
		alias /home/user-data/ssl/lets_encrypt/webroot/.well-known/acme-challenge/;

# The secure HTTPS server.
server {
	listen 443 ssl http2;
	listen [::]:443 ssl http2;


	# Improve privacy: Hide version an OS information on
	# error pages and in the "Server" HTTP-Header.
	server_tokens off;

	ssl_certificate /home/user-data/ssl/ssl_certificate.pem;
	ssl_certificate_key /home/user-data/ssl/ssl_private_key.pem;

	# Expose this directory as static files.
	#root /home/user-data/www/default;
	root /usr/local/lib/webmail;
	index index.php index.html index.htm;

	location = /robots.txt {
		log_not_found off;
		access_log off;

	location = /favicon.ico {
		log_not_found off;
		access_log off;

        location ~ /config/.* {
                # A ~-style location is needed to give this precedence over the next block.
                return 403;

        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
		        fastcgi_pass php-fpm;
                fastcgi_index index.php;
                include /etc/nginx/fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                # file upload limit to match the corresponding Postfix limit.
                client_max_body_size 128M;
	location ~ /\.(ht|svn|git|hg|bzr) {
		log_not_found off;
		access_log off;
		deny all;
	access_log /var/log/nginx/;
	error_log /var/log/nginx/;



save and close

root@home:~# nginx -s reload

Happy :blush:

You are responsible for any system damage.

Important Note:
Use the method I explained with External DNS.
Unfortunately, the method I explained conflicts with miab dns.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.