Custom hooks - feasible or not

Miha Valencic miha.valencic at gmail.com
Tue Oct 30 14:15:17 CET 2012


Hello!

I recently started working with Amavisd-new on a big project and I am
currently playing with postfix-amavisd-new setup on my development
box.

I noticed that the documentation for custom hooks is very scarce and
found a sample on Apple website[1]. This particular sample does not
work with my setup (since string_to_mime_entity is not exported -- I'm
using version 2.6.4) but I modified it a bit.

The problem I have at the moment is that I don't know whether the
custom hooks are being executed or not, since nothing shows up in
syslog (I'm doing do_log(0, "CUSTOM: foobar") to test it).

The other thing is that I'm still no sure if it makes sense to use it
for what we need - forwarding. We need to transform certain incoming
messages and forward them based on a certain criteria, for instance:

[pseudo code]
if (ldap_attribute == 'forward') {
  send_mail(ldap_attribute_recipient, subject of the message);
}

I'm testing this on Ubuntu 10.04. In the file 50-user, I've added:
  require './51-custom.conf';

and 51-custom.conf includes definition of custom hooks as per reference example.

Is there anything else I should add or maybe look elsewhere for the log output?

Regards,
 Miha.

  [1]: http://www.opensource.apple.com/source/amavisd/amavisd-110/amavisd/amavisd-new-2.5.0/amavisd-custom.conf


More information about the amavis-users mailing list