Require php code that can be run as a cronjob or manually to extract mail from a pop3 mailbox and add it to a mySql database. The senders e-mail address must be verified from a list in a users database table and discarded if the users entry either does not exist, or is suspended. If validated, each message should be broken down as it is added to the database, into headers, sent date / time, sender, subject, message body, attachment count, attachment names, attachment sizes, attachment data, complete message size ( bytes ), and should contain a unique message ID number. Messages must be processed in date / time order and deleted from the pop3 server once processed. This deletion must not affect any remaining or incoming messages in the pop3 account. A plain text notification mail must be sent to a specified address with notification of the new database entry ( contains Sender, Date/time & subject ). Sample mailing code that works on an existing web page ( same web server ) will be supplied. Once the new messages have been processed, all existing messages in the database must be examined and the plain text notification mail re-sent, depending on settings in the users table ( number of retries, retry interval since last send / resend, etc ).
A seperate php page must be supplied that will receive a mail's unique ID number and must re-join the mail's conponents ( header, message, attachments ) and send that mail to a specified address.