imap-envelope.c revision 428fb4dc39c6e9b2eb36216c396dad6096a65f8f
/* Copyright (c) 2002-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream.h"
#include "str.h"
#include "message-address.h"
#include "message-parser.h"
#include "imap-parser.h"
#include "imap-envelope.h"
#include "imap-quote.h"
struct message_part_envelope_data {
const char *in_reply_to, *message_id;
};
const char *imap_envelope_headers[] = {
"Date", "Subject", "From", "Sender", "Reply-To",
"To", "Cc", "Bcc", "In-Reply-To", "Message-ID",
};
{
switch (*name) {
case 'B':
case 'b':
*ret = IMAP_ENVELOPE_BCC;
break;
case 'C':
case 'c':
*ret = IMAP_ENVELOPE_CC;
break;
case 'D':
case 'd':
break;
case 'F':
case 'f':
break;
case 'I':
case 'i':
break;
case 'M':
case 'm':
break;
case 'R':
case 'r':
break;
case 'S':
case 's':
break;
case 'T':
case 't':
*ret = IMAP_ENVELOPE_TO;
break;
}
}
struct message_part_envelope_data **data,
struct message_header_line *hdr)
{
struct message_part_envelope_data *d;
enum imap_envelope_field field;
struct message_address **addr_p;
const char **str_p;
}
return;
/* wait for full value */
return;
}
d = *data;
switch (field) {
case IMAP_ENVELOPE_DATE:
break;
case IMAP_ENVELOPE_SUBJECT:
break;
case IMAP_ENVELOPE_MESSAGE_ID:
str_p = &d->message_id;
break;
str_p = &d->in_reply_to;
break;
case IMAP_ENVELOPE_CC:
break;
case IMAP_ENVELOPE_BCC:
break;
case IMAP_ENVELOPE_FROM:
break;
case IMAP_ENVELOPE_SENDER:
break;
case IMAP_ENVELOPE_TO:
break;
case IMAP_ENVELOPE_REPLY_TO:
break;
case IMAP_ENVELOPE_FIELDS:
break;
}
(unsigned int)-1, TRUE);
}
}
}
{
return;
}
}
}
{
static const char *empty_envelope =
"NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL";
return;
}
}
bool *in_group)
{
unsigned int list_count;
const char *args[4];
int i;
return FALSE;
/* we require 4 arguments, strings or NILs */
if (list_count < 4)
return FALSE;
for (i = 0; i < 4; i++) {
return FALSE;
}
/* end of group */
return TRUE;
}
/* beginning of group */
return TRUE;
}
/* a) mailbox@domain
b) name <@route:mailbox@domain> */
}
} else {
}
}
}
}
return TRUE;
}
{
bool in_group;
return NULL;
return NULL;
}
}
{
const char *str;
unsigned int list_count;
/* ((...)(...) ...) */
return NULL;
if (IMAP_ARG_IS_EOL(list_args))
return "";
/* (name route mailbox domain) */
list_count != 4)
return NULL;
return NULL;
}
static bool
enum imap_envelope_field field,
const char *envelope,
const char **result)
{
return TRUE;
}
switch (result_type) {
else {
}
break;
field <= IMAP_ENVELOPE_BCC);
break;
}
return TRUE;
else {
i_error("Invalid field %u in IMAP envelope: %s",
return FALSE;
}
}
const char **result)
{
struct imap_parser *parser;
int ret;
(void)i_stream_read(input);
} else {
}
return ret;
}