I have a simple python program to index emails on an Exchange server, and find that the list names that it returns are not all the same format. It seems that any names with any special characters (notably blanks) are double-quoted, and others are not.

(\Marked \HasNoChildren) "/" "Mail/_DE Courses/_cs435-ADL"
(\Marked \HasNoChildren) "/"  Mail/_etc

Last time I ran this program several years ago it did not have this issue. All other examples that I have seen show every name string quoted. Is this something non-standard, and well known? (I just made a regex to correct for this.)

有帮助吗?

解决方案

If the name contains special characters, the server has to quote. If the name is plain the server may quote or not, its choice. I can easily believe that the version you used three years ago made a different choice than the one deployed today.

其他提示

In an IMAP request or response, it is possible to represent items as strings (the quoted kind) or atoms (no quotes). Using an atom format (unquoted string) is often sufficient. However, when a space is present, opting for an unquoted string would cause the string to be interpreted as two separate strings (the part before the space, and that after it). Since client and server usually know to expect a predefined number of space-delimited items in a response, doing this would result in a parse error.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top