Hi Phil,

Sorry for the delay

On 10/24/2012 04:35 PM, Phil Daws wrote:
> Martijn:
>
> for GATEWAY-61 I have taken a look at config.xml, which I presume is the one 
> under the path /usr/share/djigzo/conf/james/SAR-INF, and see the following 
> stanza:
>
>   <mailet 
> match="SenderHeaderTrigger=matchOnError=false,user.forceSigningHeaderTrigger"
>                      class="GotoProcessor">
>
> is it possible to extend that match to include an alternative header eg:
>
>   <mailet 
> match="SenderHeaderTrigger=matchOnError=false,#{user.forceSigningHeaderTrigger}|HEADER-NAME:REG-EXP"
>                      class="GotoProcessor">
>
> then we can sign using either the subject or a new header injected by the 
> Zimlet.

This won't work since the SenderHeaderTrigger matcher does not support 
multiple values.

However you can accomplish the same thing using an extra matcher just 
below the SenderHeaderTrigger matcher that supports a static reg expr:

<mailet match="HeaderValueRegEx=matchOnError=false,HEADER-NAME:REG-EXP"
     class="GotoProcessor">
   <log> Force signing header detected </log>
   <processor> setupSMIMESignOnly </processor>
</mailet>

For example:

<mailet match="HeaderValueRegEx=matchOnError=false,X-Test: (?i)sign"
     class="GotoProcessor">
   <log> Force signing header detected </log>
   <processor> setupSMIMESignOnly </processor>
</mailet>

forces signing if the header X-Test contains the value sign (case 
insensitive). You can add as many matcher's as you want.

Alternatively you can add another SenderHeaderTrigger but with a 
different user property (for example 
#{user.extraForceSigningHeaderTrigger}). The user property is read from 
the database so this property than has to be available in the database. 
You can add user defined values with the CLI tool from the command line.

I haven't tested the above examples (due to lack of time) but they 
should work. If not I will help you making them work.

Kind regards,

Martijn

-- 
DJIGZO email encryption
_______________________________________________
Users mailing list
[email protected]
http://lists.djigzo.com/lists/listinfo/users

Reply via email to