0
pythonでimaplibを使って正しく検索する方法を教えてもらえますか?電子メールサーバーはMicrosoft Exchangeです。問題はあるようですが、python/imaplib側の解決策が必要です。 https://github.com/barbushin/php-imap/issues/128python3 imaplib検索機能のエンコーディング
Iこれまでの使用:
import imaplib
M = imaplib.IMAP4_SSL(host_name, port_name)
M.login(u, p)
M.select()
s_str = 'hello'
M.search(s_str)
そして、私は次のエラーを取得する:
>>> M.search(s_str)
('NO', [b'[BADCHARSET (US-ASCII)] The specified charset is not supported.'])
あなたはまた、IMAPClientに行くを与えたいと思うことがあります。
だから、心の中でそれらの両方で、あなたのような何かをする必要があります。検索条件をUnicode文字列として渡すと、検索エンコーディングの面で多くの面倒を見ることができます。 プロジェクト:https://github.com/mjs/imapclient; 関連ドキュメント:http://imapclient.readthedocs.io/en/stable/#imapclient.IMAPClient.search –