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

A structure returned by GSmtp::Verifier to describe the status of a 'rcpt-to' or 'vrfy' recipient. More...

#include <gverifierstatus.h>

Public Member Functions

std::string str () const
 Returns a string representation of the structure. More...
 

Static Public Member Functions

static VerifierStatus invalid (const std::string &recipient, bool temporary=false, const std::string &response={}, const std::string &reason={})
 Factory for an invalid address. More...
 
static VerifierStatus remote (const std::string &recipient, const std::string &address={})
 Constructor for a valid remote mailbox. More...
 
static VerifierStatus local (const std::string &recipient, const std::string &full_name, const std::string &mbox)
 Constructor for a valid local mailbox. More...
 
static VerifierStatus parse (const std::string &str)
 Parses a str() string into a structure. More...
 

Public Attributes

bool is_valid {false}
 
bool is_local {false}
 
bool temporary {false}
 
bool abort {false}
 
std::string recipient
 
std::string full_name
 
std::string address
 
std::string response
 
std::string reason
 

Detailed Description

A structure returned by GSmtp::Verifier to describe the status of a 'rcpt-to' or 'vrfy' recipient.

If describing an invalid recipient then 'is_valid' is set false and a 'response' is supplied. The response is typically reported back to the submitter, so it should not contain too much detail.

The 'reason' string can be added by the user of the verifier to give more context in the log in addition to 'response'.

If a valid local recipient then 'is_local' is set true, 'full_name' is set to the full description of the mailbox and 'address' is set to the recipient's mailbox name (which should not have an at sign).

If a valid remote recipient then 'is_local' is set false, 'full_name' is empty, and 'address' is typically a copy of the original recipient.

Definition at line 51 of file gverifierstatus.h.

Member Function Documentation

◆ invalid()

GSmtp::VerifierStatus GSmtp::VerifierStatus::invalid ( const std::string &  recipient,
bool  temporary = false,
const std::string &  response = {},
const std::string &  reason = {} 
)
static

Factory for an invalid address.

Definition at line 31 of file gverifierstatus.cpp.

◆ local()

GSmtp::VerifierStatus GSmtp::VerifierStatus::local ( const std::string &  recipient,
const std::string &  full_name,
const std::string &  mbox 
)
static

Constructor for a valid local mailbox.

Definition at line 54 of file gverifierstatus.cpp.

◆ parse()

GSmtp::VerifierStatus GSmtp::VerifierStatus::parse ( const std::string &  str)
static

Parses a str() string into a structure.

Definition at line 66 of file gverifierstatus.cpp.

◆ remote()

GSmtp::VerifierStatus GSmtp::VerifierStatus::remote ( const std::string &  recipient,
const std::string &  address = {} 
)
static

Constructor for a valid remote mailbox.

Definition at line 43 of file gverifierstatus.cpp.

◆ str()

std::string GSmtp::VerifierStatus::str ( ) const

Returns a string representation of the structure.

Definition at line 95 of file gverifierstatus.cpp.

Member Data Documentation

◆ abort

bool GSmtp::VerifierStatus::abort {false}

Definition at line 80 of file gverifierstatus.h.

◆ address

std::string GSmtp::VerifierStatus::address

Definition at line 83 of file gverifierstatus.h.

◆ full_name

std::string GSmtp::VerifierStatus::full_name

Definition at line 82 of file gverifierstatus.h.

◆ is_local

bool GSmtp::VerifierStatus::is_local {false}

Definition at line 78 of file gverifierstatus.h.

◆ is_valid

bool GSmtp::VerifierStatus::is_valid {false}

Definition at line 77 of file gverifierstatus.h.

◆ reason

std::string GSmtp::VerifierStatus::reason

Definition at line 85 of file gverifierstatus.h.

◆ recipient

std::string GSmtp::VerifierStatus::recipient

Definition at line 81 of file gverifierstatus.h.

◆ response

std::string GSmtp::VerifierStatus::response

Definition at line 84 of file gverifierstatus.h.

◆ temporary

bool GSmtp::VerifierStatus::temporary {false}

Definition at line 79 of file gverifierstatus.h.


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