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

Re: Create second smtp process to bypass Spamassassin?

Expand Messages
  • Noel Jones
    ... This is unreliable. The FILTER action acts per-message, not per-recipient, so it is likely that multi-recipient mail will be misdirected. The only
    Message 1 of 3 , Jan 31, 2007
      At 07:56 PM 1/31/2007, Chris St. Pierre wrote:
      >On Wed, 31 Jan 2007, Curt LeCaptain wrote:
      >
      >>I know I asked this earlier, but I'm wondering if it's possible to
      >>create another instance of postfix to bypass spamassassin checks, based
      >>on the recipient? If recipient A gets mail and is in a list that
      >>doesn't want to go through spamassassin, and recipient B wants to have
      >>things checked through spamassassin, send A to one process, send B to
      >>another?
      >
      >I think you probably want restriction classes:
      >
      >http://www.postfix.org/RESTRICTION_CLASS_README.html
      >http://www.stahl.bau.tu-bs.de/~hildeb/postfix/
      >
      >Depending on how you're invoking SpamAssassin, though, it might even
      >be easier than that. We invoke it as a filter from a recipient map,
      >so:
      >
      >In main.cf:
      >smtpd_recipient_restrictions = ...
      > check_recipient_access hash:/etc/postfix/spamassassin
      >
      >In master.cf:
      >spamassassin unix - n n - - pipe
      > user=nobody argv=/usr/bin/spamc -u spamd -e
      > /usr/sbin/sendmail -oi -f ${sender} ${recipient}
      >
      >/etc/postfix/spamassassin:
      >nebrwesleyan.edu FILTER spamassassin:
      >
      >The 'spamassassin' filter is just a shell one-liner that injects the
      >message into spamc and then uses sendmail to re-inject it into
      >Postfix. You could customize your recipient access map to direct
      >Postfix to Do The Right Thing depending on the recipient's username.

      This is unreliable. The FILTER action acts per-message, not
      per-recipient, so it is likely that multi-recipient mail will be misdirected.

      The only reliable way to do per-recipient content filtering from
      within postfix is to use multiple instances of postfix (with separate
      config and queue directories) and use transport_maps to direct
      recipients to either the second postfix instance or the content
      filter. This is also the answer to Curt's question.

      Some content filters such as amavisd-new have working per-recipient
      settings that allow mail to pass through the filter without actually
      being scanned for that user. Curt may want to investigate this also.

      --
      Noel Jones
    Your message has been successfully submitted and would be delivered to recipients shortly.