From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.52.187.5 with SMTP id fo5cs170126vdc; Tue, 10 May 2011 09:20:02 -0700 (PDT) Received: by 10.52.99.10 with SMTP id em10mr1780979vdb.257.1305044401756; Tue, 10 May 2011 09:20:01 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id u18si5999713vbx.93.2011.05.10.09.20.01; Tue, 10 May 2011 09:20:01 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 774591858377; Tue, 10 May 2011 12:20:01 -0400 (EDT) Received: from mail-vx0-f178.google.com (mail-vx0-f178.google.com [209.85.220.178]) by rubyforge.org (Postfix) with ESMTP id A5BE818583A7 for ; Tue, 10 May 2011 11:17:47 -0400 (EDT) Received: by vxc11 with SMTP id 11so9434733vxc.23 for ; Tue, 10 May 2011 08:17:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=9Ut/LTxchXIcDuWC3phu/ZemFs/d44ocP3UgvEGxGEg=; b=CqVL+mux1lIIldfDkqSfjgJs1gdc0MULa3SW4NTmCW30J75T9FxNjUeJi38Vf7EBQv Zm6Kgun5Ih8lodRwmRmmi76BkSNx+GLuTYmQXHJwrXLsiwbkBo4M1PRRICRpLxQept59 xHJ6iHawmsgzYJGv3/9TkUQssNeG0KOxy1mT0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=N+bqb4spI2ASL1oGXTW40adLZF82LOGazrCwq36U/XDKgLuY9e0kz3gMZ1WadK3nXk s04favrbzOectENZzJ3748g3w7863JeZpkyvEKO94Qebm9fDQ42M+t7rdwq5Rzf8zvpv XuM7Uh3Xaw1ILoXlVQAi4aj0++NPTLMLjKnFY= MIME-Version: 1.0 Received: by 10.52.180.8 with SMTP id dk8mr4564989vdc.73.1305040667308; Tue, 10 May 2011 08:17:47 -0700 (PDT) Received: by 10.52.107.2 with HTTP; Tue, 10 May 2011 08:17:47 -0700 (PDT) Date: Wed, 11 May 2011 00:17:47 +0900 Message-ID: From: Horacio Sanson To: sup-devel Subject: [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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org Is there a way to query Heliotrope what is the largest msg_id currently in the index? I am trying to improve the imap-dumper.rb so it does not download all my emails every time but only the new ones. >From rfc4549.txt (see section 4.3.1) I learned that the way to do this is to FETCH all the messages from [ lastknownmsg_id + 1 : * ]. This will give the ids of all messages added to the server after the last sync. Reading the source code I could not find a way to query this value. 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. regards Horacio _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel