Looking for suggestions: How to strip attachments from mails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Looking for suggestions: How to strip attachments from mails

Patrick Nagel-2
Hi,

I know this is not 100% on-topic, but I'll try anyway...

I'm looking for a way to strip attachments from incoming mails on the server.
The attachments should be stored on a file server (where users have access
via SAMBA) and only a link to the file (UNC path) should remain in the mail
body. This is to prevent the mail storage from filling up with a large amount
of big mails where at the same time the 'payload' (attached file) is not
conveniently accessible by the users.

The current setup is postfix / dovecot deliver / dovecot (with sieve plugin).
I'm considering piping the mails through something like mimeStrip.pl
(http://freshmeat.net/projects/mimestrip.pl/), but therefore I'd probably
need to bring procmail/maildrop into the game, right?

Or are there other (better) ways to accomplish this?

Patrick.

--
STAR Software (Shanghai) Co., Ltd.            http://www.star-group.net/
Phone:    +86 (21) 5427 7799 x 826             Fax:   +86 (21) 6485 0071

PGP key:         https://stshacom1.star-china.net/keys/patrick_nagel.asc
Fingerprint:           E09A D65E 855F B334 E5C3 5386 EF23 20FC E883 A005

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Looking for suggestions: How to strip attachments from mails

Jason Fesler
> I'm looking for a way to strip attachments from incoming mails on the server.

  http://detach.optimism.cc/

works in line with procmail or similiar.  It is not a standalone server;
but instead acts as a filter.  I use it in front of my mailing lists, so
that attachements are not sent out.

I couple this with "demime" to further reduce the remaining text to plain
text ( http://scifi.squawk.com/demime.html - uh oh, host not responding..
and I don't see an alternate location for it).

Reply | Threaded
Open this post in threaded view
|

Re: Looking for suggestions: How to strip attachments from mails

mouss-2
In reply to this post by Patrick Nagel-2
Patrick Nagel wrote:

> Hi,
>
> I know this is not 100% on-topic, but I'll try anyway...
>
> I'm looking for a way to strip attachments from incoming mails on the server.
> The attachments should be stored on a file server (where users have access
> via SAMBA) and only a link to the file (UNC path) should remain in the mail
> body. This is to prevent the mail storage from filling up with a large amount
> of big mails where at the same time the 'payload' (attached file) is not
> conveniently accessible by the users.
>
> The current setup is postfix / dovecot deliver / dovecot (with sieve plugin).
> I'm considering piping the mails through something like mimeStrip.pl
> (http://freshmeat.net/projects/mimestrip.pl/), but therefore I'd probably
> need to bring procmail/maildrop into the game, right?
>
> Or are there other (better) ways to accomplish this?
>  

if you're ready to script a little, you can use
    http://www.pldaniels.com/ripmime/
to "extract" the attachments...


Reply | Threaded
Open this post in threaded view
|

Re: Looking for suggestions: How to strip attachments from mails

Patrick Nagel-2
In reply to this post by Jason Fesler
Hi Jason,

On Friday 16 May 2008, Jason Fesler wrote:
> > I'm looking for a way to strip attachments from incoming mails on the
> > server.
>
>   http://detach.optimism.cc/
>
> works in line with procmail or similiar.  It is not a standalone server;
> but instead acts as a filter.  I use it in front of my mailing lists, so
> that attachements are not sent out.

Thank you very much for your suggestion. I gave 'detach' a try, and saw that
you contributed to it :)

It does exactly what I need. I set it up as a transport for postfix. The
script that gets called by postfix also takes care about delivery (pipe
through dovecot's 'deliver' after the detaching is finished, or, in case of
an error during the detachment process, pipe the original message (including
attachments) through 'deliver'. I didn't want to install procmail, because I
need dovecot's sieve plugin for all other filtering needs...

I've got one problem though (which I reported to Ryan Hamilton): detach
doesn't handle attachments with filenames that contain non-ASCII characters
well. I don't know anything about perl, so I didn't dig deeper yet... Would
you perhaps be interested in looking into the issue?

> I couple this with "demime" to further reduce the remaining text to plain
> text ( http://scifi.squawk.com/demime.html - uh oh, host not responding..
> and I don't see an alternate location for it).

For me it's just about getting those attachments to some SAMBA share - the
rest of the mail should stay as it was.

Thanks again for that hint,
Patrick.

--
STAR Software (Shanghai) Co., Ltd.            http://www.star-group.net/
Phone:    +86 (21) 5427 7799 x 826             Fax:   +86 (21) 6485 0071

PGP key:         https://stshacom1.star-china.net/keys/patrick_nagel.asc
Fingerprint:           E09A D65E 855F B334 E5C3 5386 EF23 20FC E883 A005

signature.asc (196 bytes) Download Attachment