[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-devel] Toggling usual status of sources



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