myobie / dm-imap-adapter Goto Github PK
View Code? Open in Web Editor NEWAn adapter for DM that is 0.10/next compliant (and very unfinished)
An adapter for DM that is 0.10/next compliant (and very unfinished)
IMAP Adapter for DataMapper =========================== There exist other implementations of an imap adapter but they are either not 0.10 compatible or I couldn't find a working version. Also, I am picky and want to do this right. Philosophy ========== A resource is a mailbox. So you will probably end up with a Gmail::Inbox and a Gmail::Trash. To move an item to the trash you would resource.move_to(Gmail::Trash) [not implemented yet]. Various Types are provided to make it easier to work with the different things like From and To and CC and all of that. These also help with the queries [not implemented yet]. Specs ===== I use bacon. It's the best testing library that exists. gem install bacon bacon spec/dm-imap-adapter_spec.rb or use autotest (although I'm not sure I got that setup perfectly). The specs currently assume you have a test account with test as the password on localhost which has an INBOX. All emails in this inbox will be deleted, just like a test database. How to use ========== gem install gemcutter # unless you already have gem tumble # unless you already have gem install dm-imap-adapter Check the specs! Also, do this for your model: class Inbox include DataMapper::Resource include DataMapper::Types::Imap def self.default_repository_name :test_inbox end property :uid, UID, :key => true # do we need :key here since UID is a serial? property :message_id, MessageId property :subject, Subject property :sender, Sender property :from, From property :to, To property :body, BodyText property :raw_body, Body property :date, InternalDate property :envelope_date, EnvelopeDate property :size, Size property :sequence, Sequence end How can I help? =============== Glad you asked! There are lots of things that don't work yet, mostly because I don't need them to (all I need is #all and #destroy). Here are the big things that don't work yet: * #update * #create should use update to set any attributes that can't be set during the initial append to the mailbox * Flags - a Type needs to be created that manages an array of symbols. Maybe base it off the Enum? * Searching should actually use the uid_search method and not rely on the in memory query filter. If you got 1000 emails in your inbox your currently screwed. * Figuring out why I had to hack net/imap so much to support dovecot on my machine. Seems strange that I had to open the class like that. * Extend other net/imap structs like the Address one. * Better specs!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.