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

An implementation of the MessageDelivery interface that delivers message files to mailboxes. More...

#include <gfiledelivery.h>

+ Inheritance diagram for GStore::FileDelivery:
+ Collaboration diagram for GStore::FileDelivery:

Classes

struct  Config
 A configuration structure for GStore::FileDelivery. More...
 

Public Member Functions

 FileDelivery (FileStore &, const Config &)
 Constructor. More...
 
 FileDelivery (const FileDelivery &)=delete
 
 FileDelivery (FileDelivery &&)=delete
 
FileDeliveryoperator= (const FileDelivery &)=delete
 
FileDeliveryoperator= (FileDelivery &&)=delete
 
- Public Member Functions inherited from GStore::MessageDelivery
virtual bool deliver (const MessageId &, bool is_new)=0
 Delivers a new or locked message to its local recipients' mailboxes. More...
 
virtual ~MessageDelivery ()=default
 Destructor.
 

Static Public Member Functions

static void deliverTo (FileStore &, std::string_view prefix, const G::Path &dst_dir, const G::Path &envelope_path, const G::Path &content_path, bool hardlink=false, bool pop_by_name=false)
 Low-level function to copy a single message into a mailbox sub-directory or a pop-by-name sub-directory. More...
 

Detailed Description

An implementation of the MessageDelivery interface that delivers message files to mailboxes.

Also provides a low-level delivery function deliverTo().

The deliver() override takes a ".new" or ".busy" message from the file store and delivers it to its local recipient mailbox sub-directories and then deletes the original message files (unless configured with 'no_delete').

Definition at line 49 of file gfiledelivery.h.

Constructor & Destructor Documentation

◆ FileDelivery()

GStore::FileDelivery::FileDelivery ( FileStore store,
const Config config 
)

Constructor.

The delivery base directory is an attribute of the FileStore.

Definition at line 36 of file gfiledelivery.cpp.

Member Function Documentation

◆ deliverTo()

void GStore::FileDelivery::deliverTo ( FileStore ,
std::string_view  prefix,
const G::Path dst_dir,
const G::Path envelope_path,
const G::Path content_path,
bool  hardlink = false,
bool  pop_by_name = false 
)
static

Low-level function to copy a single message into a mailbox sub-directory or a pop-by-name sub-directory.

Throws on error (incorporating the given prefix).

If pop-by-name then only the envelope is copied and the given destination directory is expected to be an immediate sub-directory of the content file's directory.

Does "maildir" delivery if the mailbox directory contains tmp/new/cur sub-directories (if not pop-by-name).

The content file is optionally hard-linked.

The process umask is modified when creating files so that the new files have full group access. The destination directory should normally have sticky group ownership.

Definition at line 102 of file gfiledelivery.cpp.


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