diff options
Diffstat (limited to 'vmime/net/imap/IMAPParser.hpp')
-rw-r--r-- | vmime/net/imap/IMAPParser.hpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/vmime/net/imap/IMAPParser.hpp b/vmime/net/imap/IMAPParser.hpp index 88d751af..ac6310b2 100644 --- a/vmime/net/imap/IMAPParser.hpp +++ b/vmime/net/imap/IMAPParser.hpp @@ -134,7 +134,7 @@ class IMAPParser : public object public: IMAPParser(weak_ref <IMAPTag> tag, weak_ref <socket> sok, weak_ref <timeoutHandler> _timeoutHandler) - : m_tag(tag), m_socket(sok), m_progress(NULL), + : m_tag(tag), m_socket(sok), m_progress(NULL), m_strict(false), m_literalHandler(NULL), m_timeoutHandler(_timeoutHandler) { } @@ -150,6 +150,27 @@ public: m_socket = sok; } + /** Set whether we operate in strict mode (this may not work + * with some servers which are not fully standard-compliant). + * + * @param strict true to operate in strict mode, or false + * to operate in default, relaxed mode + */ + void setStrict(const bool strict) + { + m_strict = strict; + } + + /** Return true if the parser operates in strict mode, or + * false otherwise. + * + * @return true if we are in strict mode, false otherwise + */ + const bool isStrict() const + { + return m_strict; + } + const string lastLine() const { @@ -562,14 +583,14 @@ public: { } - void go(IMAPParser& /* parser */, string& line, string::size_type* currentPos) + void go(IMAPParser& parser, string& line, string::size_type* currentPos) { DEBUG_ENTER_COMPONENT("text"); string::size_type pos = *currentPos; string::size_type len = 0; - if (m_allow8bits) + if (m_allow8bits || !parser.isStrict()) { const unsigned char except = m_except; @@ -5000,6 +5021,8 @@ private: utility::progressListener* m_progress; + bool m_strict; + literalHandler* m_literalHandler; weak_ref <timeoutHandler> m_timeoutHandler; |