TIP

For general receiving failures and 530 errors please see the receiving failures article.

# Using SendGrid with MailSlurp

SendGrid often has issues sending emails to MailSlurp accounts. This is because SendGrid uses a small pool of IP addresses that are rapidly blocked by other providers due to spam missuse. MailSlurp is built on AWS infrastructure and before emails are passed to MailSlurp control AWS blocks the SendGrid IP addresses that hasve been sending spam to other AWS customers.

TIP

Update: We have now added an AllowAll 0.0.0./0 IP CIDR range filter to our AWS setup that should allow any IP address to send emails to MailSlurp accounts

# Cause of errors (550 or 530 error codes)

SendGrid does not have enough IP addresses for their large user base and so spammers may use the same IP address as you (this is not the case with MailSlurp).

The resulting errors in the SendGrid UI look somewhat like this:

sendgrid error

These errors suggest that the AWS infrastructure that MailSlurp is built on is blocking the inbound emails because of bad behavior from other users of the IP address.

# Temporary fixes

MailSlurp has now implemented a filter to allow all inbound IP addresses at the SMTP layer.

ses rules

This should reduce the SendGrid errors to a minimum but because of IP pooling your SendGrid IP address may still get blacklisted by our providers.

# Alternative solutions

We are currently adding an IP address whitelist endpoint that will allow you to whitelist any IP address so that it is not blocked by MailSlurp. For this to work in your case you will need to determine the IP address that SendGrid assigns to your account.

Beside that approach and our allow all filter, unfortunately this is a fundamental issue with SendGrid and can only be fixed in a handful of way:

  • use a different email provider for email sending (MailSlurp works great but so does Postmark and AWS SES).
  • upgrade to a SendGrid pro account that allows for dedicated IP addresses (so that you alone have access to them).

# Conclusion

Please let us know if you have any other thoughts on this issue and if the new AllowAll filter has alleviated your issues.