-2

I am working on a system where we have Moodle software on one domain (I'll call it moodlehost.com) which is making a LOGIN connection to a SMTP server on another domain (I'll call it smtphost.com). I was brought in to work on the Moodle side of things, but I've ended up going some DNS work too, though I'm not an expert on DNS or server admin.

I have the Moodle software on moodlehost.com logging into the SMTP server on smtphost.com, with SPF on smtphost.com configured to approve email from the moodlehost.com IP. It's working nicely and passing all spam-filter checks with flying colors. Note: The MX for smtphost.com is a mail server which I'll call underlyingsmtp.com.

** Edit per request from Tim below: To establish a connection to the SMTP server from Moodle, I type in smtphost.com with port 587. However, the MX record for smtphost.com points to a different mail server, underlyingsmtp.com. (Now that you ask about it, I recall that the MX is only for INCOMING mail, right? So the MX record for smtphost.com would be irrelevant to outgoing mail sent through smtphost.com? In that case, my question is the same: Why would I point the MX record for moodlehost.com at the same address as the MX record on smtphost.com?)

The system admin who runs the system I'm working on wants me to set MX records on moodlehost.com so they point to underlyingsmtp.com, even though moodlehost.com doesn't exist on that server and any incoming mail @moodlehost.com bounces as a result. His explanation is "Mixing the sends is (mostly) where a backlisting can possibly occur. All or nothing is best with forwarded mail, that's all."

Again, I'm not a server guy, but this doesn't make any sense to me. As soon as moodlehost.com hands off the outgoing mail to the SMTP server on smtphost.com it's out of the picture, and the outgoing emails are all passing SPF, DKIM, and DMARC. I don't see how pointing the moodlehost.com MX at underlyingsmtp.com helps, and it actually seems like it might look suspicious if we're pointing MX at a mail server where we don't have an account so any incoming mail bounces.

Could anyone help me understand if pointing the MX at underlyingsmtp.com makes sense, and if so, why? Thanks very much for your time.

** Edit: We don't anticipate having any incoming mail to moodlehost.com, but if we do it certainly can't and won't be handled by underlyingsmtp.com. The server that HAS been handling incoming mail is moodlehost.com. It's the only one that would do so. If we point the MX records elsewhere, mail will simply bounce.

My question is this: If I have a script on site A making an SMTP connection to server B in order to send mail, is there any reason why site A's MX records would also need to point to server B?

  • Your question confuses me. Please edit your question to make the relationship between smtphost.com and underlyingsmtp.com more clear. Email and web hosting are completely independent. – Tim Aug 12 '17 at 21:40
  • Tim, thanks for requesting clarification. I've edited it above. Now that you asked, I believe the MX record pointing to what I called (incorrectly?) underlyingsmtp.com would be irrelevant? At any rate, hopefully my edit above clarifies things. – D Vogel Aug 12 '17 at 22:07
  • Not confident enough for an 'answer', but: my gut instinct is the same as yours. There's no formal reason I know of why the MX needs to be the same as the server(s) from which outgoing mail originates, and several reasons why it wouldn't be. I am, as always, happy to be corrected though :) – Craig Miskell Aug 12 '17 at 22:25
  • 1
    I think you need to really work out what server handles your incoming mail. MX records are for incoming email only, but you also need to consider SPF regarding outgoing email. – Tim Aug 12 '17 at 22:45
  • Tim: We don't anticipate having any incoming mail to moodlehost.com, but if we do it certainly can't and won't be handled by underlyingsmtp.com. The server that HAS been handling incoming mail is moodlehost.com. It's the only one that would do so. If we point the MX records elsewhere, mail will simply bounce. – D Vogel Aug 12 '17 at 22:52
3

Core question: If I have a script on site A making an SMTP connection to server B in order to send mail, is there any reason why site A's MX records would also need to point to server B?

No. MX records specify the server that handles incoming email for an individual domain. Any other domain is irrelevant, including domains that send to it.

  • Tim: Thank you again. One last question, if I may, before I mark this answered. The concern that the system admin expressed was about blacklisting, i.e. that spam filters would object to having the moodlehost.com MX record pointing to moodlehost.com while a script at moodlehost.com was sending out email through an SMTP server at another domain. Is there any reason to think that would look suspicious and get us blacklisted? – D Vogel Aug 13 '17 at 0:43
  • That's a valid concern, but it's unrelated to MX records. For that you need to look at Sender Policy Framework. Basically you set up a DNS record that specifies which servers can send email on behalf of the domain. – Tim Aug 13 '17 at 1:09
  • Right, I have SPF set up and emails are passing SPF checks. Thank again for your time on this. – D Vogel Aug 13 '17 at 1:21
  • No problem. Sometimes half the challenge is working out what the question is. – Tim Aug 13 '17 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.