Giter Site home page Giter Site logo

thefox / imapd Goto Github PK

View Code? Open in Web Editor NEW
51.0 5.0 13.0 517 KB

IMAP server (library) to serve emails to an email client, written in pure PHP.

Home Page: https://blog.fox21.at/2014/08/07/imapd.html

License: MIT License

PHP 99.64% Shell 0.36%
imap-server imap-library php imap php-library imapd mit-license

imapd's Introduction

IMAPd

IMAP server (library) to serve emails to an email client, written in pure PHP.

The d in SMTPd stands for Daemon. This script can run in background like any other daemon process. It's not meant for running as a webapplication.

Why this project?

Believe it or not, email is still the killer feature of the Internet. There are tons of projects for accessing and fetching emails from an IMAP/POP3 server. But there are not so many providing a programmatically interface to serve emails to an email client.

With this interface you can do something like this for your app users:

+--------------+     +-------+     +------------------------+     +------+
| Your PHP App +---> | IMAPd +---> | MUA (like Thunderbird) +---> | User |
+--------------+     +-------+     +------------------------+     +------+

This is useful when you have a messaging application written in PHP but no graphical user interface for it. So your graphical user interface can be any email client. Thunderbird for instance.

Project Outlines

The project outlines as described in my blog post about Open Source Software Collaboration.

  • The main purpose of this software is to provide a server-side IMAP API for PHP scripts.
  • Although the RFC implementations are not completed yet, they must be strict.
  • More features can be possible in the future. In perspective of the protocols the features must be a RFC implementation.
  • This list is open. Feel free to request features.

Planned Features

  • Full RFC 3501 Implementation.
  • Replace Zend\Mail with a better solution.

Installation

The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to composer.json:

composer require thefox/imapd

Usage

See example.php file for more information.

RFC 3501 Implementation

Complete implementation

  • 6.1.2 NOOP Command
  • 6.1.3 LOGOUT Command
  • 6.4.1 CHECK Command
  • 6.4.7 COPY Command
  • 7.1.1 OK Response
  • 7.1.2 NO Response
  • 7.1.3 BAD Response
  • 7.1.5 BYE Response
  • 7.4.1 EXPUNGE Response

Incomplete implemention

  • 2.3.1.1 Unique Identifier (UID) Message Attribute
  • 2.3.1.2 Message Sequence Number Message Attribute
  • 2.3.2 Flags Message Attribute
  • 6.1.1 CAPABILITY Command
  • 6.2.2 AUTHENTICATE Command
  • 6.2.3 LOGIN Command
  • 6.3.1 SELECT Command
  • 6.3.6 SUBSCRIBE Command
  • 6.3.7 UNSUBSCRIBE Command
  • 6.3.8 LIST Command
  • 6.3.9 LSUB Command
  • 6.3.11 APPEND Command
  • 6.4.2 CLOSE Command
  • 6.4.4 SEARCH Command
  • 6.4.5 FETCH Command
  • 6.4.6 STORE Command
  • 6.4.8 UID Command
  • 7.1.4 PREAUTH Response
  • 7.2.1 CAPABILITY Response
  • 7.2.2 LIST Response
  • 7.2.3 LSUB Response
  • 7.2.5 SEARCH Response
  • 7.3.1 EXISTS Response
  • 7.3.2 RECENT Response
  • 7.4.2 FETCH Response

TODO

  • Some tasks are commented with NOT_IMPLEMENTED. Implement these.
  • @TODO are to be complete the PHP Code Sniffer tests before releasing a new version.

Alternatives for Zend\Mail

Related Links

Related Projects

Project Links

imapd's People

Contributors

thefox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

imapd's Issues

Error in example.php

Following the readme file, I have get a PHP Fatal error by running the example.php:

PHP Fatal error:  Call to a member function error() on null in /var/www/html/imapd_test/vendor/thefox/imapd/src/TheFox/Imap/Server.php on line 99
PHP Stack trace:
PHP   1. {main}() /var/www/html/imapd_test/server.php:0
PHP   2. TheFox\Imap\Server->listen() /var/www/html/imapd_test/server.php:23

PHP7

Ready for PHP7? Testing.

Events how to

This is pretty cool! I had no idea there was an imap server in php.
I'm wondering how I can use the Events parts you showed in example.php.

Specifically, I'm starting the example.php server alongside a CMS because I want it to check user credentials in the CMS when an IMAP request comes in. Am I thinking right or am I missing something?
I'd appreciate any example about the events. Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.