I regularly need to delete emails without reading them from a forwarding address at my Vodafone phone. In an adaptation of another script:
#!/bin/bash
# Delete POP emails
# Adapted from http://www.cyberciti.biz/tips/remove-or-delete-all-emails-message-from-a-pop3-server.html
username="myemailaddress"
password="somethingsecret"
server="pop.vodafone.ie"
MAX_MESS=100
delete(){
sleep 2
echo USER $username
sleep 1
echo PASS $password
sleep 2
for ((j=1;j<=$MAX_MESS;j+=1))
do
echo DELE $j
sleep 1
done
echo QUIT
}
delete | telnet $server 110
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment