delete_gmail_inbox_script.sh 451 B

123456789101112131415161718
  1. #!/usr/bin/expect
  2. set timeout 1
  3. set ip "imap.gmail.com"
  4. set socket "993"
  5. set user "flowfactoryautomationbeta@gmail.com"
  6. set pass "auto1234AUTO1234"
  7. spawn openssl s_client -connect $ip:$socket -crlf
  8. expect -re ".OK.*" {send "01 LOGIN $user $pass\r"}
  9. expect -re "01 OK.*" {send "02 SELECT INBOX\r"}
  10. expect -re "02 OK.*" {send "03 STORE 1:* +FLAGS (\\Deleted)\r"}
  11. expect -re "03 OK.*" {send "04 EXPUNGE\r"}
  12. expect -re "04 OK.*" {send "05 LOGOUT\r"}