-1

I want to add a test for a secure IMAP connection, authentication being part of it.

That I would run using a cron job. If anything wrong happens I do want to get and email, so if it goes well it should have no output.

Does anyone have such a script, bash, python,...?

sorin
  • 8,016
  • 24
  • 79
  • 103
  • 1
    You could use openssl s_client, as suggested here: http://stackoverflow.com/questions/14959461/how-to-talk-to-imap-server-in-bash-via-openssl – NickW May 01 '14 at 14:34

2 Answers2

4

You can use

openssl s_client -connect mail.example.com:993 -quiet <<EOF
some command
another command
EOF 

to connect to the remote server.

user9517
  • 115,471
  • 20
  • 215
  • 297
2

There is a nagios-compatible plugin for IMAP available here. You can use that from a command-line without implementing Nagios. I believe it is a python script that you could repurpose.

uSlackr
  • 6,412
  • 21
  • 37