Archive for May, 2007

Mega-Mail-Delete

Monday, May 28th, 2007

Have you ever had an email address that got so spammed that by the time you check it there are 7000+ emails there? Well, I have - and I’m not the kinda person to go through each one deleting them. I knocked up this script to simply empty a mail box.

Feel free to use and distribute at your will - however it is supplied ‘as is’ and no guarantees are given to its operation and usefulness - it did work well for me though! Its easy enough to figure out - if you don’t understand what to do don’t just guess, you may well end up in a hell of a (email less) state!

Be carefull though - it will delete every message in the mailbox defined!

// enter your POP3 mailbox username and password
	$username = MAILBOX;
	$password = PASSWORD;
//enter the address of your POP3 server - this is usually mail.domain.tld
	$server = 'MAILSERVER';
//enter the port your server runs on - this is usually 110 for POP3
    	$port = 'PORT';

//Do not change anything below this line for normal (empty mailbox) opperation
    $cmd = array();
    $cmd[]  = "USER $usernamern";
    $cmd[]  = "PASS $passwordrn";
    $cmd[]  = "STATrn";
    $cmd[]  = "QUITrn";

    $fp  = fsockopen($server, $port);
    if(!$fp)
    {
        print("Error connecting to server $server");
    }
    else
    {
        $ret = fgets($fp, 1024);
        foreach($cmd as $ret)
        {
            fputs($fp,$ret);
            $line = fgets($fp, 1024);
            print($line."");
            if($ret=="STATrn")
            {
                $fields = explode(" ",$line);
                $num_mails = $fields[1];
                for($i=1;$i<=$num_mails;$i++)
                {
                fputs($fp,"DELE $irn");
                $line = fgets($fp, 1024);
                }
            }
        }
    }

New Site, New Me?

Sunday, May 27th, 2007

Well, who would have thought 9 months would go so bloody quickly!? I’m officially done with uni, assuming I haven’t failed any modules. I’ve got more than enough going on to take up my time, number one being work. I’ve decided that I don’t have enough time to fiddle with ModX for the purposes of a simple blog so trusty old WordPress it is!

Aside from my 9-5 job (which officially resumes 29th May) I’ve been working with a friend to setup a carbon neutral web-host - which will also function as an outlet for our collective web design / programming - and hopefully make some money! [plug]we can offer any thing from simple mail hosting to full dedicated server rental so contact us if you have anything to say[/plug].

Sians new website, this something I’ve been working on during uni, has reached a level where it can replace the first version - its far more *pow* than before, with black surrounding a white background for the text. I’m still working out some bugs in the e-commerce side of things, but there’s allot of neat stuff on its way there!

Aside from that I’m going to be celebrating this weekend, now that I’m free from uni work of any kind! Hopefully, now that its easier, I’ll be able to make updates here more often, we’ll see!