You will be implementing a special linux email server that will work
in the following way: all incoming emails will be sent to only
one existing account, and then the emails should be parsed to
perl script that will save it on disk as a distinct .eml file.
A different perl script will watch for new emails and it will extract
all the attachments on disk as distinct files. Here you have the
complete process in a more detailed way:
1) Email messages is sent to special formated email address like:
ref-2508891 (at) [url removed, login to view]
you see it contains a record id.
2) The email arrives on the email server where from where
sendmail must intercept all emails for [url removed, login to view] domain
and send it to a single unique email account.
3) That account is using procmail to pass the email message to a
perl script. You can use a different solution then procmail if
4) The perl script is doing the following actions:
- it is first checking if the email is a valid email, this
means if it contain a record id and if it does it connects to
remote mysql server and check if that record is still active.
if its not active or valid it will send that email to an error mail
account for later checking. This remote server is not yet ready
so use some dummy table to implement this part.
- if we have a valid email then the full content of the email
is saved on disk as .eml file with all the attachments and mail
headers included, also a new record is added to an emails mysql
table with status NEW. This emails also contains record id so we can use
it later. You are free to design the emails table the way
5) A new perl script that is running as a cronjob it is watching
the emails table for new records with status new and if it finds
one it will extract all the attachments (including the body) to
files on disk using the MIME:: Parser perl module and change the
status for that email to "ready".
6) We need a web interface where we can see statistics about now
many emails we have for each state: new emails, ready emails and