2

I got a lot of emails with uncompressed formats (like bmp, txt, ...) that I want to keep inside my IMAP-inbox, so I can access them from all my devices (Windows, Linux, ios, Android).

Those emails take much disk space and bandwidth on synchronizing.

How could I compress them retrospectively?


1. workaround

One workaround for me is to compress them after I received them:

  1. Move the email into the drafts folder.
  2. Edit the email there. (For example, remove the attachment and add a it again after you compressed it, or use the Auto Compress File Addon in Thunderbird)
  3. Save the draft email
  4. Move it from your draft-folder back to your inbox. (without sending it)

There are two big drawbacks in this approach:

  1. The timestamp changes, so the mail seems to be received just now.
  2. The sender-email changes to your own.

2. workaround

Another, a bit better workaround would be to forward that email to myself and compress the attachment this time.

Then I could delete the attachment from the original mail and will only see it if I look at the whole conversation.


Is there a solution to this?

I don't want to archive the attachments outside of Thunderbird.

I want to keep them inside my IMAP-mail-folder, so I have them on all my email-clients on all my devices.

The best way would be a Thunderbird addon that does the job where I could press "compress Attachment" on every email. (But there only exist addons that compress before sending.)
see also https://bugzilla.mozilla.org/show_bug.cgi?id=852095

rubo77
  • 4,680
  • 11
  • 45
  • 79
  • If on windows, you could simply compress the directory where thunderbird stores your mail. On Linux, you can do this also but need something like Fusecompress https://code.google.com/p/fusecompress/. In either of these cases, this is only compressing the actual email messages and would not be as good (in the case of BMPs) as converting them to jpegs with compression. But it is transparent and fairly easy. – SuperMagic Mar 07 '13 at 15:14
  • 1
    For IMAP you are looking for a solution on the server. So which server OS and email are you using? – harrymc Mar 11 '13 at 18:49
  • I use debian squeeze, courir, postgres. But I would rather solve this with an email-client program, so I could use that solution in every server configuration. – rubo77 Mar 11 '13 at 19:08
  • **There is still no acceptable solution** to this. I need a solution, that really compresses the attachment inside the email that stays on the IMAP folder – rubo77 Mar 18 '13 at 09:52
  • if you have mails which are signed, compress attachment will destroy the data integrity, and make signature invalid – LiuYan 刘研 Mar 18 '13 at 12:51
  • How is the EditEmailSubject 2.0.2 Thunderbird Addon solving this? http://pastebin.com/fLgHs7BZ (the smime signature is still valid after changing the subject retrospectively) https://addons.mozilla.org/de/thunderbird/addon/edit-email-subject/?src=ss – rubo77 Mar 18 '13 at 13:12

2 Answers2

1

If on windows, you could simply compress the directory where Thunderbird stores your mail.

On Linux, you can do this also but need something like Fusecompress

In either of these cases, this is only compressing the actual email messages and would not be as good (in the case of BMPs) as converting them to jpegs with compression. But it is transparent and fairly easy

SuperMagic
  • 935
  • 5
  • 5
  • An upvote for this nice idea, but no solution for me, cause I would have to install this compression on all my clients (difficult on android and my iphone) – rubo77 Mar 07 '13 at 17:18
  • 1
    What? You're running thunderbird on an iphone? So... assuming you're *not* running Thunderbird on IOS (since I'm pretty sure there isn't such a beast, but could be wrong :-) it now sounds like you're, perhaps, keeping copies of these bmps on... multiple devices for "documentation purposes"? Is that right? Or are these "clients" the ones *sending* you the bmps? If that's the case, then compressing your mail folder on *your* computer will compress the email you've received. as stored on disc. If that not what you wanted to do? Can you clarify the situation? – SuperMagic Mar 07 '13 at 17:28
  • you are right, the tag "Thunderbird" is obsolete here, i will edit the question, the mail client is not important. BMP is only one uncompressed format, I receive. I also get large TXT files and so on at work. And I would like to keep those mails all in my IMAP folder. – rubo77 Mar 07 '13 at 17:34
  • 1
    Well, if you're keeping them on the IMAP server, then compression on your computer, or sender's is irrelevant. Compression then would need to be done on the IMAP server to see any savings (except when you download an attachment/message to your local device, that'll still require a full download of the appropriate size). If you control the IMAP server, then use the same compression techniques I already mentioned to compress the directory where *it* stores email. Are you saving the BMPs and large text messages on the server, or just the text? – SuperMagic Mar 07 '13 at 17:40
  • I have control of the server. the numerous attachments are all inside the base64 encoded emails I guess? And yes, the bandwidth of synchronizing the uncompressed attachments is a problem too (I edited the question for clarification) – rubo77 Mar 07 '13 at 17:43
  • the best way would be a thunderbird plugin that does the job – rubo77 Mar 07 '13 at 17:45
  • 1
    Ok... so compression of the directory the server stores mail in is a partial solution. You may also be able to hook emails on arrival at the server and convert/compress attachments, but that's a **whole** other ball of WTF, I'm sure, and very dependent on the actual mail server and what it allows to happen on mail-receipt. This would happen at the same time as AV hooks. IMAP does support a COMPRESS extension (deflate), but that's probably on a server-by-server basis, and perhaps depends on the clients supporting the option. But I'd guess most newer ones do. No idea, alas, how to enable that. – SuperMagic Mar 07 '13 at 17:52
  • OK, so **this is no solution**. ;) I hope someone comes up with an idea – rubo77 Mar 18 '13 at 09:54
1

If you have your own server you can install MailScanner and set "Zip Attachments = yes" in the configuration - this will combine all incoming attachments into a single .zip file.

When it comes to a client-specific solution you might be out of luck as incoming email integrity happens at the server-side unless you have a server that allows you to explicitly change that.

CoryG
  • 314
  • 6
  • 16
  • The client-`integrity` is not given at all, see Thunderbird Addon Subject Manager that changes the subject of emails inside Thunderbird: https://addons.mozilla.org/de/thunderbird/addon/subject-manager/ – rubo77 Mar 18 '13 at 12:09
  • Unfortunately the MailScanner solution wouldt't help compressing the attachments **retrospectively** inside my already 1.5GB large IMAP folder. – rubo77 Mar 18 '13 at 12:16
  • What the client can do to it's own files (client-integrity) is separate from what the server can do to the files stored on it. If the client wants to modify emails (or attachments within emails) that are on the server and can be retrieved by other devices the server has to allow that to happen - changing it on the local machine doesn't cut it and if you aren't hosting your email yourself it's incredibly unlikely to be an option. – CoryG Mar 18 '13 at 12:16
  • 1
    MailScanner sits betwween the outside world and your email server, you didn't mention wanting to retroactively scan them (it would be possible if you changed servers and imported all your existing mail via SMTP from the old server's database through MailScanner, but modifying the existing attachments is something you would probably have to end up scripting. – CoryG Mar 18 '13 at 12:18
  • That's an idea: If I would install MailScanner and then create a new IMAP account on my server, then move all my existing emails to that account inside Thunderbird. would the MailScanner be effective in that procedure and zip all my attachments? – rubo77 Mar 18 '13 at 12:23
  • Using an email client you would need to forward the messages to yourself while including attachments - it would probably be easier to find a script that just runs through the database of the mailserver you currently use forwarding everything to a server configured as it's replacement but with MailScanner sitting in between with the Zip Attachments option set to true. At least if you are willing to set up a new server for the task. – CoryG Mar 18 '13 at 12:25
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/7963/discussion-between-rubo77-and-coryg) – rubo77 Mar 18 '13 at 12:30
  • forwarding would be my 2. workaround, I would loose the original sender email in the header – rubo77 Mar 18 '13 at 13:01
  • Yeah, I wouldn't recommend forwarding via the client unless you can find a tool that does it while spoofing the message headers to keep them intact (though MailScanner would probably flag them all as spam if you did that) - you need a tool that will sit on the existing server and iterate over all the emails in the database to forward them via SMTP the way emails are normally routed between servers (that is, just resolving the server name and forwarding them along unaltered). – CoryG Mar 18 '13 at 21:04