21 #ifndef G_SMTP_STORED_FILE_H
22 #define G_SMTP_STORED_FILE_H
46 G_EXCEPTION( FormatError ,
"invalid envelope file" ) ;
47 G_EXCEPTION( FilenameError ,
"invalid envelope filename" ) ;
48 G_EXCEPTION( ReadError ,
"cannot read envelope file" ) ;
61 bool readEnvelope( std::string & reason ,
bool check_for_no_remote_recipients ) ;
69 virtual std::string
name()
const override ;
72 virtual std::string
location()
const override ;
75 virtual bool eightBit()
const override ;
78 virtual const std::string &
from()
const override ;
87 virtual std::string
fromAuthIn()
const override ;
93 virtual void destroy()
override ;
96 virtual void fail(
const std::string & reason ,
int reason_code )
override ;
99 virtual void unfail()
override ;
111 virtual void sync(
bool )
override ;
117 const std::string & eol()
const ;
119 std::string readLine( std::istream & ) ;
120 std::string readValue( std::istream & ,
const std::string & key ) ;
121 std::string value(
const std::string & )
const ;
122 void readFormat( std::istream & stream ) ;
123 void readFlag( std::istream & stream ) ;
124 void readFrom( std::istream & stream ) ;
125 void readFromAuthIn( std::istream & stream ) ;
126 void readFromAuthOut( std::istream & stream ) ;
127 void readToList( std::istream & stream ) ;
128 void readEnd( std::istream & stream ) ;
129 void readReasons( std::istream & stream ) ;
130 void readAuthentication( std::istream & stream ) ;
131 void readClientSocketAddress( std::istream & stream ) ;
132 void readClientSocketName( std::istream & stream ) ;
133 void readClientCertificate( std::istream & stream ) ;
134 void readEnvelopeCore(
bool ) ;
135 void addReason(
const G::Path & path ,
const std::string & ,
int )
const ;
144 std::string m_from_auth_in ;
145 std::string m_from_auth_out ;
149 unique_ptr<std::istream> m_content ;
151 std::string m_authentication ;
152 std::string m_format ;
153 std::string m_client_socket_address ;
154 std::string m_client_socket_name ;
155 std::string m_client_certificate ;
bool readEnvelope(std::string &reason, bool check_for_no_remote_recipients)
Reads the envelope.
virtual void unfail() override
Override from GSmtp::StoredMessage.
SMTP and message-store classes.
virtual const std::string & from() const override
Override from GSmtp::StoredMessage.
std::vector< std::string > StringArray
A std::vector of std::strings.
An abstract interface for messages which have come from the store.
virtual unique_ptr< std::istream > extractContentStream() override
Override from GSmtp::StoredMessage.
virtual std::string fromAuthIn() const override
Override from GSmtp::StoredMessage.
virtual void destroy() override
Override from GSmtp::StoredMessage.
virtual void fail(const std::string &reason, int reason_code) override
Override from GSmtp::StoredMessage.
virtual std::string location() const override
Override from GSmtp::StoredMessage.
virtual std::string authentication() const override
Override from GSmtp::StoredMessage.
virtual size_t errorCount() const override
Override from GSmtp::StoredMessage.
virtual ~StoredFile()
Destructor.
bool openContent(std::string &reason)
Opens the content file.
virtual std::string fromAuthOut() const override
Override from GSmtp::StoredMessage.
A concete derived class implementing the StoredMessage interface.
StoredFile(FileStore &store, const G::Path &envelope_path)
Constructor.
virtual size_t remoteRecipientCount() const override
Override from GSmtp::StoredMessage.
A concrete implementation of the MessageStore interface dealing in paired flat files.
bool lock()
Locks the file by renaming the envelope file.
virtual const G::StringArray & to() const override
Override from GSmtp::StoredMessage.
virtual std::string name() const override
Override from GSmtp::StoredMessage.
A Path object represents a file system path.
virtual void sync(bool) override
Override from GSmtp::StoredMessage.
virtual bool eightBit() const override
Override from GSmtp::StoredMessage.