E-MailRelay
Public Member Functions | List of all members
GSmtp::NewMessage Class Referenceabstract

An abstract class to allow the creation of a new message in the message store. More...

#include <gnewmessage.h>

+ Inheritance diagram for GSmtp::NewMessage:

Public Member Functions

virtual void addTo (const std::string &to, bool local)=0
 Adds a 'to' address.
 
virtual bool addText (const char *, std::size_t)=0
 Adds a line of content, typically ending with CR-LF. More...
 
virtual bool prepare (const std::string &session_auth_id, const std::string &peer_socket_address, const std::string &peer_certificate)=0
 Prepares to store the message in the message store. More...
 
virtual void commit (bool strict)=0
 Commits the prepare()d message to the store. More...
 
virtual std::string location () const =0
 Returns the message's unique location.
 
virtual MessageId id () const =0
 Returns the message's unique identifier.
 
bool addTextLine (const std::string &)
 A convenience function that calls addText() taking a string parameter and adding CR-LF. More...
 
virtual ~NewMessage ()=default
 Destructor. More...
 

Detailed Description

An abstract class to allow the creation of a new message in the message store.

See also
GSmtp::MessageStore

Definition at line 37 of file gnewmessage.h.

Constructor & Destructor Documentation

◆ ~NewMessage()

virtual GSmtp::NewMessage::~NewMessage ( )
virtualdefault

Destructor.

Rolls back any prepare()d storage if un-commit()ed.

Member Function Documentation

◆ addText()

virtual bool GSmtp::NewMessage::addText ( const char *  ,
std::size_t   
)
pure virtual

Adds a line of content, typically ending with CR-LF.

Returns false on overflow.

◆ addTextLine()

bool GSmtp::NewMessage::addTextLine ( const std::string &  line)

A convenience function that calls addText() taking a string parameter and adding CR-LF.

Definition at line 26 of file gnewmessage.cpp.

◆ commit()

virtual void GSmtp::NewMessage::commit ( bool  strict)
pure virtual

Commits the prepare()d message to the store.

Errors are ignored (eg. missing files) if the 'strict' parameter is false.

◆ prepare()

virtual bool GSmtp::NewMessage::prepare ( const std::string &  session_auth_id,
const std::string &  peer_socket_address,
const std::string &  peer_certificate 
)
pure virtual

Prepares to store the message in the message store.

Returns true if a local-mailbox only message that has been fully written and needs no commit().


The documentation for this class was generated from the following files: