Android Question Foutmelding : STARTTLS command used when not advertised

ViMeAv ICT

Member
Licensed User
Longtime User
I'm using the Net 1.81 library for sending mail by smtp.
Until now never had problems. But suddenly today I get this error:
java.net.ssl.ssl.exception: 503 starttls command used when not advertised

What can be the problem?
 

JohnC

Expert
Licensed User
Longtime User
ChatGPT says....

The SMTP error "503 starttls command used when not advertised" indicates an issue related to the attempt to secure an email connection using TLS (Transport Layer Security) when the [SMTP] server hasn't indicated that it supports or is ready for a TLS upgrade. In SMTP communication, servers can advertise their capabilities using responses to certain commands, including the ability to switch to a secure TLS channel.

Here's a breakdown of what this error means:

  1. 503 Error Code: In SMTP, a 503 error generally indicates a bad sequence of commands. This means that the command was out of order based on the expected workflow or that a necessary preliminary step was not completed.
  2. STARTTLS Command: The STARTTLS command is used in SMTP (and other protocols) to initiate a switch from a non-secure connection to a secure connection using TLS encryption. This is important for protecting sensitive information contained in emails from interception or eavesdropping.
  3. Not Advertised: This part of the error message means that the server did not include STARTTLS in the list of supported capabilities when it communicated its features. SMTP clients should only issue the STARTTLS command after the server has indicated support for it. If the server does not advertise this capability, it may not support TLS, or the connection may already be encrypted, rendering the command unnecessary or incorrect.
To resolve this issue, you might consider the following steps:
  • Check Server Configuration: Ensure that the server is correctly configured to support TLS and that it is advertising this capability properly. This might involve reviewing the server's SMTP settings and ensuring that all necessary TLS certificates are in place.
  • Review Client Behavior: The client (or email sending software) should wait to receive the server's capabilities before issuing the STARTTLS command. If the error persists, it may be necessary to review the client's settings or update its software to ensure it handles the STARTTLS negotiation correctly.
  • Consult Documentation: Server and client documentation can offer specific insights into configuring TLS settings and troubleshooting errors related to STARTTLS.
If you're administering the server or client in question, these steps can help address the underlying issue. If you're an end user encountering this error, you may need to contact your email provider or IT support for further assistance.

@JohnC: So, if you did not change anything in your app, then maybe something changed on the SMTP server side, like a certificate expired. What is the SMTP server you are using?
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Upvote 0

ViMeAv ICT

Member
Licensed User
Longtime User
I'm trying to contact them.
It's strange, sending by this smtp server using starttls from outlook there's no problem.
Also other programs using this smtp server have no problems.
Actually for now it's only my android apps, having this problem, when using starttls.
 
Last edited:
Upvote 0

ViMeAv ICT

Member
Licensed User
Longtime User
the provider says : nothing changed recently and can't help.
When i use SSL instead of STARTTLS I get following error:

java.lang.RuntimeException :
Empty writer returned:
503-All RCPT commands were rejected with this error:
503-503 sender not yet given
503-valid RCPT command must precede DATA
503 Too many syntax or protocol errors
 
Upvote 0

ViMeAv ICT

Member
Licensed User
Longtime User
When I put the android tablet in my home network wifi, 2.4 ghz or 5 ghz, these errors appear.
But when I connect the android tablet to my smartphone, using the 4G network, i get no errors and the mail is perfectly send.
So it has to do with my network using this specific smtp server.
Using another smtp server has no problems.
 
Upvote 0
Top