1

Topic: Problems with domain alias

We have for example the domain domain1.com with a domain alias domain2.com.

When sending an email to user@domain1.com it arives at the user. When sending an email to user@domain2.com the email is send to the catch-all account.

Do you have any idea what it could be?

2

Re: Problems with domain alias

- Which version of iRedMail do you use?
- Which version of iRedAdmin-Pro do you use? MySQL edition or LDAP edition?
- If you have iRedAdmin-Pro-MySQL-1.0 running before, did you apply upgrade tutorial here to sync accounts? It will cause this issue.

There's a bug in iRedAdmin-Pro-MySQL-1.0, it won't create required records in table "vmail.alias", this causes catch-all account doesn't work as expected. Below SQL command can fix it.

3

Re: Problems with domain alias

We are using iRedMail 0.7.1 with iRedAdmin-Pro LDAP 1.6

4

Re: Problems with domain alias

Domain alias should be working fine in both iRedMail-0.7.1 and iRedAdmin-Pro-LDAP-1.6.x.

Can you post LDIF data of this account by visiting below URL after logged into iRedAdmin-Pro as global admin?

https://your_server/iredadmin/export/ldif/user/user@domain1.com

Please replace your domain name in LDIF data, remove attribute 'userPassword', hide other sensitive information before posting.

5

Re: Problems with domain alias

ZhangHuangbin wrote:

Domain alias should be working fine in both iRedMail-0.7.1 and iRedAdmin-Pro-LDAP-1.6.x.

Can you post LDIF data of this account by visiting below URL after logged into iRedAdmin-Pro as global admin?

https://your_server/iredadmin/export/ldif/user/user@domain1.com

Please replace your domain name in LDIF data, remove attribute 'userPassword', hide other sensitive information before posting.

dn: mail=lverhoeven[at]vcn[dot]nl,ou=Users,domainName=vcn[dot]nl,o=domains,dc=advies4you,dc=nl
accountStatus: active
amavisLocal: TRUE
cn: Luc Verhoeven
enabledService: mail
enabledService: smtp
enabledService: deliver
enabledService: pop3
enabledService: pop3secured
enabledService: imap
enabledService: imapsecured
enabledService: managesieve
enabledService: managesievesecured
enabledService: sieve
enabledService: sievesecured
enabledService: forward
enabledService: senderbcc
enabledService: recipientbcc
enabledService: internal
enabledService: shadowaddress
enabledService: displayedInGlobalAddressBook
enabledService: smtpsecured
homeDirectory: /home/vmail/vmail1/vcn[dot]nl/lverhoeven-2010.06.07.13.54.15/
mail: lverhoeven[at]vcn[dot]nl
mailMessageStore: vmail1/vcn[dot]nl/lverhoeven-2010.06.07.13.54.15/
mailQuota: 0
memberOfGroup: iedereen[at]vcn[dot]nl
objectClass: inetOrgPerson
objectClass: mailUser
objectClass: shadowAccount
objectClass: amavisAccount
shadowAddress: lverhoeven[at]deverzekeringcombinatie[dot]nl
shadowAddress: lverhoeven[at]depensioenketen[dot]nl
shadowAddress: lverhoeven[at]deverzekeringsketen[dot]nl
shadowAddress: lverhoeven[at]depensioencombinatie[dot]nl
shadowAddress: lverhoeven[at]despaarcombinatie[dot]nl
shadowAddress: lverhoeven[at]dehypotheekketen[dot]nl
shadowAddress: lverhoeven[at]dehypotheekcombinatie[dot]nl
shadowAddress: lverhoeven[at]deleencombinatie[dot]nl
shadowAddress: luc[at]vcn[dot]nl
shadowAddress: lverhoeven[at]topklasseverzekering[dot]nl
sn: lverhoeven
storageBaseDirectory: /home/vmail
uid: lverhoeven

6

Re: Problems with domain alias

Any idea?

7

Re: Problems with domain alias

Sorry for my late response.

luxus wrote:

