E-MailRelay

Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
GStore::MessageStore Class Referenceabstract

A class which allows SMTP messages to be stored and retrieved. More...

`#include <gmessagestore.h>`

Inheritance diagram for GStore::MessageStore:
[legend]

## Classes
struct | Iterator
| A base class for GStore::MessageStore iterators. More...
struct | SmtpInfo
| Information on the SMTP options used when submitted. More...

## Public Types
enum class | AddressStyle { Invalid , Ascii , Utf8Mailbox , Utf8Domain , Utf8Both }
enum class | BodyType { Unknown = -1 , SevenBit , EightBitMime , BinaryMime }

## Public Member Functions
virtual | ~MessageStore ()=default
| Destructor.
virtual std::unique_ptr< NewMessage > | newMessage (const std::string &from, const SmtpInfo &smtp_info, const std::string &from_auth_out)=0
| Creates a new message.
virtual bool | empty () const =0
| Returns true if the message store is empty.
virtual std::string | location (const MessageId &) const =0
| Returns the location of the given message.
virtual std::unique_ptr< StoredMessage > | get (const MessageId &id)=0
| Pulls the specified message out of the store. More...
virtual std::unique_ptr< Iterator > | iterator (bool lock)=0
| Returns an iterator for stored messages. More...
virtual std::vector< MessageId > | ids ()=0
| Returns a list of spooled message ids (excluding new or locked messages).
virtual std::vector< MessageId > | failures ()=0
| Returns a list of failed message ids.
virtual void | unfailAll ()=0
| Unfails all failed messages.
virtual void | rescan ()=0
| Requests that a messageStoreRescanSignal() is emitted.
virtual void | updated ()=0
| Called by associated classes to indicate that the store has changed. More...
virtual G::Slot::Signal & | messageStoreUpdateSignal () noexcept=0
| Provides a signal which is emitted when something might have changed in the store.
virtual G::Slot::Signal & | messageStoreRescanSignal () noexcept=0
| Provides a signal which is emitted when rescan() is called.

## Static Public Member Functions
static AddressStyle | addressStyle (std::string_view address)
| Parses an address to determine whether it has ASCII or UTF-8 parts. More...

## Detailed Description

A class which allows SMTP messages to be stored and retrieved.

See also
  GStore::NewMessage, GStore::StoredMessage, GStore::ProtocolMessage

Definition at line 72 of file gmessagestore.h.

## Member Enumeration Documentation

## ◆ AddressStyle

enum class GStore::MessageStore::AddressStyle
| strong

Definition at line 75 of file gmessagestore.h.

## ◆ BodyType

enum class GStore::MessageStore::BodyType
| strong

Definition at line 89 of file gmessagestore.h.

## Member Function Documentation

## ◆ addressStyle()

GStore::MessageStore::AddressStyle GStore::MessageStore::addressStyle | ( | std::string_view | address | ) |
| static

Parses an address to determine whether it has ASCII or UTF-8 parts.

See also RFC-5198.

Definition at line 33 of file gmessagestore.cpp.

## ◆ get()

virtual std::unique_ptr< StoredMessage > GStore::MessageStore::get | ( | const MessageId & | id | ) |
| pure virtual

Pulls the specified message out of the store.

Throws execptions on error.

## ◆ iterator()

virtual std::unique_ptr< Iterator > GStore::MessageStore::iterator | ( | bool | lock | ) |
| pure virtual

Returns an iterator for stored messages.

If 'lock' is true then stored messages returned by the iterator are locked. They can then be deleted by StoredMessage::destroy() once they have been fully processed.

## ◆ updated()

virtual void GStore::MessageStore::updated | ( |  | ) |
| pure virtual

Called by associated classes to indicate that the store has changed.

Implementations must cause the messageStoreUpdateSignal() signal to be emitted.

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

- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/gstore/gmessagestore.h
- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/gstore/gmessagestore.cpp