Amavis per recipients forward method

a new configuration variable @forward_method_maps (along with making
a delivery_method() a property of a recipient instead of being a property
of a message) makes per-recipient forwarding method selection possible;
suggested by Ralf Hildebrandt;

Example:
@forward_method_maps = ({ # use lowercase keys with hash-type lookups!
‘user example com’ => ‘smtp:[::1]:10025’,
‘.sub1.example.com’ => ‘smtp:[::1]:10026’,
‘.sub2.example.com’ => ‘smtp:[::1]:10027’,
‘.example.net’ => ‘smtp:[127.0.0.1]:10025’,
‘.example.org’ => [ ‘smtp:[192.0.2.9]:125’, ‘smtp:[2001:db8::f]:125’ ],
‘.’ => $forward_method,
});

– 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’) },
);

Author: stratus

Laisser un commentaire