From: Asif Iqbal on
Where do I look in postfix to introduce the following behavior.

When mail arrives to the mail server,
I like to convert any attachment to link if it is bigger than say 1M and add
a footer in the body like below, before dropping/relaying it to the
mailbox local or remote.

all attachments >1M are converted to link(s) below.
https://link.example.com/file1
https://link.example.com/file2

here file1/file2 would be exact name of the file like mydoc.doc
any doc with spaces should be converted to `_'

I like to detach the big attachments and save them to a dir. My users
have web access to that dir.

Then modify the body of the email by appending the links to it.

--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

From: Matt Hayes on
On 7/7/2010 2:16 PM, Asif Iqbal wrote:
> Where do I look in postfix to introduce the following behavior.
>
> When mail arrives to the mail server,
> I like to convert any attachment to link if it is bigger than say 1M and add
> a footer in the body like below, before dropping/relaying it to the
> mailbox local or remote.
>
> all attachments >1M are converted to link(s) below.
> https://link.example.com/file1
> https://link.example.com/file2
>
> here file1/file2 would be exact name of the file like mydoc.doc
> any doc with spaces should be converted to `_'
>
> I like to detach the big attachments and save them to a dir. My users
> have web access to that dir.
>
> Then modify the body of the email by appending the links to it.
>

My apologies if you get this twice Asif, I did not mean to reply to you
directly but to the list.

I don't believe postfix has this type of behavior, although I could be
wrong, but I'm pretty sure I'm not.

Probably need some sort of policy server to do that iirc.

-Matt

From: =?ISO-8859-1?Q?Markus_Sch=F6nhaber?= on
07.07.2010 20:27, Matt Hayes:

> On 7/7/2010 2:16 PM, Asif Iqbal wrote:

>> Where do I look in postfix to introduce the following behavior.
>>
>> When mail arrives to the mail server,
>> I like to convert any attachment to link if it is bigger than say 1M and add
>> a footer in the body like below, before dropping/relaying it to the
>> mailbox local or remote.
>>
>> all attachments >1M are converted to link(s) below.
>> https://link.example.com/file1
>> https://link.example.com/file2
>>
>> here file1/file2 would be exact name of the file like mydoc.doc
>> any doc with spaces should be converted to `_'
>>
>> I like to detach the big attachments and save them to a dir. My users
>> have web access to that dir.
>>
>> Then modify the body of the email by appending the links to it.

> Probably need some sort of policy server to do that iirc.

A postfix policy server doesn't have access to the mail body.
I guess that's a job for a milter|smtpd_proxy_filter|content_filter.

--
Regards
mks

From: /dev/rob0 on
On Wed, Jul 07, 2010 at 11:40:30PM +0200, Markus Schönhaber wrote:
> 07.07.2010 20:27, Matt Hayes:
>
> > On 7/7/2010 2:16 PM, Asif Iqbal wrote:
>
> >> Where do I look in postfix to introduce the following behavior.
> >>
> >> When mail arrives to the mail server,
> >> I like to convert any attachment to link if it is bigger than
> >> say 1M and add a footer in the body like below, before
> >> dropping/relaying it to the mailbox local or remote.
> >>
> >> all attachments >1M are converted to link(s) below.
> >> https://link.example.com/file1
> >> https://link.example.com/file2
> >>
> >> here file1/file2 would be exact name of the file like
> >> mydoc.doc any doc with spaces should be converted to `_'
> >>
> >> I like to detach the big attachments and save them to a dir. My
> >> users have web access to that dir.
> >>
> >> Then modify the body of the email by appending the links to it.
>
> > Probably need some sort of policy server to do that iirc.
>
> A postfix policy server doesn't have access to the mail body. I
> guess that's a job for a milter|smtpd_proxy_filter|content_filter.

Or, perhaps a better option, implement this in a delivery agent.
--
Offlist mail to this address is discarded unless
"/dev/rob0" or "not-spam" is in Subject: header

From: Jorge Armando Medina on
On 07/07/2010 01:16 PM, Asif Iqbal wrote:
> Where do I look in postfix to introduce the following behavior.
>
> When mail arrives to the mail server,
> I like to convert any attachment to link if it is bigger than say 1M and add
> a footer in the body like below, before dropping/relaying it to the
> mailbox local or remote.
>
> all attachments >1M are converted to link(s) below.
> https://link.example.com/file1
> https://link.example.com/file2
>
> here file1/file2 would be exact name of the file like mydoc.doc
> any doc with spaces should be converted to `_'
>
> I like to detach the big attachments and save them to a dir. My users
> have web access to that dir.
>
> Then modify the body of the email by appending the links to it.
>

Check this:

http://robur.slu.se/jensl/aradis/

I never test it, and is a little outdated, probably you can modify it to
your needs.

Best regards and keep us update with your results.