Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I need to filter email delivery in Postfix based on a specific header.

Lets have the following example:

There's some PHP script that will dispatch emails to the local MTA (postfix). These emails contain a specific custom header (for example sake, X-EMAIL-TYPE) that will have one of 3 values:

  • Bulk
  • Transactional
  • Autoreply

I need to dispatch emails to different SMTP servers based on the X-EMAIL-TYPE header.

Is this possible in Postfix? If yes, how can I do this?

Thank you!

share|improve this question

marked as duplicate by masegaloeh, Hyppy, HBruijn, Sven Jan 21 '15 at 19:04

This question was marked as an exact duplicate of an existing question.

1  
This doesn't make sense. Email routing is based on recipient's domain and not on an individual header. You need to refine your question by examples. – mailq Oct 12 '11 at 18:33

i don't know if this helps you but i think you can do it with header check.s Just luck in the file where your configs are.(/etc/postfix/header_checks). I only used this to reject mails that contain some character encodings but i think it can be done from there.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.