如何以编程方式从 gmail 获取所有(已读和未读)消息、已读状态等?
我有一个客户服务网络应用程序要求,这要求我进行拉动和拉取操作。集成来自 Gmail、eBay、Amazon 和 Paypal 的数据。我的解决方案将在 ASP.Net 4 中使用 C# 进行开发。
我遇到的问题是,我的客户几乎需要 Gmail 所拥有的关于收到的每封电子邮件的所有信息。来自 Gmail 的 ATOM feed 似乎有点缺乏。我意识到我也可以使用 POP3 或 IMAP,但由于多种原因,它们也无法使用。
具体来说,客户需要电子邮件的阅读状态(无论他们是否已阅读发送给他们的电子邮件)。他们还需要所有过滤器保持完好无损。因此,如果电子邮件带有 x、y 和 & 标签, z,那我需要了解一下。
ATOM 提要仅向我显示未读的电子邮件,所以这是不可能的。 POP3 不知道(理所当然)他们是否已阅读电子邮件(除非我将其放入数据库并管理阅读状态,我自己......但如果他们实际上从Gmail 本身内)。
IMAP似乎会给我我需要的一切,但我对此不是 100% 确定。大家觉得怎么样?另外,IMAP 太慢了。有谁知道有任何相当快的体面图书馆吗?我们正在谈论目前大约有 360,000 条消息的客户收件箱,&客户更愿意将这些消息保留在 Gmail 和 Gmail 中。无法使用断开连接的数据库。
想法/意见?
I have a customer service web app requirement, which requires that I work pull & integrate data from Gmail, eBay, Amazon, and Paypal. My solution is going to be developed in ASP.Net 4 with C#.
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. I realize I can also use POP3 or IMAP, but they too are lacking for a number of reasons.
Specifically, the client needs the read status of emails (whether or not THEY have read emails that were sent to 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.
The ATOM feed only shows me unread emails, so that's out.
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).
IMAP seems like it would give me everything I need, but I'm not 100% sure on that. What do you all think? Also, IMAP is SOOO slow. 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.
Thoughts / Opinions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IMAP 确实为每条消息提供已读/未读状态,您可以从特定的“标签”(文件夹)中提取或仅从“所有消息”存储桶中提取。您也不需要提取整个邮件,您可以仅要求标头,从而使您能够快速扫描许多电子邮件。
我一直在开发一个程序来提取我的整个 Gmail 数据集以供我自己修改和处理。我使用的是 Linux,虽然有大量的 imap“镜像”和 imap“处理”应用程序,但我只是想处理数据,能够用它做我想做的事情,而不需要将其重新塞回本地 imap 服务器。它一直工作得很好,我使用电子邮件的 UID(稍作修改)作为文件名来转储标头和邮件头。电子邮件数据。当然,您可以修改数据并更新数据库或其他任何内容,我只是将其隐藏以供稍后进行后处理。在我的电子邮件中寻找趋势,主要是修补。
我尝试使用 etpan 库进行 IMAP 处理,但没有找到我喜欢的,所以我一直从其他电子邮件程序和服务器中提取 imap 例程来使用。我有 RFC,但如果我能帮忙的话,我真的很努力不要在这里重新发明轮子。
是的,这不是最好的答案,但希望能提供一些帮助。我想 PHP 或其他基于 Web 的系统有很好的库,我自己一直在使用 C++/C。
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. 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. 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. 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. 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. I have the RFC's, but really really trying to not reinvent the wheel here if I can help it.
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.