How to remove attachments from many mails on Cyrus-IMAP Store?

Bron Gondwana brong at fastmailteam.com
Thu Oct 19 17:04:29 EDT 2017


Hi Walter,

The only way to remove attachments is to replace the message with an
edited copy of the message.  You can't alter emails in an IMAP mailstore
once they are delivered.
At FastMail we're using the attached Perl module to strip attachments
from emails for our "remove attachments" feature.  It's not pretty, but
it gets the job done.  It needs to be hooked up to some code that
actually connects via IMAP and does the work.
Cheers,

Bron.


On Thu, 19 Oct 2017, at 22:10, Walter H. via Info-cyrus wrote:
> Hello,
> 
> my energy supplier sends a daily mail about the electricity power
> consumption of the previous day;
> these mails have two attachment - one .csv and one .xml
> 
> I'd like to remove the .xml attachments from the mails already
> stored in> the cyrus database, as these are bigger and really not needed;
> how would I achieve this?
> (how to delete these from each file in the database is not problem)
> 
> why I would like to do this:  saving storage ...
> 
> the directory has these files:
> 
> 1.
> 2.
> 3.
> ...
> 10007.
> 10008.
> cyrus.cache
> cyrus.header
> cyrus.index
> cyrus.squat
> 
> my system: CentOS 6, Cyrus v2.3.16-Fedora-RPM-2.3.16-15.el6
> 
> Thanks,
> Walter
> 
> ----
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

--
  Bron Gondwana, CEO, FastMail Pty Ltd
  brong at fastmailteam.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20171020/dd56f695/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StripAttachments.pm
Type: application/x-perl
Size: 4764 bytes
Desc: not available
URL: <http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20171020/dd56f695/attachment.pl>


More information about the Info-cyrus mailing list