This error usually indicates an issue with how your email client or server is communicating with the SMTP server. The EHLO command is used by email clients and servers to identify themselves and negotiate features during the SMTP handshake.
Causes of the Error
- Misconfigured Email Server:
- The SMTP server doesn't recognize or accept the EHLO command.
- Blocked or Invalid IP:
- The sending IP address might be blocked or flagged as spam by the receiving server.
- Improper SMTP Configuration:
- Incorrect SMTP authentication settings (username, password, port, etc.).
- SSL/TLS Misconfiguration:
- The server requires encryption, but your client is not set up for SSL/TLS.
- Firewall or Security Rules:
- A firewall may block SMTP traffic or restrict the EHLO command.
Verify SMTP Configuration
1. Check the SMTP Host and Port:
- Port 587: For STARTTLS (preferred for modern email clients)
- Port 465: For SSL (older but still used)
- Port 25: For unencrypted connections (often blocked by ISPs)
Ensure the correct host is specified (e.g., smtp.example.com).
2. Enable Authentication:
- Use your email username and password for SMTP authentication.
- Ensure SMTP Authentication (AUTH LOGIN) is enabled in your email client.
Check TLS/SSL Settings
1. If your server requires encryption:
- Enable SSL/TLS in your email client or application.
- Use port 465 for SSL or port 587 for STARTTLS.
2. Test connection with OpenSSL:
openssl s_client -starttls smtp -connect smtp.example.com:587
Look for 250 responses to confirm the server supports EHLO.
Confirm DNS and Hostname Settings
1. Ensure the sending server's hostname resolves correctly:
nslookup smtp.example.com
2. Check the PTR (reverse DNS) record for your IP address:
dig -x <IP_ADDRESS>
The PTR should resolve to a valid domain name.
Test EHLO with Telnet
1. Connect to the SMTP server:
telnet smtp.example.com 25
2. Send an EHLO command:
EHLO example.com
The server should respond with a 250 code, listing supported features.
Check for IP Blocking
1. Verify if your IP address is blacklisted:
- Use tools like MXToolbox Blacklist Checker.
2. If blacklisted, contact the SMTP provider or follow delisting procedures.
Review Server Logs
If you control the SMTP server:
1. Check the logs for detailed error messages.
- Postfix:
sudo tail -f /var/log/mail.log - Exim:
sudo tail -f /var/log/exim_mainlog
2. Look for errors related to EHLO or authentication.
Example SMTP Configuration
| Setting | Value |
|---|---|
| SMTP Host | smtp.example.com |
| SMTP Port | 587 (STARTTLS) or 465 (SSL) |
| Authentication | Enabled |
| Encryption | STARTTLS or SSL |
| Username | user@example.com |
| Password | Your email account password |
Troubleshooting Table
| Issue | Solution |
|---|---|
| Invalid EHLO response | Check SMTP host and port. |
| Server requires encryption | Enable SSL/TLS or STARTTLS in your configuration. |
| Connection refused on port 25 | Use port 587 or 465. |
| Blocked IP address | Check blacklists and contact the mail provider. |
Summary
The "EHLO not accepted from server!" error generally points to miscommunication between your email client and the SMTP server. By verifying your server settings, testing the connection, and ensuring proper encryption, you should be able to resolve the issue.


