Hi there, 

I have Postfix integrated with LDAP, Postfix will validate against LDAP
for recipient and domain. But for messages to "medplus.com", I want it
to use mail relay to another SMTP server at our company. What
complicates the matter is that I have one Postfix instance serving
messages from two different IPs.  Messages are routed correctly from
both directions. The problem I have is that relay does not work:
messages with "medplus.com" as recipient domains, instead of getting
relayed to our corporate SMTP server, it comes right into "connector"
defined in master.cf. 

Any comment to trouble shoot?  

My theory is that message will be validated against LDAP first, if the
address is not found in LDAP, it would gets relayed using relayhost, is
that correct?

This is master.cf

<IP 1>:smtp      inet  n       -       n       -       -       smtpd
  -o content_filter=dovecot:
<IP 2>:smtp      inet  n       -       n       -       -       smtpd
  -o content_filter=connector:

......  <I am directing messages to Python scripts for process below>
......

connector     unix  -       n       n       -       -       pipe
   flags= user=hubdirect argv=python /usr/local/bin/connector.py
dovecot   unix  -       n       n       -       -       pipe
   flags=Rhu user=hubdirect argv=/usr/libexec/dovecot/deliver -f
${sender} -d ${recipient}


This is main.cf:

relay_domains=medplus.com                                      (any
message to x...@medplus.com should be relayed)
relayhost=<our company SMTP server host name here...>

dovecot_recipient_maps = ldap:ldaplocal
connector_recipient_maps = ldap:ldaplocal             (I want LDAP
validation here for all messages)

ldaplocal_server_host = ldap://hub-devds01.dev.medplus.com:389/

ldaplocal_search_base = ou=domain,dc=hubdirect,dc=dev,dc=medplus,dc=com
ldaplocal_query_filter = (addressvalue=%s)
ldaplocal_result_attribute = deliverto

smtpd_recipient_restrictions =                        (valid recipients
& domains are those defined in LDAP)
        reject_unauth_destination
        check_recipient_access ldap:ldaplocal

Thanks,

Yan





Confidentiality Notice: The information contained in this electronic 
transmission is confidential and may be legally privileged. It is intended only 
for the addressee(s) named above. If you are not an intended recipient, be 
aware that any disclosure, copying, distribution or use of the information 
contained in this transmission is prohibited and may be unlawful. If you have 
received this transmission in error, please notify us by telephone (513) 
229-5500 or by email (postmas...@medplus.com). After replying, please erase it 
from your computer system.

Reply via email to