ietf-mta-filters
[Top] [All Lists]

Re: MIME loops: Extracting attachment to disk and replacing it with an URL

2008-04-30 23:05:21

While I can see the utility of such an extension, I would not want to
burden the MIME loops spec for replace with it.

        Tony

Alexey Melnikov wrote:

Arnt Gulbrandsen wrote:

Alexey Melnikov <alexey(_dot_)melnikov(_at_)isode(_dot_)com>
Elaborate on how this can be done with Sieve variables, or elaborate on
extracting attachements in general?
How it would be done, the role of :url, and why :url makes this
easier/possible.
Ok, imagine that I receive in my mailbox a multipart/mixed message with some text/plain and a big pdf attachment.
The pdf attachment might look like this:

=====================
Content-Type: application/pdf;

name="Sieve-Ned.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="Sieve-Ned.pdf"

JVBERi0xLjMKJcTl8uXrp/Og0MTGCjIgMCBvYmoKPDwgL0xlbmd0aCA0IDAgUiAvRmlsdGVy
IC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeNqNkj9vwjAQxXd/ijfSAdf2Of6zlpaxEkrUzhEE
[...]

=======================

I want my Sieve script to extract the attachment and put it on an FTP server that my mail server trusts.
I want to write a Sieve script (or rather a piece of it), for example:

replace :url text:
Sender sent you a big PDF. If you really want to read it, look here:
.
;


And this would generate a replacement text/plain body part, something like:

=====================
Content-Type: text/plain

Sender sent you a big PDF. If you really want to read it, look here:
<ftp://my.trusted.ftp.example.com/extracted/alexey.melnikov/24U3219IR123E.PDF>

=======================

(Name of the extracted pdf was generated in a way to guaranty filename uniqueness.)

Does this make more sense?