[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SOLVED] Re: Strange Postfix-LDAP-Amavis behaviour



Well... I was going the wrong way... Amavis was not the problem, I took out 
amavis and the problem was still there.

So here is the solution:
I added a field on each domain in LDAP:
destinationIndicator: virtual

I added "transport_maps" to /etc/postfix/main.cf:
transport_maps = ldap:ldaptransport hash:/etc/postfix/transport
ldaptransport_server_host = localhost
ldaptransport_server_port = 389
ldaptransport_bind = no
ldaptransport_search_base = dc=domain,dc=com
ldaptransport_query_filter = (associatedDomain=%d)
ldaptransport_result_attribute = destinationIndicator

and I added a line to /etc/postfix/transport
* smtp:

This way postfix redirects all non-local aliases. I don't know if I'm misusing 
the "destinationIndicator" field, but I think if I need this field in the 
future, I can change whenever I want to :)

Thanks all for the hints! :)


El Jueves, 6 de Mayo de 2004 17:12, Tomàs Núñez Lirola escribió:
> Hi again
> I've recently installed a mail server using Postfix-LDAP-Amavis. I stored
> accepted domains on a file "postmapped" (/etc/postfix/virtualdomains) and
> everything was ok. Now I've tried to store this accepted domains in the
> LDAP server and I've found some problem: amavis returns non-local aliases.
> No problem with local aliases, no problem with local delivery.
>
> Well, this config works perfectly (well, at least it seems to):
> /etc/postfix/main.cf:
> virtual_mailbox_domains = $virtual_mailbox_maps
> hash:/etc/postfix/virtualdomains
>
> /etc/postfix/virtualdomains:
> mydomain.com required
>
> LDAP Alias:
> dn: cn=Aliased account,ou=People,dc=mydomain.com,ou=Commercial,
> ou=Dealer,dc=root,dc=ldap
> mail: aliased@mydomain.com
> sn: Aliased account
> cn: Aliased account
> objectClass: courierMailAlias
> objectClass: inetOrgPerson
> objectClass: top
> maildrop: aliased@non-local.domain.com
>
> LDAP MyDomain:
> dn: dc=mydomain.com,ou=Commercial,ou=Dealer,dc=root,dc=ldap
> associatedDomain: mydomain.com
> dc: mydomain.com
> objectClass: top
> objectClass: dnsdomain
> objectClass: domainRelatedObject
>
> main.cf:
> virtual_maps = ldap:valiases
> valiases_server_host = localhost
> valiases_search_base = dc=mydomain,dc=com
> valiases_query_filter = (&(mail=%s)(objectClass=CourierMailAlias))
> valiases_result_attribute = maildrop
>
> And this other don't work at all. All the same except:
> virtual_mailbox_domains = $virtual_mailbox_maps ldap:accepteddomains
> accepteddomains_server_host = localhost
> accepteddomains_server_port = 389
> accepteddomains_search_base = dc=mydomain,dc=com
> accepteddomains_query_filter = (associatedDomain=*)
> accepteddomains_result_attribute = associatedDomain
>
> This config works correctly with local mail, local aliases, but not with
> non-local aliases. When I send an email to this aliased account, I get an
> email from AMAVIS with the following error:
>
> From: amavisd-new <postmaster@mydomain.com>
> To: <tomas@grupoeon.net>
> at host mydomain. Our internal reference code for your message
> is 22949-09.
>
> Return-Path: <tomas@apliasi.com>
> Your message <200405051857.55576.tomas@grupoeon.net> could not be delivered
> to:
>   <aliased@non-local.domain.com>: 127.0.0.1 said:
>    550 5.1.0 <aliased@non-local.domain.com>: User unknown in virtual
> mailbox table
>
> I've been looking everywhere for what am I doing wrong, but I can't find
> it. I've got tons of docs, mans and discussion threads but unsuccessful.
> Any of you can tell me where to look at, please? Where may be the problem?
>
> Thanks ins advance



Reply to: