imap

How to download only new emails from imap?

感情迁移 提交于 2019-12-22 04:52:08
问题 I have an application that is used to archive emails using imap. Also in this application are many imap accounts that need to be archived. In this moment from time to time the application connects to imap accounts and download only new emails. My issue is that every time when it connects to an imap account it verifies all emails from all folders and downloads only emails that aren't downloaded yet (I store Message-ID for all emails and download only emails that have an Message-ID that is not

Ruby IMAP login error exception

谁都会走 提交于 2019-12-21 22:28:34
问题 With my Ruby script: imap = Net::IMAP.new('imap.gmail.com') imap.login("some_email@host.com", password) I get the following exception: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected hos has failed to respond. - connect(2) What's wrong? 回答1: You need to connect using SSL on port 993. Therefore your code should be this: imap = Net::IMAP.new('imap.gmail.com', 993, true) imap.login("user

Mailing with IMAP: How to detect that a message has been moved from one folder to another?

泄露秘密 提交于 2019-12-21 21:46:30
问题 Using JavaMail API and IMAP, i want to learn that a message has been moved from folder a to b. how can i do that without adding listeners? i mean i want to discover the changes of messages when i login to the account and open the folder. The problem is if you have 3 messages in folder a with ids 1 2 and 3 and you move the message with id 3 to the folder B, the id of the message changes and we have a message with id 1 in folder B. My goal is synchronizing the message structure in mail server

Faster reading of inbox in Java

喜欢而已 提交于 2019-12-21 13:20:22
问题 I'd like to get a list of everyone who's ever been included on any message in my inbox. Right now I can use the javax mail API to connect via IMAP and download the messages: Folder folder = imapSslStore.getFolder("[Gmail]/All Mail"); folder.open(Folder.READ_ONLY); Message[] messages = folder.getMessages(); for(int i = 0; i < messages.length; i++) { // This causes the message to be lazily loaded and is slow String[] from = messages[i].getFrom(); } The line messages[i].getFrom() is slower than

PHP imap_search UNSEEN SINCE date with time

被刻印的时光 ゝ 提交于 2019-12-21 12:39:43
问题 I am using PHP imap_search to fetch list of unseen messages since a given date like this: imap_search($stream, 'UNSEEN SINCE 20-Sep-2015'); This is working fine. However, I am periodically every few minutes checking for new emails and then storing the last check time in a session. I want to be able to run the imap_search with the UNSEEN SINCE date including time. But it just does not seem to work. I've tried: imap_search($stream, 'UNSEEN SINCE 20-Sep-2015 12:35:03 +0000 (UTC)'); imap_search(

getting the value of Message-ID from gmail imap with php

六月ゝ 毕业季﹏ 提交于 2019-12-21 12:08:03
问题 I use standard imap functions to grab mails, I need to keep track of the Message-ID (and References and In-Reply-To) to build threads. I reply to messages through the smtp, keeping the old subject, but in my web interface is not group them with others. If I add a In-Reply-To header - everything is OK. The problem is that I can't get values of Message-ID, References, In-Reply-To (but in web interface they are present). I've tried different functions (imap_headerinfo, imap_fetchheader, imap

JavaMail: how to get new messages comparing with time-stamps

拟墨画扇 提交于 2019-12-21 12:01:39
问题 I'm trying to get messages after a certain time-stamp, the way I've coded it was suggested by another programmer in this site: GregorianCalendar date = new GregorianCalendar(); SearchTerm newer = new ReceivedDateTerm(ComparisonTerm.GT,date.getTime()); Message msgs[] = folder.search(newerThen); The issue is that I get all the messages since the date, not the specific time. I was wondering if there is some work-around to emulate this. I mean, for an instance, if I want to get all the messages

Where should I draw the line between lexer and parser?

狂风中的少年 提交于 2019-12-21 07:55:25
问题 I'm writing a lexer for the IMAP protocol for educational purposes and I'm stumped as to where I should draw the line between lexer and parser. Take this example of an IMAP server response: * FLAGS (\Answered \Deleted) This response is defined in the formal syntax like this: mailbox-data = "FLAGS" SP flag-list flag-list = "(" [flag *(SP flag)] ")" flag = "\Answered" / "\Deleted" Since they are specified as string literals (aka "terminal" tokens) would it be more correct for the lexer to emit

Reading Email via IMAP in PHP

坚强是说给别人听的谎言 提交于 2019-12-21 06:27:27
问题 I need a recommendation for a PHP library that is capable of reading email via the IMAP protocol. I cannot use the standard PHP: IMAP library because that requires recompiling PHP for the target web server and I don't have access root access to the web server. 回答1: There is a PEAR package that implements the IMAP protocol: Net_IMAP 回答2: If I were you, I would download Squirrelmail and look at its source code. 回答3: I don't know any implementation of IMAP for PHP without using PHPs functions.

Need to save a copy of email using imap php and then can be open in outlook express

五迷三道 提交于 2019-12-21 06:23:47
问题 I had IMAP PHP script which is connecting and reading emails from the mail box. What i am looking is that i want to save the email on server disk and name it something like testing.eml file. So when later i down those emails and can be viewed in outlook express. Any thoughts how can this be achieved. Thanks, 回答1: See PHP's IMAP reference; here's the core functionality: $mbox = imap_open ("{localhost:993/imap/ssl}INBOX", "user_id", "password"); $message_count = imap_num_msg($mbox); if (