Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] Toggling usual status of sources
@ 2010-05-12  0:28 Ben Walton
  2010-05-12  4:44 ` Tero Tilus
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Walton @ 2010-05-12  0:28 UTC (permalink / raw)
  To: sup-devel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-13 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-12  0:28 [sup-devel] Toggling usual status of sources Ben Walton
2010-05-12  4:44 ` Tero Tilus
2010-05-13 14:15   ` Ben Walton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox