E-MailRelay
Static Public Member Functions | Public Attributes | List of all members
GStore::Envelope Class Reference

A structure containing the contents of an envelope file, with support for file reading, writing and copying. More...

#include <genvelope.h>

+ Collaboration diagram for GStore::Envelope:

Static Public Member Functions

static void read (std::istream &, Envelope &)
 Reads an envelope from a stream. More...
 
static std::size_t write (std::ostream &, const Envelope &)
 Writes an envelope to a seekable stream. More...
 
static void copyExtra (std::istream &, std::ostream &)
 A convenience function to copy extra envelope lines from an envelope input stream to an output stream. More...
 
static MessageStore::BodyType parseSmtpBodyType (const std::string &, MessageStore::BodyType default_=MessageStore::BodyType::Unknown)
 Parses an SMTP MAIL-FROM BODY= parameter. More...
 
static std::string smtpBodyType (MessageStore::BodyType)
 Converts a body type enum into the corresponding SMTP keyword. More...
 

Public Attributes

bool crlf {true}
 
bool utf8_mailboxes {false}
 
MessageStore::BodyType body_type {MessageStore::BodyType::Unknown}
 
std::string from
 
G::StringArray to_local
 
G::StringArray to_remote
 
std::string authentication
 
std::string client_socket_address
 
std::string client_certificate
 
std::string from_auth_in
 
std::string from_auth_out
 
std::string forward_to
 
std::string forward_to_address
 
std::string client_account_selector
 
std::size_t endpos {0U}
 

Detailed Description

A structure containing the contents of an envelope file, with support for file reading, writing and copying.

Definition at line 40 of file genvelope.h.

Member Function Documentation

◆ copyExtra()

void GStore::Envelope::copyExtra ( std::istream &  in,
std::ostream &  out 
)
static

A convenience function to copy extra envelope lines from an envelope input stream to an output stream.

Input lines can be newline delimited, but output is always CR-LF. Throws on input error; output errors are not checked.

Definition at line 99 of file genvelope.cpp.

◆ parseSmtpBodyType()

GStore::MessageStore::BodyType GStore::Envelope::parseSmtpBodyType ( const std::string &  s,
MessageStore::BodyType  default_ = MessageStore::BodyType::Unknown 
)
static

Parses an SMTP MAIL-FROM BODY= parameter.

Returns the given default value if the string is empty.

Definition at line 175 of file genvelope.cpp.

◆ read()

void GStore::Envelope::read ( std::istream &  stream,
GStore::Envelope e 
)
static

Reads an envelope from a stream.

Throws on error. Input lines can be newline delimited, in which case 'crlf' is set false.

Definition at line 113 of file genvelope.cpp.

◆ smtpBodyType()

std::string GStore::Envelope::smtpBodyType ( MessageStore::BodyType  type)
static

Converts a body type enum into the corresponding SMTP keyword.

Definition at line 182 of file genvelope.cpp.

◆ write()

std::size_t GStore::Envelope::write ( std::ostream &  stream,
const Envelope e 
)
static

Writes an envelope to a seekable stream.

Returns the new endpos value. Returns zero and sets the fail state on error, if for example the stream is unseekable. Output lines are CR-LF delimited. The structure 'crlf' and 'endpos' fields should normally be updated after using write().

Definition at line 59 of file genvelope.cpp.

Member Data Documentation

◆ authentication

std::string GStore::Envelope::authentication

Definition at line 81 of file genvelope.h.

◆ body_type

MessageStore::BodyType GStore::Envelope::body_type {MessageStore::BodyType::Unknown}

Definition at line 77 of file genvelope.h.

◆ client_account_selector

std::string GStore::Envelope::client_account_selector

Definition at line 88 of file genvelope.h.

◆ client_certificate

std::string GStore::Envelope::client_certificate

Definition at line 83 of file genvelope.h.

◆ client_socket_address

std::string GStore::Envelope::client_socket_address

Definition at line 82 of file genvelope.h.

◆ crlf

bool GStore::Envelope::crlf {true}

Definition at line 75 of file genvelope.h.

◆ endpos

std::size_t GStore::Envelope::endpos {0U}

Definition at line 89 of file genvelope.h.

◆ forward_to

std::string GStore::Envelope::forward_to

Definition at line 86 of file genvelope.h.

◆ forward_to_address

std::string GStore::Envelope::forward_to_address

Definition at line 87 of file genvelope.h.

◆ from

std::string GStore::Envelope::from

Definition at line 78 of file genvelope.h.

◆ from_auth_in

std::string GStore::Envelope::from_auth_in

Definition at line 84 of file genvelope.h.

◆ from_auth_out

std::string GStore::Envelope::from_auth_out

Definition at line 85 of file genvelope.h.

◆ to_local

G::StringArray GStore::Envelope::to_local

Definition at line 79 of file genvelope.h.

◆ to_remote

G::StringArray GStore::Envelope::to_remote

Definition at line 80 of file genvelope.h.

◆ utf8_mailboxes

bool GStore::Envelope::utf8_mailboxes {false}

Definition at line 76 of file genvelope.h.


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