My YunoHost server
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:
- User mail addresses:
- Mail forward:
firstname.lastname@example.org 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
<email@example.com>: user unknown
Reporting-MTA: dns; business-suite.domain.tld
X-Postfix-Sender: rfc822; firstname.lastname@example.org
Arrival-Date: Sat, 27 May 2023 12:06:41 +0000 (UTC)
Final-Recipient: rfc822; email@example.com
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 just did some deeper troubleshooting and want to share my findings:
I tried adding
/etc/postfix/main.cf and reloaded postfix service as suggested here: email - Postfix: Recipient address rejected: User unknown in local recipient table - Server Fault. Didn’t help.
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
virtual_alias_maps refers to some ldap entries. These are the relevant entries in my
myhostname = business-suite.domain.tld
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydomain = business-suite.domain.tld
mydestination = localhost
# Manual fix added by me
# Virtual Domains Control
virtual_mailbox_domains = ldap:/etc/postfix/ldap-domains.cf
virtual_mailbox_maps = ldap:/etc/postfix/ldap-accounts.cf
virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf,ldap:/etc/postfix/ldap-g>
virtual_minimum_uid = 100
virtual_uid_maps = static:vmail
virtual_gid_maps = static:mail
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?
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:
query_filter = (&(objectClass=mailDomain)(virtualdomain=%s)(!(virtualdomain=excluded-domain.com)))
Afterwards, I restarted postfix with
systemctl reload postfix and then I could finally send mails from my yunohost domain to my main domain.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.