1

Topic: Domain alias doesn't work

Hello,

We have set up domain aliasses on our mailserver, but when I sent email to one of the alias domains it sais user does not exist.

Can anyone help me with this problem?

With kind regards,

Luc Verhoeven

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Domain alias doesn't work

Can you please paste content of /etc/postfix/ldap_virtual_mailbox_domains.cf? (HIDE PASSWORD BEFORE POST)
And LDIF data of your primary domain.

3

Re: Domain alias doesn't work

ZhangHuangbin wrote:

Can you please paste content of /etc/postfix/ldap_virtual_mailbox_domains.cf? (HIDE PASSWORD BEFORE POST)
And LDIF data of your primary domain.

ldap_virtual_mailbox_domains.cf:

server_host     = 127.0.0.1
server_port     = 389
bind            = yes
start_tls       = no
version         = 3
bind_dn         = cn=vmail,dc=advies4you,dc=nl
bind_pw         = [password]
search_base     = o=domains,dc=advies4you,dc=nl
scope           = one
query_filter    = (&(objectClass=mailDomain)(|(domainName=%s)(&(enabledService=domainalias)(domainAliasName=%s)))(!(domainBackupMX=yes))(accountStatus=active)(enabledService=mail))
result_attribute= domainName
debuglevel      = 0

LDIF:

dn: domainName=vcn.nl,o=domains,dc=advies4you,dc=nl
accountSetting: defaultQuota:25
accountSetting: minPasswordLength:6
accountSetting: defaultList:iedereen@vcn.nl
accountStatus: active
cn: VCN
domainAliasName: deverzekeringcombinatie.nl
domainAliasName: depensioenketen.nl
domainAliasName: deverzekeringsketen.nl
domainAliasName: depensioencombinatie.nl
domainAliasName: despaarcombinatie.nl
domainAliasName: dehypotheekketen.nl
domainAliasName: dehypotheekcombinatie.nl
domainAliasName: deleencombinatie.nl
domainCurrentAliasNumber: 68
domainCurrentListNumber: 1
domainCurrentQuotaSize: 8713666560
domainCurrentUserNumber: 89
domainName: vcn.nl
enabledService: mail
enabledService: domainalias
mtaTransport: dovecot
objectClass: mailDomain

4

Re: Domain alias doesn't work

Postfix ldap lookup file is correct, and LDIF data looks fine too.

Can you post LDIF data of one user? (HIDE/REMOVE "userPassword" attribute and value before post)

5

Re: Domain alias doesn't work

I have replaced @ with [at] as a precaution against spam in this post

dn: mail=lverhoeven[at]vcn.nl,ou=Users,domainName=vcn.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
homeDirectory: /home/vmail/vcn.nl/lverhoeven-2010.06.07.13.54.15/
mail: lverhoeven[at]vcn.nl
mailMessageStore: vmail/vmail1/vcn.nl/lverhoeven-2010.06.07.13.54.15/
mailQuota: 209715200
memberOfGroup: iedereen[at]vcn.nl
memberOfGroup: ict[at]vcn.nl
objectClass: inetOrgPerson
objectClass: mailUser
objectClass: shadowAccount
objectClass: amavisAccount
shadowAddress: lverhoeven[at]deverzekeringcombinatie.nl
shadowAddress: lverhoeven[at]depensioenketen.nl
shadowAddress: lverhoeven[at]deverzekeringsketen.nl
shadowAddress: lverhoeven[at]depensioencombinatie.nl
shadowAddress: lverhoeven[at]despaarcombinatie.nl
shadowAddress: lverhoeven[at]dehypotheekketen.nl
shadowAddress: lverhoeven[at]dehypotheekcombinatie.nl
shadowAddress: lverhoeven[at]deleencombinatie.nl
sn: lverhoeven
storageBaseDirectory: /home
uid: lverhoeven
userPassword:

6

Re: Domain alias doesn't work

What's the version of iRedMail?
Also, please paste /etc/postfix/ldap_virtual_mailbox_maps.cf? (HIDE/REMOVE bind_pw before posting)

Correct one is like below:

server_host     = 127.0.0.1
server_port     = 389
version         = 3
bind            = yes
start_tls       = no
bind_dn         = cn=vmail,dc=iredmail,dc=org
bind_pw         =
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
debuglevel      = 0

7 (edited by veldsink 2010-10-11 19:13:03)

Re: Domain alias doesn't work

Iredmail version is 0.6.0

