Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FETCH Command #2

Open
twitchyliquid64 opened this issue Nov 2, 2014 · 4 comments
Open

FETCH Command #2

twitchyliquid64 opened this issue Nov 2, 2014 · 4 comments
Assignees
Milestone

Comments

@twitchyliquid64
Copy link
Collaborator

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
Copy link

g-dormoy commented Nov 3, 2014

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

@g-dormoy
Copy link

g-dormoy commented Nov 5, 2014

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

@alienscience
Copy link
Owner

In progress on the fetch branch.

EtienneBruines added a commit that referenced this issue Jul 6, 2015
Fetching does not yet work because of the parsing of the body types. WIP (#2)
@EtienneBruines
Copy link
Collaborator

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 = 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants