New to custom hooks

Scott Fertig scott at gotbrew.org
Sat Jan 23 19:29:10 CET 2016


Hello all,
I am sure you get questions like this all the time to the point of annoyance so I will try to keep this very short. I have tried searching for an answer during the last several days but all of my searches have lead to nowhere. Basically I am trying to learn more about the amavisd custom hooks and am trying to do some basic tests, however I feel like I may be missing something obvious that I do not know about. I have written a basic hook that does not really do anything as of yet, just simple use of get_header_body on the sender, subject, and to addresses, whenever I try to restart amavis I always get an error:

Starting amavisd...Error in config file "/etc/amavisd.conf": Error in config file "/etc/amavisd-SF.conf": Can't call method "get_header_field_body" on an undefined value at /opt/zimbra/conf/amavisd-SF.conf line 18, <DATA> line 751.

I have called a include: on the file amavisd-SF.conf in the amavisd configuration file.

The include is very small but this is the part it seems that it cannot get by:

package Amavis::Custom;
my($to) = $msginfo->get_header_field('to');
my($from) = $msginfo->get_header_field_body('from')


Am I perhaps missing a package or something else trivial? I feel like I am missing something basic like a import or defining a package, but I'm just not sure. 


More information about the amavis-users mailing list