-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstore.c
87 lines (72 loc) · 1.3 KB
/
store.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include "config.h"
/* XXXmanu licence? */
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#ifdef __RCSID
__RCSID("$Id: store.c,v 1.1 2009/04/19 00:55:32 manu Exp $");
#endif
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <errno.h>
#include <ctype.h>
#include <sysexits.h>
#ifdef HAVE_OLD_QUEUE_H
#include "queue.h"
#else
#include <sys/queue.h>
#endif
#include "dump.h"
#include "pending.h"
#include "store.h"
#include "conf.h"
#include "sync.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*
* Initialize storage backend. No lock needed
*/
void mg_init(void) {
dump_init();
pending_init();
dump_reload(); /* Reload a saved greylist */
return;
}
/*
* Start storage thread
*/
void mg_start(void) {
/*
* Start the dumper thread
*/
dumper_start();
/*
* Run the peer MX greylist sync threads
*/
sync_master_restart();
sync_sender_start();
return;
}
tuple_t mg_tuple_check(tuple)
struct tuple_fields tuple;
{
return pending_check(tuple.sa, tuple.salen,
tuple.from, tuple.rcpt, tuple.remaining, tuple.elapsed,
tuple.queueid, tuple.gldelay, tuple.autowhite);
}
/*
* stop storage background threads
*/
void mg_tuple_stop(void) {
dumper_stop();
return;
}
/*
* close storage backend
*/
void mg_tuple_close(void) {
return;
}