ldap_virtual_mailbox_maps:

server_host     = 127.0.0.1
server_port     = 389
version         = 3
bind            = yes
start_tls       = no
bind_dn         = cn=vmail,dc=advies4you,dc=nl
bind_pw         = [password]
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
debuglevel      = 0

8

Re: Domain alias doesn't work

Postfix lookup files are same. That's strange.
No idea yet why it happened.

Can you try to verify alias domains and user alias (shadow addresses) like this:

# postmap -q alias_domain.com ldap:/etc/postfix/ldap_virtual_mailbox_domains.cf
# postmap -q lverhoeven[at]despaarcombinatie.nl ldap:/etc/postfix/ldap_virtual_mailbox_maps.cf

Also, try to search user alias with ldapsearch directly:

# ldapsearch -x -D "cn=vmail,dc=advies4you,dc=nl" -w -b "o=domains,dc=advies4you,dc=nl" "(&(objectClass=mailUser)(|(mail=lverhoeven[at]despaarcombinatie.nl)(&(enabledService=shadowaddress)(shadowAddress=lverhoeven[at]despaarcombinatie.nl)))(accountStatus=active)(enabledService=mail)(enabledService=deliver))"

9

Re: Domain alias doesn't work

[root@mailserver ~]# postmap -q depensioenketen.nl ldap:/etc/postfix/ldap_virtual_mailbox_domains.cf
vcn.nl
[root@mailserver ~]# postmap -q lverhoeven[at]despaarcombinatie.nl ldap:/etc/postfix/ldap_virtual_mailbox_maps.cf
vmail/vmail1/vcn.nl/lverhoeven-2010.06.07.13.54.15/
[root@mailserver ~]# ldapsearch -x -D "cn=vmail,dc=advies4you,dc=nl" -w "[password]" -b "o=domains,dc=advies4you,dc=nl" "(&(objectClass=mailUser)(|(mail=lverhoeven[at]despaarcombinatie.nl)(&(enabledService=shadowaddress)(shadowAddress=lverhoeven[at]despaarcombinatie.nl)))(accountStatus=active)(enabledService=mail)(enabledService=deliver))"
# extended LDIF
#
# LDAPv3
# base <o=domains,dc=advies4you,dc=nl> with scope subtree
# filter: (&(objectClass=mailUser)(|(mail=lverhoeven[at]despaarcombinatie.nl)(&(enabledService=shadowaddress)(shadowAddress=lverhoeven[at]despaarcombinatie.nl)))(accountStatus=active)(enabledService=mail)(enabledService=deliver))
# requesting: ALL
#

# lverhoeven[at]vcn.nl, Users, vcn.nl, domains, advies4you.nl
dn: mail=lverhoeven[at]vcn.nl,ou=Users,domainName=vcn.nl,o=domains,dc=advies4you,
 dc=nl
objectClass: inetOrgPerson
objectClass: mailUser
objectClass: shadowAccount
objectClass: amavisAccount
mail: lverhoeven[at]vcn.nl
sn: lverhoeven
uid: lverhoeven
homeDirectory: /home/vmail/vcn.nl/lverhoeven-2010.06.07.13.54.15/
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
amavisLocal: TRUE
memberOfGroup: iedereen[at]vcn.nl
memberOfGroup: ict[at]vcn.nl
storageBaseDirectory: /home
mailMessageStore: vmail/vmail1/vcn.nl/lverhoeven-2010.06.07.13.54.15/
userPassword:: THV4dXM2OTU=
cn: Luc Verhoeven
mailQuota: 209715200
accountStatus: active
shadowAddress: lverhoeven[at]deverzekeringcombinatie.nl
shadowAddress: lverhoeven[at]depensioenketen.nl
shadowAddress: lverhoeven[at]deverzekeringsketen.nl
shadowAddress: lverhoeven[at]depensioencombinatie.nl
shadowAddress: lverhoeven[at]despaarcombinatie.nl
shadowAddress: lverhoeven[at]dehypotheekketen.nl
shadowAddress: lverhoeven[at]dehypotheekcombinatie.nl
shadowAddress: lverhoeven[at]deleencombinatie.nl

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

Everything seems to work but when I send an email it still says: User unknown.

10

Re: Domain alias doesn't work

Yes, everything looks good.

Can you please paste the original error log in postfix maillog?

11

Re: Domain alias doesn't work

What file do you mean exactly? Cause /var/log/maillog is a 50000 line file.

12

Re: Domain alias doesn't work

