Loading ...
Sorry, an error occurred while loading the content.
 

Lightweight filter interface

Expand Messages
  • Bruno De Fraine
    Hello Postfix users, I ve got a filter command that I would like to use to tag all the messages that pass through my mail server. The filter reads an entire
    Message 1 of 1 , Sep 3, 2007
      Hello Postfix users,

      I've got a filter command that I would like to use to tag all the
      messages that pass through my mail server. The filter reads an entire
      message on stdin, and outputs one line on stdout. This line should be
      added as a header (e.g. "X-Filter-Result") to the message, which can
      be delivered just as before. In case the filter exits with an error
      (for whatever reason), the message can just pass-through untagged.

      FILTER_README proposes two solutions: simple or advanced filters. The
      simple filter is a sendmail-like command that receives the message
      and that is responsible for reinjecting it in the mail queue with the
      true sendmail command. This is close to what I have already, and I
      could use a shell script and procmail's formail command to try to
      bridge the gap. The downside seems to be that local messages cannot
      be scanned as well (since Postfix needs to treat them as already
      filtered to avoid a loop), and the documentation labels this method
      as less reliable and slower (can you avoid this by programming the
      simple filter in a different style or with a different programming
      language?).

      The advanced filter is a full SMTP proxy; it can overcome these
      downsides but it is obviously a lot of effort to set-up, especially
      since it should preferably support XFORWARD. The documentation refers
      to a third party SMTP proxy which you can use, but, I have more faith
      in Postfix's own SMTP implementation. Presumably, you cannot do this
      without setting up a second Postfix instance? Besides, if this second
      Postfix instance is just going to start the filter command, why would
      it be any faster or more reliable than the simple filter?

      Anyhow, any ideas on how to set up this filter are very welcome!

      Thanks,
      Bruno De Fraine
    Your message has been successfully submitted and would be delivered to recipients shortly.