21#ifndef G_SMTP_STORED_MESSAGE_H
22#define G_SMTP_STORED_MESSAGE_H
35 class StoredMessageStub ;
51 virtual std::string
from()
const = 0 ;
54 virtual std::string
to( std::size_t )
const = 0 ;
78 virtual void fail(
const std::string & reason ,
int reason_code ) = 0 ;
120 std::string location()
const override ;
121 std::string from()
const override ;
122 std::string to( std::size_t )
const override ;
123 std::size_t toCount()
const override ;
124 std::istream & contentStream()
override ;
125 void close()
override ;
126 std::string reopen()
override ;
127 void destroy()
override ;
129 void fail(
const std::string & reason ,
int reason_code )
override ;
130 void unfail()
override ;
131 int eightBit()
const override ;
132 std::string authentication()
const override ;
133 std::string fromAuthIn()
const override ;
134 std::string fromAuthOut()
const override ;
144 std::ifstream m_content_stream ;
148inline std::string GSmtp::StoredMessageStub::location()
const {
return std::string() ; }
149inline std::string GSmtp::StoredMessageStub::from()
const {
return std::string() ; }
150inline std::string GSmtp::StoredMessageStub::to( std::size_t )
const {
return std::string() ; }
151inline std::size_t GSmtp::StoredMessageStub::toCount()
const {
return 0U ; }
152inline std::istream & GSmtp::StoredMessageStub::contentStream() {
return m_content_stream ; }
153inline void GSmtp::StoredMessageStub::close() {}
154inline std::string GSmtp::StoredMessageStub::reopen() {
return std::string() ; }
155inline void GSmtp::StoredMessageStub::destroy() {}
156inline void GSmtp::StoredMessageStub::edit(
const G::StringArray & ) {}
157inline void GSmtp::StoredMessageStub::fail(
const std::string & ,
int ) {}
158inline void GSmtp::StoredMessageStub::unfail() {}
159inline int GSmtp::StoredMessageStub::eightBit()
const {
return false ; }
160inline std::string GSmtp::StoredMessageStub::authentication()
const {
return std::string() ; }
161inline std::string GSmtp::StoredMessageStub::fromAuthIn()
const {
return std::string() ; }
162inline std::string GSmtp::StoredMessageStub::fromAuthOut()
const {
return std::string() ; }
A somewhat opaque identifer for a MessageStore message.
static MessageId none()
Returns an in-valid() id.
A StoredMessage class that does nothing and can be used as a placeholder.
StoredMessageStub()
Constructor.
~StoredMessageStub() override
Destructor.
An abstract interface for messages which have come from the store.
virtual int eightBit() const =0
Returns 1 if the message content (header+body) contains a character with the most significant bit set...
virtual MessageId id() const =0
Returns the message identifier.
virtual void destroy()=0
Deletes the message within the store.
virtual ~StoredMessage()=default
Destructor.
virtual std::istream & contentStream()=0
Returns a reference to the content stream.
virtual void edit(const G::StringArray &new_to_list)=0
Edits the message by updating the list of non-local recipients to the given non-empty list.
virtual std::string reopen()=0
Reverses a close(), returning the empty string on success or an error reason.
virtual void fail(const std::string &reason, int reason_code)=0
Marks the message as failed within the store.
virtual std::string from() const =0
Returns the envelope 'from' field.
virtual std::string to(std::size_t) const =0
Returns the requested envelope non-local recipient or the empty string if out of range.
virtual std::string fromAuthIn() const =0
Returns the incoming "mail from" auth parameter, either empty, xtext-encoded or "<>".
virtual std::string location() const =0
Returns the message location.
virtual std::size_t toCount() const =0
Returns the number of non-local recipients.
virtual std::string fromAuthOut() const =0
Returns the outgoing "mail from" auth parameter, either empty, xtext-encoded or "<>".
virtual std::string authentication() const =0
Returns the original session authentication id.
virtual void unfail()=0
Marks the message as unfailed within the store.
virtual void close()=0
Releases the message to allow external editing.
SMTP and message-store classes.
std::vector< std::string > StringArray
A std::vector of std::strings.