PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Postfix: Doppelte LDAP-Anfragen



Eddie
11.05.04, 14:26
Hallo zusammen!

Habe in der Firma einen zentralen Server als Mailforwarder mit Postfix und OpenLDAP am laufen. Diese nimmt die Mails von extern an, checkt gegen die LDAP-DB ob der Empfänger gültig ist und ggf. verteilt die Mails dann an die Mailserver der Geschäftsstellen.
Es funzt soweit alles, bloss ist mir folgendes aufgefallen: Kommt eine Mail mit der ungültigen Empfängeradresse an, fragt Postfix den LDAP 2x ab, wie man es im Log gut sehen kann:

May 11 14:32:08 host slapd[934]: daemon: conn=11 fd=7 connection from IP=127.0.0.1:33053 (IP=0.0.0.0:389) accepted.
May 11 14:32:08 host slapd[934]: conn=11 op=0 SRCH base="o=Danet-GmbH,c=de" scope=2 filter="(|(mail=notexist@danet.de)(mailAlternateAddress=no texist@danet.de))"
May 11 14:32:10 host slapd[934]: conn=11 op=1 SRCH base="o=Danet-GmbH,c=de" scope=2 filter="(|(mail=@danet.de)(mailAlternateAddress=@danet.de) )"
May 11 14:32:10 host slapd[934]: conn=11 op=0 SEARCH RESULT tag=101 err=0 text=
May 11 14:32:10 host slapd[934]: conn=11 op=1 SEARCH RESULT tag=101 err=0 text=

Es ist soweit nicht tragisch, allerdings übersteigt die Anzahl der Spams die Ham-mails um ein vilefaches, die Datenbank ist dann mit doppelten Anfragen überlastet. Bekommt Postfix bis zum Timeout keine Antwort, wird die Mail abgeschmettert mit der Log-Meldung "Temporaly lookup failure", gleich ob die gültig oder ungültig gewesen wäre. Doof, wenn es eine wichtige Mail war...

Bei einem gültigen Empfänger wird nur 1x angefragt:

May 11 14:35:55 host slapd[934]: daemon: conn=12 fd=7 connection from IP=127.0.0.1:33056 (IP=0.0.0.0:389) accepted.
May 11 14:35:55 host slapd[934]: conn=12 op=0 SRCH base="o=Danet-GmbH,c=de" scope=2 filter="(|(mail=testuser@danet.de)(mailAlternateAddress=te stuser@danet.de))"
May 11 14:35:56 host slapd[934]: conn=12 op=0 SEARCH RESULT tag=101 err=0 text=

Weis jemand wie man dass Postfix beibiegen kann in jedem Falle nur 1 mal LDAP abzufragen?



Meine Konfig:

RedHat 9
openldap-2.0.27-8
postfix-2.0.14-0.rh73.1 (7.3 Sources kompiliert auf RH9)


main.cf

---------schnipp----------
alias_maps = hash:/etc/postfix/aliases, ldap:ldapaliases
alias_database = hash:/etc/postfix/aliases, ldap:ldapaliases

ldapaliases_server_host = localhost
ldapaliases_server_port = 389
ldapaliases_timeout = 20
ldapaliases_cache = yes
ldapaliases_bind = no
ldapaliases_domain = danet.de, danet-consult.de, danet-is.de, danet.ch
ldapaliases_search_base = o=Danet-GmbH,c=de
ldapaliases_query_filter = (|(mail=%s)(mailalternateaddress=%s))
ldapaliases_result_attribute = mailForwardingAddress
ldapaliases_lookup_wildcards = no
---------schnapp----------




master.cf

---------------------------
smtp inet n - n - - smtpd
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
-o canonical_maps=
-o sender_canonical_maps=
-o recipient_canonical_maps=
-o masquerade_domains=
-o virtual_maps=
-o virtual_alias_maps=
cleanup2 unix n - n - 0 cleanup
-o virtual_alias_maps=ldap:ldapaliases
-o header_checks=
-o mime_header_checks=
-o nested_header_checks=
-o body_checks=
#qmgr fifo n - n 300 1 qmgr
qmgr fifo n - n 300 1 nqmgr
#tlsmgr fifo - - n 300 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
vscan unix - - n - 10 smtp -o disable_dns_lookups=yes
#
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# maildrop. See the Postfix MAILDROP_README file for details.
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# The Cyrus deliver program has changed incompatibly, multiple times.
#
old-cyrus unix - n n - - pipe
flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
# Cyrus 2.1.5 (Amos Gouaux)
cyrus unix - n n - - pipe
user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
127.0.01:10026 inet n - n - - smtpd
-o content_filter=
-o myhostname=iscan.danet.de
-o local_recipient_maps=
-o virtual_maps=
-o virtual_mailbox_maps=
-o cleanup_service_name=cleanup2
-o mynetworks=127.0.0.0/8
-o mynetworks_style=host
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,rej ect
---------------------------