Not receiving email Digital Ocean - email

I set up my own email server on my Digital Ocean droplet, created A and MX records for it, but am not receiving emails at my email address. How do I fix this so I receive email?

The MX record needs a name in many cases - not an IP address. Have two DNS records like below (wait 10 mins for any changes to propagate):
Type Hostname Value TTL
A mail.[domainname.com] [IP address] 3600
MX [domainname.com] mail.[domainname.com] 14400

You can easily setup mail client using 3rd party services too! For example : mailgun (https://www.mailgun.com/), mailchimp etc..
Easy to use and perfect for beginners.

Related

How to set up email forwarding from AWS domain?

I've got a domain myawsdomain.com on AWS through Route 53.
I have an email server set up with a different service under a different domain myemaildomain.com.
I have an email account set up for fred#myemaildomain.com.
I'd like to have an address inquiry#myawsdomain.com forward directly to fred#myemaildomain.com. Is there a way to do that with just DNS, or am I going to need an email server running at myawsdomain.com to make this happen?
You can point the MX records at any provider willing (and configured) to handle email for your domain. Most paid email hosts will allow you to point multiple domains at their service.
MX records are separate from your other records, so you can point your A at AWS and your MX at, say, Google Apps. (Note: there are special oddities with CNAMEs - they can't coexist with a MX.)

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 "mail#domain.tld" 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#=provider#subdomain.domain.tld>: 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 bounce-gibberish-mydomain-tld#mailgun.com instead of bounce-gibberish#mydomain.tld?
Three possible solutions, in order of preference:
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.
Use your base domain with mailgun, perhaps utilizing their forwarding feature to send incoming mails to whoever hosts your mailboxes.
Use someone other than mailgun, that will allow the bounce address to be set to their domain instead of yours.
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.
I ran into the same issue. In my case I'm using Office 365 for receiving emails and Mailgun to send emails. Here is my DNS config for my Mailgun subdomain mg.{name}.com which solved the problem:
email IN CNAME mailgun.org.
email.mg IN CNAME mailgun.org.
mg IN CNAME mailgun.org.
# IN MX 0 {name}-com.mail.protection.outlook.com.
# IN MX 10 mxb.mailgun.org.
# IN MX 10 mxa.mailgun.org.
# IN TXT "v=spf1 include:spf.protection.outlook.com include:mailgun.org ~all"
krs._domainkey.mg IN TXT "k=rsa; p={insert the value from mailgun here}"
One very important thing, is that you can't have two SPF lines in your config. I had to merge these two lines...
# IN TXT "v=spf1 include:spf.protection.outlook.com -all"
# IN TXT "v=spf1 include:mailgun.org ~all"
into one...
# IN TXT "v=spf1 include:spf.protection.outlook.com include:mailgun.org ~all"

How does email delivery work between mail servers?

How does an email address actually work?
I know how dns translates domain names into IP addresses so that it knows where the person wants to go, but I have no idea how email addresses work.
Thanks in advance,
Francis
The very short answer is: using MX records.
The domain-part (i.e. the stuff to the right of the #-character) is used in a DNS query to find the MX records for that domain. Like there are A-records for finding IP addresses, MX records stand for mail exchanger records and points to one or more servers that are responsible for all emails to the specified domain.
When you send an email, your email server finds the MX records for the recipient's domain and delivers the email to that server. The part to the left of the #-character in the email address then identifies the specific mailbox at that server.

Allow to send mail from domain with SPF record

I have question concerning SPF records.
The website (eg www.example.com) of one of my clients has a contact form that sends mails to contact#example.com.
We only provide the hosting of the website so we do not manage email accounts, DNS records, etc .. only webspace. So my clients manages the DNS settings, nameservers, mail servers, etc..
The mails are sent using PHP but they are never received by contact#example.com
When I change contact#example.com to an email address outside the domein eg contact#test.com, I do receive the contact email.
My conclusion is that their mailserver blocks mails from our IP address because PHP sends mails to an email address that has the same domain but has another IP.
Also, my client uses Google Apps for email so the MX records on their DNS server point to Google.
How can I fix this issue? Does my client need to add an SPF record that accepts our IP address? If so, whats the correct SPF syntax for this?
If your the domain has SPF records defined then you need to add the address of the web server to the SPF records.
You can check the SPF records of the domain on this website: http://spf.myisp.ch
The best way would be to check the log files on the web server or on the server of the receiver to find out what the problem is.
Make sure cpanel does not have any MX records since you are not hosting the dns

What should I use for SPF record of my domain?

I have example1.com hosted on host.example2.com. Typical cpanel scenario. And:
And example1.com is installed with Magento which sends many sorts of emails to the users from host.example2.com.
And I also set up example1.com with Google Apps with its MX entries as required by them.
Very typical. So I came up with this SPF record for example1.com:
v=spf1 a mx include:host.example2.com include:_spf.google.com -all
Is this correct?
It seems not because when I used the on-site contact form on example1.com to send a test visitor message (which was sent to my Google Apps email from host.example2.com), the email I received in Google Apps inbox was still with a 'via' field (via host.example2.com). I figure this means Google email takes this message to be not sent by example1.com ITSELF?
This record has been created since 2 days ago and the 'via' field was still present when example1.com tries to send a message from the server of host.example2.com.
If anyone could enlighten me on this that'd be really appreciated! Thanks!
The SPF record has nothing to do with the way the receiving server identifies the transmitting server.
The receiving server identifies the transmitting server by its IP address, a reverse DNS lookup on that IP address, and the HELO name it gives at the start of the mail session.
On the other hand SPF is used to determine if the transmitting server is authorized to use the envelope reverse-path address and HELO name.