gmail-imap

Google App Engine (GAE) message.getContent() using javamail and IMAP not works

 ̄綄美尐妖づ 提交于 2019-12-06 16:40:23
I have several days trying to get the contents of a message through IMAP on a Google App Engine Project. I managed to extract all the other information, but to extract the contents of jumps me an error message (not work even invoking message.getContent.tostring(), I've tried as MultiPart). I perform the same action from a normal project , (not GAE and using javamail.1.4.7), the content of the messages shown perfectly. This is the code of GAE project: import java.util.Properties; import java.util.logging.Logger; import javax.mail.Session; import java.io.IOException; import javax.mail

IMAP Fetch Encoding

[亡魂溺海] 提交于 2019-12-06 11:00:55
问题 I'm trying to fetch some email info from gmail using imap like this "(BODY.PEEK[HEADER.FIELDS (subject from date)] X-GM-MSGID X-GM-LABELS X-GM-THRID)" The problem is that it doesn't work well with special and accented characters. For example, Stéphane Maniaci is rendered as =?ISO-8859-1?Q?St=E9phane_Maniaci?= How do I tell Gmail to return the strings with an encoding of my choice, say I want Charset to be UTF-8. How to adjust that in the IMAP command I mentioned above? 回答1: Okay. I found out

How to get Gmail unread count

痞子三分冷 提交于 2019-12-06 08:14:19
问题 I am using the following code to get the Unread emails count in Gmail. However, it is returning the error: can't connect: Too many login failures Is there anything I am missing here? (IMAP and POP are enabled in the Gmail account I am testing.) NOTE: It looks like it is working (at least for most of the requests). However, it is taking way too long - maybe 2 - 3 minutes to come back with a number. Is there a way to speed it up? Thanks! <?php $mbox = imap_open ("{imap.gmail.com:993/imap/ssl

Receiving email using Imap through SSL connection using javax.mail

蓝咒 提交于 2019-12-06 07:34:11
I want to receive emails using imap trough secure connection. I implemented it using using javax.mail api. But there are different server configurations. As I found 1) store = session.getStore(imaps); store.connect(imap.gmail.com, username, password) Which make 'isSSL' true and use port 993 which is secure port to connect in javax.mail. Following configuration also prove secure connection through 993 port. 2) properties.put("mail.imap.host", imap.gmail.com); properties.put("mail.imap.port", "993"); Properties.put("mail.imap.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); properties

Search utf-8 string with Gmail X-GM-RAW IMAP command

烂漫一生 提交于 2019-12-06 07:19:52
Gmail's imap extension command X-GM-RAW allows me to perform a search if I use a ascii query string. If utf-8 chars are used in the query, the imap returns bad response. https://developers.google.com/google-apps/gmail/imap_extensions#extension_of_the_search_command_x-gm-raw How should the utf-8 input string be encoded so that X-GM-RAW search will work fine. I do not want to loose the flexibility to search specific field like "subject" or "rfc833msgid" Thanks Specify CHARSET UTF-8 and send the UTF-8 search term in a literal. For example, to search for 你好, which is 6 bytes long when encoded in

imaplib.select on big inbox: Too many arguments for command

僤鯓⒐⒋嵵緔 提交于 2019-12-06 06:20:30
问题 I am trying to access to my emails in Gmail from a python script. The code I use is the following: import imaplib m = imaplib.IMAP4_SSL("imap.gmail.com") m.login("username","password") m.select("[Gmail]/All Mail") When running this code in python 2, it works fine, I get the list of all my emails. In python 3 hoverer it fails with the error >>> m.select("[Gmail]/All Mail") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.2/imaplib.py", line 674, in

Google OAuth access tokens

泄露秘密 提交于 2019-12-05 17:29:11
I'm so confused by OAuth and Google. It took me forever to get the refresh_token to create a new access_token. Then to find out the refresh_token expires too?? What is the point of that!!!?? All I need to do is persist a valid access_token for use with legato . Here is what I manually enter into my terminal to retrieve an OAUTH code: client = OAuth2::Client.new('GA_CLIENT_ID', 'GA_SECRET_KEY', { :authorize_url => 'https://accounts.google.com/o/oauth2/auth', :token_url => 'https://accounts.google.com/o/oauth2/token' }) client.auth_code.authorize_url({ :scope => 'https://www.googleapis.com/auth

Is IMAP CONDSTORE widely supported?

南笙酒味 提交于 2019-12-05 07:54:35
I'm building a simple webmail and I would like to make use of the CONDSTORE extension for IMAP: it allows to fetch everything that has changed (messages, flags, …) since a date, which is very practical to synchronize the email client to the IMAP server. However I have absolutely no idea if this IMAP extension is actually supported by most IMAP servers or not. So is there any kind of source that could tell me how well this extension is supported? For example, does GMail or Hotmail support it? (the hidden question behind this is obvious: is CONDSTORE the most appropriate way to synchronize my

Useful IMAP header information not showing up

不想你离开。 提交于 2019-12-05 01:32:52
问题 I'm using standard IMAP functions to get emails in PHP. I need to keep track of the Message-ID (and References and In-Reply-To ) for each message to build threads. Once this system gets deployed, I want users to be able to reply to messages in their mail client to add a message to a thread, but in my web interface, replies can't be attached to the original post because I don't have an In-Reply-To ID from any email headers. I would use In-Reply-To ID to attach their reply to the notification

Creating a Draft message in Gmail using the imaplib in Python

Deadly 提交于 2019-12-04 03:20:33
I want to write a python module that sends data to a draft message in a G-mail account. I have written a script about two weeks ago that worked perfectly using imaplib. A simplified example of my module is below. (I have created a test email address for anyone to test this script on.) import imaplib import time conn = imaplib.IMAP4_SSL('imap.gmail.com', port = 993) conn.login('testpythoncreatedraft@gmail.com', '123456aaa') conn.select('[Gmail]/Drafts') conn.append("[Gmail]/Drafts", '', imaplib.Time2Internaldate(time.time()), "TEST") It utilized the .append function, but today when I run the