mail.c revision ad48319996942463675b53877092ab7e13a7a75a
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen/* Copyright (c) 2002-2009 Dovecot authors, see the included COPYING file */
da2aa032ccfa8e7e4a4380ef738014549f4d2c2dTimo Sirainenstruct mail *mail_alloc(struct mailbox_transaction_context *t,
411d6baa37f31d90730e90c4a28c43e1974bbe58Timo Sirainen struct mailbox_header_lookup_ctx *wanted_headers)
7e1f68ad71d3485f1882142837b01f7a98ca8467Timo Sirainen return t->box->v.mail_alloc(t, wanted_fields, wanted_headers);
5ac0b0bf32898c63da086ae169674ecac151a31eTimo Sirainen struct mail_private *p = (struct mail_private *)*mail;
09801f106cd531a28b4e03ec665e44c421264560Timo Sirainenvoid mail_set_seq(struct mail *mail, uint32_t seq)
09801f106cd531a28b4e03ec665e44c421264560Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
212a34c06ff45952c008ae9eec387ced783de6cfPhil Carmodybool mail_set_uid(struct mail *mail, uint32_t uid)
212a34c06ff45952c008ae9eec387ced783de6cfPhil Carmody struct mail_private *p = (struct mail_private *)mail;
0c1835a90dd1dcedaeaedd1cd91672299cbeb5beTimo Sirainenenum mail_flags mail_get_flags(struct mail *mail)
f4735bf7ec2019fdc730e9ebdb39e5a4ea580405Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen struct mail_private *p = (struct mail_private *)mail;
cd56a23e21f1df3f79648cf07e2f4385e2fadebbTimo Sirainenconst char *const *mail_get_keywords(struct mail *mail)
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
1a0ece3e873e3864269ed7eaed957dc10c56d25fTimo Sirainenconst ARRAY_TYPE(keyword_indexes) *mail_get_keyword_indexes(struct mail *mail)
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
c28f6aa0b70af4811c9ace9114fe827c2f503455Timo Sirainenint mail_get_parts(struct mail *mail, const struct message_part **parts_r)
1a0ece3e873e3864269ed7eaed957dc10c56d25fTimo Sirainen struct mail_private *p = (struct mail_private *)mail;
46ce4d9273e6df12ef1912bbdb1c8b84b104f394Timo Sirainenint mail_get_date(struct mail *mail, time_t *date_r, int *timezone_r)
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
07e4875d250e7a7157cd99132aafc773cf3cdf83Timo Sirainen return p->v.get_date(mail, date_r, timezone_r);
7662010b03ffe5f2a6ecf4b4eb220d1c65efea76Timo Sirainenint mail_get_received_date(struct mail *mail, time_t *date_r)
7662010b03ffe5f2a6ecf4b4eb220d1c65efea76Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
0a49b316fc729e5d57268ffa63c7122ac73f994cTimo Sirainenint mail_get_save_date(struct mail *mail, time_t *date_r)
51e1a1c280ccb461a15827f7987d09cb9708b6e3Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
c0435c854a0e7246373b9752d163095cc4fbe985Timo Sirainenint mail_get_virtual_size(struct mail *mail, uoff_t *size_r)
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
602a0434db30d8e3292d1c161a803d96a879a74fTimo Sirainenint mail_get_physical_size(struct mail *mail, uoff_t *size_r)
602a0434db30d8e3292d1c161a803d96a879a74fTimo Sirainen struct mail_private *p = (struct mail_private *)mail;
7d207b1e77a7b5e3fda640e353acfc86d261fedfTimo Sirainenint mail_get_first_header(struct mail *mail, const char *field,
7d207b1e77a7b5e3fda640e353acfc86d261fedfTimo Sirainen const char **value_r)
7d207b1e77a7b5e3fda640e353acfc86d261fedfTimo Sirainen struct mail_private *p = (struct mail_private *)mail;
01f4ee4a0243f3fe9af763e1a540cd5cff0d63f5Timo Sirainen return p->v.get_first_header(mail, field, FALSE, value_r);
4b9f99761df5014c659cd87fddaf6854af428cfcTimo Sirainenint mail_get_first_header_utf8(struct mail *mail, const char *field,
7e1f68ad71d3485f1882142837b01f7a98ca8467Timo Sirainen const char **value_r)
a3c197999dfe2b0c8ea38cb77cfa5e95026005c0Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
923115fd382904fa13bb09bf307bf2835b52df60Timo Sirainen return p->v.get_first_header(mail, field, TRUE, value_r);
7e1f68ad71d3485f1882142837b01f7a98ca8467Timo Sirainenint mail_get_headers(struct mail *mail, const char *field,
89e195dfb5c4b0efd9b9f459771a4467674e5b1fTimo Sirainen const char *const **value_r)
51e1a1c280ccb461a15827f7987d09cb9708b6e3Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
89e195dfb5c4b0efd9b9f459771a4467674e5b1fTimo Sirainen return p->v.get_headers(mail, field, FALSE, value_r);
89e195dfb5c4b0efd9b9f459771a4467674e5b1fTimo Sirainenint mail_get_headers_utf8(struct mail *mail, const char *field,
6f08b98ac63c25b747120d0c8f8e319b4e26ab0fTimo Sirainen const char *const **value_r)
6f08b98ac63c25b747120d0c8f8e319b4e26ab0fTimo Sirainen struct mail_private *p = (struct mail_private *)mail;
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen return p->v.get_headers(mail, field, TRUE, value_r);
c06f4017027263cf3a08becc551f5126409e2a83Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
699fdc186f982f70d990820796eaa0f12133e27cTimo Sirainen return p->v.get_header_stream(mail, headers, stream_r);
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen mail_storage_set_error(mail->box->storage, MAIL_ERROR_NOTPOSSIBLE,
282a436a74d8835edb45cc019b1c916013013fd3Timo Sirainen "Mail field not cached");
282a436a74d8835edb45cc019b1c916013013fd3Timo Sirainenint mail_get_stream(struct mail *mail, struct message_size *hdr_size,
4c096615cb86a826fda377b87df22c579bfe5525Timo Sirainen struct message_size *body_size, struct istream **stream_r)
4c096615cb86a826fda377b87df22c579bfe5525Timo Sirainen struct mail_private *p = (struct mail_private *)mail;
4c096615cb86a826fda377b87df22c579bfe5525Timo Sirainen if (mail->lookup_abort != MAIL_LOOKUP_ABORT_NEVER)
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen return p->v.get_stream(mail, hdr_size, body_size, stream_r);
const char **value_r)
const char *mail_generate_guid_string(void)
static unsigned int pid = 0;
for (i = 0; i < MAILBOX_GUID_SIZE; i++) {
if (guid_128[i] != 0)
return FALSE;
return TRUE;