*value_r = data->envelope;
return 0;
case MAIL_FETCH_FROM_ENVELOPE:
+ *value_r = data->from_envelope != NULL ?
+ data->from_envelope : "";
+ return 0;
case MAIL_FETCH_UIDL_FILE_NAME:
case MAIL_FETCH_UIDL_BACKEND:
case MAIL_FETCH_SEARCH_RELEVANCY:
{
return 0;
}
+
+void index_mail_save_finish(struct mail_save_context *ctx)
+{
+ struct index_mail *imail = (struct index_mail *)ctx->dest_mail;
+
+ if (imail == NULL)
+ return;
+
+ if (ctx->from_envelope != NULL && imail->data.from_envelope == NULL) {
+ imail->data.from_envelope =
+ p_strdup(imail->data_pool, ctx->from_envelope);
+ }
+}
struct message_part *parts;
const char *envelope, *body, *bodystructure, *uid_string, *guid;
+ const char *from_envelope;
struct message_part_envelope_data *envelope_data;
uint32_t seq;
int index_mail_cache_lookup_field(struct index_mail *mail, buffer_t *buf,
unsigned int field_idx);
+void index_mail_save_finish(struct mail_save_context *ctx);
#endif
void index_save_context_free(struct mail_save_context *ctx)
{
+ index_mail_save_finish(ctx);
i_free_and_null(ctx->from_envelope);
i_free_and_null(ctx->guid);
i_free_and_null(ctx->pop3_uidl);
}
return 0;
}
-