Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save email attachments

Status
Not open for further replies.

maanku

IS-IT--Management
Jan 21, 2001
6
0
0
US
Hi all,

I need to save all email attachments (text or pdf most importantly) sent to an account so that I can automatically print and archive them.

The mail will end up through Postfix, currently using old-style mailboxes but moving to maildir shortly.

I was thinking of using a procmail filter since my attempts using Perl and BASH/sed seemed kludgy. I'm open to suggestions and comments though.

My thoughts are (BASH/Perl):
1. Receive email directly (no preprocessing).
2. Lock file (mail) or files (looping with maildir) writing out between content attachments.
3. Post-processing through cron (not highly time sensitive) using a check twice daily.

With Procmail:
1. Receive mail and spool to script so no lock file on my script needed.
2. Post-processing occurs with procmail, to a dir (similar to above) but with cron to lpr.

Hence I came to the decision that procmail would make life infinitely more simple.

Is there a better way to do this? Does anyone already have a script/recipe for doing such for any file format?

TIA,
Maanku

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top