1 (edited by chrisjrob 2012-06-22 18:24:43)

Topic: Mail Lists and Aliases for Aliased Domains

- iRedMail 0.8.1 (LDAP)
- Ubuntu Server 12.04

I am commissioning a new mailserver using iRedMail with iRedAdmin-Pro.  All seems as expected, with one exception, emails sent to aliases or mail lists for aliased domains are bouncing.

For example:

tridentgarages.co.uk - primary domain
surreyhonda.co.uk - aliased to tridentgarages.co.uk
tridenthonda.co.uk - aliased to tridentgarages.co.uk

Emails sent to user@surreyhonda.co.uk are arriving perfectly, but emails sent to alias or mail list e.g. sales@surreyhonda.co.uk are bouncing, presumably because the aliases or mail lists have not been set up on the aliased domains.

I suppose I can set up all 100 or so mail lists and aliases for each and every aliased domain (please no), but this seems so unnecessary.  Worse, trying to keep them all synchronised will be a challenge. Having set up the domains to alias, surely anyone would expect that the mail lists and aliases would also be aliased?

On our previous mailserver, which also used postfix, dovecot, and openldap, we used Phamm for the administration.  Under Phamm you set up a Catch-all for the domain "@tridentgarages.co.uk", after which it all just worked.

Is this possible in some way?  Or is this one for the wishlist?

Thanks!

Chris Roberts

----

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

2

Re: Mail Lists and Aliases for Aliased Domains

Alias domain for mail alias/list should be handled correctly with iRedAdmin-Pro.

- Could you please show me output of below command:

# postconf virtual_alias_maps

- Show me output of below commands. Please replace sales@ by real email address in commands, but you can replace real email address/domain while pasting here to hide sensitive info.

# cd /etc/postfix/ldap/
# for cf in $(ls *.cf); do echo $cf; postmap -q 'sales@surreyhonda.co.uk' ldap:./$cf; done

- Paste output of below command:

# cd /etc/postfix/ldap/
# grep 'query_filter' *.cf

3

Re: Mail Lists and Aliases for Aliased Domains

Alias domain for mail alias/list should be handled correctly with iRedAdmin-Pro.

That's good to know!  Responses below:

# postconf virtual_alias_maps
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/virtual_group_members_maps.cf, proxy:ldap:/etc/postfix/ldap/catchall_maps.cf
# cd /etc/postfix/ldap/
/etc/postfix/ldap# for cf in $(ls *.cf); do echo $cf; postmap -q 'composite@surreyhonda.co.uk' ldap:./$cf; done
catchall_maps.cf
recipient_bcc_maps_domain.cf
recipient_bcc_maps_user.cf
relay_domains.cf
sender_bcc_maps_domain.cf
sender_bcc_maps_user.cf
sender_login_maps.cf
transport_maps_domain.cf
transport_maps_user.cf
virtual_alias_maps.cf
virtual_group_maps.cf
virtual_group_members_maps.cf
virtual_mailbox_domains.cf
virtual_mailbox_maps.cf
/etc/postfix/ldap#
/etc/postfix/ldap# grep 'query_filter' *.cf
catchall_maps.cf:query_filter    = (&(objectClass=mailUser)(accountStatus=active)(|(mail=@%d)(shadowAddress=@%d)))
recipient_bcc_maps_domain.cf:query_filter    = (&(objectClass=mailDomain)(|(domainName=%d)(domainAliasName=%d))(accountStatus=active)(enabledService=mail)(enabledService=recipientbcc))
recipient_bcc_maps_user.cf:query_filter    = (&(mail=%s)(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=recipientbcc))
relay_domains.cf:query_filter    = (&(objectClass=mailDomain)(|(domainName=%s)(&(enabledService=domainalias)(domainAliasName=%s)))(domainBackupMX=yes)(accountStatus=active)(enabledService=mail))
sender_bcc_maps_domain.cf:query_filter    = (&(objectClass=mailDomain)(|(domainName=%d)(domainAliasName=%d))(accountStatus=active)(enabledService=mail)(enabledService=senderbcc))
sender_bcc_maps_user.cf:query_filter    = (&(mail=%s)(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=senderbcc))
sender_login_maps.cf:query_filter    = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=smtp)(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s))))
transport_maps_domain.cf:query_filter    = (&(objectClass=mailDomain)(|(domainName=%s)(domainAliasName=%s))(accountStatus=active)(enabledService=mail))
transport_maps_user.cf:query_filter    = (&(objectClass=mailUser)(mail=%s)(accountStatus=active)(enabledService=mail))
virtual_alias_maps.cf:query_filter    = (&(|(mail=%s)(shadowAddress=%s))(accountStatus=active)(enabledService=mail)(enabledService=deliver)(|(objectClass=mailAlias)(&(objectClass=mailUser)(enabledService=forward))))
virtual_group_maps.cf:query_filter    = (&(memberOfGroup=%s)(accountStatus=active)(enabledService=mail)(enabledService=deliver)(|(objectClass=mailUser)(objectClass=mailExternalUser)))
virtual_group_members_maps.cf:query_filter    = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=deliver)(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s))))
virtual_mailbox_domains.cf:query_filter    = (&(objectClass=mailDomain)(|(domainName=%s)(&(enabledService=domainalias)(domainAliasName=%s)))(!(domainBackupMX=yes))(accountStatus=active)(enabledService=mail))
virtual_mailbox_maps.cf:query_filter    = (&(objectClass=mailUser)(|(mail=%s)(&(enabledService=shadowaddress)(shadowAddress=%s)))(accountStatus=active)(enabledService=mail)(enabledService=deliver))

4

Re: Mail Lists and Aliases for Aliased Domains

