I use ubuntu 16.04 on my server and recently I've installed postfix MTA on my server following this tutorial.
The problem is the email I send goes into spam, not inbox. Any idea what's wrong and how can I fix it? Noted that my domain name isn't into black list. Because few months ago, I did in on another server and emails sent as well (they went into inbox).
Also I send email via command line interface like this:
echo "This is the body of the email" | mail -s "This is the subject line" <my_email>
What should I do now?
Also this is my /etc/postfix/main.cf file on the server and this is my DNS records on cloudflare:
As a starter you SPF record, does not allow your mail server to send mails on behalf of your domain, it only allows Zoho's servers to sent such. If 195.201.0.150 is the IP of your mail server you can allow the sending like this:
lamtakam.com TXT v=spf1 ip4:195.201.0.150 include:zoho.com ~all
this will allow the IP to send mails on behalf of the domain. Note that instead ip4:195.201.0.150 you can just write a, like this:
lamtakam.com TXT v=spf1 a include:zoho.com ~all
this allows the IP from the A record, which is the same IP, it just makes one more resolve to get the IP address.
Also Notice that the RR type in my example is TXT, this is the proper way to pass SPF records, since the SPF record type is deprecated. My advice is to create it as a TXT record and then just add the new part in your existing SPF record, this way you will have TXT and SPF records, which is a recommendation from Bind, or you can just have the TXT one
Related
I used ionos/1and1 for my company website and I send e-mails using gmail. The e-mails are hosted by ionos/1and1.
Whenever I send an e-mail to a gmail account I get the following message:
"Be careful with this message
Gmail could not verify that it actually came from domainname.com Avoid clicking links, downloading attachments, or replying with personal information."
I have created a spf recond with a txt in my domain by I guess it could be wrong this is what I'm using
v=spf1 include:_spf.perfora.net include:_spf.kundenserver.de ~all
if that one is not correct will this one work?
v=spf1 include:_spf.perfora.net include:_spf.kundenserver.de include:_spf.google.com ~all
Thank you for the help
Add a record
TXT # "google-site-verification=blabla0123456789"
to the zone file of your domain.
You can get the value for blabla0123456789 from
https://support.google.com/a/answer/183895
https://search.google.com/search-console/welcome
https://postmaster.google.com/managedomains
By the way, if you omit any spf record in your zone file ionos will automatically create an appropriate record for sending emails to gmail addresses.
I just found out my domain's emails have been going to the spam folder of gmail recipients. I did some research and I put the following in my DNS records for my domain name:
TXT - "v=spf1 include:_spf.google.com ~all"
I'm not sure if I have to put anything before the spf like my server's IP address or a or mx in some configurations I see. I mainly use my google apps domain email by using my plain gmail account and set "Send As" to send from the domain specific emails.
Is there something else I am missing or overlooking that I need to do to resolve this issue?
If you're only using google apps to send emails then that's the correct SPF record.
If you want to be sure, the best thing you can do is send an email to
mailtest#unlocktheinbox.com
check-auth#verifier.port25.com
They are know as reflectors and will auto-respond with your configuration, letting you know if you have your SPF set up correctly.
If you're unsure of what you need just use an SPF Wizard, but I think based on your description you're 100% fine. The MX and A just tells the receiving mail server that if the mail comes from you MX or A of your domain, then it's a good email, but you're sending from google, so you wouldn't need it.
Also with GMAIL in-boxing takes time and SPF isn't the magic cure, but it helps.
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"
I have a question that I guess is not just related to SendGrid.
Say, I own the mydomain.com domain, and I want to be able to send emails from, for example, team#mydomain.com.
Right now, when I go and manage my domain, I can see that I have added some MX record values added there. By doing this, I am able to send email using Gmail.
However, with Sendgrid I find this a little bit more confusing. I have read through the documentation, but I fail to see what should I do. I am using NameCheap, and all it comes to my mind is the following:
If I want to use Sendgrid to send emails from my application (Ruby on Rails), will I still be able to access my Gmail account and send emails using the same address (team#mydomain.com)? Is it compatible to have both (Gmail and Sendgrid) configuration in my domain?
Why don't I need to add any MX records for SendGrid?
First and foremost, the MX records for your domain are used only to specify the hostnames of the servers to handle INCOMING mail for your domain - i.e. the MX records have nothing to do with the servers that are used to send outgoing mail. You can use both Gmail's outgoing mail servers and Sendgrid's outgoing mail servers (and any other outgoing SMTP servers for that matter) to send outgoing mail for you domain. The only caveat to this is if you have an SPF record setup for your domain, but you didn't mention one so I won't elaborate.
MX records, as stated previously, are for specifying a server that handles INCOMING emails. You can use Sendgrid to send outgoing emails together with an email account service like Gmail. With Gmail, you would both send and receive emails. With Sendgrid, you would only send emails.
the MX records for the domain would be specified as those for Gmail/Google. The trick is in correctly configuring the SPF records, which is a TXT type record in the domain name. In the SPF record, you would include both Gmail/Google info as well as Sendgrid info on the same line.
So, say you only used Gmail for sending and receiving email, your SPF record would look something like this:
v=spf1 include:_spf.google.com ~all
However, if you add another server from another service, say Sendgrid, in order to also send verified emails for that domain, the SPF would be altered to something like this:
v=spf1 include:_spf.google.com include:u826348.wl.sendgrid.net -all
In both of these examples, only the GMail/Google MX records would be added to the DNS records.
I use a different server to send mail to my mailing list. I want to add an SPF record to my domain to show that the IP of the different server is authorized to send mail (as well as the default server).
The server sending email in the example is 1.2.3.4 with the main domain of test.co.uk.
So far I have v=spf1 mx a ip4:1.2.3.4/32 mx:test.co.uk ?all", would this work for what I want?
EDIT:
I would be sending mail using sendmail. The SPF record would be to increase % of mail going to inbox and also so we can enforce -all in the near future on SPF.
Try using an online tool like http://www.mtgsy.net/dns/spfwizard.php to generate the SPF record. If you Google for "SPF Record checker", you will find many websites which will even validate the SPF record for your domain.
Let's assume your domain is test.co.uk. This makes mx the same as mx:test.co.uk. Specifying an IP as ip4:1.2.3.4 is the same as ip4:1.2.3.4/32.
That would be enough:
v=spf1 mx a ip4:1.2.3.4 ?all
Make sure you verify your SPF records using a SPF checker. Try the following one.
http://spf.myisp.ch
It does some pretty extensive testing.