Networking
Risk: Medium

Port 587 β€” SMTP Submission (STARTTLS)

Port 587 is the modern standard port for email client-to-server message submission (e.g. SendGrid, Mailgun, Amazon SES) protected by mandatory STARTTLS encryption.

PORT NUMBER

587

PROTOCOL

TCP

DEFAULT PROCESS

postfix, exim4

FIREWALL TARGET

587/tcp

Instant Terminal Fixes for Port 587

macOS & Linux Terminal
1. Check who is listening on port 587:
openssl s_client -starttls smtp -connect smtp.gmail.com:587
2. Kill process occupying port 587 (EADDRINUSE fix):
sudo systemctl restart postfix
3. UFW Firewall Allow rule:
sudo ufw allow 587/tcp
Windows PowerShell (Admin)
1. Check listening port:
Test-NetConnection -ComputerName smtp.sendgrid.net -Port 587
2. Force kill process on port 587:
Get-NetTCPConnection -LocalPort 587
3. Docker Port Forwarding Mapping:
docker run -p 587:587 -d my-mail-server

Common Error Encountered

535 5.7.8 Error: authentication failed on SMTP port 587

Security Advisory & Hardening

Requires SMTP authentication before relaying any messages to prevent open-relay abuse.

Frequently Asked Questions

Port 587 Questions & Answers

Common questions regarding default services, kill commands, and firewall configurations.

Port 587 is commonly used for SMTP Submission (STARTTLS). Port 587 is the modern standard port for email client-to-server message submission (e.g. SendGrid, Mailgun, Amazon SES) protected by mandatory STARTTLS encryption.