Using curl to test IMAP and SMTP authentication

During the move to our new server, I needed to test if IMAP and SMTP authentication work. Using a mail client is tedious, so I used the awesome curl.


I already wrote about using curl for IMAP login a year ago, but here it is again:

$ curl -k imaps://


You need a mail.txt file that you want to send:

$ curl -vk smtp:// \
  --upload-file mail.txt\
  --user '' --ssl

Written by Christian Weiske.

Comments? Please send an e-mail.