From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.142.241.17 with SMTP id o17cs90350wfh; Sun, 15 May 2011 07:58:51 -0700 (PDT) Received: by 10.52.180.72 with SMTP id dm8mr4687190vdc.118.1305471530894; Sun, 15 May 2011 07:58:50 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id fq13si3644872vbb.37.2011.05.15.07.58.49; Sun, 15 May 2011 07:58:49 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 6F95E1D780FC for ; Sun, 15 May 2011 10:58:49 -0400 (EDT) Received: from masanjin.net (masanjin.net [209.20.72.13]) by rubyforge.org (Postfix) with ESMTP id 3E2461858112 for ; Sun, 15 May 2011 10:54:26 -0400 (EDT) Received: from w by masanjin.net with local (Exim 4.71) (envelope-from ) id 1QLcpB-0004ul-2q for sup-devel@rubyforge.org; Sun, 15 May 2011 15:01:41 +0000 From: William Morgan To: sup-devel In-reply-to: References: Date: Sun, 15 May 2011 15:01:41 +0000 Message-Id: <1305471101-sup-6655@masanjin.net> User-Agent: Sup/git Subject: Re: [sup-devel] Query for largest msg_id? X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org Reformatted excerpts from Horacio Sanson's message of 2011-05-10: > Is there a way to query Heliotrope what is the largest msg_id > currently in the index? Sort of---it's a hack, but if you search for e.g. "a OR -a" you'll get every message in the index, and the first result will be the message with the highest id thanks to Whistlepig's search semantics. > I am trying to improve the imap-dumper.rb so > it does not download all my emails every time but only the new ones. Sounds great. Unfortunately the Heliotrope message id and the IMAP message id / message uid are completely different things, and maintaining a cross-session mapping of them is impossible for generic IMAP servers, because the uid of every message can change every time you connect to an IMAP server---see the section on IMAP's 'uidvalidity' variable. So you'll have to rescan the inbox every time and rebuild the mapping. Welcome to hell. > Also while looking at the code I see that messages are stored in the > index using the msg_id as parsed by RMail. There is no further > association with the source or mailbox from where the messages were > downloaded. This I think may cause collisions if we use one Heliotrope > server with more than one email account. Not sure what is the > probability of two messages from two different IMAP servers having the > same msg_id but nothing in the standard rules out that possibility. This is yet another id: the Message-Id header of the email. This is only needed to build up the thread structure and should otherwise be ignored. -- William _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel