[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Postfix Virtual Accounts & Aliases
Dear List,
I'm having a mental block here. I've setup Postfix and OpenLDAP for
virtual domains/users, using the Jamm schema, although I'm not using
Jamm's front end, I've written my own web-based front end to add, edit
domains, users and aliases. It works nicely.
Using the defined schema, accounts and aliases have an identical DN
structure (below), which is giving me the problem, whereby I can't
define how to deliver mail to multiple recipients if I'm initially
sending mail directly to an account (rather than an alias).
For example, I would not be able to add the following two entries (an
account and an alias) to my directory, since the DN's are identical.
An Account:
dn: mail=chris@domain.com,jvd=domain.com,o=hosting,dc=domain,dc=com
objectClass: top
objectClass: JammMailAccount
mail: chris@domain.com
homeDirectory: /home/vmail/domains
mailbox: domain.com/chris/
cn: Chris Andrew
An Alias:
dn: mail=chris@domain.com,jvd=domain.com,o=hosting,dc=domain,dc=com
objectClass: top
objectClass: jammmailalias
mail: chris@domain.com
maildrop: chris@domain.com
maildrop: someoneelse@someotherdomain.com
>From this, I could either:
(1)
change the DN for an alias to incorporate an identifer, hence changing
the DN structure between accounts and aliases.
or,
(2)
Incorporate the two ldif's into one.
I wonder if anyone else has had this problem and found the best
solution.
Here are the LDAP parameters from main.cf:
#
# LDAP PARAMETERS
#
# transports - to determine what to do next with the email
# should always return virtual:
transport_server_host = localhost
transport_search_base = o=hosting,dc=oxspring,dc=com
transport_query_filter =
(&(&(jvd=%s)(objectClass=JammVirtualDomain))(accountActive=TRUE))
transport_result_attribute = postfixTransport
transport_cache = no
transport_bind = no
transport_scope = one
# aliases - get maildrop attribute
aliases_server_host = localhost
aliases_search_base = o=hosting,dc=oxspring,dc=com
aliases_query_filter = (&(objectClass=JammMailAlias)(mail=%s))
aliases_result_attribute = maildrop
aliases_bind = no
aliases_cache = no
# accounts - get the mailbox attribute
accounts_server_host = localhost
accounts_search_base = o=hosting,dc=oxspring,dc=com
accounts_query_filter =
(&(objectClass=JammMailAccount)(mail=%s)(accountActive=TRUE)(delete=FALSE))
accounts_result_attribute = mailbox
accounts_cache = no
accounts_bind = no
# accounts map - postfix needs a second check to ensure
# an account is valid. The accounts map lookup helps
# postfix determine this.
accountsmap_server_host = localhost
accountsmap_search_base = o=hosting,dc=oxspring,dc=com
accountsmap_query_filter =
(&(objectClass=JammMailAccount)(mail=%s)(accountActive=TRUE)(delete=FALSE))
accountsmap_result_attribute = mail
accountsmap_cache = no
accountsmap_bind = no
# transport map - make postfix aware of the above transport source
transport_maps = ldap:transport
# virtual map - make postfix aware of the above aliases and accountsmap
source
virtual_maps = ldap:aliases, ldap:accountsmap
# virtual - tell postfix how to figure out the virtual accounts
virtual_mailbox_base = /home/vmail/domains
virtual_mailbox_maps = ldap:accounts
virtual_minimum_uid = 101
virtual_uid_maps = static:101
virtual_gid_maps = static:101
Regards,
Chris Andrew