Here is the project requirements I've been shopping around:
A company who manages social workers for developmentally disabled children is looking for an automated improvement to their workflow. Currently, they receive daily reports from 100+ individual caseworkers who email scanned PDFs of physical documents to a firstname.lastname@example.org email address. An employee in the office then manually opens each email, downloads the attachment, then files the PDF into a folder for the particular case onto their file server. We are looking for a solution that would automatically download attachments then file them under the proper case file.
I think the simplest procedure is to have this script monitor an email box and download the attachments. The caseworkers would email their documents to records+[casenumber]@theirdomain.com instead of email@example.com. The script would take a look at the 'send to' field in the mail header then file the attachment on a local server in the proper folder, which would also be the case number. The script would identify the proper case by looking at the appended number after the + in the email address.
I'd like there to be a wildcard folder on the server that would get all other attachments when the appended case number in an email does not match an existing folder. This could happen if someone fat fingers the case number or if a new case doesn't have a folder on the server. This way, they don't need to bother with checking the email account for documents that might slip through the cracks on a regular basis.
After the email has been processed, I'd like the message to be moved to a 'processed' folder on the mail server to keep the mailbox organized. This isn't a requirement if this one feature alone requires the move off Google Apps or to a 3rd party mail server.
Finally, although not necessary, I'd like the script to generate a log file of attachments downloaded and where they were filed. I'd like this for easier diagnosis of any problems that may come up down the line, but this is not necessary. Ideally, it'd produce daily logs that would get saved on the file server.
For me, the two most important values for this project are to keep the setup as simple and maintenance free as possible. Please design your strategy with this in mind. If for some reason you see reliability being a problem in the future, please let me know what I should expect as far as short and long-term maintenance.
Please let me know how much extra it would be to have you generate documentation for use of the script.
The file server I just installed for them is a Synology NAS. This is the device I'd like to run this script. If you're unfamiliar with the product, it is a fully featured NAS server that runs a linux distro they call DSM which is based on GNU. It has the full capabilities you'd expect from a GNU distro with some extra value-adds from Synology. It has a full CLA that you can run all linux commands in. It serves as the company's file server and also does automated local and offsite backups. I have tons more information about the device and am generally pretty knowledgeable about the platform. Please feel free to reach out to me with any questions or clarifications needed about the server and its capabilities.
We will be moving this company to a Google Apps account for email and calendar sharing soon. It would be most convenient for the script to be able to pull email from a Google Apps account, but this is not necessary. We can set up a mail server on the NAS if need be. Synology actually has their own mail server package I'd prefer to use as a second choice before running our own mail server. I'm not opposed to another mail client but I'd prefer to use Google Apps or the Synology mail client over something else.
I only mention this about email servers as another firm I shopped this to said they may need another mail server to pull the mail. I’d prefer not to run another mail server if it can be avoided.