1
/* Copyright (c) 2002-2009 Dovecot Sieve authors, see the included COPYING file
4
#ifndef __SIEVE_TYPES_H
5
#define __SIEVE_TYPES_H
11
/* Enable runtime trace functionality */
12
#define SIEVE_RUNTIME_TRACE
15
* Forward declarations
21
struct sieve_message_data;
22
struct sieve_script_env;
23
struct sieve_exec_status;
28
* - The mail message + envelope data
31
struct sieve_message_data {
33
const char *return_path;
34
const char *to_address;
35
const char *auth_user;
42
* - Environment for currently executing script
45
struct sieve_script_env {
47
struct mail_namespace *namespaces;
48
const char *default_mailbox;
49
bool mailbox_autocreate;
50
bool mailbox_autosubscribe;
55
const char *postmaster_address;
59
/* Interface for sending mail */
61
(const char *destination, const char *return_path, FILE **file_r);
62
bool (*smtp_close)(void *handle);
64
/* Interface for marking and checking duplicates */
65
int (*duplicate_check)
66
(const void *id, size_t id_size, const char *user);
67
void (*duplicate_mark)
68
(const void *id, size_t id_size, const char *user, time_t time);
70
/* Execution status record */
71
struct sieve_exec_status *exec_status;
74
struct ostream *trace_stream;
77
#define SIEVE_SCRIPT_DEFAULT_MAILBOX(senv) \
78
(senv->default_mailbox == NULL ? "INBOX" : senv->default_mailbox )
81
* Script executionstatus
84
struct sieve_exec_status {
86
bool message_forwarded;
87
bool tried_default_save;
89
struct mail_storage *last_storage;
93
* Execution exit codes
96
enum sieve_execution_exitcode {
98
SIEVE_EXEC_FAILURE = 0,
99
SIEVE_EXEC_BIN_CORRUPT = -1,
100
SIEVE_EXEC_KEEP_FAILED = -2
103
#endif /* __SIEVE_TYPES_H */