procmail
[Top] [All Lists]

Re: Strip and SAVE attachment

2001-08-08 05:05:11
* James Wilde <james(_dot_)wilde(_at_)glocalnet(_dot_)com> [010807 10:51]:
Hi:

I've searched the archives, studied the man pages and one or two other
sources of info on Procmail without finding what I am looking for.  Sorry if
I have missed something obvious.  I'm a new user - well, not even a user
yet, but it was suggested I try Procmail - so not ready for programming my
own recipies.

What I would like to do is to take incoming messages to a particular mailbox
and strip and save the attachment, which is a PGP encrypted file.  The
message is usually empty - just a subject line, which should be the name of
the file when it is saved.  Actually, of course, I want to feed the file
into pgp and save the output to file, but I can probably live with doing
that via a cron job.  This is in the UNIX (specifically Solaris) world.  For
safety's sake, it would be good to save a copy of the message in the user's
mailbox, in case the pgp handling goes wrong.

All the attachment handling scripts I've seen seem to have been concerned
with stripping off the html attachments to Outlook messages, or stripping
off and throwing away .exe files, viruses, etc, which is the exact reverse
of what I need.

Maybe Procmail is not the product I need?

This topic is addressed in the archives.  Here's something that can get
you started (very untested):

:0
* ^Subject: attachment test
{
    # save copy (just in case)
    :0c:
    backup_folder

    METAMAIL_TMPDIR=$HOME/tmp

    # unpack the attachment
    :0b
    | metamail -w -q -x
}


-- 
- Matt Dunford <> zoot(_at_)zotikos(_dot_)com ..
-. www.zotikos.com -- o,;-
        
It is not because things are difficult that we do not dare; it is 
because we do not dare that they are difficult.
  -- Seneca
--
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>