550 5.7.0 Message rejected per SPF policy - dns

So recently we started to get this issue of email rejected by SPF, We we using the fraud-detector.eu site as away to send mails to test SPF :
Recipient: [SMTP:spf#fraud-detector.eu] Reason: Remote SMTP Server Returned: 550 5.7.23 <spf#fraud-detector.eu>: Recipient address rejected: Message rejected due to: SPF fail - not authorized. Please see http://www.openspf.net/Why? s=helo;id=mail.domain.co.uk;ip=45.83.xxx.xxx;r=<UNKNOWN>
**We have tweaked SPF and tested again with such tools as:**
[https://www.mail-tester.com][1]
[https://www.spf-record.com/analyzer][2]
[https://www.kitterman.com/spf/validate.html][3]
[https://mxtoolbox.com][4]
and they all gives the thumbs up, but still we are receiving these SPF rejection messages. So I'm sort of out of ideas.
**Current SPF on our domain names:**"
v=spf1 mx ip4:45.83.xxx.xxx ip4:45.83.xxx.xxx include:crm.cloud-example.com -all"
**The two listed ip4's represents:**
**1.)** our mail server
**2.)** Our business application server which also sends emails and host various busyness systems including our company's CRM which obviously also sends emails from staff and marketing mails.
We have updated the SPF records, but the result is nevertheless the same. We have checked and validated both SPF, Dmarc and DMKIM and they all turn out green and authenticated correctly on test tools such as:
[1]: https://www.mail-tester.com
[2]: https://www.spf-record.com/analyzer
[3]: https://www.kitterman.com/spf/validate.html
[4]: https://mxtoolbox.com
Feedback please?

Related

Email received but sender get "Undelivered Mail Returned to Sender" after 5 days

I manage a server with Plesk 12.5 since a couple of years.
Everything (emails, websites, etc.) works perfectly with our main domain (let's call it myfirstdomain.com).
Since a couple of weeks, I added a new domain (let's cal it myseconddomain.fr) and everything seems to work too (emails and websites), except the following error: when a sender sends an email to us, he receives the following error after 5 days:
This is the mail system at host myfirstdomain.com.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<fabrice#myseconddomain.fr>: Message can not be delivered at this time
Reporting-MTA: dns; myfirstdomain.com
X-Postfix-Queue-ID: DC0B1702585
X-Postfix-Sender: rfc822; xxx#xxx.net
Arrival-Date: Tue, 5 Mar 2019 21:18:00 +0100 (CET)
Final-Recipient: rfc822; fabrice#myseconddomain.fr
Original-Recipient: rfc822;fabrice#myseconddomain.fr
Action: failed
Status: 4.2.1
Diagnostic-Code: x-unix; Message can not be delivered at this time
De: XXX XXX <xxx#uxxxvi.net>
Objet: Testing title
Date: 5 mars 2019 à 21:17:58 UTC+1
À: Fabrice Troilo <fabrice#myseconddomain.fr>
Testing body
You can see that the reporting-MTA is myfirstdomain.com, so maybe there is confusion between the two domains?
Here is our SPF:
"v=spf1 a mx include:_spf.google.com ip4:XX.XX.XX.XX ~all"
I will try with this update for the two domains:
"v=spf1 +a +mx +a:myfirstdomain.com +a:myseconddomain.fr include:_spf.google.com ip4:62.210.16.40 ~all "
Also, the email address is simply forwarding to a gmail address.
Do you please have any clue to look at?
If you can send mail from the domain, but not receive it, it's not related to SPF. SPF authenticates when you send mail, not receive it.
Have you ensured that an MX record is set up for the secondary domain?
You can test this using the terminal on Linux or macOS with host -t MX myseconddomain.fr
If you are on Windows, then open a command prompt, type nslookup. Then when in nslookup, switch to query MX types with set q=mx and press enter. Then enter your domain myseconddomain.frand press enter.
If the MX records looks correct, then it must be some configuration in Plesk. We can test this by trying to deliver mail ourselves with telnet.
Open a terminal/command prompt and type telnet <myserverIP> 25 and press enter. This connects to your mailserver. It should respond with a line beginning with 220, and it's hostname. Then you can try and deliver a simple test mail, let's say from account1#example.net
EHLO example.NET
MAIL FROM:<account1#example.net>
RCPT TO:<fabrice#myseconddomain.fr>
DATA
This is a test email. To test delivery.
.
QUIT
The first few lines introduces yourself, sender and receiver to the mail server. DATA indicates you want to start the body of your email. And the period on a line by itself indicates that you are done with the body. QUIT then terminates the connection.
Then watch what your server says in reply to each command. If you can successfully deliver this way, then it's like a problem with your MX record.
I don't know if you have solve this Problem. If you have please let me know. We have a similar error.
I found out that is has to do with the E-Mail-Header because it may have two domains in it because it gets forwarded. Google don't like this :)
Google has opened a thread about it and they say you can enter the Domain that forward to the gmail address so it is not detected as some kind of spam.
I can not test it because I it is an gmail account from an client and I have no access.
May my executions help. I hope you have an better answer.
Greets Matt

Mailgun Email rejected by some providers

I am trying to send emails through MailGun APIs and it was working fine until we noticed some emails were rejected by Orange.fr . I assume it could be the case for other providers, but Gmail is working fine for instance.
Error I see in MailGun admin panel is the following:
Failed: postmaster#mg.lesjardinsdelariviere.com → m****ou#orange.fr 'Subject' Server response: 501 5.1.0 Emetteur invalide. Invalid Sender. OFR003_405 [405]
I am sending those emails from no-reply#lesjardinsdelariviere.com and in Gmail they appear to be signed & sent by "mg.lesjardinsdelariviere.com"
I had requested my DNS provider to make those changes to verify my MailGun account:
(type, hostname, value)
TXT mg.lesjardinsdelariviere.com v=spf1 include:mailgun.org ~all
TXT mx._domainkey.mg.lesjardinsdelariviere.com k=rsa;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9x/kulF+1LfeDRnrAlDjNBwD7oP7jIcdJ9MhgWASmDh3SJ2t2GT2zmTSKMPt25dtEYNMX2qvXIAq/rmQ4XB15YgBUTUaX/IdJ18bYUulH//BXVq7q8H2J/mWYAcoWnTTecVOUm75CiY6rngtBBw1g+TICnVMq2/HZ0lA047HEhQIDAQAB
(type, priority, value)
MX 10 mxa.mailgun.org
MX 10 mxb.mailgun.org
(type, hostname, value)
CNAME email.mg.lesjardinsdelariviere.com mailgun.org
I tried searching for similar issues and I think there might be something missing in the DNS records but I don't know what... Any help? Thanks!
Mailgun is regularly added to spam blacklists because their entire business model is based on sending out huge numbers of emails and these are not always appreciated.
There is nothing you can do about this except change mail providers or complain to mailgun.
If you are truly sending out mail that is "not spam", for example customer invoices or individually written emails to individual people, you can get your own dedicated server from a reputable hosting company, and a clean IP address, and you will have very few delivery problems.

Limesurvey notification emails will not send

I've recently noticed an issue with my Limesurvey installation. Until recently, I had a number of surveys set to email the user after submission (using {email} in the "Send detailed admin notification email" box to refer to an email question in the survey). However despite not manually changing anything, they no longer send. Some others do send from within limesurvey, for example from the "Create new admin" option, while token related emails will not.
In the case of token invitations, the debugging there will say emails sent when using php, but the test emails never arrive (multiple emails tested). When using SMTP, I get the below:
SMTP connect() failed... Some emails were not sent because the server did not accept the email(s) or some other error occured.
I should note that while I first noticed this in existing surveys in version 2.73.0, I've since done a fresh install of 3.1 and created a test survey. So this is pointing at a server config issue, but I haven't had any issues with emails sending except in this specific case.
Any suggestions of particular places to look would be much appreciated!
Did you try to change the email method in settings (https://manual.limesurvey.org/Global_settings/en#Email_settings)?
Email method: This determines how emails are being sent. The following options are available:
PHP (default value): uses internal PHP mail function
Sendmail : uses sendmail mailer
SMTP : based on SMTP relaying. Use this setting when you are running LimeSurvey on a host that is not your mail server
Make sure that you are using your SMTP configured email (Global settings -> Email settings) if you use SMTP, otherwise there might be a chance that the following error is displayed: 'SMTP -> ERROR: RCPT not accepted from server: 553 5.7.1 : Sender address rejected: not owned by user'
Qmail : Set this if you are running the Qmail mailer

cpanel sent emails marked as spam

my site use latest version of cpanel
but when i send email via cpanel email account to gmail,the gmail marked it as spam
where is the problem?
This can occur for many causes,
The first thing that causes many email services mark a message as SPAM is your IP address, maybe your IP address is listed as SPAM generator - But I think it's not very important for GMail.
You should set your Reverse DNS record because It's important too.
Maybe you're sending email with bad protocol parameters - I think cpanel does It good, I'm not a cpanel experienced.
Removing SPAM mark from emails helps to GMail removes the sender from blacklists.
Google has very good documents about how to send emails to GMail to not marking as SPAM.
you can check if your mail server is not listed in spam databases.
Here is one: http://www.spamhaus.org/query/bl?ip=173.194.32.21
When i opened spam message in gmail, then she said why it is in spam ...

How to check if an email address belongs to Gmail

I'm creating a function uses Google's API to import contacts from a person's gmail account. However I'm aware that many businesses sign up to Google in order to have a more professional domain name( eg. some_name#bislr.com) but still belongs to Gmail.
Is there a way to check for that?
Option 1
if you do a DNS lookup for the MX records on bislr.com, you get the following:
$ host -t mx bislr.com
bislr.com mail is handled by 10 aspmx.l.google.com.
bislr.com mail is handled by 20 alt1.aspmx.l.google.com.
bislr.com mail is handled by 20 alt2.aspmx.l.google.com.
bislr.com mail is handled by 30 aspmx2.googlemail.com.
bislr.com mail is handled by 30 aspmx3.googlemail.com.
bislr.com mail is handled by 30 aspmx4.googlemail.com.
bislr.com mail is handled by 30 aspmx5.googlemail.com.
Anyone hosting their email Google Apps will have MX records very similar to these. You can do a MX lookup with any common DNS mechanism and test the MX records for Google's most-recommended mail servers - aspmx.l.google.com, alt1.aspmx.l.google.com, and alt2.aspmx.l.google.com, or look for any/all of the servers in this list.
This won't show you anyone who uses an external forwarding/filtering service but it will work for all of the common cases.
Option 2
You can connect to a mail server to verify if it will accept mail to a specific address. Using this, we can connect to asmpx.l.google.com and ask it whether an address is a valid Google Mail account.
If you connect to aspmx.l.google.com:25 and send this string (replace the email addresses as appropriate):
HELO
MAIL FROM:<ping#mydomain.com>
RCPT TO:<user#theirdomain.com>
Google's mail server will respond with a smtp status code, probably a line starting with something like 250 2.1.5 OK if it's a valid address. This is a cleaner and far more reliable way than simply checking DNS records, and should work as long as you don't get the checking IP blacklisted by using it to send actual spam to gmail.
Here is a full walkthrough of the process.
You can't be certain.
The MX record check described by #lunixbochs covers most cases, but many corporates will use Postini, which has different domain names. They might also be using any number of other mail pre-processing engines which will hide the aspmx records.
One other way to check is to see if they have an active domain name:
curl http://www.google.com/a/DOMAINNAME | grep "domain that isn't using Google Apps"
Use your language / library of choice instead of curl to fetch the url...

Resources