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
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