简体   繁体   English

如何以编程方式从gmail获取所有(已读和未读)消息,已读状态等?

[英]How to programatically get ALL (read and unread) messages from gmail, read status, etc?

I have a customer service web app requirement, which requires that I work pull & integrate data from Gmail, eBay, Amazon, and Paypal. 我有一个客户服务Web应用程序要求,该要求要求我从Gmail,eBay,Amazon和Paypal中提取和集成数据。 My solution is going to be developed in ASP.Net 4 with C#. 我的解决方案将使用C#在ASP.Net 4中开发。

The issue that I'm running into is that my client needs pretty much all of the information that Gmail has about each and every email that comes in & the ATOM feed coming from Gmail seems to be a bit lacking. 我遇到的问题是,我的客户需要Gmail几乎提供的所有有关每一封电子邮件以及来自Gmail的ATOM提要的所有信息。 I realize I can also use POP3 or IMAP, but they too are lacking for a number of reasons. 我知道我也可以使用POP3或IMAP,但是由于多种原因,它们也缺乏。

Specifically, the client needs the read status of emails (whether or not THEY have read emails that were sent to THEM). 具体来说,客户端需要阅读电子邮件的状态(无论他们是否已阅读发送给THEM的电子邮件)。 They also need for all of the filters to remain intact. 他们还需要所有过滤器保持完整。 So if an email is tagged with x,y, & z, then I need to know about it. 因此,如果电子邮件中标有x,y和&z,则我需要了解它。

The ATOM feed only shows me unread emails, so that's out. ATOM提要仅显示我未读的电子邮件,因此可以了。 POP3 has no clue (and rightfully so) whether or not they've read an email or not (unless I pull it into a database and manage read status, myself...but that doesn't work if they actually read a mail from within gmail itself). POP3不知道(是否正确)他们是否已阅读电子邮件(除非我自己将其拉入数据库并管理已读取状态)的线索,但是如果他们实际上从中读取了电子邮件,则这是行不通的在gmail本身内)。

IMAP seems like it would give me everything I need, but I'm not 100% sure on that. IMAP 似乎可以满足我的所有需求,但是我不确定100%可以做到。 What do you all think? 你们怎么想 Also, IMAP is SOOO slow. 另外,IMAP太慢了。 Is anyone aware of any decent libraries that are fairly fast. 有谁知道任何相当快的体面的图书馆。 We're talking about a customer inbox with some 360,000'ish messages at the present time, & the client would prefer to keep those messages at gmail & not work with a disconnected database. 我们目前正在谈论一个客户收件箱,其中包含大约360,000条消息,并且该客户希望将这些消息保留为gmail,并且不能与断开连接的数据库一起使用。

Thoughts / Opinions? 有想法/意见吗?

IMAP does provide read/not-read status for each message and you can pull from particular 'labels' (folders) or just pull from the 'all messages' bucket. IMAP确实为每封邮件提供了已读/未读状态,您可以从特定的“标签”(文件夹)中拉出,也可以从“所有邮件”存储桶中拉出。 You don't need to pull the entire message either, you can ask for headers only, giving you the ability to quickly scan many emails. 您也不需要提取整个邮件,您只需要询问标题即可快速扫描许多电子邮件。

I've been working on a program to pull my entire gmail dataset down for my own tinkering and processing. 我一直在研究一个程序,将我的整个gmail数据集下拉,以进行自己的修补和处理。 I'm using linux, and while there are a multitude of imap 'mirror' and imap 'processing' applications out there, I just want to play with the data, being able to do what I want with it, without stuffing it back into an imap server locally. 我正在使用linux,尽管那里有许多imap“镜像”和imap“处理”应用程序,但我只想使用数据,能够使用我想做的事情,而不必将其塞回到本地imap服务器。 It's been working decently and I'm using the email's UID (modified slightly) as a file name to dump the headers & email data. 它一直在正常工作,我使用电子邮件的UID(稍作修改)作为文件名来转储标题和电子邮件数据。 Of course, you could massage the data and update a database or whatever at that point, I'm just stashing it for post-processing later. 当然,那时您可以处理数据并更新数据库或其他任何东西,我只是将其存储起来以便以后进行后期处理。 Looking for trends in my email, mostly tinkering. 在我的电子邮件中寻找趋势,主要是修补。

I tried using the etpan libraries for IMAP processing, didn't find them to my liking, so I've been pulling imap routines from other email programs and servers to play with. 我尝试使用etpan库进行IMAP处理,但并没有找到喜欢的库,因此我一直在从其他电子邮件程序和服务器中提取imap例程来使用。 I have the RFC's, but really really trying to not reinvent the wheel here if I can help it. 我有RFC,但是如果我能帮助的话,实际上我真的很想不要在这里重新发明轮子。

Yup, not the best answer, but hopefully some information to help. 是的,不是最好的答案,但希望能提供一些帮助。 I imagine there are nice libraries for PHP, or other web-based systems, I've been working with C++/C myself. 我认为有一些不错的PHP或其他基于Web的系统库,我自己一直在使用C ++ / C。

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

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