简体   繁体   English

Python imaplib选择包含特殊字符的邮箱文件夹

[英]Python imaplib select mailbox folder including special characters

If I list my mailbox folder with conn.list() I get a list of mailbox folder names that do not include special (accented) characters. 如果使用conn.list()列出我的邮箱文件夹,我会得到一个不包含特殊(带重音)字符的邮箱文件夹名称列表。 Eg my real mailbox fodler is "gelöschte elemente" but conn.list() returns with "gelschte elemente". 例如,我真正的邮箱装箱商是“gelöschteelemente”,但conn.list()返回的是“ gelschte elemente”。 It would not be a problem, if conn.select() would work with it but it does not work neither with "gelöschte elemente" nor with "gelschte elemente". 如果conn.select()可以使用它,但它不适用于“gelöschteelemente”或“ gelschte elemente”,这不是问题。 Can anybody help me how to select a mailbox folder that contais special (accented) characters with python imaplib (or maybe with other python package)? 有人可以帮助我如何选择一个包含python imaplib(或其他python软件包)包含特殊(重音)字符的邮箱文件夹吗?

Of course my script works perfectly with mailbox folders that contain only ASCII characters like "INBOX" or "INBOX.Sent"... 当然,我的脚本可以与仅包含ASCII字符(例如“ INBOX”或“ INBOX.Sent”)的邮箱文件夹完美配合...

Thank you! 谢谢!

I found the solution here 我在这里找到解决方案

surround your folder name in double quotes 用双引号括住您的文件夹名称

if it contains any non ASCII characters or spaces... 如果包含任何非ASCII字符或空格...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM