52 const string &srcmailbox = command.
getMailbox();
56 if ((mailbox = depot.
get(canonmailbox)) == 0) {
65 vector<string>::const_iterator f_i = command.
flags.begin();
66 while (f_i != command.
flags.end()) {
75 int mday, year, hour, minute, second;
80 sscanf(command.
getDate().c_str(),
"%2i-%3s-%4i %2i:%2i:%2i",
81 &mday, month, &year, &hour, &minute, &second);
84 string monthstr = month;
89 mytm.tm_year = year - 1900;
91 if (monthstr ==
"jan") mytm.tm_mon = 0;
92 else if (monthstr ==
"feb") mytm.tm_mon = 1;
93 else if (monthstr ==
"mar") mytm.tm_mon = 2;
94 else if (monthstr ==
"apr") mytm.tm_mon = 3;
95 else if (monthstr ==
"may") mytm.tm_mon = 4;
96 else if (monthstr ==
"jun") mytm.tm_mon = 5;
97 else if (monthstr ==
"jul") mytm.tm_mon = 6;
98 else if (monthstr ==
"aug") mytm.tm_mon = 7;
99 else if (monthstr ==
"sep") mytm.tm_mon = 8;
100 else if (monthstr ==
"oct") mytm.tm_mon = 9;
101 else if (monthstr ==
"nov") mytm.tm_mon = 10;
102 else if (monthstr ==
"dec") mytm.tm_mon = 11;
116 bool literalPlus =
false;
126 if (c ==
'+' && !literalPlus) {
144 int nchars =
atoi(nr.c_str());
146 session.
setLastError(
"expected positive size of appended message");
164 time_t newtime = (command.
getDate() !=
"") ? mktime(&mytm) : time(0);
165 if (newtime == -1) newtime = time(0);
174 bincClient <<
"+ go ahead with " << nchars <<
" characters" << endl;
184 int bytesToRead = nchars > 8192 ? 8192 : nchars;
225 session.
setLastError(
"failed to commit after successful APPEND: "
255 session.
setLastError(
"Expected mailbox after APPEND SPACE");
262 session.
setLastError(
"Expected SPACE after APPEND SPACE mailbox");
282 session.
setLastError(
"expected a SPACE after the flag list");
290 session.
setLastError(
"expected a SPACE after date_time");
virtual ParseResult parse(Request &) const
ProcessResult process(Depot &, Request &)
const std::string getName(void) const
virtual Mailbox * get(const std::string &path) const
virtual std::string mailboxToFilename(const std::string &m) const =0
virtual Mailbox * getSelected(void) const
virtual bool rollBackNewMessages(void)=0
const std::string & getLastError(void) const
virtual bool commitNewMessages(const std::string &mbox)=0
virtual Message * createMessage(const std::string &mbox, time_t idate=0)=0
The Message class provides an interface for IMAP messages.
virtual void setInternalDate(time_t)=0
virtual void close(void)=0
virtual void setStdFlag(unsigned char)=0
virtual bool appendChunk(const std::string &)=0
const std::string & getLastError(void) const
const std::string & getDate(void) const
void setDate(const std::string &s_in)
void setMailbox(const std::string &s_in)
std::vector< std::string > & getFlags(void)
void setName(const std::string &s_in)
const std::string & getMailbox(void) const
std::vector< std::string > flags
bool getUidMode(void) const
void setLastError(const std::string &error) const
void setResponseCode(const std::string &error) const
static Session & getInstance(void)
Declaration of the IODevice class.
Declaration of the IOFactory class.
Declaration of the Mailbox class (Mailbox is logical container)
Operator::ParseResult expectFlag(std::vector< std::string > &v_in)
std::string toImapString(const std::string &s_in)
Operator::ParseResult expectSPACE(void)
std::string toCanonMailbox(const std::string &s_in)
Operator::ParseResult expectThisString(const std::string &s_in)
bool pendingUpdates(Mailbox *, int type, bool rescan, bool showAll=false, bool forceScan=false, bool uidfetchflags=false)
Operator::ParseResult expectDateTime(std::string &s_in)
int atoi(const std::string &s_in)
void lowercase(std::string &input)
Operator::ParseResult expectMailbox(std::string &s_in)
Declaration of all operators.
Declaration of a recursive descent IMAP command parser.