This is a breakdown of the basic electronic mail or "e-mail" ("email") infrastructure on the Internet.
Mail User Agent
Mail (or Message) Transfer (or Transport) Agent, Mail (or Message) Submission Agent, respectively.
The MTA listens on port 25, as a general rule.
The MSA listens on ports 587 and 465 for the submission of outgoing mail by the MUA.
A common Mail Delivery Agent is Dovecot. The MDA listens for connections from the MUA to check for and pick up incoming mail on ports 143 and 993 for IMAP (Internet Message Access Protocol) and ports 110 and 995 for the older POP (Post Office Protocol).