Discourse forum activation email issue

According to Discourse’s official recommendation, we are using MailGun’s service.

In most cases, there are no issues, but for some specific email addresses, such as iCloud, we receive the following prompt when sending activation emails:

"message": "5.5.1 Error: need MAIL command - MAIL FROM error: 450 4.1.8 <bounce+6712f2.21c8873-lucas.hu=@mail.visafn.com>: Sender address rejected: Domain not found",


The image below shows the error log information provided by the email service provider:

Problem and Solution

The main reason for the above problem is that some specific email service providers have spam checking policies.

Especially iCloud, which verifies the domain address of the sender when sending emails.

Because our service uses a subdomain for sending, the domain address we send from is actually mail.visafn.com instead of the traditional visafn.com.

Therefore, iCloud cannot verify the above address and considers the email sent by the system as spam, thus rejecting it.

Solution

The solution is also very simple. It is necessary to ensure that the MX record for the subdomain mail.visafn.com used for sending emails exists in the DNS.


As marked in the image above.

The MX record for the subdomain needs to be added to your DNS, and the record above should show as verified.

Of course, DNS updates will not take effect immediately. If you continue to send to iCloud, you may still experience intermittent errors.

Wait a few hours before testing again, which usually resolves the issue of emails being marked as spam.

Generally, most problems with Discourse sending emails are related to email server configuration and DNS, specifically MX record issues.

1 Like

Thanks for the tutorial.

But I use gmail. This can be used as a reference.

1 Like

We also used Gmail’s SMTP service at the beginning.

One issue here is Gmail’s daily sending limit.

According to Gmail’s official documentation: Gmail sending limits in Google Workspace - Google Workspace Admin Help Gmail has daily sending limits.

This is usually a few thousand, and if the forum server sends more emails than this limit, it may not be able to send them out.

Generally, for larger email sending, one might consider using Gmail’s API, but Gmail’s API is really not that user-friendly: Sending Email  |  Gmail  |  Google for Developers

For the sake of simplicity, and also for email sending analysis features, I personally feel that using MailGun or other third-party services is much more stable.

2 Likes

I was like that at first too