<div dir="ltr">Thanks Aki,<div><br></div><div>Just a followup regarding this. I set 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">"mail_always_cache_fields" to the following in dovecot configuration file: </span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px">mail_cache_fields = flags,imap.body,imap.bodystructure</span><br></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px">mail_always_cache_fields = imap.body,imap.bodystructure</span><br></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px"><br></span></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px">I run the following command to ensure that these configurations have an effect on the caching behavior: </span></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px"><br></span></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px">doveadm index -u bob INBOX</span><br></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px"><br></span></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px">I notice that "</span></span><span style="font-size:12.8px">data->wanted_fields" in index-mail.c is as follows: </span></div><div><span style="font-size:12.8px"><br></span></div><div><div><span style="font-size:12.8px">(MAIL_FETCH_STREAM_HEADER | MAIL_FETCH_STREAM_BODY | MAIL_FETCH_RECEIVED_DATE | MAIL_FETCH_SAVE_DATE | MAIL_FETCH_PHYSICAL_SIZE | MAIL_FETCH_VIRTUAL_SIZE | MAIL_FETCH_UIDL_BACKEND | MA</span><span style="font-size:12.8px">IL_FETCH_GUID | MAIL_FETCH_POP3_ORDER)</span></div></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Since I made the changes above I except 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">data->wanted_fields to contain </span>MAIL_FETCH_IMAP_BODY and MAIL_FETCH_IMAP_BODYSTRUCTURE. This tells me that these fields are not being cached? </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Am I doing something wrong here?</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 March 2018 at 02:33, Aki Tuomi <span dir="ltr"><<a href="mailto:aki.tuomi@dovecot.fi" target="_blank">aki.tuomi@dovecot.fi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
On 19.03.2018 05:14, Sivathmican Sivakumaran wrote:<br>
> Hello,<br>
><br>
> It looks like the "mail_always_cache_fields" and<br>
> "mail_never_cache_fields" can be used to control dovecot's caching<br>
> decisions. I cannot seem to find any documentation regarding how these<br>
> fields should be used.<br>
><br>
> What are acceptable values for these fields? I am quite new to this so<br>
> any help would be much appreciated. <br>
><br>
> Regards,<br>
><br>
> Siva<br>
<br>
</div></div>Hi!<br>
<br>
You can use the same field names as for 'doveadm fetch'. Please note<br>
though that you need to rm dovecot.index.cache file after changes, this<br>
has only been fixed in 2.2.34 dovecot release.<br>
<span class="HOEnZb"><font color="#888888"><br>
Aki<br>
</font></span></blockquote></div><br></div>