tags:

views:

161

answers:

2

I am writing a Lua script that works with IMAPfilter (http://imapfilter.hellug.gr/), that is able to change the names of MIME attachments

for example:

Content-Type: application/pdf; name="Final Fäntäsy.pdf"

is converted to

Content-Type: application/pdf; name="FinalFantasy.pdf"

Currently, this is done via exporting the mail to the file system and manipulating. My question is, can I manipulate the file directly on the IMAP server via IMAPfilter? I've checked the documentation, but haven't found anything for manipulating files on the server, beyond moving/deleting/etc.

A: 

Hi,

I'm not familiar with that specific product, however, the IMAP protocol does not offer something like this.

In the IMAP world, you would have to fetch the message, modify your content, Append it back to the folder, and delete the original.

Cheers!

Dave

dave wanta
A: 

According to the its description IMAPFilter issues search requests to the IMAP server and does something with the results (copy, fetch, delete etc.). In order to change the name/content type of the attachments you will need to fetch the message, parse it, make your corrections and append it back to the mailbox (and delete the original one).

IMAP does not support changing the content of mail messages in-place (so you can't for example fetch only the attachment part, change it and upload it back). APPEND command only works with a complete message, not any part of it.

liggett78