ghettoVCB icon indicating copy to clipboard operation
ghettoVCB copied to clipboard

Mail notification not working

Open nathanpinotti opened this issue 4 years ago • 2 comments
trafficstars

Hello there. I'm trying to use mail notification but I just get the error above;

The error I get does not say much about what is causing this issue. I've alredy re-checked the configs and it seems to be righ (since I can log e use the same account in other tools)

2021-01-20 15:48:09 -- info: ERROR: Failed to email log output to mail.myserver.com.br:587 to [email protected] Not even with the -d debug parameter I get more information

Ps; ESXI firewall rules form SMTP (587) was created

Any tips?

nathanpinotti avatar Jan 20 '21 18:01 nathanpinotti

Now i haven't checked the code but 587 sounds like submission. Might be a login or tls issue. Go look at the line in ghettovcb.sh that runs the mail command and look for an error there.

TheNetworkIsDown avatar Jan 20 '21 20:01 TheNetworkIsDown

Hi I had a problem with starttls so I fixed email sending with openssl package:

This code is not pretty look but it works :D

(echo "ehlo $(hostname -s)"; sleep 3 ; echo "AUTH LOGIN"; sleep 2 ; echo "${EMAIL_USER_NAME}";sleep 5;echo "${EMAIL_USER_PASSWORD}"; sleep 2; echo "mail from: <${EMAIL_FROM}>";sleep 2; echo "rcpt to: <${EMAIL_ADDRESS}>"; sleep 2; echo "DATA"; sleep 2; echo "Subject: ghettoVCB - $(hostname -s) ${JOBNAME} ${FINAL_STATUS}\r\n" ; sleep 2 ; echo "Date: $( date +"%a, %d %b %Y %T %z" )\r\n"; sleep 2; echo "ghetto backup from esxi"; sleep 2; echo "."; sleep 2; echo "QUIT")| openssl s_client -crlf -starttls smtp -connect ${EMAIL_SERVER}:${EMAIL_SERVER_PORT}

I hope this will help you Petr

Zun1k avatar Mar 01 '22 10:03 Zun1k