Jeremy,

> > Additional notifications can be sent from a custom hook,
> > as indicated in the amavisd-custom.conf example.
>
> I'm having a bit of trouble with this.  I'm not sure if I'm fighting
> amavis or just my inexperience with it.  Any pointers would be very
> useful.

The hooks are somewhat limiting for the purposes you have in mind.
I see that some improvements would be in order.

> I want to notify the local user (sender for outbound, recipient(s) for
> inbound) when a message is banned by my custom hook, using a template.
> I can't leave things to the normal final destiny settings, because
> banned files need to be handled differently to these policy
> violations, and I can't see any way of making the notification
> dependent on the reason for a banned message.  So I'm trying to notify
> within my custom hook.

A possible solution would be to allow custom hooks to prepare a
value for some new dedicated macro, and let templates base their
expansion on that value. That would probably offer the cleanest
solution for least work.

I also see a need for a mechanism by which custom hooks could
suppress normal notifications and quarantining - currently this
is only possible indirectly by modifying attributes of a mail
(e.g. its contents category). Then you could send your own
notifications without worrying about multiple notifications.

> When I follow the example, it doesn't seem to be able to expand a
> template's macros successfully.  I'm copying the global
> Amavis::builtins and trying to use that, calling the expand sub from
> its package in the main code.

That should work. I'll test it tomorrow.

> Even if I get this working, I think the normal banned template gets
> sent to the user, as well as my notification, which is not acceptable.
>
> So my questions:
> 1) Can I expand a template within a custom hook?

I believe this should be possible. Will try.

> 2) Can I prevent the original notification from being sent?

Not without a hack, or without modifying a reason for a notification.

> 3) Do I want to do this?  Is there a better way?

I think your needs are sensible. I'll see what can be done.

  Mark

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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