I need a script that will pull from a variety of pop accounts and process the spam.
1) Based on provided pop accounts, must support port 110 and port 995 configuration setup, script, preferably perl will pull mail from pop accounts. Please consider that some accounts may contain hundreds or thousands of messages at a time so timeout considerations should be in affect.
2) When the emails are received, a couple of points are logged and parsed. 1) Full Header, 2) Full Body, 3) From Address, 4) To Address, 5) Subject, 6) Originating IP's, each of these 6 points is parsed and inserted into the mysql table as such. Please consider that originating IP's is not always the last IP, so it will be important to be a little smart about pulling those out.
3) Because of the size of a single table, each table must only contain a days worth of activity and created on the fly. This is a simple create if not exist statement in mysql and dynamically creating the table name, for example, for 4_1_2007, you'd do something like create table if not exists spam_2007_4_1 and insert subsequent spam into that table.
4) After the script is fully through all the emails, it will do a summary into two single tables, From, IPs, meaning that there will be 1 table with a UNIQUE set of From's I.E. spammers and another table with UNIQUE IP's for spammers IP's.
All and all, this script should pull spam, log spam and summarize spam.
Final delivery should include script and table structures. Please consider that pop accounts will change from time to time and some accounts will be very large and some messages very large. All considerations that must be taken into account.