TCP port 587 is the standard port for SMTP message submission, meaning mail sent from users or applications to their outgoing mail server.
A port is a transport layer number used together with an IP address and a protocol such as TCP or UDP to direct traffic to the correct service on a host.
A server process binds a socket to a port and listens, while a client typically chooses an ephemeral source port for outbound connections.
The combination of source and destination IP addresses, source and destination ports, and the transport protocol uniquely identifies a flow so the operating system can keep many conversations separate.
Firewalls, NAT, and scanners talk about ports because the destination port is the stable rendezvous point that exposes a service to the network.
A submission server listens on 587 and a client connects from an ephemeral source port.
After the TCP handshake, the two sides exchange SMTP commands, and the session typically upgrades to TLS using STARTTLS before credentials are sent.
The client then authenticates and submits the message, and the server applies policy and relays it onward.
This is different from port 25, which is mainly server to server relay, and from port 465, which expects TLS immediately rather than negotiating an upgrade.
From a security view, 587 is designed for authentication and abuse controls.
If it is misconfigured as an open relay or if credentials are weak, attackers can use it to send spam or to impersonate users.