alienscience / imapsrv

An IMAP server written in Go
BSD 3-Clause "New" or "Revised" License
48 stars 9 forks source link

FETCH Command #2

Open twitchyliquid64 opened 9 years ago

twitchyliquid64 commented 9 years ago

Arguments: sequence set message data item names or macro

Responses: untagged responses: FETCH

Result: OK - fetch completed NO - fetch error: can't fetch that data BAD - command unknown or arguments invalid

  The FETCH command retrieves data associated with a message in the
  mailbox.  The data items to be fetched can be either a single atom
  or a parenthesized list.

  Most data items, identified in the formal syntax under the
  msg-att-static rule, are static and MUST NOT change for any
  particular message.  Other data items, identified in the formal
  syntax under the msg-att-dynamic rule, MAY change, either as a
  result of a STORE command or due to external events.

       For example, if a client receives an ENVELOPE for a
       message when it already knows the envelope, it can
       safely ignore the newly transmitted envelope.

  There are three macros which specify commonly-used sets of data
  items, and can be used instead of data items.  A macro must be
  used by itself, and not in conjunction with other macros or data
  items.
g-dormoy commented 9 years ago

I'll start to look for that one when I get back from work

g-dormoy commented 9 years ago

Aften looking at a few things I won't take care of that for now

alienscience commented 9 years ago

In progress on the fetch branch.

EtienneBruines commented 9 years ago

In the branch lmtp (which contains all commits of fetch at moment of writing), I've created a Mailstore implementation, which does a pretty nice job.This will allow you to send e-mails to Postfix (which in return, sends it to the IMAP server), in order to test the FETCH command on real-life e-mails.

How do I use it?

Running demo/complete/main.go might be helpful. I had to hardcode a directory in line 17, to create a persistent database, so you may have to change that. It runs together with Postfix, which you can configure by doing:

In /etc/postfix/master.cf, replace: lmtp unix - - - - - lmtp with lmtp unix - - n - - lmtp (this causes LMTP to run non-chrooted, and thus have access to the socket.

In /etc/postfix/main.cf, make sure you set these variables:

# This single line can contain more entries, but should contain these:
mydestination = localhost.localdomain, localhost, example.local

mailbox_transport = lmtp:inet:localhost:61194
local_recipient_maps =