The WebApp rule “includes these words in the transport-headers” leads to a restriction like {RES_CONTENT, PR_TRANSPORT_MESSAGE_HEADERS, Way, Swindon} being added. This is far from ideal because
Transport Headers contains everything and one easily runs into a false positive
Transport Headers are stored by kopano-dagent in verbatim form with \r\n\t, and kopano-gateway expects them to be like that to satisfy the HEADERS request of the IMAP protocol. Changing the folding is probably not ideal, because that would change the message, which is something that perhaps wants to be avoided.
The proper way (according to the Exchange ecosystem) is to test for a different property, namely the one header you are actually interested in. The restriction is {RES_CONTENT, PS_INTERNET_HEADERS:Organization, Way, Swindon}. That would solve problem A, and avoids B too. For historical reasons, dagent needs to be told to index those (kopano-dagent.cfg):
indexed_headers = Organization
and then someone needs to spruce up WebApp to use PS_INTERNET_HEADERS:x.