Notifications incompatible with reply by email

I have carefully read the guides on emails at this link Email delivery configuration checklist and the following ones.
I have studied this link How to setup "Reply by email address" now that it must be different from the "Notification email", and this one Notification email cannot be the same as reply by email.

All the addresses I use on the forum can send or receive emails via an email client like Thunderbird or Claws Mail.

There are four different addresses, only the first three are concerned by this topic:

  • the administration one in app.yml: admin@
  • the notifications one in app.yml: forum@
  • the reply-to one: reply@
  • and the one for email publishing: questions@
  1. The notifications obtained via the forum’s mailing list status are sent correctly. And the sending test on the admin/email/server-settings page goes well.

  2. If I set up reply by email, this feature is correctly operational but notifications no longer work.
    The previous sending test then fails with the status “501 5.5.4 You are not allowed to send from this address.”

  3. If I disable reply by email, the test passes correctly again.

Can someone explain to me why I have this error and how to correctly set up both notifications and “reply by email”?

2 Likes

That message is from your mail sending service. It’s pretty clear.

You need to send from an email address that you’re smtp server can use. It is something like it’s set to send from example.com and you’re now sending from forum.example.com

4 Likes

Why then in one case is the sending test OK and it is KO when I set up the “reply by email”? I specify that I am not changing anything in the notification configuration.

What happens at the Discourse level in the preparation of the emails?

1 Like

The problem does indeed come from Discourse.

By refining the log settings, I see that the posted message is correctly authenticated by the right address:

2026-02-25T12:54:24Z TRACE Data store
iteration operation (store.data-iterate) elapsed = 0ms
<3.14, remotePort = 47104, accountName =
“forum.cagut@domain.tld”, accountId = 31

But it becomes

2026-02-25T12:54:24Z [[35;1mTRACE [[37;1mRaw SMTP output sent
(smtp.raw-output) listenerId = “submissions”, localPort = 465, remoteIp
= 51.178.53.14, >
<53.14, remotePort = 47104, size = 73,
contents = “MAIL
FROM:<reply.cagut+verp-8bf40c695b1f612e555cf25f3c14c9b8@domain.tld>\\r\\n”

The mail server has no knowledge of this address format.

1 Like

That magic number is how Discourse connects the replies with the topic.

You’ll need another mail server (or change this one to support + addresses) or not have reply-by-mail.

Yes, I know this is an identifier to use the “reply by email”.

So the test for sending emails does not work when “reply…” is enabled. The documentation does not specify this, and the error comes from Discourse and not the mail server, which was your first answer!

Besides, how can a “from” address have this “magic number”? This address format is used in the headers.
Your answer is absolutely not one.

This transformation of the “From” should not be done.

And to say that we must do without a feature provided by the software is strange…

Tomorrow, I’ll do other studies.

1 Like

It’s not a transformation of the header per se - when reply-by-email is enabled, DIscourse sends out email with the envelope-from set to the reply_by_email_address address pattern and also sets reply-to: if the email is replyable.

For example, here on meta it’s:

notification_email: notifications@meta.discoursemail.com
reply_by_email_address: incoming+%{reply_key}@meta.discoursemail.com

which turns into:

Return-Path: <incoming+verp-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@meta.discoursemail.com>
From: Person <notifications@meta.discoursemail.com>
Reply-To: Person <incoming+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@meta.discoursemail.com>

The notification email goes into the From header, and reply_by_email_address goes into envelope-from. We’ve configured our incoming mail such that anything addressed to …@meta.discoursemail.com gets delivered to meta, which makes this work.

But if your email server does not permit you to use this envelope-from, you’ll get the error you’re reporting.

This error is most definitely coming from the mail server. Discourse might be reporting it to you, but the mail server is generating it.

2 Likes