On Tuesday.January 20,2009 Magnus Bäck wrote
>>On Monday, January 19, 2009 at 10:50 CET,
 >>    Goutam Baul <goutam.b...@cesc.co.in> wrote:

>> I am trying to configure postfix 2.2.10 in a way that two of my group
>> companies can get their mailing services from one physical server
>> machine. The two companies are having their separate domains
>>registered and the name space for them will be completely separate
>>i.e. a...@company1.com will have a separate mailbox from that of
>> a...@company2.com.
>
>> The details of the users are all kept in LDAP. I have created the LDAP
>> tree where the users of company1.com are under
>> ou=company1.com,dc=my,dc=organization and those for company2.com are
>> under ou=company2.com,dc=my,dc=organization.
>
>> I have added company1.com and company2.com in mydestination and have
>> defined the LDAP search_base as ou=%d,dc=my,dc=organization.

> Where have you made this definition? Two domains listed in mydestination
>  by definition have the same set of localparts, i.e.

I am giving below the portion of the main.cf to show the place where I
defined it:
virtual_mailbox_maps = ldap:accounts
accounts_timeout = 60
accounts_server_host = 127.0.0.1
accounts_search_base = ou=%d,dc=my,dc=organization
accounts_server_port = 389
accounts_query_filter = (&(|(mail=%s) (mailAlternateAddress=%s))
(accountStatus=active))
accounts_result_attribute = mailMessageStore

>   a...@b == a...@c

>for all values of `a' given that `b' and `c' are listed in
>mydestination. Put differently, you will not be able to distinguish
>between j...@example.com and j...@example.net because they'll both map to
>the same local user joe.

>> My SMTP transaction is going fine in a sense, the mails are getting
>> delivered to the individual mailboxes. May I request you to kindly
>> point out whether there is any issue in this approach? I have read
>> that this sort of scenario is best tackled by using virtual hosting
>> feature of postfix using things like virtual_mailbox_domains etc.

> Yes, that's what I'd recommend.

>> I tried to take that route but could not achieve the result after lots
>> of efforts. Mails for company1.com were getting delivered but those
>> for company2.com were bouncing with "user unknown" result. Thus have
>> taken to this route. Will there be any problem with this approach if I
>> "go live" with it? Kindly guide me.

> Try again with the virtual mailbox domain and report back the problems
>  you get. Your current design is simply broken unless it's feasible to
>  use aliases to separate j...@example.com from j...@example.net -- the
>  actual usernames could be joecom and joenet and the virtual alias table
>  would resolve j...@example.com to joecom and j...@example.net to joenet.

If  I  define the company1.com in the my destination and have company2.com
in the parameter virtual_mailbox_domains then mail for company1.com gets
delivered properly but those for company2.com gets rejected. I get the
following type of message in the maillog
Jan 20 15:17:39 mail postfix/virtual[1692]: 6E16F17E20:
to=<a...@company2.com>, relay=virtual, delay=0, status=bounced (unknown
user: "a...@company2.com")
I tried to increase the verbosity of virtual daemon at master.cf. But could
not make much from the result. I am giving below the log output with the
increased verbosity:
Jan 20 15:38:59 mail postfix/virtual[2191]: dict_ldap_lookup: No existing
connection for LDAP source accounts, reopening
Jan 20 15:38:59 mail postfix/virtual[2191]: dict_ldap_connect: Connecting to
server ldap://127.0.0.1:389
Jan 20 15:38:59 mail postfix/virtual[2191]: dict_ldap_connect: Actual
Protocol version used is 2.
Jan 20 15:38:59 mail postfix/virtual[2191]: dict_ldap_connect: Binding to
server ldap://127.0.0.1:389 as dn
Jan 20 15:38:59 mail postfix/virtual[2191]: dict_ldap_connect: Successful
bind to server ldap://127.0.0.1:389 as
Jan 20 15:38:59 mail postfix/virtual[2191]: dict_ldap_connect: Cached
connection handle for LDAP source accounts
Jan 20 15:38:59 mail postfix/virtual[2191]: dict_ldap_lookup: accounts:
Searching with filter (&(|(mail=a...@company2.com)
(mailalternateaddress=a...@company2.com)) (accountStatus=active))
Jan 20 15:38:59 mail postfix/virtual[2191]: dict_ldap_get_values[1]: Search
found 0 match(es)
Jan 20 15:38:59 mail postfix/virtual[2191]: dict_ldap_get_values[1]: Leaving
dict_ldap_get_values
Jan 20 15:38:59 mail postfix/virtual[2191]: dict_ldap_lookup: Search
returned nothing
Jan 20 15:38:59 mail postfix/virtual[2191]: maps_find: virtual_mailbox_maps:
a...@company2.com: not found
Kindly advice me how to debug the situation.
With regards,
Goutam



Reply via email to