Author Topic: SMTP Error (530) 5.7.0 Must issue a STARTTLS command first  (Read 15160 times)

Offline SipriusPT

  • Jr. Member
  • **
  • Posts: 36
SMTP Error (530) 5.7.0 Must issue a STARTTLS command first
« on: November 23, 2016, 12:31:48 PM »
Hello guys,

I am trying to use port 587 in roundcubemail running in the same machine as my mail server, and i am always receiving this error:

Quote
SMTP Error (530): Failed to set sender "X" (5.7.0 Must issue a STARTTLS command first).

I have already changed at master.cf from postfix,

Quote
smtpd_tls_security_level=encrypt

to

Quote
smtpd_tls_security_level=may

and nothing happen, and i have already 'submission' uncommented. Those was the solutions that i have found to solve this problem, but till now no result here.

Main.cf: http://pastebin.com/aEtC0AJt

Master.cf: http://pastebin.com/023uu2T8

Config.inc.php: http://pastebin.com/F2aenRum

Default.inc.php (IMAP and SMTP configs): http://pastebin.com/nFvmFNf9

System specs:
1. PHP Version 5.6.25
2. Postfix
4. Dovecot
3. MacOS 10.12

And i dont know if it is related but i cannot login through IMAP port 993. With that port i am getting,

Quote
IMAP Error: Login failed for X from 127.0.0.1(X-Forwarded-For: 192.168.1.1). Empty startup greeting (localhost:993) in /Library/Server/Web/Data/Sites/Default/program/lib/Roundcube/rcube_imap.php on line 193 (POST /?_task=login&_action=login)

I am only able to use ports 25 and 143 without SSL.

Never saw this error before, and i think that what is causing it is something with PHP or roundcube but i dont know exactly what can be.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Re: SMTP Error (530) 5.7.0 Must issue a STARTTLS command first
« Reply #1 on: November 23, 2016, 01:10:23 PM »
$config['smtp_server'] = 'tls://localhost'; For imap issue it looks like a problem on imap server side.

Offline SipriusPT

  • Jr. Member
  • **
  • Posts: 36
Re: SMTP Error (530) 5.7.0 Must issue a STARTTLS command first
« Reply #2 on: November 24, 2016, 04:15:22 AM »
$config['smtp_server'] = 'tls://localhost'; For imap issue it looks like a problem on imap server side.

Thanks alec, after you said that i notice in SMTP comments that warning in config.inc.php and defautl.inc.php.

I am still unable to use that port. I will have to check my imap server dovecot and smtp server postfix.


Offline TomHsiung

  • Jr. Member
  • **
  • Posts: 16
Re: SMTP Error (530) 5.7.0 Must issue a STARTTLS command first
« Reply #3 on: February 16, 2019, 08:28:39 AM »
I have encountered the same issue.

Offline guihin

  • Newbie
  • *
  • Posts: 3
Re: SMTP Error (530) 5.7.0 Must issue a STARTTLS command first
« Reply #4 on: February 25, 2023, 10:28:00 AM »
STARTTLS ist not the same like TLS an uses another port an protocol.
For me this configuration worked well on ubuntu 22.04 with postfix, dovecot, nginx and letsencrypt.

Code: [Select]
# SMTP
$config['smtp_server'] = 'ssl://mail.server.tld';  # maybe localhost works too
$config['smtp_port'] = 465;
$config['smtp_timeout'] = 5;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['smtp_auth_type'] = 'LOGIN';
$config['smtp_conn_options'] = [
  'ssl' => [
    'verify_peer' => true,
    'verify_depth' => 3,
    'peer_name' => 'mail.server.tld',
    'cafile' => '/etc/ssl/certs/ca-certificates.crt'
  ],
];