-1

I am running postfix and I'm using ubuntu 14.04.

I created php script and i injected it into postfix to filter incoming mail. All run as I wish.

But Now I want my postfix to run filter only with selected mail (for example I will run filter when mail contains pdf attachments) else all other mail ( that don't contain pdf attach) pass without being filtered (without running filter.)

I have been searching the net however not getting proper help to understand thoroughly. I found configuration below:

mime_header_checks = regexp:/etc/postfix/blocked_attachments

But I understand that this config block mail. ( I don't want to block any mail, I want mails either to be passed by filter or pass normally without being filtered)

Is it possible to achieve my aim or should I have to code this with php into my script.

Earliest response will be appreciated.

xtensa1408
  • 141
  • 6

1 Answers1

2

Basically, what the mime_header_checks directive does it to instruct postfix to check an external table (/etc/postfix/blocked_attachments, in your case) for a matching pattern and action.

But to correctly use it you should really read the relevant postfix man page

shodanshok
  • 47,711
  • 7
  • 111
  • 180
  • What I understand that mime_header_checks either pass mail into filter or rejected it !!! more explanation please. – xtensa1408 Apr 17 '15 at 16:46
  • 1
    mime_header_checks simply instruct postfix to match each incoming email against the regular expression listed inside the /etc/postfix/blocked_attachments file. When a regexp match, it will execute the corresponding action. I linked the documentation in the answer. Please read it. – shodanshok Apr 17 '15 at 17:08