python / python/cpython

Unable to use certain charaters on imap outlook connection

未關閉
#99,147 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

pending stdlib topic-email type-bug
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

  • Operating system and architecture: Windows 10 x86_64

I am having trouble logging in to the imap server "outlook.office365.com:993", basically sometimes the passwords i use contain special characters (-"_?$%& and such) that make the login fail with error: imaplib.IMAP4.error: b'LOGIN failed.' i know that this is a problem with the characters, because it appears only when the password contains some of them, while when the password is only numbers/letters it works fine. This is the code that is causing the issue:

def get_email(username, password):
    imap = imaplib.IMAP4_SSL(host="outlook.office365.com", port=993)
    imap.login(username, password)

i have tried many different things:
-Escaping the characters with \ and another time with ^
-Writing double quotes around the special characters
and more

online there is almost no documentation/examples on it. I also am not able to change the password to the account, as much as i would like to. And it also logins fine on the outlook site

For testing purposes here is a password similar to that one:

mozz@-rell@?9torey

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從報告中顯示的 imaplib.IMAP4_SSL 和 login 呼叫開始,然後使用包含和不包含特殊字元的密碼,針對 outlook.office365.com:993 重現該失敗。比較觀察到的 LOGIN failed 回應,並判斷問題出在 imaplib 還是伺服器互動上;完成的標準是取得可重現的診斷,並提供一個有針對性的回歸測試,或記錄說明為何不適用任何程式庫變更的理由。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
networking
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
需要釐清
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。