gmail-imap

imaplib2 : imap.gmail.com handler BYE response: System error

你离开我真会死。 提交于 2019-12-04 03:20:24
问题 I'm renovating a python script that checks IMAP for new emails and sends a push notification if there's a new email. The problem is that every few hours I'm getting a crash. At first I couldn't really understand what's going on but then I found about M.debug = 4 that gave me a nice output but I still can't understand what is causing the problem. I've posted my script and the debug output from normal behavior till the crash, hoping that someone with better understanding in python can tell me

Access Gmail Imap with OAuth 2.0 Access token

半城伤御伤魂 提交于 2019-12-03 06:09:53
问题 I am using Google's Oauth 2.0 to get the user's access_token, but I dont know how to use it with imaplib to access inbox. 回答1: Below is the code for IMAP with oauth 2.0 email = 'k@example.com' access_token = 'vF9dft4qmTc2Nvb3RlckBhdHRhdmlzdGEuY29tCg' auth_string = 'user=%s\1auth=Bearer %s\1\1' % (email, access_token) imap_conn = imaplib.IMAP4_SSL('imap.gmail.com') imap_conn.debug = 4 imap_conn.authenticate('XOAUTH2', lambda x: auth_string) imap_conn.select('INBOX') for more details see the

HTML formatted email not showing up at all in Gmail but is in other mail clients

て烟熏妆下的殇ゞ 提交于 2019-12-03 04:04:50
问题 I'm currently sending html formatted emails from PHP's mail() function and checking them simply to make sure they are showing up as HTML (formatting aside, I'm well aware that the formatting will vary (probably drastically) from client to client). They are displaying as HTML in the Apple Mail client as well as on my iPhone. However, Gmail simply refuses to display it as HTML as all. And by that I don't mean it is formatted incorrectly, it just simply isn't using HTML it appears. The weird

Access Gmail Imap with OAuth 2.0 Access token

三世轮回 提交于 2019-12-02 20:49:13
I am using Google's Oauth 2.0 to get the user's access_token, but I dont know how to use it with imaplib to access inbox. user303110 Below is the code for IMAP with oauth 2.0 email = 'k@example.com' access_token = 'vF9dft4qmTc2Nvb3RlckBhdHRhdmlzdGEuY29tCg' auth_string = 'user=%s\1auth=Bearer %s\1\1' % (email, access_token) imap_conn = imaplib.IMAP4_SSL('imap.gmail.com') imap_conn.debug = 4 imap_conn.authenticate('XOAUTH2', lambda x: auth_string) imap_conn.select('INBOX') for more details see the library code . Currently you can use OAuth 1.0 to access Gmail over IMAP and SMTP, but OAuth 2.0 is

HTML formatted email not showing up at all in Gmail but is in other mail clients

喜你入骨 提交于 2019-12-02 17:25:16
I'm currently sending html formatted emails from PHP's mail() function and checking them simply to make sure they are showing up as HTML (formatting aside, I'm well aware that the formatting will vary (probably drastically) from client to client). They are displaying as HTML in the Apple Mail client as well as on my iPhone. However, Gmail simply refuses to display it as HTML as all. And by that I don't mean it is formatted incorrectly, it just simply isn't using HTML it appears. The weird part is that an img from a tag is being loaded, but that's about it... is it that I'm mostly using divs

ImapMailReceiver NO STORE attempt on READ-ONLY folder (Failure) [THROTTLED];

只愿长相守 提交于 2019-12-02 05:31:35
问题 I spend day trying to find some explanation this exception. I try to configure ImapMailReceiver and ImapIdleChannelAdapter programmatic. I didn't find any tutorials about this question just small info in Pro Spring Integration book. public void loadMessages() { ImapIdleChannelAdapter imapIdleChannelAdapter = null; ImapMailReceiver imapMailReceiver = null; try { imapMailReceiver = new ImapMailReceiver("imaps://" + URLEncoder.encode(USERNAME, "UTF-8") + ":" + PASSWORD + "@imap.gmail.com:993

Trouble opening gmail nnimap server in Emacs gnus on Windows

萝らか妹 提交于 2019-12-02 00:17:01
I'm trying to use Emacs gnus to connect to my gmail account. This is the relevant configuration code, taken mostly from here : (setq tls-program '("openssl s_client -CAfile C:/Users/GGustafson/gmail.crt -connect %h:%p -no_ssl2 -ign_eof")) (setq gnus-select-method '(nnimap "gmail" (nnimap-address "imap.gmail.com") (nnimap-server-port 993) (nnimap-stream ssl) (nnimap-authinfo-file "~/.authinfo"))) (setq message-send-mail-function 'smtpmail-send-it smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) smtpmail-auth-credentials '(("smtp.gmail.com" 587 "gordon3.14@gmail.com" nil))

Error code 400 on generating OAuth 2 SASL string

天大地大妈咪最大 提交于 2019-12-01 12:19:36
I have generated the following SASL string FOR OAuth 2: user=designadmin@mydesign.mygbiz.com^Aauth=Bearer ya29.AHES6ZTtYOu0NR0vAYbrvKZNcHJPuZEpr4Hk3W3dXcXFQ88^A^A Then i encoded it and sent the encoded string like this: MSB AUTHENTICATE XOAUTH2 encoded string But i get error response as: {"status":"400","schemes":"Bearer","scope":" https://mail.google.com/ "} What does this error mean and how can i correct it? I finally figured it out. In my case, the Gmail scope(" https://mail.google.com/ ") was missing, from the token generation process. It works fine now. +1 to akshay for self answering.

Gmail IMAP OAuth for desktop clients

心不动则不痛 提交于 2019-12-01 09:50:44
Recently Google announced that they are supporting OAUth for Gmail IMAP/SMTP. I browsed through their multiple documentations, but still I am confused about if they support OAuth for installed applications. 1. In this documentation they say: Note: Though the OAuth protocol supports the desktop/installed application use case, Google only supports OAuth for web applications. But they also have a document for OAuth for installed applications . 2. When I read the OAuth specification pointed by them, it says (in section 11.7): In many applications, the Consumer application will be under the control

Gmail IMAP OAuth for desktop clients

心已入冬 提交于 2019-12-01 06:28:19
问题 Recently Google announced that they are supporting OAUth for Gmail IMAP/SMTP. I browsed through their multiple documentations, but still I am confused about if they support OAuth for installed applications. 1. In this documentation they say: Note: Though the OAuth protocol supports the desktop/installed application use case, Google only supports OAuth for web applications. But they also have a document for OAuth for installed applications. 2. When I read the OAuth specification pointed by