Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mailgun messages from subdomain without MX record get rejected by some mail-providers

I'd like to use Mailgun to send e-mails from a web application, sending newsletters as well as transactional mails.

I set up a sudomain "subdomain.domain.tld" and configured the DNS as specified on the Mailgun panel, except for the (optional) MX record needed to recieve mail at that subdomain. This is because the current hoster/domain-registrar doesn't allow setting an MX record for subdomains, just for the main domain. Their support says something like 'We don't care about this, deal with it.'.

I don't want to configure the main domain for the use by Mailgun, as the client is recieving regular e-mail the main domain that is handled by other servers.

The current setup allows me to send mail using mailgun with the "From"-address "[email protected]" to most major E-Mail providers including Gmail, Yahoo and Hotmail. However the mails get rejected by some providers (e.g. mail.ru, freenet.de or arcor.de), with an error messages like the following:

<bounce+gibberish-user@[email protected]>: Sender address rejected: Domain not found 

Other providers have slightly different messages, but point to the same problem:

  • Domain of sender address [..] does not exist.
  • Unrouteable mail domain, verifying bounce failed
  • Unroutable sender address

It seems to me that the mails get rejected because of the missing MX record for subdomain.domain.tld , as used within the bounce address.

How do I solve this problem without moving the complete domain to another registrar that allows me to change MX records for subdomains? I would really like to avoid this.

Is it possible to configure mailgun to use different bounce addresses that are actually valid independent of my MX records? For example [email protected] instead of [email protected]?

like image 703
theister Avatar asked Jan 13 '15 20:01

theister


People also ask

Can I send email without MX record?

An MX (Mail eXchange) record is a DNS record pointing to the mail server that is responsible for handling email for a given domain. You can send emails without the MX record configured for your domain name, but you will not be able to receive emails without it.

How do I verify my DNS for mailgun?

1) Login to the Mailgun control panel and select the Domains section. 2) Select any domain that is in the orange “unverified” state. 3) In the Domain Verification & DNS section, locate the records with the red warning indicator.

Does SMTP use MX records?

A DNS 'mail exchange' (MX) record directs email to a mail server. The MX record indicates how email messages should be routed in accordance with the Simple Mail Transfer Protocol (SMTP, the standard protocol for all email).

Are MX records for sending or receiving?

Mail Exchange (MX) records are DNS records that are necessary for delivering email to your address. In simple DNS terms, an MX record is used to tell the world which mail servers accept incoming mail for your domain and where emails sent to your domain should be routed to.


2 Answers

Three possible solutions, in order of preference:

  1. Find a different DNS provider, that will allow you to put an MX on a subdomain. Note that this does not necessarily require you to change registrars.

  2. Use your base domain with mailgun, perhaps utilizing their forwarding feature to send incoming mails to whoever hosts your mailboxes.

  3. Use someone other than mailgun, that will allow the bounce address to be set to their domain instead of yours.

like image 144
Joe Sniderman Avatar answered Oct 06 '22 21:10

Joe Sniderman


My setup:

  • root MX set up for gmail. Sends and receives as @mydomain.com
  • added mailgun and delivers as @mg.mydomain.com
  • getting bounces when doing mailgun sends to certain email providers (e.g. sbcglobal.net) because as mailgun said, don't add MX record if I already have another email service set up to use MX records.

My fix:

  • Contacted godaddy support. They told me I could add more MX records for my subdomain. Instead of MX @ mxa.mailgun , it's MX mg mxa.mailgun

Hope this helps.

like image 21
theNotSoPro Avatar answered Oct 06 '22 19:10

theNotSoPro