Re: Strange Postfix-LDAP-Amavis behaviour
El Viernes, 7 de Mayo de 2004 00:40, Theodore Knab escribió:
> If you are using ldap with postfix, the mapping is not a hash anymore.
>
> It becomes a ldap querry.
That's exactly what I'm trying to do.
> You need to create mappings like this.
>
> virtual_maps = hash:/etc/postfix/virtual, ldap:ldapaltmail
> #ldap virtual aliases
> (...)
> ldapaltmail_domain = hash:/etc/postfix/searchdomains
This is a hash, so this is not what I want... What I'm trying to do is to
put/get the maximum info on the ldap server, and put/get the minimum info
from HD config files. This hash makes accepted domains are stored in HD, and
I want to store/get them from LDAP server...
>
> Read the documents called LDAP_README.gz in your /usr/share/doc/postfix
> directory.
Done carefully, be sure ;)
That's not the problem. Postfix gets the aliases correctly with my config. But
when the maildrop is a non-local email, amavis drops it back. I am trying now
file /etc/postfix/master.cf, maybe the problem is there, but I'm not sure.
Here's what I added to this file for amavis:
smtp-amavis unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-o disable_dns_lookups=yes
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
I've been tuning this parameters, but I can't find the solution...
Any hint? Thanks
Here's the log entries for an aliased account that sends email to a
local-email and a non-local-email. We can see it delivers the mail to local
correctly, but fails to non-local:
May 7 11:10:19 orc postfix/smtpd[24258]: connect from unknown[172.16.1.11]
May 7 11:10:19 orc postfix/smtpd[24258]: 0C24393293:
client=unknown[172.16.1.11]
May 7 11:10:19 orc postfix/trivial-rewrite[24260]: warning: dict_ldap_lookup:
accepteddomains: Fixed query_filter (associatedDomain=*) is probably useless
May 7 11:10:19 orc postfix/cleanup[24259]: 0C24393293:
message-id=<200405071108.54553.mail@localdomain.com>
May 7 11:10:19 orc postfix/qmgr[24253]: 0C24393293:
from=<mail@local-domain.com>, size=1234, nrcpt=2 (queue active)
May 7 11:10:19 orc postfix/smtpd[24258]: disconnect from unknown[172.16.1.11]
May 7 11:10:19 orc postfix/trivial-rewrite[24260]: warning: dict_ldap_lookup:
accepteddomains: Fixed query_filter (associatedDomain=*) is probably useless
May 7 11:10:19 orc postfix/trivial-rewrite[24260]: warning: dict_ldap_lookup:
accepteddomains: Fixed query_filter (associatedDomain=*) is probably useless
May 7 11:10:19 orc postfix/smtpd[24262]: connect from localhost[127.0.0.1]
May 7 11:10:19 orc postfix/smtpd[24262]: 4C3A693294:
client=localhost[127.0.0.1]
May 7 11:10:19 orc postfix/trivial-rewrite[24260]: warning: dict_ldap_lookup:
accepteddomains: Fixed query_filter (associatedDomain=*) is probably useless
May 7 11:10:19 orc postfix/trivial-rewrite[24260]: warning: dict_ldap_lookup:
accepteddomains: Fixed query_filter (associatedDomain=*) is probably useless
May 7 11:10:19 orc postfix/smtpd[24262]: 4C3A693294: reject: RCPT from
localhost[127.0.0.1]: 550 <mail@non-local-domain.com>: User unknown in
virtual mailbox table; from=<mail@local-domain.com>
to=<mail@non-local-domain.com> proto=ESMTP helo=<localhost>
May 7 11:10:19 orc postfix/cleanup[24259]: 4C3A693294:
message-id=<200405071108.54553.mail@local-domain.com>
May 7 11:10:19 orc postfix/smtpd[24262]: disconnect from localhost[127.0.0.1]
May 7 11:10:19 orc postfix/qmgr[24253]: 4C3A693294:
from=<mail@local-domain.com>, size=1644, nrcpt=1 (queue active)
May 7 11:10:19 orc postfix/smtpd[24262]: connect from localhost[127.0.0.1]
May 7 11:10:19 orc postfix/smtpd[24262]: 7DF3793295:
client=localhost[127.0.0.1]
May 7 11:10:19 orc postfix/trivial-rewrite[24260]: warning: dict_ldap_lookup:
accepteddomains: Fixed query_filter (associatedDomain=*) is probably useless
May 7 11:10:19 orc postfix/cleanup[24259]: 7DF3793295:
message-id=<DSN23870-02@orc>
May 7 11:10:19 orc postfix/qmgr[24253]: 7DF3793295: from=<>, size=2977,
nrcpt=1 (queue active)
May 7 11:10:19 orc postfix/smtpd[24262]: disconnect from localhost[127.0.0.1]
May 7 11:10:19 orc postfix/smtp[24261]: 0C24393293:
to=<mail@local-domain.com>, orig_to=<aliased-account@local-domain.com>,
relay=127.0.0.1[127.0.0.1], delay=0, status=sent (250 2.6.0 Ok, id=23870-02,
from MTA: 250 Ok: queued as 4C3A693294, but 1 REJECT)
May 7 11:10:19 orc postfix/smtp[24261]: 0C24393293:
to=<mail@non-local-domain.com>, orig_to=<aliased-account@local-domain.com>,
relay=127.0.0.1[127.0.0.1], delay=0, status=sent (250 2.6.0 Ok, id=23870-02,
from MTA: 250 Ok: queued as 4C3A693294, but 1 REJECT)
May 7 11:10:19 orc postfix/virtual[24263]: 4C3A693294:
to=<mail@local-domain.com>, relay=virtual, delay=0, status=sent (maildir)
May 7 11:10:19 orc postfix/virtual[24264]: 7DF3793295:
to=<mail@local-domain.com>, relay=virtual, delay=0, status=sent (maildir)
>
> > 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: