-
Notifications
You must be signed in to change notification settings - Fork 375
Description
I managed to make emailing functional in ghettoVCB with email servers that require STARTTLS before any mail commands. netcat/nc does not support this, so I needed to switch to openssl (included in ESXi).
Here is what needs to be modified in ghettoVCB.sh
The lines:
cat "${EMAIL_LOG_CONTENT}" | sendDelay| "${NC_BIN}" "${EMAIL_SERVER}" "${EMAIL_SERVER_PORT}" > /dev/null 2>&1
will be replaced by:
cat "${EMAIL_LOG_CONTENT}" | sendDelay | openssl s_client -starttls smtp -crlf -pause -connect "${EMAIL_SERVER}":"${EMAIL_SERVER_PORT}"
in the If/else just before the "Start of Main Script" Section
In the SendDelay() function, we need to modify the line:
[ $c -lt 4 ] && sleep ${EMAIL_DELAY_INTERVAL}
to:
[ $c -lt 15 ] && sleep ${EMAIL_DELAY_INTERVAL}
With these applied ghettovcb.sh will connect to the mail server using TLS and will be able to send the log file reports.