1 #ifndef RAW_STORAGE_H
2 #define RAW_STORAGE_H
3 
4 #include "index-storage.h"
5 
6 #define RAW_STORAGE_NAME "raw"
7 #define RAW_SUBSCRIPTION_FILE_NAME "subscriptions"
8 
9 struct raw_storage {
10 	struct mail_storage storage;
11 };
12 
13 struct raw_mailbox {
14 	struct mailbox box;
15 	struct raw_storage *storage;
16 
17 	time_t mtime, ctime;
18 	uoff_t size;
19 	const char *envelope_sender;
20 
21 	bool synced:1;
22 	bool have_filename:1;
23 };
24 
25 #define RAW_STORAGE(s)		container_of(s, struct raw_storage, storage)
26 #define RAW_MAILBOX(s)		container_of(s, struct raw_mailbox, box)
27 
28 extern struct mail_vfuncs raw_mail_vfuncs;
29 
30 struct mail_user *
31 raw_storage_create_from_set(const struct setting_parser_info *set_info,
32 			    const struct mail_user_settings *set);
33 
34 int raw_mailbox_alloc_stream(struct mail_user *user, struct istream *input,
35 			     time_t received_time, const char *envelope_sender,
36 			     struct mailbox **box_r);
37 int raw_mailbox_alloc_path(struct mail_user *user, const char *path,
38 			   time_t received_time, const char *envelope_sender,
39 			   struct mailbox **box_r);
40 
41 #endif
42