virtual_alias_maps and query_filter settings in Postfix are correct. But output of postmap commands is not expected.
Could you please paste LDIF data of account 'composite@surreyhonda.co.uk'? You can get the LDIF data with iRedAdmin-Pro-LDAP:

1: Log in to iRedAdmin-Pro-LDAP as global admin
2: Go to account profile page of mail list 'composite@tridentgarages.co.uk' (not composite@surreyhonda.co.uk)
3: Under profile page tab 'General', you can see link "Export account to LDIF". That's what we want.

Then paste the whole LDIF data here to help troubleshoot.

5

Re: Mail Lists and Aliases for Aliased Domains

Dear chrisjrob,

It's confirmed this is a bug in both iRedMail and iRedAdmin-Pro-LDAP. The latest iRedMail-0.8.1 and iRedAdmin-Pro-LDAP-1.7.2 handles alias domain for mail users and mail aliases, but not mail lists. Sorry about this trouble.

You can fix it with below steps:

1: Use the latest iRedMail LDAP schema file. Please follow this tutorial to use the latest schema file:
http://www.iredmail.org/wiki/index.php? … chema_file

NOTE: The upgrade tutorial for upcoming iRedMail-0.8.2 is still a draft, please just apply section "Use the newest schema file", do NOT try others.

2: Apply attached patch for iRedAdmin-Pro-LDAP-1.7.2.

Steps to apply this patch on your server:

1): Download attached patch, upload it to your server which has iRedAdmin-Pro-LDAP-1.7.2 running. Assume uploaded file is /root/maillist_shadowaddress.patch

2): Change working directory to the root directory of iRedAdmin-Pro-LDAP-1.7.2. For example:

# cd /usr/share/apache2/iRedAdmin-Pro-LDAP-1.7.2/

3): Verify the patch with command 'patch --dry-run -p1':

# patch --dry-run -p1 < /root/maillist_shadowaddress.patch
patching file libs/ldaplib/domain.py

4): If you see the same output message, it's safe to apply it without '--dry-run':

# patch -p1 < /root/maillist_shadowaddress.patch
patching file libs/ldaplib/domain.py

5): Restart Apache web server.

You have to remove alias domain first, then add it again. So that (patched) iRedAdmin-Pro-LDAP will handle alias domain for all mail accounts correctly.

That's all. Let me know whether it works for you or not.

Post's attachments

maillist_shadowaddress.patch 619 b, 6 downloads since 2012-06-23 

You don't have the permssions to download the attachments of this post.

6

Re: Mail Lists and Aliases for Aliased Domains

ZhangHuangbin wrote:

It's confirmed this is a bug in both iRedMail and iRedAdmin-Pro-LDAP. The latest iRedMail-0.8.1 and iRedAdmin-Pro-LDAP-1.7.2 handles alias domain for mail users and mail aliases, but not mail lists. Sorry about this trouble.

No problem, bugs are a fact of life - it's how developers deal with them that matters - and this level of support is simply amazing.

1: Use the latest iRedMail LDAP schema file. Please follow this tutorial to use the latest schema file:
http://www.iredmail.org/wiki/index.php? … chema_file

Please note that the instructions for debian/ubuntu would appear to be incorrect - /etc/init.d/ldap is not a service - it should be "slapd".  In Ubuntu, it should be

service slapd restart

although

/etc/init.d/slapd restart

works fine and is probably more Debian friendly.

You have to remove alias domain first, then add it again. So that (patched) iRedAdmin-Pro-LDAP will handle alias domain for all mail accounts correctly.
That's all. Let me know whether it works for you or not.

Yes it worked, thank you so much, I cannot say how impressed I am.

7

Re: Mail Lists and Aliases for Aliased Domains

chrisjrob wrote:

Please note that the instructions for debian/ubuntu would appear to be incorrect - /etc/init.d/ldap is not a service - it should be "slapd".

Fixed. it's a typo error caused by copy-paste. Thanks for your feedback. smile

8 (edited by swiss2011 2012-12-27 00:50:09)

Re: Mail Lists and Aliases for Aliased Domains

Hi ZhangHuangbin

I tried with the above steps. Its not working for me. It shows me an error message users not in virutal mailbox. Could you help me.

I am using  iRedAdmin-Pro-LDAP-1.7.2/

My ldiff file for mailing list

dn: mail=sfs-bm@mail.xxxx.in,ou=Groups,domainName=mail.xxxx.in,o=domains,dc=xxx,dc=com
accessPolicy: subdomain
accountStatus: active
cn: SFS-BM
enabledService: mail
enabledService: deliver
mail: sfs-bm@mail.xxxx.in
objectClass: mailList

Thanks

ZhangHuangbin wrote:
chrisjrob wrote:

Please note that the instructions for debian/ubuntu would appear to be incorrect - /etc/init.d/ldap is not a service - it should be "slapd".

Fixed. it's a typo error caused by copy-paste. Thanks for your feedback. smile

9

Re: Mail Lists and Aliases for Aliased Domains

Hi @swiss2011,

Could you please clearly explain what your issue is in a new topic? And show us original error message to help troubleshoot.

10 (edited by swiss2011 2012-12-27 00:53:32)

Re: Mail Lists and Aliases for Aliased Domains

Hi,

I have created a domain called mail.xxx.com & alias name given was xxx.com. I tried to create a mailing list called sfs-bm@mail.xxx.com & added few members. When i try to send email to sfs-bm@xxx.com It says users unknow in virtual mail box table. Can you help me on this

Error message in mail log

NOQUEUE: reject: RCPT from unknown[115.248.220.98]: 550 5.1.1 <sfs-bm@xxx.in>: Recipient address rejected: User unknown in virtual mailbox table;

ZhangHuangbin wrote:

Hi @swiss2011,

Could you please clearly explain what your issue is in a new topic? And show us original error message to help troubleshoot.