Re: Strange Postfix-LDAP-Amavis behaviour
If you are using ldap with postfix, the mapping is not a hash anymore.
It becomes a ldap querry.
You need to create mappings like this.
virtual_maps = hash:/etc/postfix/virtual, ldap:ldapaltmail
#ldap virtual aliases
ldapaltmail_timeout = 10
ldapaltmail_server_host = localhost
ldapaltmail_search_base = ou=People,dc=annapolislinux,dc=org
ldapaltmail_server_port = 389
ldapaltmail_domain = hash:/etc/postfix/searchdomains
ldapaltmail_query_filter = (&(mailAlternateAddress=%s)(accountstatus=active))
#ldapaltmail_query_filter = (&(uid=%u)(accountstatus=active))
ldapaltmail_result_attribute = mail
ldapaltmail_special_result_attribute = uniquemember
ldapaltmail_bind = yes
ldapaltmail_bind_dn = cn=evil_alien_mail_leader,ou=System,dc=annapolislinux,dc=org
ldapaltmail_bind_pw = 123abc
Read the documents called LDAP_README.gz in your /usr/share/doc/postfix directory.
The evil_alien_mail_leader in this example also needs rights to read the mail
info in ldap. The rights are defined in the slapd.conf file.
If it is missing:
apt-get install postfix-docs
> On 06/05/04 17:12 +0200, Tom?s N??ez Lirola wrote:
> 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
>
>
> --
> To UNSUBSCRIBE, email to debian-isp-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
--
------------------------------------------
Ted Knab
Chester, Maryland 21619 USA
------------------------------------------
Conquest is easy. Control is not.
-- Kirk, "Mirror, Mirror", stardate unknown
Reply to: