annotate src/deliver/deliver.h @ 8220:8e5c93f37e48 HEAD

deliver: Moved mailbox autocreate/autosubscribe settings to struct deliver_settings.
author Timo Sirainen <tss@iki.fi>
date Mon, 29 Sep 2008 12:43:09 +0300
parents 0307382cf011
children f6ef01a25db9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 5661
diff changeset
1 #ifndef DELIVER_H
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 5661
diff changeset
2 #define DELIVER_H
4347
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 #include <sysexits.h>
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5
7825
0307382cf011 HP-UX: Added missing EX_CONFIG macro
Timo Sirainen <tss@iki.fi>
parents: 6948
diff changeset
6 #ifndef EX_CONFIG
0307382cf011 HP-UX: Added missing EX_CONFIG macro
Timo Sirainen <tss@iki.fi>
parents: 6948
diff changeset
7 # define EX_CONFIG 78 /* HP-UX */
0307382cf011 HP-UX: Added missing EX_CONFIG macro
Timo Sirainen <tss@iki.fi>
parents: 6948
diff changeset
8 #endif
0307382cf011 HP-UX: Added missing EX_CONFIG macro
Timo Sirainen <tss@iki.fi>
parents: 6948
diff changeset
9
4347
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 #include "lib.h"
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11 #include "mail-storage.h"
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12
5661
f18a7fd8ac9a Added rejection_reason setting for deliver.
Timo Sirainen <tss@iki.fi>
parents: 5500
diff changeset
13 #define DEFAULT_MAIL_REJECTION_HUMAN_REASON \
f18a7fd8ac9a Added rejection_reason setting for deliver.
Timo Sirainen <tss@iki.fi>
parents: 5500
diff changeset
14 "Your message to <%t> was automatically rejected:%n%r"
6948
6b5f89c41de5 Added deliver_log_format setting to control what's logged when a mail is
Timo Sirainen <tss@iki.fi>
parents: 6515
diff changeset
15 #define DEFAULT_LOG_FORMAT "msgid=%m: %$"
5661
f18a7fd8ac9a Added rejection_reason setting for deliver.
Timo Sirainen <tss@iki.fi>
parents: 5500
diff changeset
16
4347
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
17 struct deliver_settings {
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
18 const char *hostname;
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
19 const char *postmaster_address;
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
20 const char *sendmail_path;
5661
f18a7fd8ac9a Added rejection_reason setting for deliver.
Timo Sirainen <tss@iki.fi>
parents: 5500
diff changeset
21 const char *rejection_reason;
6948
6b5f89c41de5 Added deliver_log_format setting to control what's logged when a mail is
Timo Sirainen <tss@iki.fi>
parents: 6515
diff changeset
22 const char *log_format;
8220
8e5c93f37e48 deliver: Moved mailbox autocreate/autosubscribe settings to struct deliver_settings.
Timo Sirainen <tss@iki.fi>
parents: 7825
diff changeset
23 bool mailbox_autosubscribe;
8e5c93f37e48 deliver: Moved mailbox autocreate/autosubscribe settings to struct deliver_settings.
Timo Sirainen <tss@iki.fi>
parents: 7825
diff changeset
24 bool mailbox_autocreate;
4347
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
25 };
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
26
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
27 extern struct deliver_settings *deliver_set;
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
28
5500
4862cb37106c Moved namespace handling to lib-storage. Beginnings of namespace support for
Timo Sirainen <tss@iki.fi>
parents: 5220
diff changeset
29 typedef int deliver_mail_func_t(struct mail_namespace *namespaces,
4862cb37106c Moved namespace handling to lib-storage. Beginnings of namespace support for
Timo Sirainen <tss@iki.fi>
parents: 5220
diff changeset
30 struct mail_storage **storage_r,
4862cb37106c Moved namespace handling to lib-storage. Beginnings of namespace support for
Timo Sirainen <tss@iki.fi>
parents: 5220
diff changeset
31 struct mail *mail,
6515
95eb92b49d9c Added -a parameter to specify authentication username. It can be used to
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
32 const char *destaddr, const char *mailbox);
4347
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
33
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
34 extern deliver_mail_func_t *deliver_mail;
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
35
5220
7fbdcce95982 Keep only TZ and HOME environments when calling sendmail.
Timo Sirainen <tss@iki.fi>
parents: 4347
diff changeset
36 void deliver_env_clean(void);
7fbdcce95982 Keep only TZ and HOME environments when calling sendmail.
Timo Sirainen <tss@iki.fi>
parents: 4347
diff changeset
37
4347
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
38 /* Save a mail into given mailbox with given flags and keywords. */
5500
4862cb37106c Moved namespace handling to lib-storage. Beginnings of namespace support for
Timo Sirainen <tss@iki.fi>
parents: 5220
diff changeset
39 int deliver_save(struct mail_namespace *namespaces,
4862cb37106c Moved namespace handling to lib-storage. Beginnings of namespace support for
Timo Sirainen <tss@iki.fi>
parents: 5220
diff changeset
40 struct mail_storage **storage_r, const char *mailbox,
4347
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
41 struct mail *mail, enum mail_flags flags,
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
42 const char *const *keywords);
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
43
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
44 /* Extracts user@domain from Return-Path header. Returns NULL if not found. */
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
45 const char *deliver_get_return_address(struct mail *mail);
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
46
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
47 /* Returns a new unique Message-ID */
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
48 const char *deliver_get_new_message_id(void);
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
49
a73d2867f6e1 Moved all the non-Sieve code from dovecot-lda in here and rewrote parts of
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
50 #endif