Jeremy, > > Don't set recip_done to true, just add_contents_category(). > > OK, but... > > > If you do set recip_done, you must also set recip_smtp_response(...), > > indicating the success status of a delivery that you pretended > > to have done. > > So I could do this if I wanted to have control over the SMTP response.
Yes, but only if it is your custom hook code that sets recip_done to true, indicating (or faking) it performed a delivery. Otherwise the status code will be overwritten by some later code section which does a delivery and sets recip_done to true. > > Turning off quarantinining is trickier - I can't think > > of an elegant way to do it from a custom hook. > > I admit it would be useful. > > Can I set the quarantine method ($banned_files_quarantine_method) to > undef() or something like that? Not really - doing so would change a global setting for the lifetime of this process, affecting future messages checked by this child process. Some other trick will need to be devised (like adding a new variable or a recipient object property), with a corresponding supporting change in the base code. > > There is no involvement of attachents concept there, all MIME > > parts are treated equally. > > Yes, for a single-part MIME with no other parts. However what about a > plain RFC2822 message without any MIME? It is still a tree of MIME parts, a small one with a single node. > In particular, some of the > base code, do_notify_and_quarantine(), looks at $r->banned_parts, It will contain a list of just one element, the plain mail body part. Actually the list may even be empty, in case of no body and no header/body separator line. > but if I haven't set any banned parts, I might break something. I suspect > this will only break template macros related to banned attachments, > which I can deal with. But I'd like to be sure that there isn't a bit > of code that assumes a banned attachment is always present in a banned > message. It shouldn't break anything. If it does, it needs to be fixed. > My reading of the release notes suggests that I can check the virus > status of the message before performing an action, because the custom > checks() happens after the built-in checks. Assuming that's correct, > what's the best way to do this? Right. > Should I test $r->is_in_contents_category(CC_VIRUS) per recipient? > Or can I do it for the entire message with > $msginfo->is_in_contents_category(CC_VIRUS)? The $msginfo has a CC_VIRUS set if a virus was found. Probably this is what you want. A recipient's object has a CC_VIRUS set if a virus was found AND this particular recipient DOES NOT have a bypass_virus_checks_maps set. As you already know, the is_in_contents_category test for presence of a contents category, but this is not necessary a blocking ccat, e.g. when a recipient is a virus lover. > Sorry, one more question: Can I determine, from within a custom hook, > what is the currently loaded policy bank? Yes, the c('policy_bank_path') returns a string, which is a slash-separated list of currently loaded policy bank names. Same as provided by a macro %p. Mark ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ 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/