Multiple Domains - 2 separate VPS

I have 2 VPSs both go through cloud flare.

A-VPS = Web Server with multiple Domains
B-VPS = Mail In a Box

I believe I have the Mail In a Box setup correctly. I do have a few errors on the status check page but not sure it is related to using cloud flare or if I did something wrong. I will be glad to share errors.

I can send/receive emails so it seems to be working.

Here is the goal.

When I send an email just using php the receiver sees www-data from a web form. I would like them to see admin@somedomain.com or even just domain.com - I think I have solved this using my main (1) domain.

However, I would like to add multiple domains. I have read through the documentation as well as searched google which seems to always lead me to here. Everything talks about adding my glue records from what I can tell or A/AAAA. To be honest I am a little confused.

Bottom line - I want to add multiple domains to be used in this manner as explained above.

Thanks,

BR

When you are not using the MiaB DNS server for mail-related services, you are mostly on your own, as MiaB is configured to function this way.

Glue records is a term for creating a name server record using your domain. For ns1.box.example.net to be the name server for example.net, there must exist a record some place pointing to the IP address of the server. Since the name server record is served by the domain registrar, the domain registrar is where the glue record must be created. So somewhere in your registrar’s interface will be some option, possibly with a different name, for creating the glue record.

Adding a domain to MiaB is performed by adding an email address for the domain in the admin dashboard.

As far as using MiaB as a relay, there is a guide for this in the docs:

But you will have to configure your web applications to provide the desired envelope data.

Glue records have nothing to do with this situation so let’s stop that conversation here. @BeardedRazorback

First off, do not proxy email through CloudFlare. I am honestly shocked that it works. Now, on to your concern…

You need to tell your web form which address to use as the sender address, and this address must be either the address that you use to authenticate with SMTP to your MiaB (something that you are not doing using PHPmail) or a permitted sender of that address. Note, since it plays a role in domain validation the use of admin@ email addresses is not advised.

So as you have described it, this is not a MiaB issue at all since you are sending emails directly from the server using PHP. But if you want to send via MiaB using SMTP you need to take heed of the requirements I have listed.

Add a user account for each domain in your MIAB control panel and update the applicable mail DNS records for each domain.

PHPMailer is bulletproof for sending mail via PHP in a manner that recipient mailservers expect.

Don’t make me laugh.

Sure PHPMailer may do everything right, but it is all the other things that so many people overlook that are the problem.

rDNS
DKIM
SPF
Proper configuration of postfix/sendmail

and so on. Also PHPMailer does not authenticate emails so often times recipient servers block them simply for being sent unauthenticated.

No, in this day and age emails should really be sent via SMTP rather than simply through the web server.

1 Like

$mail->SMTPAuth = true;

$mail->isSMTP();

Ok thanks. Working on it now. I am trying to figure out how to convert my php form to be authenticated via the MiaB smtp server. I have not ever done this, but working thought it.

First off, do not proxy email through CloudFlare. I am honestly shocked that it works. Now, on to your concern…

You can use Cloudflare for external MIAB hosting, but it must be GRAY cloud (ie, no Orange Cloud proxy), otherwise it will not work properly, as Alento mentioned.

Just adding for clarity sakes.

1 Like

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