# HG changeset patch # User Josef 'Jeff' Sipek # Date 1518995236 18000 # Node ID 9a52b8a91de0bb3e58b02d61374294cde0dafbeb # Parent 6012215fe5dc9647958a101dc2e561861795c685 lib-storage: Generate snippet while saving new mails diff -r 6012215fe5dc -r 9a52b8a91de0 src/lib-storage/index/index-mail-headers.c --- a/src/lib-storage/index/index-mail-headers.c Mon Feb 19 15:43:31 2018 +0200 +++ b/src/lib-storage/index/index-mail-headers.c Sun Feb 18 18:07:16 2018 -0500 @@ -386,6 +386,10 @@ mail->data.save_sent_date = TRUE; mail->data.save_bodystructure_header = TRUE; mail->data.save_bodystructure_body = TRUE; + /* Don't unnecessarily waste time generating a snippet, since it's + not as cheap as the others to generate. */ + if (index_mail_want_cache(mail, MAIL_CACHE_BODY_SNIPPET)) + mail->data.save_body_snippet = TRUE; mail->data.tee_stream = tee_i_stream_create(input); input = tee_i_stream_create_child(mail->data.tee_stream);