Skip to content

Commit

Permalink
idle-works
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmahoney committed May 8, 2024
1 parent 0e73e0a commit 292808e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions telnet-imap-smtp-sh/imap-example.exp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ expect "a3 OK*"
send "a4 FETCH 1 BODY\[1.1\]\r"
expect "a4 OK*"

# Begin IDLE
send "a5 IDLE\r"
expect "+ IDLE*" # Server response indicating it's ready to push notifications

set idle_timeout 30
expect {
timeout { send "DONE\r"; expect "a5 OK*" }
"* EXISTS" {
send "DONE\r"
expect "a5 OK*"
# Add handling for new mail or changes here if needed
}
}

send "a5 LOGOUT\r"
expect "*"
#</gen>

0 comments on commit 292808e

Please sign in to comment.