Hi,
I've spent a good amount of time pouring over the documentation and the forums for this one, but can't seem to figure it out.

I'm creating an archiving app that can restore archived items (mail messages) on the GW server, and gives them a custom field named "archive". It's a numeric field, set to "1". We've been reading from the mail store using a filter on the "created" field, and now I want to add a filter for the "archived" field so that we don't archive those mails twice.

From what I can gather from reading the examples, the way to construct the compound filter is as follows:
Code:
Filter gwFilter = new Filter();
FilterGroup gwFG = new FilterGroup();
FilterEntry[] gwFE = new FilterEntry[2];

gwFE[0] = new FilterEntry();
gwFE[0].setField("created");
gwFE[0].setValue("2010-09-17T00:00:00Z");
gwFE[0].setOp(FilterOp.GT);

gwFE[1] = new FilterEntry();
final Custom fwCustom = new Custom();
fwCustom.setField("archived");
fwCustom.setType(CustomType.NUMERIC);
fwCustom.setAdminOnly(true);
gwFE[1].setCustom(fwCustom);
gwFE[1].setOp(FilterOp.NOT_EXIST);

gwFG.setOp(FilterOp.AND);
gwFG.getElement().add(gwFE[0]);
gwFG.getElement().add(gwFE[1]);
gwFilter.setElement(gwFG);
You'll notice that it's more or less copy-pasted from the example code in the SOAP docs.

The problem is, that this doesn't work. For some reason, this filter finds all message that *do* have the custom field, even thought the Op is set to NOT_EXIST. The proof (SOAP trace) is listed below, where you can clearly see the filter with the NOT_EXIST op, and the subsequent response containing an item with exactly that field.

So my question is, how do I get this to work? How do I construct a filter that gets all messages after a certain timestamp, but without a certain field?

I noticed there was a similar question in the forums from around 2008, and that Preston had opened a bug for that issues. Has this been fixed?

Regards,
Maarten
Code:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns3:createCursorRequest xmlns="http://schemas.novell.com/2005/01/GroupWise/types" xmlns:ns2="http://schemas.novell.com/2005/01/GroupWise/events" xmlns:ns3="http://schemas.novell.com/2005/01/GroupWise/methods">
      <ns3:container>folders</ns3:container>
      <ns3:view>peek message delivered subject hasAttachments priority size attachments custom email from default recipients sendoptions</ns3:view>
      <ns3:filter>
        <element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FilterGroup">
          <op>and</op>
          <element xsi:type="FilterEntry">
            <op>gt</op>
            <field>created</field>
            <value>2010-09-17T00:00:00Z</value>
          </element>
          <element xsi:type="FilterEntry">
            <op>notExist</op>
            <custom type="Numeric">
              <field>archived</field>
              <adminOnly>true</adminOnly>
            </custom>
          </element>
        </element>
      </ns3:filter>
    </ns3:createCursorRequest>
  </S:Body>
</S:Envelope>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Header />
  <S:Body>
    <gwm:createCursorResponse xmlns:gwe="http://schemas.novell.com/2005/01/GroupWise/events" xmlns:gwm="http://schemas.novell.com/2005/01/GroupWise/methods" xmlns:gwt="http://schemas.novell.com/2005/01/GroupWise/types">
      <gwm:cursor>-122826395</gwm:cursor>
      <gwm:status>
        <gwt:code>0</gwt:code>
      </gwm:status>
    </gwm:createCursorResponse>
  </S:Body>
</S:Envelope>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns3:readCursorRequest xmlns="http://schemas.novell.com/2005/01/GroupWise/types" xmlns:ns2="http://schemas.novell.com/2005/01/GroupWise/events" xmlns:ns3="http://schemas.novell.com/2005/01/GroupWise/methods">
      <ns3:container>folders</ns3:container>
      <ns3:cursor>-122826395</ns3:cursor>
      <ns3:forward>true</ns3:forward>
      <ns3:count>1000</ns3:count>
    </ns3:readCursorRequest>
  </S:Body>
