24 void outputFlags(
const Message & message)
38 for (vector<string>::const_iterator k
39 = flagv.begin(); k != flagv.end(); ++k) {
45 for (vector<string>::const_iterator it = customFlags.begin();
46 it != customFlags.end(); ++it) {
47 if (flagv.size() > 0 || it != customFlags.begin())
bincClient <<
" ";
84 bool updateFlags =
false;
91 vector<BincImapParserFetchAtt>::const_iterator f_i;
92 bool uidfetched =
false;
94 f_i = request.
fatt.begin();
95 while (f_i != request.
fatt.end()) {
96 if ((*f_i).type ==
"UID") {
106 req.
fatt.push_back(b);
111 f_i = request.
fatt.begin();
112 while (f_i != request.
fatt.end()) {
113 const string &type = (*f_i).type;
119 }
else if (type ==
"FULL") {
125 }
else if (type ==
"FAST") {
143 for (; i != mailbox->
end(); ++i) {
147 bool hasprinted =
false;
148 f_i = req.
fatt.begin();
149 while (f_i != req.
fatt.end()) {
153 if (hasprinted) prefix =
" ";
155 if (fatt.
type ==
"FLAGS") {
160 outputFlags(message);
161 }
else if (fatt.
type ==
"UID") {
165 }
else if (fatt.
type ==
"RFC822.SIZE") {
169 }
else if (fatt.
type ==
"ENVELOPE") {
174 }
else if (fatt.
type ==
"BODYSTRUCTURE") {
185 }
else if (fatt.
type ==
"INTERNALDATE") {
191 struct tm *_tm = gmtime(&iDate);
194 if (strftime(internal,
sizeof(internal),
195 "%d-%b-%Y %H:%M:%S %z", _tm) != 0) {
196 if (internal[0] ==
'0') internal[0] =
' ';
202 }
else if (fatt.
type ==
"BODY" || fatt.
type ==
"BODY.PEEK") {
208 bool peek = (fatt.
type ==
"BODY.PEEK");
211 bool includeheaders =
true;
212 bool fullheader =
false;
213 bool bodyfetch =
false;
222 includeheaders =
false;
231 v.push_back(
"content-type");
232 v.push_back(
"content-transfer-encoding");
233 v.push_back(
"content-disposition");
234 v.push_back(
"content-description");
239 unsigned int size = fullheader
292 }
else if (fatt.
type ==
"RFC822") {
306 }
else if (fatt.
type ==
"RFC822.HEADER") {
318 }
else if (fatt.
type ==
"RFC822.TEXT") {
326 bool bodyfetch =
false;
365 outputFlags(message);
394 session.
setLastError(
"Expected sequence set after FETCH SPACE");
399 session.
setLastError(
"Expected SPACE after FETCH SPACE set");
407 c_in.
fatt.push_back(f);
410 c_in.
fatt.push_back(f);
413 c_in.
fatt.push_back(f);
415 c_in.
fatt.push_back(f);
424 c_in.
fatt.push_back(ftmp);
435 session.
setLastError(
"Expected ALL, FULL, FAST, fetch_att or (");
500 bool gotadotalready =
false;
505 gotadotalready =
true;
544 string header_fld_name;
612 f_in.
type =
"INTERNALDATE";
615 f_in.
type =
"RFC822";
621 " RFC822.SIZE or RFC822.TEXT");
std::vector< std::string > headerlist
unsigned int offsetlength
std::string toString(void)
const std::string & str(void) const
virtual Mailbox * getSelected(void) const
virtual ParseResult parse(Request &) const
ParseResult expectFetchAtt(BincImapParserFetchAtt &f_in) const
ParseResult expectSectionText(BincImapParserFetchAtt &f_in) const
ParseResult expectHeaderList(BincImapParserFetchAtt &f_in) const
ParseResult expectOffset(BincImapParserFetchAtt &f_in) const
ProcessResult process(Depot &, Request &)
ParseResult expectSection(BincImapParserFetchAtt &f_in) const
const std::string getName(void) const
unsigned int getSqnr() const
virtual void updateFlags(void)=0
virtual iterator begin(const SequenceSet &bset, unsigned int mod=INCLUDE_EXPUNGED|SQNR_MODE) const =0
virtual iterator end(void) const =0
The Message class provides an interface for IMAP messages.
virtual bool printEnvelope(void) const =0
virtual time_t getInternalDate(void) const =0
virtual unsigned int getUID(void) const =0
virtual unsigned int getBodySize(const std::string §ion, unsigned int startOffset=0, unsigned int length=UINTMAX) const =0
virtual void setFlagsUnchanged(void)=0
virtual bool printDoc(unsigned int startOffset=0, unsigned int length=UINTMAX, bool onlyText=false) const =0
virtual bool printBody(const std::string §ion, unsigned int startOffset=0, unsigned int length=UINTMAX) const =0
virtual bool printHeader(const std::string §ion, std::vector< std::string > headers, bool includeHeaders=false, unsigned int startOffset=0, unsigned int length=UINTMAX, bool mime=false) const =0
virtual unsigned int getSize(bool render=false) const =0
virtual void setStdFlag(unsigned char)=0
virtual unsigned int getHeaderSize(const std::string §ion, std::vector< std::string > headers, bool includeHeaders=false, unsigned int startOffset=0, unsigned int length=UINTMAX, bool mime=false) const =0
virtual unsigned char getStdFlags(void) const =0
virtual bool printBodyStructure(bool extended=true) const =0
virtual std::vector< std::string > getCustomFlags(void) const =0
virtual unsigned int getDocSize(unsigned int startOffset=0, unsigned int length=UINTMAX, bool onlyText=false) const =0
virtual bool hasFlagsChanged(void) const =0
std::vector< BincImapParserFetchAtt > fatt
void setName(const std::string &s_in)
bool getUidMode(void) const
SequenceSet & getSet(void)
void setLastError(const std::string &error) const
static Session & getInstance(void)
Declaration of miscellaneous convertion functions.
Declaration of the common items for parsing IMAP input.
Declaration of the IODevice class.
Declaration of the IOFactory class.
Declaration of the Mailbox class (Mailbox is logical container)
Operator::ParseResult expectNumber(unsigned int &i_in)
std::string toImapString(const std::string &s_in)
Operator::ParseResult expectAstring(std::string &s_in)
Operator::ParseResult expectSPACE(void)
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 expectNZNumber(unsigned int &i_in)
Operator::ParseResult expectSet(SequenceSet &s_in)
Operator::ParseResult expectCRLF(void)
Declaration of all operators.
Declaration of a recursive descent IMAP command parser.