From: Ben Walton <bwalton@cquest.utoronto.ca>
To: sup-devel@rubyforge.org
Subject: [sup-devel] Toggling usual status of sources
Date: Tue, 11 May 2010 20:28:34 -0400 [thread overview]
Message-ID: <4BE9F632.3020108@cquest.utoronto.ca> (raw)
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
next reply other threads:[~2010-05-12 1:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-12 0:28 Ben Walton [this message]
2010-05-12 4:44 ` Tero Tilus
2010-05-13 14:15 ` Ben Walton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BE9F632.3020108@cquest.utoronto.ca \
--to=bwalton@cquest.utoronto.ca \
--cc=sup-devel@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox