Probe needed for Cyrus IMAP

Phil Pennock info-cyrus-spodhuis at spodhuis.org
Mon Oct 30 12:10:13 EST 2006


On 2006-10-30 at 08:57 -0600, Gary Mills wrote:
> `telnet' might work, but the script would need to analyze the output
> and terminate the connection.  A timeout would also be helpful.  Is
> `imtest' better for this?

Do you have expect installed?  Something like the below might help.

----------------------------8< cut here >8------------------------------
#!/usr/local/bin/expect -f

spawn -noecho telnet localhost imap
expect {
	timeout {exit 1}
	-re "Escape character is '(.*)'.\r*\n" {}
}
expect {
	timeout					{exit 1}
	eof					{exit 2}
	-re "^. OK .* server ready\r*\n"	{}
	-re "."					{exit 2}
}
send ". LOGOUT\r\n"
exit 0
----------------------------8< cut here >8------------------------------

Regards,
-Phil


More information about the Info-cyrus mailing list