I am trying to build a script that checks an email account. I want the script to output the attachments into individual files. Say I get sent an email with a standard message, a word document and 2 gif images. I want the script to take the email and create 4 files out of it.<br><br>
file 1: The standard email message<br><br>
file 2: The word document (with the doc extension)<br><br>
file 3: A gif image file (with the gif extension)<br><br>
file 4: The second image file (with the gif extension)<br><br>
Since the email accounts I want to grab from are on my server /var/spool/mail I thought that one way would be to go straight into the spooled mail. But then I am not to sure how to do the MIME decoding for the attachments.<br><br>
Also any ideas on how to do this to email accounts that don’t exist on my server?