21#ifndef G_SMTP_PROTOCOL_MESSAGE_H
22#define G_SMTP_PROTOCOL_MESSAGE_H
35 class ProtocolMessage ;
72 std::string response ;
76 using AddressStyle = GStore::MessageStore::AddressStyle ;
81 bool smtputf8 {
true} ;
82 AddressStyle address_style {AddressStyle::Ascii} ;
88 AddressStyle address_style ;
121 virtual GStore::NewMessage::Status
addContent(
const char * , std::size_t ) = 0 ;
136 virtual std::string
from()
const = 0 ;
145 virtual void process(
const std::string & session_auth_id ,
const std::string & peer_socket_address ,
146 const std::string & peer_certificate ) = 0 ;
An interface used by the ServerProtocol class to assemble and process an incoming message.
virtual bool addTo(const ToInfo &to)=0
Adds an envelope 'to'.
virtual void clear()=0
Clears the message state and terminates any asynchronous message processing.
virtual ProcessedSignal & processedSignal()=0
Returns a signal which is raised once process() has completed.
virtual ~ProtocolMessage()=default
Destructor.
virtual void reset()=0
Clears the message state, terminates any asynchronous message processing and resets the object as if ...
virtual GStore::MessageId setFrom(const std::string &from_user, const FromInfo &)=0
Sets the message envelope 'from' address etc.
virtual std::size_t contentSize() const =0
Returns the current content size.
virtual std::string from() const =0
Returns the setFrom() user string.
virtual GStore::NewMessage::Status addContent(const char *, std::size_t)=0
Adds content.
virtual void addReceived(const std::string &)=0
Adds a 'received' line to the start of the content.
void addContentLine(const std::string &)
A convenience function that calls addContent() taking a string parameter and adding CR-LF.
virtual std::string bodyType() const =0
Returns the setFrom() body type, fromInfo().body.
virtual void process(const std::string &session_auth_id, const std::string &peer_socket_address, const std::string &peer_certificate)=0
Starts asynchronous processing of the message.
virtual FromInfo fromInfo() const =0
Returns the setFrom() extra info.
A structure returned by GSmtp::Verifier to describe the status of a 'rcpt-to' or 'vrfy' recipient.
A somewhat opaque identifer for a GStore::MessageStore message id.
Extra information from the SMTP MAIL-FROM command passed to GSmtp::ProtocolMessage::setFrom().
Parameters for GSmtp::ProtocolMessage::processedSignal()
Extra information passed to GSmtp::ProtocolMessage::addTo().