Blame view

imap4d/examine.c 1.49 KB
1
/* GNU Mailutils -- a suite of utilities for electronic mail
2 3
   Copyright (C) 1999, 2001, 2007, 2008, 2010 Free Software Foundation,
   Inc.
Jakob Kaivo authored
4

5
   GNU Mailutils is free software; you can redistribute it and/or modify
Jakob Kaivo authored
6
   it under the terms of the GNU General Public License as published by
7
   the Free Software Foundation; either version 3, or (at your option)
Jakob Kaivo authored
8 9
   any later version.

10
   GNU Mailutils is distributed in the hope that it will be useful,
Jakob Kaivo authored
11 12 13 14 15
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
16
   along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>. */
Jakob Kaivo authored
17 18 19 20

#include "imap4d.h"

/*
21
6.3.2.  EXAMINE Command
Jakob Kaivo authored
22

23 24 25 26 27 28 29 30 31 32
   Arguments:  mailbox name

   Responses:  REQUIRED untagged responses: FLAGS, EXISTS, RECENT
               OPTIONAL OK untagged responses: UNSEEN, PERMANENTFLAGS

   Result:     OK - examine completed, now in selected state
               NO - examine failure, now in authenticated state: no
                    such mailbox, can't access mailbox
               BAD - command unknown or arguments invalid
*/
Jakob Kaivo authored
33
int
34
imap4d_examine (struct imap4d_command *command, imap4d_tokbuf_t tok)
Jakob Kaivo authored
35
{
36
  if (imap4d_tokbuf_argc (tok) != 3)
37
    return io_completion_response (command, RESP_BAD, "Invalid arguments");
38 39
  return imap4d_select0 (command, imap4d_tokbuf_getarg (tok, IMAP4_ARG_1),
			 MU_STREAM_READ);
Jakob Kaivo authored
40
}