I'm attempting to create an AppleScript which will be used to grab an attachment from an email and then fax that attachment to a number specified in the email. Essentially, the workflow is as follows:
User sends fax to FAXNUMBER@fax.example.com with a PDF attachment. (FAXNUMBER is the number to which the document is to be faxed.)
All emails sent to @fax.example.com are routed to email@example.com which is configured in Mail.
When any email is received at firstname.lastname@example.org, it runs an AppleScript.
What I need that AppleScript to do is strip FAXNUMBER from the to address and pass it off to OS X's built-in faxing functions and pass the PDF along as the actual document to be faxed. Getting OS X to fax (which is basically treated the same as printing) an email when received is pretty easy, the issue I'm having is that I'm not sure how to strip the email from the front of the address and pass it along to the faxing functions.