2009/11/14 Ben Donohue <donoh...@icafe.com.au>: > Hi all, > > So far I have not found a solution in Google but maybe I'm not looking for > the correct thing...? > > A client of mine is getting a .zip file every day to his redhat postfix > inbox. > > I need to automatically get the zip file from the email and put it in a > folder on another machine, then unzip it, then run a program on the > extracted file.
General ideas on how I'd tackle such a task: 1. procmail to scan each incoming e-mail for the message you want to process, then extracts the mail and runs the rest. 2. A script to scp the extracted attachment to the other machine using a limited-access, no passphrase-protected, dedicated ssh key (limited on the server side using the "command=" parameter in .ssh/authorized_keys on the remote side - see "man sshd" section on "AUTHORIZED_KEYS FILE FORMAT". 3. Instead of scp you can also run something on the remote side which will accept the file over the ssh connection, dump it into the remote file then execute something else when the file is done. 4. Another option is to scp with one key then use another ssh key to trigger a script to process the file remotely. HTH, --Amos -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html