The script failed for my VPS , had to change SSLtype for mbsync to STARTTLS instead of IMAPS. Added a question so the user can choose. My error before this adjustement was this: error:1408F10B:SSL routines:ssl3_get_record:wrong version number