Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Adding domain name same as mailcow domain #2106

Closed
ghost opened this issue Dec 19, 2018 · 6 comments
Closed

[question] Adding domain name same as mailcow domain #2106

ghost opened this issue Dec 19, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Dec 19, 2018

I have installed mailcow using the domain mail.test.domain.tld.

now I want to add that same domain on the add domain page in the mailcow UI and im getting an error.
Is this not possible?

I have configured A record domain mail.test.domain.tld to point to my server ip and MX record domain mail.test.domain.tld pointing to the same server ip.

Im very new to this. hope someone can help. would really appreciate it.

@mkuron
Copy link
Member

mkuron commented Dec 19, 2018

You can remove the check from the code and it will work. Details are in some ticket I couldn't find. The check mainly exists to discourage people from confusing their host name and domain -- barely anyone uses the domain as the mail server's host name. But there is no technical reason not to.

@mkuron mkuron closed this as completed Dec 19, 2018
@andryyy
Copy link
Contributor

andryyy commented Dec 19, 2018

There was a time we had the hostname in mydestination, I think. Not sure, but there could be something else I am missing now.

@ghost
Copy link
Author

ghost commented Dec 20, 2018

thanks for getting back to me @mkuron however, I couldn't find the code. could you tell me in which file the code is? that would be very helpful. i couldn't find the ticket with the details either.. please help. thanks!

@ghost
Copy link
Author

ghost commented Dec 20, 2018

never mind. found the code and removed it. its working now. much thanks!

@Coronon
Copy link

Coronon commented Dec 31, 2021

never mind. found the code and removed it. its working now. much thanks!

This is not very useful to people that find this while they have the exact same problem... Does anyone know where to find these mysterious lines?

Edit: It seems the following if is responsible in functions.mailbox.inc.php:

if ($domain == getenv('MAILCOW_HOSTNAME')) {
  $_SESSION['return'][] = array(
    'type' => 'danger',
    'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),
    'msg' => 'domain_cannot_match_hostname'
  );
  return false;
}

Maybe this should become a warning, not an error one needs to "fix" by changing the code?

@ciroiriarte
Copy link

Hello, can this be moved to an optional check?. I don't want to monkey patch my installation.
In my case, I use a mail-specific domain (mydomain.email), so it doesn't handle anything else appart from email service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants