php telnet to mail server pop3

Previously I had work on the telnet to some mail server & trying to send out the email (refer here).
Recently I am working on some with the mail server again, but is receiving this time.

I am using PHP + MySQL to access to a mail account & try to clean up the email account due to it contain 100k+ emails (1.7G) inside the inbox. This is a headache problem & I cant even login the mail account by webmail. That’s why I decided to write an backend script to delete “SPAM” emails.

During my development, I found that the “imap_open()” function that provide by PHP is unable to connect to the mail server using the mail account.  I got no idea on how to login into the mail server & delete those email & finally I try on the telnet & found that the telnet is pretty fast.

Check this website for the telnet commands definition.

Below is my script:
script file

Leave a Reply