Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alias processing vs. transport maps

Status
Not open for further replies.

shaodius

MIS
Nov 22, 1999
5
0
0
US
OUr mail server is setup to do LDAP lookups to determine mailforwarding addresses for each individual mailbox as follows:

alias_maps = hash:/etc/postfix/aliases, ldap:ldapalias
alias_database = hash:/etc/postfix/aliases

ldapalias_timeout = 10
ldapalias_server_host = 192.168.48.1
ldapalias_search_base = o=COMPANY,c=US
ldapalias_query_filter = (mail=%s\@*)
ldapalias_result_attribute = mailForwardingAddress
ldapalias_cache = no
ldap_debug_level = 3

By placing into the "mailForwardingAddress" attribute of LDAP a comma delimited list of destination mail addresses, the mail is sent to all aliases.

When we use the mailbox_transport option to determine the destination for the mail, this works great
#mailbox_transport = cyrus
mailbox_transport = smtp:spamfilter.company.com

(Using the mailbox_transport:cyrus does immediate local delivery, using the smtp:spamfilter sends all mail to a separate spam filter machine, which then uses lmtp do return the message to the cyrus mailbox)

Many users complain that they do not want spam filtering on their account. Our solution is to setup a transport_maps using LDAP to determine whether each user has opted into spam filtering or not. We added these lines to the main.cf:
transport_maps = ldap:ldaptransport
ldaptransport_timeout = 10
ldaptransport_server_host = 192.168.48.1
ldaptransport_search_base = o=Company, c=US
ldaptransport_query_filter = (mail=%s)
ldaptransport_result_attribute = mailHost
ldaptransport_cache = no
ldaptransport_debuglevel = 0

and disabled the mailbox_transport line.

By placing into the LDAP attribute "mailhost" the value "cyrus" or "smtp:spamfilter.company.com", postfix does correctly route the email locally or through the mail filter. However the mailforwarding no longer works.

I assume this is occurring because the transport_maps processes the mail prior to the forwards being processed, where mailbox_transport processes after the forwards.

I would appreciate any ideas or suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top