Subdomain emails are redirected to main domain

I have searched the forum for similar issues

on

This category is for general issues(=something is broken) regarding YunoHost, NOT apps.

on

This form is written in English but feel free to write in French if you’re more comfortable!

on

What type of hardware are you using

Old laptop or computer

What YunoHost version are you running

12.1.40.1

How are you able to access your server

Direct access via physical keyboard/screen

Are you in a special context or did you perform specific tweaking on your YunoHost instance ?

No

Describe your issue

Hello Yunohost Team,

Thank you for providing this system!

I have public IP at home and would like to configure small development server for me and few colleagues.

Server is running YunoHost 12.1.40.1
Yunohost domains are configured as follows:
** • laaasdsad_pl** (outgoing emails enabled) (as I understand so in this way it will be able to notify me from WpForms and it works is able to notify to OVH emailbox).
• dev.laaasdsad_pl (incomming / outgoing emails enabled) (it should host local emails RoundCube for dev group and also tools like gitea, file share).
*Real domain name change to laaasdsad_pl for description only.

I am able to send email from RoundCube to outside world but I am not able to receive them properly.

Trying to send email from poczta.onet_pl I got:

<szymon.k@laaasdsad_pl> (expanded from <szymon.k@dev.laaasdsad_pl >): host
mx0.mail.ovh_net[178.33.252.245] said: 550 5.1.1 <szymon.k@laaasdsad_pl>:
Recipient address rejected: User unknown (in reply to RCPT TO command)
In local Yunohost mail logs:

2026-09-16T12:57:08.254148+02:00 laaasdsad postsrsd[8518]: srs_forward: <szymon.k@dev.laaasdsad_pl> not rewritten: Domain excluded by policy
2026-09-16T12:57:08.300778+02:00 laaasdsad postfix/cleanup[8517]: 3DA3B247072: message-id=<2bd5f8fba32ac37c5c496aa3f5309856@dev.laaasdsad_pl>
2026-09-16T12:57:08.353502+02:00 laaasdsad postfix/qmgr[1801]: 3DA3B247072: from=<szymon.k@dev.laaasdsad_pl>, size=642, nrcpt=1 (queue active)
2026-09-16T13:12:38.046193+02:00 laaasdsad postfix/smtp[1925]: D6F9A2470A6: to=<szymon.k@laaasdsad_pl>, orig_to=<szymon.k@dev.laaasdsad_pl>, relay=mx0.mail.ovh.net[178.33.252.245]:25, delay=8.6, delays=1.1/0.09/7.2/0.22, dsn=5.1.1, status=bounced (host mx0.mail.ovh.net[178.33.252.245] said: 550 5.1.1 <szymon.k@laaasdsad_pl>: Recipient address rejected: User unknown (in reply to RCPT TO command))
2026-09-16T13:33:49.963508+02:00 laaasdsad postsrsd[2299]: srs_forward: <szymon.k@dev.laaasdsad_pl> not rewritten: Domain excluded by policy
2026-09-16T13:33:50.010818+02:00 laaasdsad postfix/cleanup[2298]: EABFF241331: message-id=<e6a3b62ba2a5c2535e42487df44025b4@dev.laaasdsad_pl>
2026-09-16T13:33:50.063799+02:00 laaasdsad postfix/qmgr[1788]: EABFF241331: from=<szymon.k@dev.laaasdsad_pl>, size=614, nrcpt=1 (queue active)
2026-09-16T13:33:52.900620+02:00 laaasdsad postfix/smtp[2302]: B41D22470AE: to=<szymon.k@laaasdsad_pl>, orig_to=<szymon.k@dev.laaasdsad_pl>, relay=mx0.mail.ovh.net[178.33.252.245]:25, delay=1.2, delays=0/0/0.93/0.23, dsn=5.1.1, status=bounced (host mx0.mail.ovh.net[178.33.252.245] said: 550 5.1.1 <szymon.k@laaasdsad_pl>: Recipient address rejected: User unknown (in reply to RCPT TO command)) 

** It looks like domain name is stripped **
from @dev.laaasdsad_pl to @laaasdsad_pl right ? **

I tried to:

Success! Configuration updated for 'yunohost'
Success! Configuration updated for 'nginx'
Success! Configuration updated for 'dnsmasq'
dnsmasq:

then reboot

I checked:

szymki@laaasdsad:/etc/default$ sudo cat postsrsd
Default settings for postsrsd
Local domain name.
Addresses are rewritten to originate from this domain. The default value
is taken from postconf -h mydomain and probably okay.
SRS_DOMAIN=laaasdsad_pl
Exclude additional domains.
You may list domains which shall not be subjected to address rewriting.
If a domain name starts with a dot, it matches all subdomains, but not
the domain itself. Separate multiple domains by space or comma.
We have to put some "dummy" stuff at start and end... see this comment :

SRS_EXCLUDE_DOMAINS="dummy laaasdsad_pl dev.laaasdsad_pl dummy"

I also checked:

szymki@laaasdsad:~$ cat /etc/postfix/virtual-mailbox-domains
This file is regenerated automatically
Please DO NOT edit manually ... changes will be overwritten!
dev.laaasdsad_pl

OVH mail configuration looks like:

;relate with OVH mail box in main domain 
$TTL 3600
        IN NS     dns100.ovh.net.
        IN NS     ns100.ovh.net.
        IN MX     50 mx2.mail.ovh.net.
        IN MX     5 mx1.mail.ovh.net.
        IN MX     100 mx3.mail.ovh.net.
IN MX     1 mx0.mail.ovh.net.

;related with dev group mail boxes

dev        IN MX     10 dev.laaasdsad_pl.
dev        IN A     195.222.XXX.XX
dev   3600 IN TXT     "v=spf1 a mx ip4:195.222.XXX.XX -all"

Share relevant logs or error messages

Do you have any suggestions ?

Did you try sending from outside of yunohost?
Could be yet onother issue, I had not tested local sending to a subdomain of the main-domain:

Hey,

Yes, I tried sending from google and poczta.onet.pl to yunohost subdomain. Main domain email is handled by OVH (IP reputation and not marked as spam).

Detailed rejection information I shared earlier was provided from Onet.pl.

Domains are organized as follows:

laaasdsad_pl (main domain website hosted by Yunohost but 1 email by OVH)

dev.laaasdsad_pl (developer apps and mailboxes hosted by Yunohost)

Kindly Regards

Sorry, I overlooked your external origin, so there is a known issue involved…

The common experience seems to be that currently the yunohost main-domain must have mail_in enabled for any secondary-domains to be able to receive email. (See other thread where I tried to summarize the current state of problems.)

I don’t know whether “Subdomain emails are redirected to main domain” would be a problem of its own, if it works for you after you enable mail_in for the main-domain.

The root problems could just be that currently

  • all domains use the main-domain mailboxes, instead of, e.g. generic @localhost mailboxes
  • mail_in for subdomains does not work independently (without mail_in ‘on’ for main-domain)

While (locally) rewriting unconfigured (i.e. non-mail_in) sub-domains (not secondary-domains) to their parent-domain could be a feature (a default setting that avoids having to set up users for every configured app-subdomain).

Hi, I enbaled email inbox in main Yunohost domain without configuring MX at OVH so Yunohost complains about bad configured DNS but looks like it works on both mailboxes OVH and Yunohost dev.laaasdsad_pl
Thank you for suggestion and support :slight_smile: :clap: