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" ) ;
49 G_EXCEPTION( EditError ,
"cannot update envelope file" ) ;
62 bool readEnvelope( std::string & reason ,
bool check_for_no_remote_recipients ) ;
76 void fail(
const std::string & reason ,
int reason_code )
override ;
80 std::string location()
const override ;
81 int eightBit()
const override ;
82 std::string from()
const override ;
83 std::string to( std::size_t )
const override ;
84 std::size_t toCount()
const override ;
85 std::string authentication()
const override ;
86 std::string fromAuthIn()
const override ;
87 std::string fromAuthOut()
const override ;
88 void close()
override ;
89 std::string reopen()
override ;
90 void destroy()
override ;
91 void unfail()
override ;
92 std::istream & contentStream()
override ;
97 void operator=(
const StoredFile & ) = delete ;
101 enum class State { Normal , Locked , Bad } ;
104 void readEnvelopeCore(
bool check_recipients ) ;
105 const std::string & eol()
const ;
107 void addReason(
const G::Path & path ,
const std::string & ,
int )
const ;
111 std::unique_ptr<std::istream> m_content ;
A structure containing the contents of an envelope file, with support for file reading,...
A concrete implementation of the MessageStore interface dealing in paired flat files.
A somewhat opaque identifer for a MessageStore message.
A concete derived class implementing the StoredMessage interface.
StoredFile(FileStore &store, const G::Path &envelope_path)
Constructor.
void fail(const std::string &reason, int reason_code) override
Override from GSmtp::StoredMessage.
bool lock()
Locks the file by renaming the envelope file.
MessageId id() const override
Override from GSmtp::StoredMessage.
~StoredFile() override
Destructor.
void edit(const G::StringArray &) override
Override from GSmtp::StoredMessage.
bool openContent(std::string &reason)
Opens the content file.
bool readEnvelope(std::string &reason, bool check_for_no_remote_recipients)
Reads the envelope.
An abstract interface for messages which have come from the store.
A Path object represents a file system path.
SMTP and message-store classes.
std::vector< std::string > StringArray
A std::vector of std::strings.