</S:Envelope>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Header />
  <S:Body>
    <gwm:readCursorResponse xmlns:gwe="http://schemas.novell.com/2005/01/GroupWise/events" xmlns:gwm="http://schemas.novell.com/2005/01/GroupWise/methods" xmlns:gwt="http://schemas.novell.com/2005/01/GroupWise/types">
      <gwm:items>
        <gwt:item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="gwt:Mail">
          <gwt:id>4C98CFA7.s1tv.fantasticpo.100.1757630.1.50D0.1@1:4A952666.s1tv.fantasticpo.100.1757630.1.5070.1@13</gwt:id>
          <gwt:version>3</gwt:version>
          <gwt:modified>2010-09-21T13:30:56Z</gwt:modified>
          <gwt:container>4A952666.s1tv.fantasticpo.100.1757630.1.5070.1@13</gwt:container>
          <gwt:created>2010-09-17T12:29:55Z</gwt:created>
          <gwt:customs>
            <gwt:custom type="Numeric">
              <gwt:field>archived</gwt:field>
              <gwt:value>1</gwt:value>
            </gwt:custom>
          </gwt:customs>
          <gwt:status />
          <gwt:msgId>4C98CFA7.s1tv.fantasticpo.200.200007E.1.528.1</gwt:msgId>
          <gwt:source>received</gwt:source>
          <gwt:delivered>2010-09-17T12:29:55Z</gwt:delivered>
          <gwt:security>Normal</gwt:security>
          <gwt:subject>test</gwt:subject>
          <gwt:distribution>
            <gwt:from>
              <gwt:displayName>Wayne rooney</gwt:displayName>
              <gwt:email>wayne@fantastic.socs.lan</gwt:email>
              <gwt:uuid>59A83700-1732-0000-8576-D999178DF7D8</gwt:uuid>
            </gwt:from>
            <gwt:to>Alex ferguson</gwt:to>
            <gwt:recipients>
              <gwt:recipient>
                <gwt:displayName>Alex ferguson</gwt:displayName>
                <gwt:email>alex@fantastic.socs.lan</gwt:email>
                <gwt:uuid>92481080-1732-0000-8576-D999178DF7D8</gwt:uuid>
                <gwt:distType>TO</gwt:distType>
                <gwt:recipType>User</gwt:recipType>
              </gwt:recipient>
            </gwt:recipients>
            <gwt:sendoptions>
              <gwt:statusTracking>None</gwt:statusTracking>
            </gwt:sendoptions>
          </gwt:distribution>
          <gwt:message>
            <gwt:part contentType="text/plain" length="160">e1xydGYxXGRlZmYwe1xmb250dGJse1xmMFxmbmlsXGZjaGFyc2V0MSBUYWhvbWE7fX17XHN0eWxlc2hlZXR7XGZzMTYgR3JvdXBXaXNlVmlldzt9fVxmczE2IGFzZGZhc2RmIHNhZGYgYXNkZiBzZCBhYSBkfQ==</gwt:part>
          </gwt:message>
          <gwt:attachments>
            <gwt:attachment>
              <gwt:id>4C98CFA7.s1tv.fantasticpo.200.200007E.1.525.1@45:4C98CFA7.s1tv.fantasticpo.100.1757630.1.50D0.1@1:4A952666.s1tv.fantasticpo.100.1757630.1.5070.1@13</gwt:id>
              <gwt:name>TEXT.htm</gwt:name>
              <gwt:contentType>TEXT/HTML</gwt:contentType>
              <gwt:size>237</gwt:size>
              <gwt:date>2010-09-17T14:29:49Z</gwt:date>
              <gwt:hidden>1</gwt:hidden>
            </gwt:attachment>
            <gwt:attachment>
              <gwt:id>4C98CFA7.s1tv.fantasticpo.200.200007E.1.526.1@45:4C98CFA7.s1tv.fantasticpo.100.1757630.1.50D0.1@1:4A952666.s1tv.fantasticpo.100.1757630.1.5070.1@13</gwt:id>
              <gwt:name>Water lilies.jpg</gwt:name>
              <gwt:contentType>image/jpeg</gwt:contentType>
              <gwt:size>83794</gwt:size>
              <gwt:date>2010-09-17T14:29:49Z</gwt:date>
              <gwt:hidden>0</gwt:hidden>
            </gwt:attachment>
          </gwt:attachments>
          <gwt:options>
            <gwt:priority>Standard</gwt:priority>
          </gwt:options>
          <gwt:hasAttachment>1</gwt:hasAttachment>
          <gwt:size>84918</gwt:size>
        </gwt:item>
      </gwm:items>
      <gwm:status>
        <gwt:code>0</gwt:code>
      </gwm:status>
    </gwm:readCursorResponse>
  </S:Body>
</S:Envelope>