Email fails to send 'Must issue a STARTTLS command first'

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
RedNumberOne
Posts: 3
Joined: Sat Mar 16, 2019 8:52 pm

Email fails to send 'Must issue a STARTTLS command first'

Post by RedNumberOne »

Hello,

I'm running v1.32.3 on CentOS 7.

I'm attempting to get it to send me email alerts and everything works up until the point where I get the error for STARTTLS command. I followed this https://wiki.zoneminder.com/How_to_get_ ... Zoneminder

I've also already consulted viewtopic.php?t=20621, etc.

Sending a test email via the provided code works.

Code: Select all

echo "Hello, World" | mail -s "My email check" my_user_id@gmail.com

Code: Select all

2019-03-16 15:54:56	zmfilter_17		4558	ERR	Unable to send email: SMTP mail() command failed: 5.7.0 Must issue a STARTTLS command first. q8sm2357882ioi.33 - gsmtp	zmfilter.pl
2019-03-16 15:54:56	zmfilter_17		4558	INF	Creating notification email	zmfilter.pl	
2019-03-16 15:54:56	zmfilter_17		4558	INF	Sending notification email 'ZoneMinder: Alarm - CameraTest -137 (54 - 19 12)'	zmfilter.pl
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Email fails to send 'Must issue a STARTTLS command first'

Post by snake »

See more configuration tips in
https://wiki.zoneminder.com/SMS_Notifications

You need to configure ssmtp for your email server first. Not an issue with ZM.
RedNumberOne
Posts: 3
Joined: Sat Mar 16, 2019 8:52 pm

Re: Email fails to send 'Must issue a STARTTLS command first'

Post by RedNumberOne »

I've been through that a few times as well and I'm unsure how to proceed as what's below works every time.

Code: Select all

echo "Testing" | ssmtp myusername@gmail.com
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Email fails to send 'Must issue a STARTTLS command first'

Post by snake »

If it is working from the command line then it should work in ZM, just a configuration error somewhere.

In my experience, when this occurs, its because either the checkbox in zm options for new mail module isn't checked, or /etc/ssmtp/revaliases isn't filled out correctly. it tries to send as the wrong user (root or www-data / apache), but you want to send as the user you specified in /etc/ssmtp/ssmtp.conf.

Make sure you use the sendemail that has ssmtp support (not sendmessage)

Add DEBUG=yes to /etc/ssmtp/ssmtp.conf
Post Reply