From: Mark M. <Mar...@ij...> - 2005-01-31 16:05:25
|
John, > I am attempting to setup qmail 1.03 to talk to amavisd-new 2.2.0 > I have written a custom 'shim' qmail-queue which will first send the > message to amavisd-new for virus scanning (via SMTP). If all is well it > calls the original qmail-queue. This is all working but I have one > small issue. > > If the message is clean, I will continue with the regular qmail-queue > which will deliver the message in the normal qmail way. I don't want > amavisd-new to deliver the message as well. If I set $forward_method = > undef; then the SMTP interface to amavisd-new is not activated. I have > a workaround with a pipe: to a script which cats the message to > /dev/null but I don't know if that is the best way to do what I want. You may turn off the safety valve to make this work: --- amavisd.orig Thu Dec 23 02:38:39 2004 +++ amavisd Mon Jan 31 16:57:10 2005 @@ -5468,9 +5468,9 @@ do_log(0, sprintf("Module %-19s %s", $m, $m->VERSION || '?')); } - if (c('forward_method') eq '' && $extra_code_in_smtp) { - do_log(1,"forward_method in default policy bank is null (milter setup?), ". - "DISABLING SMTP-in AS A PRECAUTION"); - $extra_code_in_smtp = undef; - } +# if (c('forward_method') eq '' && $extra_code_in_smtp) { +# do_log(1,"forward_method in default policy bank is null (milter setup?), ". +# "DISABLING SMTP-in AS A PRECAUTION"); +# $extra_code_in_smtp = undef; +# } do_log(0,"Amavis::DB code ".($extra_code_db ?'':" NOT")." loaded"); do_log(0,"Amavis::Cache code ".($extra_code_cache ?'':" NOT")." loaded"); @@ -10043,6 +10043,10 @@ if ($smtp_resp !~ /^4/ && grep { !$_->recip_done } @{$msginfo->per_recip_data}) { - die "TROUBLE: (MISCONFIG) not all recipients done, " . - "forward_method is: " . $msginfo->delivery_method; + if ($msginfo->delivery_method eq '') { + do_log(2,"not all recipients done, forward_method is empty"); + } else { + die "TROUBLE: (MISCONFIG) not all recipients done, " . + "forward_method is: " . $msginfo->delivery_method; + } } if (!$lmtp) { And don't forget to use D_REJECT as a *destiny instead of D_DISCARD, as there is no way to distinguish between the discard and ok,pass in the SMTP response code. > Also, I would prefer not to use SMTP to talk to amavisd-new but from > what I have seen of the native protocol I don't want to use that either. > I would like to connect via a socket, send a message over the socket > and then read back either an error code or a new modified message. Does > such an interface exist? Use the new AM.PDP protocol, that is designed for the purpose. See README.protocol. Place the $protocol='AM.PDP'; in amavisd.conf to use AM.PDP instead of the older AM.CL protocol on the Unix socket. There is a sample client helper-progs/amavis.pl that speaks the new protocol. Mark |