Python ErrorSchemaValidation针对电子邮件主题的多个筛选查询(由于“已超过最大读取深度(32)”)

Python ErrorSchemaValidation针对电子邮件主题的多个筛选查询(由于“已超过最大读取深度(32)”),python,django,django-queryset,exchangelib,Python,Django,Django Queryset,Exchangelib,我需要过滤掉主题包含我配置的列表中的任意字符串的电子邮件。我尝试用几个Q表达式构建如下查询,因为目前(上次我检查时)不支持在=[“somestring1”、“somestring2”、…“somestring25”]中查询主题 然而,当我在Q建筑中传递更长一点的模式列表时,这种情况就会爆发 File "/usr/local/lib/python3.6/site-packages/exchangelib/services/common.py", line 329, in _ra

我需要过滤掉主题包含我配置的列表中的任意字符串的电子邮件。我尝试用几个Q表达式构建如下查询,因为目前(上次我检查时)不支持在=[“somestring1”、“somestring2”、…“somestring25”]中查询主题

然而,当我在Q建筑中传递更长一点的模式列表时,这种情况就会爆发

File "/usr/local/lib/python3.6/site-packages/exchangelib/services/common.py", line 329, in _raise_soap_errors
    raise vars(errors)[code](msg) 
ErrorSchemaValidation: The request failed schema validation. The maximum read depth (32) has been exceeded because XML data being read has more levels of nesting than is allowed by the quota. This quota may be increased by changing the MaxDepth property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 499.

关于如何实现过滤出多个主题模式的预期查询结果,您有什么想法吗?

我认为您的缩减并没有达到预期的效果
reduce()
可能会生成类似于
((((“somestring1”或“somestring2”)或“somestring3”)或“somestring4”)或“somestring5”)的内容。
这对Exchange服务器来说太多了。您可以启用检查XML的确切格式


如果您希望字符串完全匹配,exchangelib确实支持
subject\uuuuu in=[…]
。请参见

我错误地将其称为u in。实际上,subject\uu regex可能有助于我的情况。我将尝试用显式Q链替换reduce()。
File "/usr/local/lib/python3.6/site-packages/exchangelib/services/common.py", line 329, in _raise_soap_errors
    raise vars(errors)[code](msg) 
ErrorSchemaValidation: The request failed schema validation. The maximum read depth (32) has been exceeded because XML data being read has more levels of nesting than is allowed by the quota. This quota may be increased by changing the MaxDepth property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 499.