genkgo / mail

Library to send e-mails over different transports and protocols (like SMTP and IMAP) using immutable messages and streams. Also includes SMTP server.
https://mail.readthedocs.io/
Other
402 stars 21 forks source link

Implement imap client #42

Closed frederikbosch closed 6 years ago

frederikbosch commented 6 years ago

IMAP spec.

frederikbosch commented 6 years ago

Today I finished successfully fetching messages from the imap server using a decent API that should be ready for extending it to the full RFC spec. At least that is what I am thinking considering my current knowledge of IMAP v4rev1.

frederikbosch commented 6 years ago

One should consider that the current API could be wrapped in the future in an easy to use generic mail account/mailbox API. That might look like this.

$account = new ImapAccount (ClientFactory::fromString('imap://user:pass@host'));
$mailbox = $account->select('INBOX');
$messages = $mailbox->fetch(1, 5); // fetch first 5 messages
foreach ($messages as $message) {}

The above, however, is the next level of abstraction. First we need to implement the specifics of the IMAP protocol.

frederikbosch commented 6 years ago

Almost done covering the complete IMAP spec. I think I will leave the coverage as it is now. Focus now on getting this completely tested and adding the ClientFactory.

frederikbosch commented 6 years ago

IMAP protocol has 100% spec (from request perspective) and 100% test coverage now. Only a client factory left.