File: sieve-storage-private.h

package info (click to toggle)
dovecot 1:2.2.13-12~deb8u4
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 38,792 kB
  • sloc: ansic: 341,472; sh: 16,920; makefile: 5,393; cpp: 1,474; perl: 265; xml: 44; python: 34; pascal: 27
file content (69 lines) | stat: -rw-r--r-- 1,694 bytes parent folder | download | duplicates (3)
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
/* Copyright (c) 2002-2013 Pigeonhole authors, see the included COPYING file
 */

#ifndef __SIEVE_STORAGE_PRIVATE_H
#define __SIEVE_STORAGE_PRIVATE_H

#include "sieve.h"
#include "sieve-error-private.h"

#include "sieve-storage.h"

#define SIEVE_READ_BLOCK_SIZE (1024*8)

/* How often to scan tmp/ directory for old files (based on dir's atime) */
#define SIEVE_STORAGE_TMP_SCAN_SECS (8*60*60)
/* Delete files having ctime older than this from tmp/. 36h is standard. */
#define SIEVE_STORAGE_TMP_DELETE_SECS (36*60*60)

struct sieve_storage;

struct sieve_storage_ehandler {
	struct sieve_error_handler handler;
	struct sieve_storage *storage;
};

/* All methods returning int return either TRUE or FALSE. */
struct sieve_storage {
	pool_t pool;
	struct sieve_instance *svinst;

	char *name;
	char *dir;

	/* Private */
	char *active_path;
	char *active_fname;
	char *link_path;
	char *error;
	char *username; /* name of user accessing the storage */

	mode_t dir_create_mode;
	mode_t file_create_mode;
	gid_t file_create_gid;

	struct mailbox *inbox;

	uint64_t max_scripts;
	uint64_t max_storage;

	enum sieve_error error_code;
	struct sieve_error_handler *ehandler;

	enum sieve_storage_flags flags;
	time_t prev_mtime;
};

struct sieve_script *sieve_storage_script_init_from_path
	(struct sieve_storage *storage, const char *path, const char *scriptname);

void sieve_storage_inbox_script_attribute_set
	(struct sieve_storage *storage, const char *name);
void sieve_storage_inbox_script_attribute_rename
	(struct sieve_storage *storage, const char *oldname, const char *newname);
void sieve_storage_inbox_script_attribute_unset
	(struct sieve_storage *storage, const char *name);


#endif