Dominik Schulz: > Am Montag 11 Januar 2010 15:08:05 schrieb Wietse Venema: > > l...@ds.gauner.org: > > > Hi, > > > I'm trying to use header_checks in conjunction with a pcre map to > > > distribute certain mail traffic to certain outgoing transports. I've got > > > a setup like this: > > > --- main.cf snip --- > > > header_checks = pcre:/etc/postfix/header.pcre > > > --- snap --- > > > --- header.pcre snip --- > > > /^X-CUSTOMER-ID: ([0-9])/ FILTER smtpout$1: > > You MUST specify a nexthop destination. The purpose of FILTER is > > to send mail for MANY destinations through ONE filter destination. > > If you don't specify a next-hop destination, then Postfix will > > choose a default one. > > To make Postfix routing sender dependent, use > > sender_dependent_relayhost_maps (Postfix 2.3 and later) or > > sender_dependent_default_transport_maps (Postfix 2.7 and later). > Thanks for the reply. Unfortunately I don't seem to have myself clear. > > I want to controll to nexthop (i.e. the outgoing relay) through some kind of > "X-"-Header, e.g. "X-CUSTOMER_ID: 34554", and not through the > sender/recipient > addresses. > > Is there some way to achieve this behaviour?
The short answer: specify a FILTER command that points to a Postfix instance that has its own unique hostname, and that is bound to its own unique IP address. myhostname = unique-name.example.com inet_interfaces = $myhostname Adding Postfix instances is easy with Postfix 2.6. Until someone explains why they must use the header and can't use the envelope sender, I am not inclined to invest a lot of effort on my side to find out if there exists a better solution. Wietse