E-MailRelay

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

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

`#include <gmessagestore.h>`

Inheritance diagram for GSmtp::MessageStore:

## Classes
struct | Iterator
| A base class for GSmtp::MessageStore iterators. More...

## Public Member Functions
virtual | ~MessageStore ()=default
| Destructor.
virtual std::unique_ptr< NewMessage > | newMessage (const std::string &from, const std::string &from_auth_in, const std::string &from_auth_out)=0
| Creates a new message. More...
virtual bool | empty () const =0
| Returns true if the message store is empty. More...
virtual std::string | location (const MessageId &) const =0
| Returns the location of the given message. More...
virtual std::unique_ptr< StoredMessage > | get (const MessageId &)=0
| Pulls the specified message out of the store. More...
virtual std::shared_ptr< Iterator > | iterator (bool lock)=0
| Returns an iterator for stored messages. More...
virtual std::shared_ptr< Iterator > | failures ()=0
| Returns an iterator for failed messages. More...
virtual void | unfailAll ()=0
| Causes messages marked as failed to be unmarked.
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 ()=0
| Provides a signal which is when something might have changed in the store. More...
virtual G::Slot::Signal & | messageStoreRescanSignal ()=0
| Provides a signal which is emitted when rescan() is called. More...

## Static Public Member Functions
static G::Path | defaultDirectory ()
| Returns a default spool directory, such as "/var/spool/emailrelay". More...

## Detailed Description

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

See also
  GSmtp::NewMessage, GSmtp::StoredMessage, GSmtp::ProtocolMessage

Definition at line 72 of file gmessagestore.h.

## Member Function Documentation

## ◆ defaultDirectory()

G::Path GSmtp::MessageStore::defaultDirectory | ( |  | ) |
| static

Returns a default spool directory, such as "/var/spool/emailrelay".

(Typically with an os-specific implementation.)

Definition at line 30 of file gmessagestore_unix.cpp.

## ◆ empty()

virtual bool GSmtp::MessageStore::empty | ( |  | ) | const
| pure virtual

Returns true if the message store is empty.

Implemented in GSmtp::FileStore.

## ◆ failures()

virtual std::shared_ptr< Iterator > GSmtp::MessageStore::failures | ( |  | ) |
| pure virtual

Returns an iterator for failed messages.

Implemented in GSmtp::FileStore.

## ◆ get()

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

Pulls the specified message out of the store.

Throws execptions on error.

As a side effect some stored messages may be marked as bad, or deleted (if they have no recipients).

Implemented in GSmtp::FileStore.

## ◆ iterator()

virtual std::shared_ptr< Iterator > GSmtp::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.

If 'lock' is true invalid messages having no receipients are not returned by the iterator.

If 'lock' is true then as a side effect of iteration some stored messages may be marked as bad, or get deleted if they have no recipients.

Implemented in GSmtp::FileStore.

## ◆ location()

virtual std::string GSmtp::MessageStore::location | ( | const MessageId & |  | ) | const
| pure virtual

Returns the location of the given message.

Implemented in GSmtp::FileStore.

## ◆ messageStoreRescanSignal()

virtual G::Slot::Signal & GSmtp::MessageStore::messageStoreRescanSignal | ( |  | ) |
| pure virtual

Provides a signal which is emitted when rescan() is called.

Implemented in GSmtp::FileStore.

## ◆ messageStoreUpdateSignal()

virtual G::Slot::Signal & GSmtp::MessageStore::messageStoreUpdateSignal | ( |  | ) |
| pure virtual

Provides a signal which is when something might have changed in the store.

Implemented in GSmtp::FileStore.

## ◆ newMessage()

virtual std::unique_ptr< NewMessage > GSmtp::MessageStore::newMessage | ( | const std::string & | from,
|  | const std::string & | from_auth_in,
|  | const std::string & | from_auth_out
| ) |  |
| pure virtual

Creates a new message.

Implemented in GSmtp::FileStore.

## ◆ updated()

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

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

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

Implemented in GSmtp::FileStore.

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

- /usr/src/slapt-src-x86_64/network/emailrelay/emailrelay-2.3/src/gsmtp/gmessagestore.h
- /usr/src/slapt-src-x86_64/network/emailrelay/emailrelay-2.3/src/gsmtp/gmessagestore_unix.cpp