Different $forward_method for internal mail

Mark Martinec Mark.Martinec+amavis at ijs.si
Wed Sep 21 01:23:37 CEST 2011


Peter,

> What I want is inside my MYNETS policy bank I have
> one forward_method that is triggered when mail is SPAM
> and another ( in the same policy bank) when mail is CLEAN

With 2.7.0 you can use %forward_method_maps_by_ccat.
With earlier versions you need to use a custom hook.

release notes:

- a new configuration variable %forward_method_maps_by_ccat allows the
  forward_method_maps to depend on content type and allows per-recipient
  specification of a forward method, such as specifying a next hop MTA's
  IP address and port number. This offers new possibilities to control
  mail routing for purposes like implementing sender reputation schemes
  which dynamically choose an SMTP source IP address (typically of
  outgoing mail) based on the contents of a mail message or based on
  recipient's e-mail address or domain. This needs to be complemented
  by a suitable configuration of an MTA, such as Postfix 2.7.0 or later.
  The default is to use the $forward_method setting, ensuring compatibility.
  There is no need to specify entries for content types which are not being
  forwarded (often: CC_VIRUS, CC_BANNED, CC_SPAM).

  Example use:

    $forward_method = 'smtp:[127.0.0.1]:10025';

    %forward_method_maps_by_ccat = (
      CC_BADH.',3',  [ 'smtp:*:10027' ],
      CC_BADH.',4',  [ 'smtp:*:10027' ],
      CC_BADH.',5',  [ 'smtp:*:10027' ],
      CC_BADH.',6',  [ 'smtp:*:10027' ],
      CC_BADH.',8',  [ 'smtp:*:10027' ],
      CC_SPAMMY,     [ 'smtp:[192.0.2.22]:10025' ],
      CC_CATCHALL,   sub { ca('forward_method_maps') },
    );



Within a policy bank use a syntax:

  forward_method_maps_by_ccat => {
    ....
  },


Mark


More information about the amavis-users mailing list