<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>OK, an update on the progress with this. <br>
</p>
<p>I finally settled on a python script which does the stripping
based on code here: <br>
<a class="moz-txt-link-freetext" href="http://code.activestate.com/recipes/302086-strip-attachments-from-an-email-message/">http://code.activestate.com/recipes/302086-strip-attachments-from-an-email-message/</a><br>
</p>
<p>And then a bash script using find that allows me to select
candidate files with 'find' and pass them to the python script,
eg. <br>
<br>
find $DIR -type f -mtime +$OLDERTHANDAYS -size +$LARGERTHAN !
-name 'dovecot*'</p>
<p>After a bit of debugging to do with UTF characters etc, I seem to
have got the script working and it will process a directory or
entire account without complaining. My coding is not good, but if
anyone wants a copy, contact me off list, to spare my blushes. <br>
</p>
<p>I'm now experiencing an issue when I go to check the emails,
using Thunderbird IMAP. The mails were cached in Thunderbird, and
indexed by dovecot on the server. I've been trying to figure out
the minimum I need to do to get Thunderbird to pick up the
changes. <br>
</p>
<ul>
<li>'doveadm force-resync -u <a class="moz-txt-link-abbreviated" href="mailto:user@domain.com">user@domain.com</a> INBOX' seemed like an
option, but didn't actually seem to do much. <br>
</li>
<li>deleting all the dovecot.* files in the user directory on the
server, seemed like a harsher option, but again didn't really
fix things. <br>
</li>
<li>On the Thunderbird end, deleting the INBOX.msf file, didn't do
anything, and deleting the INBOX and INBOX.msf files, still
meant the wrong versions of the mails were coming down with
attachments, and then disconnecting when it created an error. <br>
</li>
</ul>
<p>Errors in the logs were</p>
<p>Apr 05 12:15:33 imap(<a class="moz-txt-link-abbreviated" href="mailto:user@domain.com">user@domain.com</a>) Error: Corrupted record in
index cache file /mail/path/dovecot.index.cache: UID 1298: Broken
physical size in mailbox INBOX:
read(/mail/path/cur/1615880838.M742750P25731.mail.domain.com,S=12893560,W=13061037:2,Se)
failed: Cached message size larger than expected (12893560 >
2937, box=INBOX, UID=1298)<br>
Apr 05 12:15:33 imap(<a class="moz-txt-link-abbreviated" href="mailto:user@domain.com">user@domain.com</a>): Info: FETCH read() failed
in=10718 out=7471947 deleted=0 expunged=0 trashed=0 hdr_count=1647
hdr_bytes=645910 body_count=448 body_bytes=6371591<br>
Apr 05 12:15:36 imap(<a class="moz-txt-link-abbreviated" href="mailto:user@domain.com">user@domain.com</a>): Error: Corrupted record in
index cache file /mail/path/dovecot.index.cache: UID 1298: Broken
physical size in mailbox INBOX:
read(/mail/path/cur/1615880838.M742750P25731.mail.domain.com,S=12893560,W=13061037:2,Se)
failed: Cached message size larger than expected (12893560 >
2937, box=INBOX, UID=1298)</p>
<p>It seems the only way to do this is to disconnect, delete all
dovecot.* files on the server, delete all Thunderbird cache files
on the PC, and then reconnect and wait for them to figure it out.
Does that seem correct? <br>
</p>
<p><br>
</p>
<p>Finally, and relatedly, the maildir files on the server are
tagged with a size field eg S=12893560. Is it possible to
regenerate them with the new correct file sizes? <br>
If I leave them alone, will it affect anything?</p>
<p>P.<br>
</p>
</body>
</html>