Try to re-send a testing email, and extract related log from /var/log/maillog.

13

Re: Domain alias doesn't work

Oct 12 13:11:01 mail postfix/smtpd[24011]: connect from unknown[192.168.10.64]
Oct 12 13:11:01 mail postfix/smtpd[24011]: ACC816D84FE: client=unknown[192.168.10.64], sasl_method=PLAIN, sasl_username=lverhoeven[at]vcn.nl
Oct 12 13:11:01 mail postfix/cleanup[24836]: ACC816D84FE: message-id=<4CB44245.2040409[at]vcn.nl>
Oct 12 13:11:01 mail postfix/qmgr[24087]: ACC816D84FE: from=<lverhoeven[at]vcn.nl>, size=711, nrcpt=1 (queue active)
Oct 12 13:11:01 mail postfix/smtpd[24011]: disconnect from unknown[192.168.10.64]
Oct 12 13:11:02 mail postfix/smtpd[23553]: connect from mail.wistikhetmaar.nl[127.0.0.1]
Oct 12 13:11:02 mail postfix/smtpd[23553]: CA88A6D84FF: client=mail.wistikhetmaar.nl[127.0.0.1]
Oct 12 13:11:02 mail postfix/cleanup[23590]: CA88A6D84FF: message-id=<4CB44245.2040409[at]vcn.nl>
Oct 12 13:11:03 mail postfix/smtpd[23553]: disconnect from mail.wistikhetmaar.nl[127.0.0.1]
Oct 12 13:11:03 mail postfix/qmgr[24087]: CA88A6D84FF: from=<lverhoeven[at]vcn.nl>, size=1198, nrcpt=1 (queue active)
Oct 12 13:11:03 mail amavis[25390]: (25390-01) Passed CLEAN, MYNETS LOCAL [192.168.10.64] [192.168.10.64] <lverhoeven[at]vcn.nl> -> <lverhoeven[at]despaarcombinatie.nl>, Message-ID: <4CB44245.2040409[at]vcn.nl>, mail_id: MczBjZeqlHBX, Hits: -11.9, size: 711, queued_as: CA88A6D84FF, 1267 ms
Oct 12 13:11:03 mail postfix/smtp[24840]: ACC816D84FE: to=<lverhoeven[at]despaarcombinatie.nl>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.4, delays=0.11/0/0.01/1.3, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=25390-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as CA88A6D84FF)
Oct 12 13:11:03 mail postfix/qmgr[24087]: ACC816D84FE: removed
Oct 12 13:11:03 mail postfix/pipe[23511]: CA88A6D84FF: to=<lverhoeven[at]despaarcombinatie.nl>, relay=dovecot, delay=0.27, delays=0.24/0/0/0.03, dsn=5.1.1, status=bounced (user unknown)
Oct 12 13:11:03 mail postfix/cleanup[24836]: 188A56D84FE: message-id=<20101012111103.188A56D84FE[at]mail.advies4you.nl>
Oct 12 13:11:03 mail postfix/qmgr[24087]: 188A56D84FE: from=<>, size=3043, nrcpt=1 (queue active)
Oct 12 13:11:03 mail postfix/bounce[25397]: CA88A6D84FF: sender non-delivery notification: 188A56D84FE
Oct 12 13:11:03 mail postfix/qmgr[24087]: CA88A6D84FF: removed
Oct 12 13:11:03 mail postfix/pipe[24275]: 188A56D84FE: to=<lverhoeven[at]vcn.nl>, relay=dovecot, delay=0.1, delays=0.04/0/0/0.06, dsn=2.0.0, status=sent (delivered via dovecot service)
Oct 12 13:11:03 mail postfix/qmgr[24087]: 188A56D84FE: removed

14

Re: Domain alias doesn't work

According to log content, seems Dovecot can't find user.
Can you please post dovecot-ldap.conf? (HIDE/REMOVE password first)
Correct one:

user_filter     = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=%Ls%Lc)(|(mail=%u)(&(enabledService=shadowaddress)(shadowAddress=%u))))
pass_filter     = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=%Ls%Lc)(|(mail=%u)(&(enabledService=shadowaddress)(shadowAddress=%u))))

15

Re: Domain alias doesn't work

This was different in my config file:

user_filter     = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=%Ls%Lc)(mail=%u))
pass_filter     = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=%Ls%Lc)(mail=%u))

Changed it and now it works!

16

Re: Domain alias doesn't work

It's better to post original log in the future big_smile