Hardware: VPS bought online YunoHost version: 11.1.20 I have access to my server : Through SSH | through the webadmin Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
Description of my issue
I encounter a strange error using postfix mail service. This is my setup.
Yunohost domain: business-suite.domain.tld
User mail addresses: username@business-suite.domain.tld
Mail forward: username@domain.tld I setup the forwarding so that my users only need to check their main mail addresses.
At first everything was running fine, aka the mails were forwarded correctly to the regular mail addresses. Then I transferred our main wordpress homepage running under domain.tld to yunohost by changing domain.tld A-record and AAAA-record. Homepage is up and running but since I changed the A-record and AAAA-record the mails are not forwarded correctly anymore. I receive the following error message from postfix:
This is the mail system at host business-suite.domain.tld.
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
<username@domain.tld>: user unknown
Reporting-MTA: dns; business-suite.domain.tld
X-Postfix-Queue-ID: 3B4F747354
X-Postfix-Sender: rfc822; root@business-suite.domain.tld
Arrival-Date: Sat, 27 May 2023 12:06:41 +0000 (UTC)
Final-Recipient: rfc822; username@domain.tld
Original-Recipient: rfc822;username@domain.tld
Action: failed
Status: 5.1.1
Diagnostic-Code: x-unix; user unknown
It’s strange to me as I haven’t changed the MX record of my main domain, but only A-record and AAAA-record. Note, the MX-record of the main domain does point to another mailserver.
I did some tests from command line using mailx. Mails to other external recipients are successfully sent (e.g. to Protonmail e-mail address) but mails to mail addresses of my main domain fail. Does anybody have an idea what I can do to fix that?
I read this link about delivering some but not all accounts locally Postfix Standard Configuration Examples and it referred to virtual_alias_maps. Then I studied the entries in main.cf and virtual_alias_maps refers to some ldap entries. These are the relevant entries in my main.cf
So, the issue might be in the ldap postfix configuation? However, I am neither familiar with ldap nor with postfix. So, I would be grateful for somebody pointing me in the right direction.
I still didn’t find a solution for this issue. I also explicitly turned off outgoing and incoming mails for the main domain in yunohost admin. There was a warning in history which said
The configuration file '/var/www/.well-know/domain.tld/autoconfig/mail/config-v1.1.xml' has been manually modified and will not be updated
So, I took a look at this file and these are the contents
I also renamed this file by appending .bkp postfix and reloaded postfix service with systemctl reload postfix. Didn’t help. Error message stayed the same. Can anybody please help with this?
UPDATE:
Finally I could solve this issue by modifying the query filter in /etc/postfix/ldap-domains.cf. I added condition (!(virtualdomain=excluded-domain.com)). So, the whole query filter looks like this now: