获取邮件未读内容,不影响未读状态
现在它是一个 Gmail 邮箱,但迟早我希望它能够扩展。
我想在其他地方同步实时个人邮箱(收件箱和发件箱)的副本,但我不想影响任何未读邮件的未读
状态。
什么类型的访问将使这变得最简单?我找不到 IMAP 是否会影响阅读状态的任何信息,但看来我可以手动将邮件重置为未读。根据定义,Pop 不会影响未读状态,但似乎没有人使用 Pop 来访问他们的 Gmail,为什么?
Right now its a gmail box but sooner or later I want it to scale.
I want to sync a copy of a live personal mailbox (inbox and outbox) somewhere else, but I don't want to affect the unread
state of any unread messages.
what type of access will make this easiest? I can't find any information if IMAP will affect the read state, but it appears I can manually reset a message to unread. Pop by definition doesn't affect unread state but nobody seems to use pop to access their gmail, why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
如果它对任何人有帮助,GAE 允许您通过 HTTP 请求接收电子邮件< /a>,所以现在我只是在那里转发电子邮件。
if it helps anyone, GAE allows you to receive email as an HTTP request, so for now i'm just forwarding emails there.
跟进上面 Dan Goldstein 的回答 ,在 python 中使用“.PEEK”选项的语法是调用 IMAP4.fetch 并传递它“BODY.PEEK< /a>"
将此应用于 python 文档 中的示例:
To follow up on Dan Goldstein's answer above, in python the syntax to use the ".PEEK" option would be to call IMAP4.fetch and pass it "BODY.PEEK"
To apply this to the example in the python docs :
在 IMAP 世界中,每条消息都有标志。您可以在每条消息上设置单独的标志。当您获取消息时,实际上可以在不应用 \Seen 标志的情况下读取该消息。
大多数邮件客户端在阅读邮件时都会应用 \Seen 标志。因此,如果该消息已在您的应用程序之外被阅读,那么您将需要删除 \Seen 标志。
正如仅供参考...这里是有关 RFC 中标志的相关部分:
系统标志是在此预定义的标志名称
规格。所有系统标志均以“\”开头。某些系统
标志(\Deleted 和 \Seen)具有特殊的语义描述
别处。当前定义的系统标志是:
In the IMAP world, each message has flags. You can set the individual flags on each message. When you Fetch a message, it's actually possible to read the message, without applying the \Seen flag.
Most mail clients will apply the \Seen flag when the message is read. So, if the message has already been read, outside of your app, then you will need to remove the \Seen flag.
Just as fyi...here is the relevant part about flags from the RFCs:
A system flag is a flag name that is pre-defined in this
specification. All system flags begin with "\". Certain system
flags (\Deleted and \Seen) have special semantics described
elsewhere. The currently-defined system flags are:
IMAP 中的 FETCH 命令有一个 .PEEK 选项,该选项将明确不设置 /Seen 标志。
查看RFC 3501 中的 FETCH 命令并向下滚动位至第 57 页或搜索“BODY.PEEK”。
There is a .PEEK option on the FETCH command in IMAP that will explicitly not set the /Seen flag.
Look at the FETCH command in RFC 3501 and scroll down a bit to page 57 or search for "BODY.PEEK".
使用BODY.PEEK时需要指定截面。 IMAP Fetch Command< 中解释了各个部分/a> BODY[
PS:我想修复给出的答案 Gene Wood 但不允许,因为编辑较小超过 6 个字符 (BODY.PEEK -> BODY.PEEK[])
You need to specify section when you use BODY.PEEK. Sections are explained in IMAP Fetch Command documentations under BODY[<section>]<<partial>>
PS: I wanted to fix answer given Gene Wood but was not allowed because edit was smaller than 6 characters (BODY.PEEK -> BODY.PEEK[])
没有人使用 POP,因为他们通常想要 IMAP 的额外功能,例如跟踪邮件状态。当该功能只会妨碍您并且需要解决方法时,我认为使用 POP 是您最好的选择!-)
Nobody uses POP because typically they want the extra functionality of IMAP, such as tracking message state. When that functionality is only getting in your way and needs workarounds, I think using POP's your best bet!-)