GMail - Must issue a STARTTLS command first

Compresses, encrypts, secures and monitors SQL Server backups.

Moderators: JonathanWatts, Chris Auckland, eddie davis, Colin Millerchip, Brian Harris, james.billings, RBA, petey

GMail - Must issue a STARTTLS command first

Postby sraitken » Fri Sep 07, 2012 6:05 pm

I am getting a "5.7.0 Must issue a STARTTLS command first..." error message popping-up when trying to send a test email via GMail. Settings are:

SMTP host: smtp.gmail.com
Port: 587
UserName: <email address>
Password: <password for above>
Send From: <same as email address in UserName>

Thanks for any help.
sraitken
 
Posts: 5
Joined: Fri Sep 07, 2012 5:59 pm

Postby petey » Mon Sep 10, 2012 8:28 am

SQL Backup's e-mail delivery feature does not support TLS/SSL connections.
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
petey
 
Posts: 2233
Joined: Sun Apr 24, 2005 12:34 pm

Postby spthorn » Tue Sep 16, 2014 3:41 pm

Is this still the case? v7.7.0.18

Will it ever be the case? Our email is provided by Amazon SES, which requires it.
spthorn
 
Posts: 6
Joined: Fri Apr 11, 2014 7:07 pm

Re: GMail - Must issue a STARTTLS command first

Postby petey » Tue Sep 23, 2014 6:59 am

There is a patch available that allows you to send mail via TLS and SSL. Details of the patch and required configuration can be found in this document:

ftp://support.red-gate.com/patches/sql_ ... _patch.pdf
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
petey
 
Posts: 2233
Joined: Sun Apr 24, 2005 12:34 pm

Re: GMail - Must issue a STARTTLS command first

Postby spthorn » Tue Sep 23, 2014 2:41 pm

Peter, I installed the patch files per your attached procedure. Still not getting emails.
SMTP Host: email-smtp.us-east-1.amazonaws.com
Results are the same regardless of SMTPEncoding value in registry (TLS, SSH or blank). Doesn't appear to be any change from before.
I tried the following ports (based on http://docs.aws.amazon.com/ses/latest/D ... nnect.html):
Port Result
465 Screen freezes, after 20 seconds or so it comes back, but no email received
2465 Screen freezes, after 20 seconds or so I get error "Socket Error # 10060 Connection timed out."
25 Screen freezes, after 20 seconds or so I get error "Socket Error # 10060 Connection timed out."
587 Get error "Must issue a STARTTLS command first"
2587 Screen freezes, after 20 seconds or so I get error "Socket Error # 10060 Connection timed out."

I don't doubt that it works with Gmail and Yahoo mail. Nobody else is using Amazon SES (Simple Email Service) with SQL Backup Pro?
spthorn
 
Posts: 6
Joined: Fri Apr 11, 2014 7:07 pm

Re: GMail - Must issue a STARTTLS command first

Postby petey » Tue Sep 23, 2014 5:03 pm

Were you using the SQL Backup GUI to test the sending of emails?
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
petey
 
Posts: 2233
Joined: Sun Apr 24, 2005 12:34 pm

Re: GMail - Must issue a STARTTLS command first

Postby spthorn » Tue Sep 23, 2014 5:05 pm

Yep, the Send Test Email button.
spthorn
 
Posts: 6
Joined: Fri Apr 11, 2014 7:07 pm

Re: GMail - Must issue a STARTTLS command first

Postby petey » Tue Sep 23, 2014 6:17 pm

Could you please try configuring the email server settings as per the document referenced earlier for GMail (TLS, port 587 etc), and run a test backup using SSMS that sends an email e.g.

Code: Select all
EXEC master..sqlbackup '-sql "BACKUP DATABASE model TO DISK = [<AUTO>] WITH MAILTO = [<your email address here>], MAILLIB_SYN"'


Does the email get sent successfully?
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
petey
 
Posts: 2233
Joined: Sun Apr 24, 2005 12:34 pm

Re: GMail - Must issue a STARTTLS command first

Postby spthorn » Tue Sep 23, 2014 6:33 pm

Yes, it did generate the email just fine.

I went ahead and added email notification to one of my half-hourly transaction log backup jobs, just to see if that email would fail as well... and it did. Generated a SQL Backup warning "Warning 151: MAILTO error: Failed to send mail. (Must issue a STARTTLS command first)".
spthorn
 
Posts: 6
Joined: Fri Apr 11, 2014 7:07 pm

Re: GMail - Must issue a STARTTLS command first

Postby petey » Wed Sep 24, 2014 1:19 am

In the job you modified, did you add the MAILLIB_SYN switch e.g.

EXEC master..sqlbackup '-sql "BACKUP DATABASE model TO DISK = [<AUTO>] WITH MAILTO = [me@me.com], MAILLIB_SYN"'
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
petey
 
Posts: 2233
Joined: Sun Apr 24, 2005 12:34 pm

Re: GMail - Must issue a STARTTLS command first

Postby spthorn » Wed Sep 24, 2014 2:08 pm

Ok, Peter, I added that switch to the job via SSMS, and got the email generated as expected.

However, when I attempt to edit the job in SQLBackup, I get the error "Cannot Edit Job <snip> Unknown option: MAILLIB_SYN".

Overall, though, I'm happy I'm getting emails, and can deal with manual edits. Thanks so much for your help!
spthorn
 
Posts: 6
Joined: Fri Apr 11, 2014 7:07 pm

Re: GMail - Must issue a STARTTLS command first

Postby petey » Thu Sep 25, 2014 5:42 pm

Glad to hear you've got it working.

The patch was made only in the SQL Backup engine. The GUI hasn't been patched to recognise the new keyword yet, hence why it's raising that error.
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
petey
 
Posts: 2233
Joined: Sun Apr 24, 2005 12:34 pm


Return to SQL Backup 7

Who is online

Users browsing this forum: No registered users and 0 guests