What the message looks like
530 5.7.0 Must issue a STARTTLS command firstCommon causes
- Client or application set to “no encryption”.
- Port 587 configured with implicit TLS or port 465 with STARTTLS – port and mode do not match.
- Postfix enforces TLS via
smtpd_tls_security_level = encryptorsmtpd_tls_auth_only = yes. - The server's TLS certificate is missing or unreadable, so STARTTLS is not offered.
Check
- Check that STARTTLS is offered and which certificate is sent
- Show TLS enforcement in Postfix
postconf -n | grep -E 'smtpd_tls_security_level|smtpd_tls_auth_only|smtpd_tls_cert_file' - Show settings for submission (587) and smtps (465)
postconf -M submission/inet smtps/inet - Search the log for STARTTLS errors
Fix
- In the client choose port 587 with STARTTLS or port 465 with SSL/TLS – never 587 with “none”.
- Set the TLS option in applications, e.g. PHPMailer
SMTPSecure = 'tls'for 587 or'ssl'for 465. - On the server configure a valid certificate in
smtpd_tls_cert_fileandsmtpd_tls_key_file, then runpostfix reload. - Keep
smtpd_tls_security_level = mayon port 25 between servers, otherwise you reject mail from servers without TLS.
Typical scenario
A network printer with scan-to-mail is meant to send through the mail server on port 587, with user name and password set. Sending fails and the Postfix log shows '530 5.7.0 Must issue a STARTTLS command first'. The device opens the session without encryption. First check in the device configuration whether the encryption option is set to 'none', and test with openssl s_client -starttls smtp -connect mail.example.com:587 that the server itself answers correctly.
FAQ
Should I enforce TLS on port 25?
Not globally. Port 25 receives mail from other servers and some of them do not speak TLS. Enforce TLS on 587 and 465 only.
Why does 530 appear right after moving to a new mail server?
The new server enforces TLS while the old one allowed plain logins. Printers, scanners and old scripts must be switched to STARTTLS.
What is the difference between port 587 and 465?
Port 587 starts unencrypted and switches to TLS with STARTTLS (submission), whereas port 465 encrypts from the first line (SMTPS). Both are fine, but the client has to choose the matching mode or you get exactly this error or a handshake failure.
Can I switch off the TLS requirement so the old device works?
Technically yes, via smtpd_tls_auth_only, but then passwords cross the network in clear text. It is better to update the device or to set up a separate relay for that fixed IP only, without login.
Why does it work with a mail client but not with the device?
Mail clients speak modern TLS versions and ciphers. Older devices often support only outdated protocols that the server refuses. Then no STARTTLS is offered or the handshake aborts with a TLS error.