Emails sent via the Nylas API go into spam or return a bounced message

Emails sent via the Nylas /send endpoint are flagged as spam / bounced, yet emails sent via the providers' mail client are received successfully.

 

Follow the steps below to determine the cause and the next steps. The bounce message (554 5.7.1 / 5.1.8) will typically tell you if it's a block due to:

  • Modifying headers - SPAM
  • IP BLOCK
  • Email Account flagged as SPAM
  • Message rejected due to local policy (could be anything including - Domain reputation)

You may get these response from the recipient OR the sending SMTP server.

 

Resolution

1. Confirm that this behaviour happens ONLY when sending via Nylas

  • Have the customer send the same email to the recipient via the providers webmail client
  • If the email is blocked when sent via the provider then the issue is with either:
    • The providers SMTP IP address
    • The senders domain reputation
  • If this is an IMAP / generic account this is the problem 90% of the time.
  • Solution: to either of the above is to have the customer contact their mail administrator.

 

2. Is you application modifying the headers, i.e. are you sending as RAW vs MIME? Providers do not trust modified headers.

curl -X POST 'https://api.nylas.com/send' \
-H 'Content-Type: message/rfc822' \ <<<< RAW MIME
  • Try sending it via NYLAS as MIME.
curl --request POST \
  --url https://api.nylas.com/send \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  • Solution: Don't modify your headers, modify the body instead. The Nylas default is to send as MIME.

 

3. Microsoft and Google have a separate SMTP server for applications

An email sent via the Providers mail client will be sent via a different SMTP server than that used by third-party applications such as Nylas. 

They have a pool of outbound SMTP servers which applications such as Nylas get directed to via DNS round robin.

The client's domain shares these servers with other organisations, as such the reputation on these servers IP addresses can be tarnished by third parties using those same servers.

As the developer / support team of the application:

  • Open the sent email in a text editor and check the header it should have a list of hostnames / IP addresses used in the path to send the email.
  • Lookup those IP's with https://mxtoolbox.com/blacklists.aspx to see if they are blacklisted
  • Solution: Reach out to the domains mail administrator, they will need to ask their Provider to change their outbound SMTP server. This is quite a common issue.

4.  The account is sending spam

5. Try sending the email without link tracking enabled.

6. Office365 mailboxes are able to send from the Outlook email client without issues.

It is normal for Office365 accounts to send from an email client and have their email land in the Inbox while emails sent from Nylas land in Spam. This is because Nylas is forced by Microsoft to share the same sending IPs with all other third party apps. Those apps are often used for bulk sending, so their emails get flagged as spam and that eventually gets the IP blocked.

 

Email clients like Outlook get reserved sending IPs that are not allowed for third party apps, so their IPs remain clean of spam.

 

Please reach out to Microsoft to get you assigned different IPs or switch email providers as Microsoft does little to protect their spam reputation.

7 . Checked all the above and it all comes back clean

  • Get the RAW message to find the FULL headers which have the spam report and pass the headers into ChatGPT to determine why the bounced message identified as SPAM
  • Test the IP's and domains in the headers against blacklist checkers 
  • Find the Header Message-ID as per our docs
  • If this is happening for ALL messages for a specific provider then reach out to support.

Resources

Deciphering spam headers for Office365 recipients

User received a 5.1.8 response. I am an email admin, How do I fix this?

Feature request - White Label Tracking URL's

Apple icloud SPAM policy

Dealing with SPAM
Google: Email bounces due to blocked IP address

Updated

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.