E-MailRelay
src
gstore
gmessagedelivery.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2001-2024 Graeme Walker <graeme_walker@users.sourceforge.net>
3
//
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
// ===
17
///
18
/// \file gmessagedelivery.h
19
///
20
21
#ifndef G_MESSAGE_DELIVERY_H
22
#define G_MESSAGE_DELIVERY_H
23
24
#include "gdef.h"
25
#include "
gmessagestore.h
"
26
#include <string>
27
28
namespace
GStore
29
{
30
class
MessageDelivery ;
31
}
32
33
//| \class GStore::MessageDelivery
34
/// An interface to deliver a message to its local recipients' mailboxes.
35
///
36
/// This interface is typically used to implement a delivery filter:
37
/// \code
38
/// struct Filter : GSmtp::Filter {
39
/// void start( MessageId ) override ;
40
/// MessageDelivery* m_delivery ;
41
/// ...
42
/// } ;
43
/// void Filter::start( MessageId id )
44
/// {
45
/// assert( m_filter_type == Filter::Type::server ) ;
46
/// m_delivery->deliver( id ) ;
47
/// m_timer.startTimer( 0 ) ;
48
/// }
49
/// \endcode
50
///
51
class
GStore::MessageDelivery
52
{
53
public
:
54
virtual
bool
deliver
(
const
MessageId
& ,
bool
is_new ) = 0 ;
55
///< Delivers a new or locked message to its local recipients'
56
///< mailboxes. Does nothing if there are no local recipients.
57
///< If all the recipients are local then the message might
58
///< be removed from the store. Returns true iff the message
59
///< has been removed.
60
61
virtual
~MessageDelivery
() = default ;
62
///< Destructor.
63
} ;
64
65
#endif
GStore::MessageDelivery
An interface to deliver a message to its local recipients' mailboxes.
Definition:
gmessagedelivery.h:52
GStore::MessageDelivery::~MessageDelivery
virtual ~MessageDelivery()=default
Destructor.
GStore::MessageDelivery::deliver
virtual bool deliver(const MessageId &, bool is_new)=0
Delivers a new or locked message to its local recipients' mailboxes.
GStore::MessageId
A somewhat opaque identifer for a GStore::MessageStore message id.
Definition:
gmessagestore.h:43
gmessagestore.h
GStore
Message store classes.
Definition:
genvelope.cpp:30
Generated by
1.9.3