Do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains

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

Virtual machine

What YunoHost version are you running

12.1.41.2

How are you able to access your server

SSH

Describe your issue

I have perhaps something wrong on postfix configuration

I have an app Mailman3 using Django sending warning mails periodically, few ones per minutes to user www-data [at] foo.domain.tld. It is the main domain where is installed mailman3.

I have try add an alias www-data [at] foo.domain.tld to watch the messages.
The message sended

Cron <www-data@foo> [ -f /usr/bin/django-admin ] && flock -n /var/run/mailman3-web/cron.minutely /usr/share/mailman3-web/manage.py runjobs minutely
De root@foo.domain.tld, le 2026-10-04 11:13
Détails En-têtes
/usr/lib/python3/dist-packages/django_q/conf.py:139: UserWarning: Retry and timeout are misconfigured. Set retry larger than timeout,
        failure to do so will cause the tasks to be retriggered before completion.
        See https://django-q.readthedocs.io/en/latest/configure.html#retry for details.
  warn(
System check identified some issues:

WARNINGS:
django_mailman3.MailDomain: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the DjangoMailman3Config.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
django_mailman3.Profile: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the DjangoMailman3Config.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
hyperkitty.Attachment: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
hyperkitty.Email: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
hyperkitty.Favorite: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
hyperkitty.LastView: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
hyperkitty.MailingList: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
hyperkitty.Profile: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
hyperkitty.Tag: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
hyperkitty.Tagging: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
hyperkitty.Thread: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
hyperkitty.ThreadCategory: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
hyperkitty.Vote: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the HyperKittyConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
postorius.EmailTemplate: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the PostoriusConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.

The only change I’ve done after inspecting was to edit the file /etc/mailman3/mailman-web.py to add these lines

#: Django Q connection parameters.
Q_CLUSTER = {
    'retry': 360,
    'timeout': 300,
    'save_limit': 100,
    'orm': 'default',
    'workers': 2,
}

after seeing this in few issues and commits I Challenge Thee and mailman_web/settings/mailman.py · master · GNU Mailman / Mailman Web · GitLab.

Now I think I have less messages with this warning but still here…

So I try understand if there is something to do in the postfix main.cf conf ?

From another source, I understood there is a conflict to resolve. https://www.howtoforge.com/postfix-do-not-list-domain-example.com-in-both-mydestination-and-virtual_mailbox_domains

It seems the domain foo.domain.tld is referenced in virtual-mailbox-domains and in mydestination in /etc/postfix/main.cf
In the post they said

You have example.com in the resource (for example a MySQL database) referenced in the virtual_mailbox_domains directive in /etc/postfix/main.cf AND in the mydestination line (also in /etc/postfix/main.cf)! This doesn’t work. You can list example.com either in virtual_mailbox_domains or in mydestination, but not in both.

So I have this in the postfix main.cf

mydestination = localhost

virtual_mailbox_domains = /etc/postfix/virtual-mailbox-domains
virtual_mailbox_maps = ldap:/etc/postfix/ldap-accounts.cf, hash:/var/lib/mailman3/data/postfix_lmtp,hash:/etc/postfix/app_senders_login_maps

Can I found how resolve this error ?

Share relevant logs or error messages

grep warning /var/log/mail.log

.....

2026-10-05T15:59:03.206908+00:00 foo postfix/trivial-rewrite[1024668]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:00:03.927713+00:00 foo postfix/trivial-rewrite[1024668]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:00:04.164423+00:00 foo postfix/trivial-rewrite[1024668]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:00:04.277389+00:00 foo postfix/trivial-rewrite[1024668]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:00:13.615497+00:00 foo postfix/trivial-rewrite[1024668]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:01:03.124161+00:00 foo postfix/trivial-rewrite[1024668]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:01:03.683096+00:00 foo postfix/trivial-rewrite[1024668]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:02:03.790874+00:00 foo postfix/trivial-rewrite[1024668]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:02:04.073852+00:00 foo postfix/trivial-rewrite[1024668]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:02:04.151112+00:00 foo postfix/trivial-rewrite[1024668]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:02:13.359404+00:00 foo postfix/trivial-rewrite[1034613]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:03:03.157481+00:00 foo postfix/trivial-rewrite[1034613]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:03:03.368727+00:00 foo postfix/trivial-rewrite[1034613]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:04:03.125419+00:00 foo postfix/trivial-rewrite[1034613]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains
2026-10-05T16:04:03.240463+00:00 foo postfix/trivial-rewrite[1034613]: warning: do not list domain foo.domain.tld in BOTH virtual_mailbox_domains and relay_domains

It’s confusing, first I have try add a post for the app, but I could not then paste logs from the app… So I related it to postfix…