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 abcde.com existing …hosting a website.

I want to add a MIAB server such that user emails can be accessible from a simple url such as abcde.com 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.
1960Web

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 abcde.com/mail. But you mention an existing website abcde.com, how are you hosting that?

@KierkerJan
the website abcde.com 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 abcde.com url to the other hosting provider, correct? In that case, abcde.com/mail is not reachable.
Alternatively, you can setup mail.abcde.com, which is equally short:

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

mail.abcde.com:
    redirects:
        ^/$: https://box.abcde.com/mail

Then, add a mail user or alias: newuser@mail.abcde.com
This should give you access to the webmail using mail.abcde.com, 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 webmail.contoso.com.
webmail.contoso.com/?admin

Add maib domains from .

Emails such as gmail outlook yandex and mail.ru are supported.

Dear sirs,

Thanks for your replies so far.

Maybe let me re-clarify

I setup the server as box.domain1.com, therefore webmail URL is box.domain1.com/mail
DNS are ns1.box.domain1.com, ns2.box.domain1.com. 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 domain2.com/mail

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.

regards
1960web

Hello there,

Just to clarify: do you mean to say I should set up a subdomain mail.abcde.com? 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.

thanks
1960web

webmail.home.caylak.tk

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

replace

////$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!

## webmail.home.caylak.tk
## Cum 19 Oca 2024 00:15:46 
server {
	listen 80;
	listen [::]:80;

	server_name webmail.home.caylak.tk;
	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 https://webmail.home.caylak.tk$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;

	server_name webmail.home.caylak.tk;

	# 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/webmail.home.caylak.tk-access.log;
	error_log /var/log/nginx/webmail.home.caylak.tk-error.log;

}

## home.caylak.tk

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.