I am trying to configure postfix to work as follows:

1) In a header_check, look for a header "X-Vmta: n" where n is some number.
2) Based on n, choose an outgoing smtp transport (bound to some ip)

Basically I want postfix to choose the outgoing IP based on a header
that can be placed within the message. I have configured it thusly, so
far, but I am getting a "mail loops back to myself" error.

main.cf:
  header_checks = regexp:/etc/postfix/header_checks

header_checks:
  /^X-Vmta.*1$/   FILTER vmta1:
  /^X-Vmta.*2$/   FILTER vmta2:
  /^X-Vmta.*3$/   FILTER vmta3:
  /^X-Vmta.*4$/   FILTER vmta4:
  /^X-Vmta.*5$/   FILTER vmta5:

master.cf:
  vmta1     unix  -       -       n       -       -       smtp
      -o smtp_bind_address=x.x.x.x
  vmta2     unix  -       -       n       -       -       smtp
      -o smtp_bind_address=y.y.y.y
  vmta3     unix  -       -       n       -       -       smtp
      -o smtp_bind_address=z.z.z.z
  vmta4     unix  -       -       n       -       -       smtp
      -o smtp_bind_address=w.w.w.w.w
  vmta5     unix  -       -       n       -       -       smtp
      -o smtp_bind_address=v.v.v.v

My expectation was that the header_check would "tag" the mails when
readding them to the queue and then they would go out the specified
transport, but maybe the loop detection in postfix is defeating me? Is
it that the requeued emails also pass through the header_checks? I'm
fine with stripping off the header during the check to avoid that, but
I don't see how to FILTER and IGNORE the same line based on
header_checks(5).

Ideas?

--Ian

Reply via email to