<div dir="ltr">On 18/03/2021 16.52, Steven Varco wrote:<br>> I would like such a
feature too, but instead of deleting the atatchment files, I would like
to „detach“ the files and save them into a sperate directory, which
could be on a different storage like a share in the users home directory
or even S3 and then replace the attachment in the Mail with a LINK to
that file.<br>> Thunderbird does this quite well with its „Detach Attachment“ feature; the MIME part looks like this after that:<br><br>I'm familiar with the Thunderbird implementation. I'd like it if the attachment name was preserved in there too. Saving it to a directory would be nice, but not require for my needs.<br><br>>
I know that for MS Exchange / Outlook some external archiving solutions
as components do exist and looking for something similar to offload
attachments with dovecot. :)<br><br>I forgot to mention before, the
ImapSize utility, which will help for single accounts, for which the
login and password are known. <br> <a href="https://broobles.com/imapsize/">https://broobles.com/imapsize/</a><br><br>But what I'm really looking for is something that I can script on a server. I'll let you know what I come up with. <br><br>P.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 18, 2021 at 4:53 PM Steven Varco <<a href="mailto:dovecot.org@bbs.varco.ch">dovecot.org@bbs.varco.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I would like such a feature too, but instead of deleting the atatchment files, I would like to „detach“ the files and save them into a sperate directory, which could be on a different storage like a share in the users home directory or even S3 and then replace the attachment in the Mail with a LINK to that file.<br>
Thunderbird does this quite well with its „Detach Attachment“ feature; the MIME part looks like this after that:<br>
<br>
————————————————————————————————————————<br>
Content-Type: image/png;<br>
name="funny-picture.png"<br>
Content-Disposition: attachment; filename="funny-picture.png"<br>
X-Mozilla-External-Attachment-URL: file://///fileserver/home/svarco/mail/attachments/funny-picture.png<br>
X-Mozilla-Altered: AttachmentDetached; date="Thu Mar 18 09:44:37 2021"<br>
<br>
You deleted an attachment from this message. The original MIME headers for the attachment were:<br>
Content-Transfer-Encoding: base64<br>
Content-Disposition: inline;<br>
filename=funny-picture.png<br>
Content-Type: image/png;<br>
name="funny-picture.png"<br>
————————————————————————————————————————<br>
<br>
I know that for MS Exchange / Outlook some external archiving solutions as components do exist and looking for something similar to offload attachments with dovecot. :)<br>
<br>
Steven<br>
<br>
-- <br>
<a href="https://steven.varco.ch/" rel="noreferrer" target="_blank">https://steven.varco.ch/</a> <br>
<br>
> Am 18.03.2021 um 08:31 schrieb Plutocrat <<a href="mailto:plutocrat@gmail.com" target="_blank">plutocrat@gmail.com</a>>:<br>
> <br>
> Hi,<br>
> <br>
> I've been looking around for a solution to this problem. I want to prune down the attachments on a server before a migration. Some of the emails are 7 years old and have 40Mb attachments, so this seems like a good opportunity to rationalize things. So perhaps I'd like to "Remove all attachments from emails older than 2 years, in the .Sent directory", or "Attachments over 10Mb anywhere in the mail tree"<br>
> <br>
> I've found the <a href="http://strip_attachments.pl" rel="noreferrer" target="_blank">strip_attachments.pl</a> script here <<a href="https://fossies.org/linux/Mail-Box/examples/strip-attachments.pl" rel="noreferrer" target="_blank">https://fossies.org/linux/Mail-Box/examples/strip-attachments.pl</a>> which works fine on mbox (as tested on my local Thunderbird mboxes), but not on maildir which is on the dovecot server. My Perl isn't strong enough to re-purpose it.<br>
> <br>
> I've looked at ripmime and mpack/munpack, and although they seem like useful tools to do the job of deconstructing the mail into its constituent parts, it doesn't seem to help in re-building the email. I think they could be used with a bit of study into mail MIME structure, and used with a helper script.<br>
> <br>
> So before I take a deep dive into scripting my own solution, I just wanted to check if anyone else on the list has been through this and has some resources or pointers they can share, or maybe even someone to tell me "Duh, you can do it with doveadm of course".<br>
> <br>
> P.<br>
<br>
</blockquote></div>