IMAP 
  # bash -c 'echo "tag login user@localdomain.tld userpasswd"; while read x; do echo "$x"; done' |  openssl s_client -crlf -connect 127.0.0.1:993  

  On success you will see 'Logged in' after the IMAP connection parameters

 SMTP (submission)
  # cd /usr/local/bin && wget http://www.jetmore.org/john/code/swaks/latest/swaks && chown root.root swaks && chmod +x swaks
  # swaks --to user@remotedomain.tld --from user@localdomain.tld --server 127.0.0.1 --port 587 --ehlo test -tls --auth login --auth-user user@localdomain.tld --auth-password userpasswd

  On success you will see the remote host accept your email

 Check passwords
  # vpopmailpasswd=`cat filepasswd`  
  # echo "select pw_passwd from localdomain_tld where pw_name='user'" | mysql -u root -p$vpopmailpasswd vpopmail | grep -v pw_passwd | sed 's/\$1\$//' | cut -f1 -d"$" > saltfile
  # usersalt=`cat saltfile`
  # userpasswd=`cat fileuserpasswd` /* Put your user's password in this file */
  # userhash0=`openssl passwd -1 -salt $usersalt $userpasswd`
  # userhash1=`echo "select pw_passwd from localdomain_tld where pw_name='user'" | mysql -u root -p$vpopmailpasswd vpopmail | grep -v pw_passwd`
  # [ "$userhash0" = "$userhash1" ] && echo "Matched passwords" || echo "Unmatched passwords"

 Script to test all IMAP accounts (post migration)
  #!/bin/bash

  # Change fqdn to suit
  fqdn=mail.whitehorsetc.com

  for domain in `ls /home/vpopmail/domains`
  do
     for user in `ls /home/vpopmail/domains/$domain`
     do
        pass=`/home/vpopmail/bin/vuserinfo $user@$domain | grep "clear passwd: " | sed 's/clear passwd: //'`
        [ ! -z $pass ] && curl -v imaps://${user}%40${domain}:${pass}@${fqdn}/ &> tmpcon && \
           tmpconok=`cat tmpcon | grep "OK Logged in"` && \
           [[ ! -z $tmpconok ]] && (echo "$user@$domain --> success"  || echo "$user@$domain --> failed")
     done
  done

  rm tmpcon
  exit 0