enabledService: shadowaddress
shadowAddress: lverhoeven[at]deverzekeringcombinatie[dot]nl
shadowAddress: lverhoeven[at]depensioenketen[dot]nl
shadowAddress: lverhoeven[at]deverzekeringsketen[dot]nl
shadowAddress: lverhoeven[at]depensioencombinatie[dot]nl
shadowAddress: lverhoeven[at]despaarcombinatie[dot]nl
shadowAddress: lverhoeven[at]dehypotheekketen[dot]nl
shadowAddress: lverhoeven[at]dehypotheekcombinatie[dot]nl
shadowAddress: lverhoeven[at]deleencombinatie[dot]nl
shadowAddress: luc[at]vcn[dot]nl
shadowAddress: lverhoeven[at]topklasseverzekering[dot]nl

You hav all required attributes and values, so LDAP data is fine.

What's the output message of below command:

# postmap -q 'lverhoeven[at]vcn[dot]nl' ldap:/etc/postfix/ldap_virtual_mailbox_maps.cf

Also, could you paste content of file /etc/postfix/ldap_virtual_mailbox_maps.cf (it might be /etc/postfix/ldap/virtual_mailbox_maps.cf on your server)? Remove password and replace sensitive information before pasting.

Here's a working config of /etc/postfix/ldap_virtual_mailbox_maps.cf:

...
search_base     = o=domains,dc=iredmail,dc=org
scope           = sub
query_filter    = (&(objectClass=mailUser)(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s)))(accountStatus=active)(enabledService=mail)(enabledService=deliver))
result_attribute= mailMessageStore
...

= UPDATE =
I updated postfix lookup file name above. Sorry about my mistake.

8

Re: Problems with domain alias

The output of the command you posted:

vmail1/vcn.nl/lverhoeven-2010.06.07.13.54.15/

And the content from /etc/postfix/ldap_virtual_mailbox_maps.cf

search_base     = o=domains,dc=advies4you,dc=nl
scope           = sub
query_filter    = (&(objectClass=mailUser)(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s)))(accountStatus=active)(enabledService=mail)(enabledService=deliver))
result_attribute= mailMessageStore

9

Re: Problems with domain alias

Could you please show me output of this command:

# postconf -n | grep -i 'ldap:'

And paste content of file /etc/postfix/ldap/catchall_maps.cf. A working sample is:

query_filter    = (&(objectClass=mailUser)(accountStatus=active)(|(mail=@%d)(shadowAddress=@%d)))
result_attribute= mailForwardingAddress

10

Re: Problems with domain alias

Output of the command:

recipient_bcc_maps = proxy:ldap:/etc/postfix/ldap_recipient_bcc_maps_domain.cf, proxy:ldap:/etc/postfix/ldap_recipient_bcc_maps_user.cf
relay_domains = $mydestination, proxy:ldap:/etc/postfix/ldap_relay_domains.cf
relay_recipient_maps = proxy:ldap:/etc/postfix/ldap_virtual_mailbox_maps.cf
sender_bcc_maps = proxy:ldap:/etc/postfix/ldap_sender_bcc_maps_domain.cf, proxy:ldap:/etc/postfix/ldap_sender_bcc_maps_user.cf
smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ldap_sender_login_maps.cf
transport_maps = proxy:ldap:/etc/postfix/ldap_transport_maps_user.cf, proxy:ldap:/etc/postfix/ldap_transport_maps_domain.cf
virtual_alias_maps = proxy:ldap:/etc/postfix/ldap_virtual_alias_maps.cf, proxy:ldap:/etc/postfix/ldap_virtual_group_maps.cf, proxy:ldap:/etc/postfix/ldap_sender_login_maps.cf, proxy:ldap:/etc/postfix/ldap_catch_all_maps.cf
virtual_mailbox_domains = proxy:ldap:/etc/postfix/ldap_virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap_virtual_mailbox_maps.cf

Configuration /etc/postfix/ldap_catch_all_maps:

query_filter    = (&(objectClass=mailUser)(accountStatus=active)(|(mail=@%d)(shadowAddress=@%d)))
result_attribute= mailForwardingAddress

11

Re: Problems with domain alias

Great, please show me content of /etc/postfix/ldap_sender_login_maps.cf. A working sample:

search_base     = o=domains,dc=iredmail,dc=org
scope           = sub
query_filter    = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=smtp)(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s))))
result_attribute= mail

12

Re: Problems with domain alias

problem seems to be sold,

the part (&(enabledService=shadowaddress)(shadowAddress=%s))) was missing

13

Re: Problems with domain alias

Good news. So sorry about spending so much time and delayed your issue.
Anyway, enjoy. smile