From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.204.79.193 with SMTP id q1cs119643bkk; Tue, 11 May 2010 18:58:01 -0700 (PDT) Received: by 10.224.0.160 with SMTP id 32mr4496271qab.284.1273629480140; Tue, 11 May 2010 18:58:00 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 1si10258797qyk.40.2010.05.11.18.57.59; Tue, 11 May 2010 18:58:00 -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 94DDF1858350; Tue, 11 May 2010 21:57:59 -0400 (EDT) X-Greylist: delayed 2317 seconds by postgrey-1.31 at rubyforge.org; Tue, 11 May 2010 21:07:12 EDT Received: from jimi.chass.utoronto.ca (jimi.chass.utoronto.ca [128.100.160.32]) by rubyforge.org (Postfix) with ESMTP id 038E01858329 for ; Tue, 11 May 2010 21:07:12 -0400 (EDT) Received: from [24.36.152.183] (port=37203 helo=[192.168.0.10]) (auth info: dovecot_plain:bwalton@chass.utoronto.ca) by jimi.chass.utoronto.ca with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1OBzoQ-0007YB-T5 for sup-devel@rubyforge.org; Tue, 11 May 2010 20:28:34 -0400 Message-ID: <4BE9F632.3020108@cquest.utoronto.ca> Date: Tue, 11 May 2010 20:28:34 -0400 From: Ben Walton User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: sup-devel@rubyforge.org X-Mailman-Approved-At: Tue, 11 May 2010 21:57:56 -0400 Subject: [sup-devel] Toggling usual status of sources 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org Hi All, I'm looking to redefine my mail storage and want to implement a somewhat unorthodox hook[1]. I want to dynamically add new sources to sup while sup is running using the after-poll hook. So far, I've succeeded in adding a source with the following: --snip-- u = "maildir:/u/bwalton/Maildir/.test2/" unless Redwood::SourceManager.source_for(u) Redwood::Logger.force_message "test2 not setup yet." Redwood::SourceManager.add_source Recoverable.new(Redwood::Maildir.new(u)) un\ less Redwood::SourceManager.source_for(u) end --snip-- (Sorry about the wrapping...Thunderbird is driving me nuts.) Now, what I really want to do is something like: --snip-- d = Date.today s = "maildir:/u/bwalton/Maildir/.incoming.#{d.year}.#{d.strftime('%m')}" unless Redwood::SourceManager.source_for(s) # determine currently 'primary' source (decrement month, # possibly wrap month to 12 and decrement year) #add source #toggle usual status on previous source end --snip-- I don't see a way, currently, to toggle that flag. Would there be objections to adding support for that? Is what I'm proposing _too_ nuts? I already have my procmail recipe delivering into the .incoming.$year.$month folders and have given up filing individual lists into separate folders...With a good before-add-message hook, I can give up on assigning labels based on folders and just have monthly mailboxes that are added automatically. :) Thoughts? Thanks -Ben [1] This is along the lines of my 'patterned/dynamic source' idea that I briefly described a few nights back, but I think that was eaten... _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel