raw-mail.c revision b0a901f1dbe9e05ac1c92a0974af6bce0274f31a
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
45312f52ff3a3d4c137447be4c7556500c2f8bf2Timo Sirainen/* Copyright (c) 2007-2009 Dovecot authors, see the included COPYING file */
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct raw_mailbox *mbox = (struct raw_mailbox *)mail->box;
b0a901f1dbe9e05ac1c92a0974af6bce0274f31aTimo Sirainen struct mail_private *p = (struct mail_private *)mail;
ebe6df72f1309135f02b6a4d2aef1e81a073f91cTimo Sirainen if (mail->lookup_abort == MAIL_LOOKUP_ABORT_NOT_IN_CACHE)
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstatic int raw_mail_get_received_date(struct mail *_mail, time_t *date_r)
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct index_mail *mail = (struct index_mail *)_mail;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct raw_mailbox *mbox = (struct raw_mailbox *)_mail->box;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen *date_r = mail->data.received_date = mbox->mtime;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstatic int raw_mail_get_save_date(struct mail *_mail, time_t *date_r)
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct index_mail *mail = (struct index_mail *)_mail;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct raw_mailbox *mbox = (struct raw_mailbox *)_mail->box;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenstatic int raw_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct index_mail *mail = (struct index_mail *)_mail;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct raw_mailbox *mbox = (struct raw_mailbox *)_mail->box;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen *size_r = mail->data.physical_size = mbox->size;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainenraw_mail_get_stream(struct mail *_mail, struct message_size *hdr_size,
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct message_size *body_size, struct istream **stream_r)
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct index_mail *mail = (struct index_mail *)_mail;
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen struct raw_mailbox *mbox = (struct raw_mailbox *)_mail->box;
ba7feb1cccc99ce1e8a03d35ca024192ea9233b1Timo Sirainen /* we can't just reference mbox->input, because
ba7feb1cccc99ce1e8a03d35ca024192ea9233b1Timo Sirainen index_mail_close() expects to be able to free the stream */
ba7feb1cccc99ce1e8a03d35ca024192ea9233b1Timo Sirainen i_stream_create_limit(mbox->input, (uoff_t)-1);
4146f38412c650f4d0e100cf22d7b32e7d24b2b6Timo Sirainen return index_mail_init_stream(mail, hdr_size, body_size, stream_r);
8fa302c0c0f110aecf266d20673aae567bd77f3bTimo Sirainenraw_mail_get_special(struct mail *_mail, enum mail_fetch_field field,
8fa302c0c0f110aecf266d20673aae567bd77f3bTimo Sirainen const char **value_r)
8fa302c0c0f110aecf266d20673aae567bd77f3bTimo Sirainen struct raw_mailbox *mbox = (struct raw_mailbox *)_mail->box;
80cc932b7d4fd914ed6ccb68e988e9002118d5deTimo Sirainen *value_r = mbox->have_filename ? mbox->path : "";