On 02/03/12 03:24, Laurent RAYSSIGUIER wrote:
> 
> I need to have a postfix relay which is able to separate customers
> who have an antispam service provided by another company, and the
> other who don't have antispam service.
> 

We do something similar. We have two final mailbox destinations at the
moment (mail1 and mail2), so we set the default relay to mail1, and
override for those recipients on mail2.

The recipients on mail1 are provided by an import/export routine.
Everything on mail2 is stored in a postgres database.


  # Default, overridden for accounts on mail2.
  relayhost = mail1.example.com


  # relay_domains are imported from mail1
  #
  # relay_domains-permanent are entries I don't want to be clobbered
  # by the import routine.
  #
  # The postgres map checks for the existence of a domain on mail2.
  # If a domain exists, it's a relay domain.
  relay_domains =
        cdb:/etc/postfix/maps/relay_domains,
        cdb:/etc/postfix/maps/relay_domains-permanent,
        proxy:pgsql:/etc/postfix/maps/relay_domains.pgsql


  # Works exactly the same as relay_domains.
  relay_recipient_maps =
        cdb:/etc/postfix/maps/relay_recipient_maps,
        cdb:/etc/postfix/maps/relay_recipient_maps-permanent,
        proxy:pgsql:/etc/postfix/maps/relay_recipient_maps.pgsql


  # The postgres map checks to see if a domain exists on mail2.
  # If it does, we relay it to mail2 instead of the default.
  #
  # The text file contains special stuff, manually entered.
  transport_maps =
        cdb:/etc/postfix/maps/transport_maps,
        proxy:pgsql:/etc/postfix/maps/transport_maps.pgsql

Reply via email to