Subject: Re: [sup-devel] Toggling usual status of sources

From: Tero Tilus <[email-masked]>
Date: Wed, 12 May 2010 07:44:29 +0300

Ben Walton, 2010-05-12 03:28:
>    #toggle usual status on previous source
> [...]
> 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?

Not at all.  If you do that, I'll switch to rotating inbox.

> [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...

Patterned/dynamic/recursive sources are in my todo-list.  Haven't got
around implementing it yet.  Gave it some thought though.  Did you
consider them "virtual" (as in bunch of "physical" maildir/mbox stores
made transparently look like one source) or "meta" (as in template
source which sup uses to generate a set of "physical" sources)?  Which
one would be better?

I think rotating inbox would pretty clean to implement using either
"virtual" or "meta" source.  If either of them ever got implemented.

-- 
Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Ben Walton <[email-masked]>
Date: Thu, 13 May 2010 10:15:06 -0400

> Not at all.  If you do that, I'll switch to rotating inbox.

Cool!

> Patterned/dynamic/recursive sources are in my todo-list.  Haven't
> got around implementing it yet.  Gave it some thought though.  Did
> you consider them "virtual" (as in bunch of "physical" maildir/mbox
> stores made transparently look like one source) or "meta" (as in
> template source which sup uses to generate a set of "physical"
> sources)?  Which one would be better?

I was thinking meta, but virtual is interesting too.  I _think_ that
meta would be easier to implement given the current code structure.  I
also think having each of the 'dynamic' sources listed explicitly in
sources.yaml has some merit.

Thanks
-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

---

From: Ben Walton <[email-masked]>
Date: Tue, 11 May 2010 20:28:34 -0400

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
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel