On 7/12/23 04:53, Wietse Venema via Postfix-devel wrote:
(major) there is no code to escape special characters when parts or all of a Postfix query are pasted into the MongoDB query filter. I think that at the very least, quotes and backslashes should be escaped with a backslash. I can add a little function for that and update the mongodb_table file.
Since it's JSON then escaping according to JSON rules would seem appropriate. Using a JSON library would generally be ideal but probably not worth it here. RFC 4627 basically says to escape quotes, backslashes and any control characters (U+0000 through U+001F):
https://www.rfc-editor.org/rfc/rfc4627#section-2.5 Peter _______________________________________________ Postfix-devel mailing list -- postfix-devel@postfix.org To unsubscribe send an email to postfix-devel-le...@postfix.org