Giter Site home page Giter Site logo

imapsrv's Introduction

Stories in Ready

Imapsrv

This is an IMAP server written in Go. It is a work in progress.

Demo

In the demo subdirectory there are several implementation examples available.

$ go run ./demo/basic/main.go

You can connect to this server using telnet or netcat. For example:

$ nc -C localhost 1193
* OK IMAP4rev1 Service Ready
10 LOGIN test anypassword
10 OK LOGIN completed
20 CAPABILITY
* CAPABILITY IMAP4rev1
20 OK CAPABILITY completed
30 SELECT inbox
* 8 EXISTS
* 4 RECENT
* OK [UNSEEN 4] Message 4 is first unseen
* OK [UIDVALIDITY 1] UIDs valid
* OK [UIDNEXT 9] Predicted next UID
30 OK SELECT completed
40 LOGOUT
* BYE IMAP4rev1 Server logging out
40 OK LOGOUT completed

Developing

The server is not fully operational on its own. It requires a mailstore and an authentication mechanism.

It defines an interface in mailstore.go which describes the service it needs from a Mailstore. For example a Mailstore could serve its data from: database, filesystem, maildir, etc... At the moment only one mailstore can be used at the same time.

To add a new IMAP command the usual steps are:

  1. Add the command to parser.go
  2. Add the command and its client interaction to commands.go
  3. Put the main functionality in session.go.

Current state

IMAP (RFC 3501)

Client Commands - Any state

  • CAPABILITY command - in progress
  • NOOP command
  • LOGOUT command

Client Commands - Not-Authenticated State

  • STARTTLS command
  • AUTHENTICATE command
  • LOGIN command

Client Commands - Authenticated State

  • SELECT command
  • EXAMINE command
  • CREATE command
  • DELETE command
  • RENAME command
  • SUBSCRIBE command
  • UNSUBSCRIBE command
  • LIST command
  • LSUB command
  • STATUS command
  • APPEND command

Client Commands - Selected State

  • CHECK command
  • CLOSE command
  • EXPUNGE command
  • SEARCH command
  • FETCH command - in progress
  • STORE command
  • COPY command
  • UID command

Server responses

  • OK response
  • NO response
  • BAD response
  • PREAUTH response
  • BYE response

License

3-clause BSD

imapsrv's People

Contributors

alienscience avatar etiennebruines avatar rossjhagan avatar waffle-iron avatar twitchyliquid64 avatar

Watchers

James Cloos avatar Jiajin Yin avatar

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.