Skip to content

Solution for adding STARTTLS support  #269

@Feribv

Description

@Feribv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions