Within Internet message handling services (MHS), a message transfer agentMTA=Message Transfer Agent (similar to X.400 name) is found, e.g., in RFC 1506, RFC 2476, RFC 3461, RFC 3464, RFC 3865, RFC 3888, RFC 6409, RFC 5598. or mail transfer agentMTA=Mail Transfer Agent (similar to Mail Transfer Protocol) is found, e.g., in RFC 2298, RFC 2305, RFC 3804, RFC 3798, RFC 4496, RFC 5442, RFC 5429. ( MTA) or mail relay is software that transfers electronic mail messages from one computer to another using a client–server application architecture. An MTA implements both the client (sending) and server (receiving) portions of the Simple Mail Transfer Protocol. RFC 5598, Internet Mail Architecture, D. Crocker (July 2009).
The terms mail server, mail exchanger, and MX host may also refer to a computer performing the MTA function. The Domain Name System (DNS) associates a mail server to a domain with an MX record containing the domain name of the host(s) providing MTA services.
A mail server is a computer that serves as an electronic post office for email. Mail exchanged across networks is passed between mail servers that run specially designed software. This software is built around agreed-upon, standardized protocols for handling not only mail messages, but also any data files (such as images, multimedia or documents) that might be attached to them.
An MTA works in the background, while the user usually interacts directly with a mail user agent. One may distinguish initial submission as first passing through an MSA – port 587 is used for communication between an MUA and an MSA, while port 25 is used for communication between MTAs, or from an MSA to an MTA;See table at Email client#Port numbers this distinction is first made in RFC 2476.
For recipients hosted locally, the final delivery of email to a recipient mailbox is the task of a message delivery agent (MDA). For this purpose the MTA transfers the message to the message handling service component of the message delivery agent (MDA). Upon final delivery, the Return-Path field is added to the envelope to record the return path.
At its most basic, an MUA using POP3 downloads messages from the server mailbox onto the local computer for display in the MUA. Messages are generally removed from the server at the same time but most systems also allow a copy to be left behind as a backup. In contrast, an MUA using IMAP displays messages directly from the server, although a download option for archive purposes is usually also available. One advantage this gives IMAP is that the same messages are visible from any computer accessing the email account, since messages aren't routinely downloaded and deleted from the server. If set up properly, sent mail can be saved to the server also, in contrast with POP mail, where sent messages exist only in the local MUA and are not visible by other MUAs accessing the same account.
The IMAP protocol has features that allow uploading of mail messages and there are implementations that can be configured to also send messages like an MTA,E.g. Courier mail server IMAP's Outbox feature, not fully supported by clients. which combine sending a copy and storing a copy in the Sent folder in one upload operation.
The reason for using SMTP as a standalone transfer protocol is twofold: