Local webmail link with domain pointed external?

Metro2

Well-Known Member
May 24, 2006
473
49
178
USA
cPanel Access Level
Root Administrator
This might be a silly question but I've been digging around and can't seem to find a real way to do this.

Scenario - user has cPanel account and keeping email hosted on local server, but the A record for the domain is pointed to a different host destination, and I'm wondering there's a way to give a direct webmail link without them logging into cPanel or using the hostname.

I already know how to set the MX and mail A record to keep mail local while the domain's master A record points to different host / destination like so:

example.com. 14400 IN MX Priority: 0 Destination: mail.example.com
mail.example.com. 14400 IN A xxx.xxx.xxx.xxx (local IP of server)

Which is fine for most users who use mail client software local on their device.

BUT what I'd LIKE to be able to do is give them a webmail link for Roundcube or Horder that does NOT require using the server's hostname (long story, but suffice to say the person "managing" mail for their company is not allowed to access cPanel and does not want to use local mail client software on their computer, or offload to different webmail service).

Obvious example.com/webmail does not work when the domain's master A record points to different host, but I'm wondering if it's possible to create a custom DNS entry that would give them some kind of webmail URL like webmail.example.com that allows them direct access to RoundCube / Horde, instead of hostname.com/webmail or hostname.com:2096

Is such a thing possible?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,297
1,251
313
Houston
  • Like
Reactions: Metro2

Metro2

Well-Known Member
May 24, 2006
473
49
178
USA
cPanel Access Level
Root Administrator
Hi @cPanelLauren - I was just coming here to post the solution I came up with and see that you responded. Thanks for the reply and the link.

Early this morning I did something a little different than your example, and this *might* actually be safer / more "recommended" method for some people, and it's actually quite simple. Just in case this can help someone else someday here's what I did:

1. In cPanel > Subdomains - created a subdomain getmail.example.com (obviously user's domain in place of example.com)

2. In cPanel > Redirects - set getmail.example.com to redirect to https://server.hostnameexample.com:2096/ (obviously my server's hostname in place of server.hostnameexample)

3. Told user to use https://getmail.example.com to access their Webmail

Works nicely, easy to implement, user is happy :)

But if you think there are any concerns with my method please feel free to critique / give your opinion / let me know if there are any downsides to my method.

Thank you again for the response, always appreciated!
 
  • Like
Reactions: cPanelLauren

brt

Well-Known Member
Jul 9, 2015
103
9
68
US
cPanel Access Level
Root Administrator
I'm curious why no one so far is just using webmail.domain.com and letting it redirect, as cPanel does by default now, to https://webmail.domain.com?

If this is an old account it might not have the newer configuration quite right to do that, but that's what current cPanel servers do.... and the nice part is it uses the standard https port, so no :2096 in the URL.

This would work regardless of the website being hosted on the cPanel server or not, as long as webmail.domain.com was pointed at the cPanel server.

No, seriously, this is just standard cPanel 101 -- @cPanelLauren why did you not point this out to the OP?

@Metro2, this is your best bet by far -- no extra additional hostnames/redirects, and it runs on the standard https port.
 
Last edited by a moderator:
  • Like
Reactions: cPanelLauren