Topic: postfix turns user@my.domain into user@host.my.domain
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version: 1.6.8 PGSQL edition
- Deployed with iRedMail Easy or the downloadable installer: yes
- Linux/BSD distribution name and version: Debian GNU/Linux 12 (bookworm)
- Store mail accounts in which backend: PGSQL
- Web server: Nginx
- Manage mail accounts with iRedAdmin-Pro: no
====
Hello there,
I recently set up iRedMail and linked it to my domain (FreeIPA) via LDAP. So far, everything is working quite well. The only thing that does not work is sending and receiving mails via alias addresses that do not correspond to the user name before the @. To change this, I have tried to add an alias mapping. For this I have:
1. extended the virtual_alias_maps line in /etc/postfix/main.cf:
virtual_alias_maps = proxy:ldap:/etc/postfix/ad_virtual_group_maps.cf, proxy:ldap:/etc/postfix/ad_alias_maps.cf
2. create the file /etc/postfix/ad_alias_maps.cf:
server_host = ipa-dc.my.domain
server_port = 389
version = 3
bind = yes
start_tls = yes
bind_dn = uid=ldap_reader,cn=users,cn=accounts,dc=my,dc=domain
bind_pw = [ldap_readers pw]
search_base = cn=users,cn=accounts,dc=my,dc=domain
scope = sub
query_filter = (&(mail=%s)(objectClass=person)(memberOf=cn=mail_user_group,cn=groups,cn=accounts,dc=my,dc=domain))
result_attribute= uid
debuglevel = 0
With
postmap -q user@my.domain ldap:/etc/postfix/ad_alias_maps.cf
I could make sure that the mapping works the way I want it to. But as soon as I activate this configuration by reloading, the postfix always makes user@my.domain to user@mailserver.my.domain and the mail delivery fails. Without the additional alias mapping, it does not do this and I can send and receive mails to the standard addresses.
Can anyone give me a clue as to why this is happening?
Best regards and nice weekend
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.