<div dir="ltr">Not that hard actually.<div><br></div><div>Your create a new port for Amavisd:</div><div><br></div><div>$inet_socket_port = [10024, 10030]</div><div><br></div><div>Then create a Policy for it:</div><div><br></div><div>$interface_policy{'10030'} = 'Quarantine.Postfix';<br></div><div>$policy_bank{'Quarantine.Postfix'} = {</div><div>    archive_quarantine_to_maps = > ['archive-quarantine'];</div><div>    archive_quarantine_method => 'local:hold-%m',</div><div>    final_destiny_maps_by_ccat => { REPLACE = 1, &CC_CATCHALL => D_DISCARD },</div><div>    forward_method => 'smtp:[127.0.0.1]:10024'</div><div>};</div><div><br></div><div><br></div><div>After that, in your header checks, you would have the header check cause "FILTER smtp-amavis:[127.0.0.1]:10030" instead of "PREPEND X-Hold: ....".</div><div><br></div><div>This will mean that any mail submitted on port 10030 of Amavisd gets quarantined (and will appear as hold-UniqID in your quarantine (UniqID being the Amavisd ID), and anything submitted on your normal port (assumed 10024 in this case), will get scanned as normal.</div><div><br></div><div>This is just an example, and you could do more with it if you'd like, such as separating different reasons to be quarantined.</div><div><br></div><div><br></div><div>To my knowledge, Amavis doesn't have an automatic quarantine header list.</div><div><br></div><div><br></div><div><br></div><div>The other option would be to add a large score in SpamAssassin if this header is found. That would also cause the mail to get quarantined, but may not appear necessarily the same way you are looking for it to appear in the quarantine (it'll get marked as Spam).</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 9, 2018 at 5:41 PM, Dominic Raferd <span dir="ltr"><<a href="mailto:dominic@timedicer.co.uk" target="_blank">dominic@timedicer.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 9 February 2018 at 16:59, Markus Clardy <<a href="mailto:markus@clardy.eu">markus@clardy.eu</a>> wrote:<br>
> On Fri, Feb 9, 2018 at 4:23 PM, Dominic Raferd <<a href="mailto:dominic@timedicer.co.uk">dominic@timedicer.co.uk</a>><br>
> wrote:<br>
>><br>
>> Is there a way to have the presence of a specific header (or, better,<br>
>> a specific beginning to a header, where the later text might vary)<br>
>> causing quarantining by amavis. Use case is that postfix header_checks<br>
>> will identify a suspect mail and add the header before the mail is<br>
>> passed to amavis.<br>
>><br>
>> Example header which should lead to amavis quarantining the mail:<br>
>><br>
>> X-Hold: mydomain.tld; Withheld by order of check_header.pcre (.world<br>
>> domain)<br>
>><br>
>> I feel sure amavis is powerful enough to do this but the plethora of<br>
>> options, and the perl terminology, leave me baffled. Thanks for any<br>
>> help.<br>
>><br>
> What you can do is have a port/policy in Amavisd for Quarantining<br>
> everything, then just instead of adding a header in Postfix, have the mail<br>
> redirect to that port.<br>
><br>
> This way, mail that is meant to be held as designated by Postfix, will go to<br>
> the quarantine that way.<br>
><br>
<br>
</span>Thanks Marcus but I want amavis to continue doing its own stuff as<br>
normal as well as quarantining these extra mails. Also it sounds<br>
complicated to resubmit mails via a different port but it is very easy<br>
to add a header using the postfix PREPEND option.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"> - Markus</div></div>
</div>