All emails blocked because sent from mailer-daemon@nextcloud

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud Hub 10 (31.0.7)
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 12/Bookworm
  • Web server and version (e.g, Apache 2.4.25):
    • Apache/2.4.62
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • NGINX PROXY MANAGER v2.12.3
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • Right from the beginning
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Turnkey on Proxmox
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • Yes, Cloudflare

Summary of the issue you are facing:

All my nextcloud emails look like being sent from mailer-daemon@nextcloud, despite having smtp correctly configured. I would like them to be sent from my sender address (specified in SMTP settings) so these are not blocked by my antispam environment.

Test version of the above screenshot

This is the mail system at host nextcloud.

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

(expanded from ): host
ipv6mx01a.antispameurope.com[94.100.134.10] said: 504 5.5.2
: Sender address rejected: need fully-qualified address (in
reply to RCPT TO command)

CRON-APT RUN [/etc/cron-apt/config]: Tue Jul 15 07:53:01 UTC 2025
CRON-APT SLEEP: 529, Tue Jul 15 08:01:50 UTC 2025
CRON-APT ACTION: 5-install
CRON-APT LINE: /usr/bin/apt-get -o quiet=1 autoclean -y
Reading package lists…
Building dependency tree…
Reading state information…
CRON-APT LINE: /usr/bin/apt-get -o quiet=1 dist-upgrade -y -o APT::Get::Show-Upgraded=true -o Dir::Etc::sourcelist=/etc/apt/sources.list.d/security.sources.list -o Dir::Etc::sourceparts=nonexistent -o DPkg::Options::=–force-confdef -o DPkg::Options::=–force-confold
Reading package lists…
Building dependency tree…
Reading state information…
Calculating upgrade…
The following packages have been kept back:
openssh-client openssh-server openssh-sftp-server ssh
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

How can I change sender’s address?

Thanks for any help.

Administrative settings → Basic settings → Email server → From address (example: noreply-nextcloud@yourdomain.tld)

It is configured already like this:

Fun fact: if I try and test email sending, email is being sent with the above configured email address. It’s all other automatic/system-defined emails that basically don’t pick the sender address as the one to use!

Nextcloud can’t handle system emails, so you need to configure them separtly on OS level. There are multiple programs you could use for that, such as full blown MTAs in a sattelite configuration, like Postfix or Exim4, or something more lightweight specifically made for this usecase like msmtp.

Apparently, the TurnKey images already come with Postfix installed. I found this guide on how to configure it to send email via an external SMTP server (SMTP relay): Email: Send emails via SMTP Relay | TurnKey GNU/Linux

1 Like