Rudy,

> I looking on replacing the body of certain messages with an other
> message and and adding the original body as an attachment.
>
> Going through the docs, this is call 'defanging'.
>
> As an extra requirement I would like to do this defaning only in
> specific cases.
>
> I can see that I can configure amavis to defang when a mail is
> classified into a category.
>
> In my case it would be when e.g. a certain criteria is met:
>
> E.g. if from address a  local address and the reply to is an external
> address E.g. the body of the email address has 'Dear UGent mail user'
>
> Is it possibly to let amavis do certain actions if a certain
> spamassassin test has succeeded?

It is possible for a custom hook code to load a policy bank
when desired. A policy bank could then replace the default
%defang_maps_by_ccat with whatever settings it pleases.

Something like:

/etc/amavisd-custom.conf :


package Amavis::Custom;
use strict;

# invoked at child process creation time;
# return an object, or just undef when custom checks are not needed
sub new {
  my($class,$conn,$msginfo) = @_;
  my($self) = bless {}, $class;
  if ($msginfo->sender eq '' && your-other-conditions) {
    Amavis::load_policy_bank('CUSTOMDEFANGS');
  }
  $self;
}


And then in a config file:

include_config_files('/etc/amavisd-custom.conf');

$policy_bank{'CUSTOMDEFANGS'} = {
  defang_maps_by_ccat =>
    { REPLACE => 1, (CC_CATCHALL) => 1 },
};


  Mark


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 
 AMaViS-HowTos:http://www.amavis.org/howto/ 

Reply via email to