How to Read Email Body as Plane Text in C#
The Simple Mail Transfer Protocol (SMTP) is an internet standard communication protocol for electronic postal service transmission. Mail service servers and other message transfer agents use SMTP to send and receive postal service letters. User-level email clients typically use SMTP only for sending messages to a mail service server for relaying, and typically submit outgoing email to the post server on port 587 or 465 per RFC 8314. For retrieving messages, IMAP (which replaced the older POP3) is standard, but proprietary servers as well often implement proprietary protocols, e.one thousand., Exchange ActiveSync.
Since SMTP'southward introduction in 1981, it has been updated, modified and extended multiple times. The protocol version in common utilize today has extensible structure with various extensions for authentication, encryption, binary data transfer, and internationalized email addresses. SMTP servers commonly use the Transmission Command Protocol on port number 25 (for plaintext) and 587 (for encrypted communications).
History [edit]
Predecessors to SMTP [edit]
Various forms of one-to-one electronic messaging were used in the 1960s. Users communicated using systems developed for specific mainframe computers. As more computers were interconnected, especially in the U.Due south. Government's ARPANET, standards were developed to allow commutation of messages between different operating systems. SMTP grew out of these standards developed during the 1970s.
SMTP traces its roots to two implementations described in 1971: the Mail Box Protocol, whose implementation has been disputed,[ii] but is discussed in RFC 196 and other RFCs, and the SNDMSG program, which, according to RFC 2235, Ray Tomlinson of BBN invented for TENEX computers to send mail service messages across the ARPANET.[3] [4] [5] Fewer than 50 hosts were connected to the ARPANET at this fourth dimension.[vi]
Farther implementations include FTP Mail[7] and Mail Protocol, both from 1973.[eight] Evolution piece of work continued throughout the 1970s, until the ARPANET transitioned into the modern Cyberspace around 1980.
Original SMTP [edit]
In 1980, Jon Postel published RFC 772 which proposed the Mail Transfer Protocol as a replacement of the utilize of the File Transfer Protocol (FTP) for post. RFC 780 of May 1981 removed all references to FTP and allocated port 57 for TCP and UDP[ citation needed ], an allocation that has since been removed by IANA. In November 1981, Postel published RFC 788 "Unproblematic Mail service Transfer Protocol".
The SMTP standard was adult around the aforementioned fourth dimension as Usenet, a ane-to-many communication network with some similarities.[ citation needed ]
SMTP became widely used in the early on 1980s. At the time, it was a complement to the Unix to Unix Re-create Programme (UUCP), which was amend suited for handling email transfers betwixt machines that were intermittently connected. SMTP, on the other hand, works best when both the sending and receiving machines are connected to the network all the time. Both used a store and forward mechanism and are examples of push technology. Though Usenet'southward newsgroups were still propagated with UUCP betwixt servers,[9] UUCP as a mail transport has virtually disappeared[10] along with the "bang paths" it used equally message routing headers.[11]
Sendmail, released with four.1cBSD in 1982, soon after RFC 788 was published in November 1981, was 1 of the starting time mail service transfer agents to implement SMTP.[12] Over time, as BSD Unix became the most popular operating system on the Net, Sendmail became the most common MTA (mail transfer agent).[xiii]
The original SMTP protocol supported only unauthenticated unencrypted 7-scrap ASCII text communications, susceptible to trivial human being-in-the-middle attack, spoofing, and spamming, and requiring any binary data to be encoded to readable text before transmission. Due to absenteeism of a proper authentication machinery, by design every SMTP server was an open mail relay. The Net Mail Consortium (IMC) reported that 55% of mail servers were open up relays in 1998,[14] only less than 1% in 2002.[xv] Because of spam concerns nigh email providers blocklist open up relays,[16] making original SMTP essentially impractical for general use on the Internet.
Modern SMTP [edit]
In November 1995, RFC 1869 defined Extended Uncomplicated Mail service Transfer Protocol (ESMTP), which established a full general structure for all existing and time to come extensions which aimed to add together-in the features missing from the original SMTP. ESMTP defines consistent and manageable means by which ESMTP clients and servers can be identified and servers tin can indicate supported extensions.
Message submission (RFC 2476) and SMTP-AUTH (RFC 2554) were introduced in 1998 and 1999, both describing new trends in email delivery. Originally, SMTP servers were typically internal to an organization, receiving post for the organisation from the exterior, and relaying messages from the organization to the outside. But as fourth dimension went on, SMTP servers (mail transfer agents), in do, were expanding their roles to become message submission agents for Post user agents, some of which were now relaying mail service from the outside of an organization. (due east.g. a company executive wishes to send email while on a trip using the corporate SMTP server.) This issue, a consequence of the rapid expansion and popularity of the World Wide Web, meant that SMTP had to include specific rules and methods for relaying mail and authenticating users to preclude abuses such as relaying of unsolicited e-mail (spam). Piece of work on message submission (RFC 2476) was originally started because popular mail servers would ofttimes rewrite mail in an attempt to fix problems in it, for example, calculation a domain name to an unqualified address. This behavior is helpful when the bulletin beingness fixed is an initial submission, just dangerous and harmful when the message originated elsewhere and is being relayed. Cleanly separating postal service into submission and relay was seen as a way to permit and encourage rewriting submissions while prohibiting rewriting relay. As spam became more prevalent, it was too seen as a way to provide authorization for mail being sent out from an organization, also as traceability. This separation of relay and submission quickly became a foundation for modern electronic mail security practices.
As this protocol started out purely ASCII text-based, it did not deal well with binary files, or characters in many not-English languages. Standards such every bit Multipurpose Internet Postal service Extensions (MIME) were developed to encode binary files for transfer through SMTP. Mail transfer agents (MTAs) developed subsequently Sendmail besides tended to be implemented 8-bit-clean, and then that the alternate "but send 8" strategy could be used to transmit arbitrary text data (in whatever viii-bit ASCII-like grapheme encoding) via SMTP. Mojibake was still a problem due to differing grapheme set mappings between vendors, although the email addresses themselves all the same allowed only ASCII. eight-bit-clean MTAs today tend to support the 8BITMIME extension, permitting some binary files to be transmitted most equally easily as plain text (limits on line length and permitted octet values still utilise, so that MIME encoding is needed for most non-text data and some text formats). In 2012, the SMTPUTF8 extension was created to back up UTF-8 text, allowing international content and addresses in not-Latin scripts similar Cyrillic or Chinese.
Many people contributed to the core SMTP specifications, among them Jon Postel, Eric Allman, Dave Crocker, Ned Freed, Randall Gellens, John Klensin, and Keith Moore.
Mail service processing model [edit]
Blue arrows describe implementation of SMTP variations
Email is submitted past a mail service client (mail service user agent, MUA) to a mail server (mail service submission agent, MSA) using SMTP on TCP port 587. Most mailbox providers still allow submission on traditional port 25. The MSA delivers the mail to its postal service transfer agent (mail transfer agent, MTA). Often, these two agents are instances of the same software launched with different options on the same automobile. Local processing tin be done either on a single motorcar, or split amidst multiple machines; mail agent processes on ane machine can share files, but if processing is on multiple machines, they transfer messages between each other using SMTP, where each automobile is configured to utilise the next auto as a smart host. Each process is an MTA (an SMTP server) in its own correct.
The boundary MTA uses DNS to look up the MX (mail exchanger) record for the recipient's domain (the part of the email address on the right of @). The MX record contains the name of the target MTA. Based on the target host and other factors, the sending MTA selects a recipient server and connects to it to complete the mail exchange.
Message transfer can occur in a single connexion between two MTAs, or in a serial of hops through intermediary systems. A receiving SMTP server may be the ultimate destination, an intermediate "relay" (that is, information technology stores and forwards the message) or a "gateway" (that is, it may forward the message using some protocol other than SMTP). Per RFC 5321 section 2.i, each hop is a formal handoff of responsibility for the bulletin, whereby the receiving server must either evangelize the message or properly report the failure to practice so.
In one case the final hop accepts the incoming message, it easily it to a mail delivery agent (MDA) for local commitment. An MDA saves messages in the relevant mailbox format. Equally with sending, this reception can exist done using one or multiple computers, just in the diagram above the MDA is depicted every bit one box nearly the mail exchanger box. An MDA may evangelize messages direct to storage, or forward them over a network using SMTP or other protocol such as Local Mail service Transfer Protocol (LMTP), a derivative of SMTP designed for this purpose.
Once delivered to the local mail server, the mail is stored for batch retrieval by authenticated post clients (MUAs). Mail is retrieved past end-user applications, called e-mail clients, using Cyberspace Bulletin Access Protocol (IMAP), a protocol that both facilitates access to mail and manages stored mail, or the Post Office Protocol (Popular) which typically uses the traditional mbox mail file format or a proprietary organization such every bit Microsoft Commutation/Outlook or Lotus Notes/Domino. Webmail clients may utilize either method, simply the retrieval protocol is often not a formal standard.
SMTP defines message transport, not the message content. Thus, information technology defines the mail envelope and its parameters, such as the envelope sender, but not the header (except trace information) nor the body of the message itself. STD 10 and RFC 5321 define SMTP (the envelope), while STD 11 and RFC 5322 define the message (header and body), formally referred to as the Internet Message Format.
Protocol overview [edit]
SMTP is a connection-oriented, text-based protocol in which a mail sender communicates with a mail receiver past issuing command strings and supplying necessary data over a reliable ordered data stream channel, typically a Transmission Control Protocol (TCP) connection. An SMTP session consists of commands originated by an SMTP client (the initiating agent, sender, or transmitter) and respective responses from the SMTP server (the listening amanuensis, or receiver) then that the session is opened, and session parameters are exchanged. A session may include zero or more SMTP transactions. An SMTP transaction consists of three control/reply sequences:
- MAIL control, to establish the render address, as well called return-path,[17] reverse-path,[18] bounce address, mfrom, or envelope sender.
- RCPT control, to establish a recipient of the message. This command can be issued multiple times, ane for each recipient. These addresses are also part of the envelope.
- Information to signal the outset of the message text; the content of the message, as opposed to its envelope. It consists of a message header and a message body separated by an empty line. DATA is actually a group of commands, and the server replies twice: in one case to the Data command itself, to acknowledge that it is set to receive the text, and the second time subsequently the cease-of-data sequence, to either accept or reject the entire message.
Besides the intermediate reply for Data, each server'southward reply can be either positive (2xx respond codes) or negative. Negative replies can be permanent (5xx codes) or transient (4xx codes). A turn down is a permanent failure and the client should send a bounce bulletin to the server information technology received information technology from. A driblet is a positive response followed by message discard rather than commitment.
The initiating host, the SMTP client, can be either an finish-user's email client, functionally identified every bit a post user agent (MUA), or a relay server's mail transfer agent (MTA), that is an SMTP server acting as an SMTP customer, in the relevant session, in order to relay mail service. Fully capable SMTP servers maintain queues of messages for retrying message transmissions that resulted in transient failures.
A MUA knows the outgoing postal service SMTP server from its configuration. A relay server typically determines which server to connect to by looking up the MX (Post substitution) DNS resource record for each recipient's domain proper name. If no MX record is found, a conformant relaying server (not all are) instead looks upwards the A tape. Relay servers can too be configured to employ a smart host. A relay server initiates a TCP connexion to the server on the "well-known port" for SMTP: port 25, or for connecting to an MSA, port 587. The main divergence between an MTA and an MSA is that connecting to an MSA requires SMTP Authentication.
SMTP vs mail retrieval [edit]
SMTP is a delivery protocol merely. In normal use, mail is "pushed" to a destination post server (or next-hop mail service server) as it arrives. Mail is routed based on the destination server, not the private user(south) to which information technology is addressed. Other protocols, such as the Postal service Part Protocol (POP) and the Cyberspace Message Access Protocol (IMAP) are specifically designed for use past individual users retrieving messages and managing postal service boxes. To let an intermittently-connected mail server to pull messages from a remote server on demand, SMTP has a feature to initiate postal service queue processing on a remote server (see Remote Message Queue Starting below). POP and IMAP are unsuitable protocols for relaying mail by intermittently-connected machines; they are designed to operate after final commitment, when data disquisitional to the correct operation of mail relay (the "postal service envelope") has been removed.
Remote Bulletin Queue Starting [edit]
Remote Message Queue Starting enables a remote host to start processing of the mail queue on a server so it may receive letters destined to it by sending a respective command. The original Plow command was accounted insecure and was extended in RFC 1985 with the ETRN command which operates more securely using an authentication method based on Domain Proper noun System data.[nineteen]
Outgoing mail service SMTP server [edit]
An electronic mail client needs to know the IP accost of its initial SMTP server and this has to be given as office of its configuration (usually given as a DNS name). This server volition evangelize outgoing letters on behalf of the user.
Approachable mail service server admission restrictions [edit]
Server administrators demand to impose some control on which clients tin use the server. This enables them to deal with abuse, for example spam. Two solutions take been in common employ:
- In the by, many systems imposed usage restrictions past the location of the client, but permitting usage by clients whose IP address is one that the server administrators control. Usage from any other customer IP accost is disallowed.
- Modern SMTP servers typically offer an culling organisation that requires hallmark of clients by credentials before allowing access.
Restricting access by location [edit]
Nether this arrangement, an ISP'southward SMTP server will not allow admission by users who are exterior the ISP's network. More precisely, the server may just allow access to users with an IP address provided by the ISP, which is equivalent to requiring that they are continued to the Cyberspace using that same ISP. A mobile user may often be on a network other than that of their normal ISP, and will then find that sending email fails considering the configured SMTP server choice is no longer attainable.
This system has several variations. For case, an organisation'south SMTP server may only provide service to users on the same network, enforcing this by firewalling to cake admission by users on the wider Internet. Or the server may perform range checks on the client's IP accost. These methods were typically used by corporations and institutions such equally universities which provided an SMTP server for outbound mail just for utilize internally within the organisation. However, most of these bodies now use customer hallmark methods, as described below.
Where a user is mobile, and may use different ISPs to connect to the internet, this kind of usage restriction is onerous, and altering the configured outbound email SMTP server address is impractical. It is highly desirable to be able to use e-mail client configuration information that does not demand to change.
Client authentication [edit]
Modern SMTP servers typically require authentication of clients by credentials before allowing access, rather than restricting admission past location equally described earlier. This more than flexible system is friendly to mobile users and allows them to have a fixed choice of configured outbound SMTP server. SMTP Authentication, often abbreviated SMTP AUTH, is an extension of the SMTP in social club to log in using an authentication mechanism.
Ports [edit]
Communication between mail servers generally uses the standard TCP port 25 designated for SMTP.
Mail clients yet generally don't use this, instead using specific "submission" ports. Mail services by and large accept electronic mail submission from clients on one of:
- 587 (Submission), as formalized in RFC 6409 (previously RFC 2476)
- 465 This port was deprecated after RFC 2487, until the result of RFC 8314.
Port 2525 and others may be used by some individual providers, but have never been officially supported.
Many Net service providers now block all outgoing port 25 traffic from their customers. Mainly every bit an anti-spam measure out,[20] but besides to cure for the higher cost they have when leaving it open up, perhaps by charging more from the few customers that require it open.
SMTP transport case [edit]
A typical example of sending a message via SMTP to two mailboxes (alice and theboss) located in the same mail domain (instance.com) is reproduced in the following session commutation. (In this case, the conversation parts are prefixed with Southward: and C:, for server and customer, respectively; these labels are not part of the substitution.)
Subsequently the message sender (SMTP client) establishes a reliable communications aqueduct to the message receiver (SMTP server), the session is opened with a greeting by the server, usually containing its fully qualified domain name (FQDN), in this case smtp.example.com. The client initiates its dialog by responding with a HELO command identifying itself in the control'southward parameter with its FQDN (or an address literal if none is bachelor).[21]
S: 220 smtp.example.com ESMTP Postfix C: HELO relay.example.org South: 250 How-do-you-do relay.case.org, I am glad to run across you C: MAIL FROM:<bob@case.org> S: 250 Ok C: RCPT TO:<alice@instance.com> S: 250 Ok C: RCPT TO:<theboss@example.com> S: 250 Ok C: Information Southward: 354 Finish information with <CR><LF>.<CR><LF> C: From: "Bob Instance" <bob@example.org> C: To: "Alice Example" <alice@example.com> C: Cc: theboss@instance.com C: Date: Tue, 15 Jan 2008 16:02:43 -0500 C: Bailiwick: Test message C: C: Hello Alice. C: This is a test message with 5 header fields and 4 lines in the bulletin body. C: Your friend, C: Bob C: . S: 250 Ok: queued as 12345 C: QUIT Southward: 221 Cheerio {The server closes the connection}
The customer notifies the receiver of the originating e-mail address of the bulletin in a MAIL FROM command. This is likewise the return or bounciness address in instance the bulletin cannot be delivered. In this case the e-mail message is sent to two mailboxes on the same SMTP server: one for each recipient listed in the To: and Cc: header fields. The corresponding SMTP command is RCPT TO. Each successful reception and execution of a control is best-selling past the server with a consequence code and response message (e.thousand., 250 Ok).
The transmission of the body of the postal service message is initiated with a DATA command after which information technology is transmitted verbatim line by line and is terminated with an end-of-data sequence. This sequence consists of a new-line (<CR><LF>), a single total stop (.), followed past another new-line (<CR><LF>). Since a bulletin torso can comprise a line with just a catamenia as part of the text, the client sends two periods every fourth dimension a line starts with a menstruum; correspondingly, the server replaces every sequence of two periods at the beginning of a line with a single one. Such escaping method is chosen dot-stuffing.
The server'southward positive respond to the end-of-data, every bit exemplified, implies that the server has taken the responsibility of delivering the message. A message tin exist doubled if in that location is a advice failure at this fourth dimension, e.k. due to a power shortage: Until the sender has received that 250 Ok reply, information technology must assume the bulletin was not delivered. On the other hand, subsequently the receiver has decided to take the message, it must assume the message has been delivered to information technology. Thus, during this fourth dimension span, both agents have active copies of the message that they will try to deliver.[22] The probability that a communication failure occurs exactly at this step is directly proportional to the amount of filtering that the server performs on the message body, most ofttimes for anti-spam purposes. The limiting timeout is specified to be 10 minutes.[23]
The QUIT command ends the session. If the electronic mail has other recipients located elsewhere, the client would QUIT and connect to an advisable SMTP server for subsequent recipients later the electric current destination(s) had been queued. The information that the client sends in the HELO and Postal service FROM commands are added (not seen in example code) as additional header fields to the message past the receiving server. It adds a Received and Render-Path header field, respectively.
Some clients are implemented to shut the connection afterwards the message is accepted (250 Ok: queued as 12345), so the concluding 2 lines may actually be omitted. This causes an error on the server when trying to send the 221 Bye reply.
SMTP Extensions [edit]
Extension discovery mechanism [edit]
Clients acquire a server'southward supported options by using the EHLO greeting, as exemplified below, instead of the original HELO. Clients fall back to HELO just if the server does not support EHLO greeting.[24]
Modernistic clients may use the ESMTP extension keyword SIZE to query the server for the maximum bulletin size that volition exist accepted. Older clients and servers may try to transfer excessively sized letters that will be rejected after consuming network resources, including connect fourth dimension to network links that is paid by the minute.[25]
Users can manually determine in advance the maximum size accepted past ESMTP servers. The customer replaces the HELO command with the EHLO command.
Southward: 220 smtp2.example.com ESMTP Postfix C: EHLO bob.example.org S: 250-smtp2.example.com Howdy bob.instance.org [192.0.two.201] S: 250-SIZE 14680064 S: 250-PIPELINING S: 250 HELP
Thus smtp2.instance.com declares that it tin can accept a stock-still maximum message size no larger than 14,680,064 octets (8-bit bytes).
In the simplest case, an ESMTP server declares a maximum SIZE immediately after receiving an EHLO. According to RFC 1870, however, the numeric parameter to the SIZE extension in the EHLO response is optional. Clients may instead, when issuing a MAIL FROM control, include a numeric guess of the size of the message they are transferring, so that the server can pass up receipt of overly-large messages.
Binary data transfer [edit]
Original SMTP supports only a unmarried body of ASCII text, therefore whatsoever binary information needs to be encoded as text into that body of the message earlier transfer, and and so decoded by the recipient. Binary-to-text encodings, such as uuencode and BinHex were typically used.
The 8BITMIME command was developed to address this. It was standardized in 1994 as RFC 1652[26] Information technology facilitates the transparent commutation of e-mail letters containing octets outside the vii-bit ASCII character set by encoding them as MIME content parts, typically encoded with Base64.
Mail delivery machinery extensions [edit]
On-Need Mail Relay [edit]
On-Demand Mail Relay (ODMR) is an SMTP extension standardized in RFC 2645 that allows an intermittently-connected SMTP server to receive email queued for it when it is connected.
Internationalization extension [edit]
Original SMTP supports electronic mail addresses composed of ASCII characters only, which is inconvenient for users whose native script is not Latin based, or who utilize diacritic not in the ASCII character fix. This limitation was alleviated via extensions enabling UTF-8 in address names. RFC 5336 introduced experimental[25] UTF8SMTP command and later was superseded by RFC 6531 that introduced SMTPUTF8 control. These extensions provide back up for multi-byte and not-ASCII characters in e-mail addresses, such as those with diacritics and other linguistic communication characters such equally Greek and Chinese.[27]
Current back up is limited, but in that location is strong interest in wide adoption of RFC 6531 and the related RFCs in countries similar China that have a large user base of operations where Latin (ASCII) is a foreign script.
Extensions [edit]
Like SMTP, ESMTP is a protocol used to transport Cyberspace postal service. It is used as both an inter-server ship protocol and (with restricted behavior enforced) a post submission protocol.
The principal identification feature for ESMTP clients is to open up a transmission with the command EHLO (Extended Hello), rather than HELO (Hello, the original RFC 821 standard). A server will respond with success (code 250), failure (code 550) or fault (lawmaking 500, 501, 502, 504, or 421), depending on its configuration. An ESMTP server returns the lawmaking 250 OK in a multi-line reply with its domain and a list of keywords to betoken supported extensions. A RFC 821 compliant server returns error code 500, allowing ESMTP clients to endeavour either HELO or QUIT.
Each service extension is divers in an approved format in subsequent RFCs and registered with the Cyberspace Assigned Numbers Dominance (IANA). The offset definitions were the RFC 821 optional services: SEND, SOML (Send or Post), SAML (Send and Mail service), EXPN, HELP, and TURN. The format of additional SMTP verbs was set and for new parameters in MAIL and RCPT.
Some relatively common keywords (not all of them corresponding to commands) used today are:
-
8BITMIME– 8 bit data transmission, RFC 6152 -
ATRN– AuthenticatedTURNfor On-Demand Mail Relay, RFC 2645 -
AUTH– Authenticated SMTP, RFC 4954 -
CHUNKING– Chunking, RFC 3030 -
DSN– Delivery status notification, RFC 3461 (See Variable envelope return path) -
ETRN– Extended version of remote message queue starting commandTURN, RFC 1985 -
HELP– Supply helpful information, RFC 821 -
PIPELINING– Command pipelining, RFC 2920 -
SIZE– Message size declaration, RFC 1870 -
STARTTLS– Ship Layer Security, RFC 3207 (2002) -
SMTPUTF8– Let UTF-8 encoding in mailbox names and header fields, RFC 6531 -
UTF8SMTP– Permit UTF-viii encoding in mailbox names and header fields, RFC 5336 (deprecated[28])
The ESMTP format was restated in RFC 2821 (superseding RFC 821) and updated to the latest definition in RFC 5321 in 2008. Support for the EHLO command in servers became mandatory, and HELO designated a required fallback.
Non-standard, unregistered, service extensions can be used by bilateral agreement, these services are indicated by an EHLO message keyword starting with "X", and with any additional parameters or verbs similarly marked.
SMTP commands are case-insensitive. They are presented hither in capitalized grade for emphasis only. An SMTP server that requires a specific capitalization method is a violation of the standard.[ citation needed ]
8BITMIME [edit]
At least the following servers annunciate the 8BITMIME extension:
- Apache James (since 2.iii.0a1)[29]
- Citadel (since 7.30)
- Courier Mail Server
- Gmail[thirty]
- IceWarp
- IIS SMTP Service
- Kerio Connect
- Lotus Domino
- Microsoft Exchange Server (as of Exchange Server 2000)
- Novell GroupWise
- OpenSMTPD
- Oracle Communications Messaging Server
- Postfix
- Sendmail (since six.57)
The following servers tin be configured to annunciate 8BITMIME, only do non perform conversion of 8-bit data to 7-flake when connecting to non-8BITMIME relays:
- Exim and qmail exercise not interpret eight-fleck messages to 7-bit when making an attempt to relay 8-bit data to non-8BITMIME peers, as is required past the RFC.[31] This does not cause problems in do, since virtually all modern mail relays are viii-scrap clean.[32]
- Microsoft Exchange Server 2003 advertises 8BITMIME by default, but relaying to a not-8BITMIME peer results in a bounciness. This is immune past RFC 6152 section 3.
SMTP-AUTH [edit]
The SMTP-AUTH extension provides an admission control machinery. It consists of an authentication pace through which the client finer logs into the mail service server during the process of sending mail. Servers that support SMTP-AUTH can usually exist configured to require clients to use this extension, ensuring the true identity of the sender is known. The SMTP-AUTH extension is defined in RFC 4954.
SMTP-AUTH can be used to allow legitimate users to relay mail service while denying relay service to unauthorized users, such equally spammers. It does not necessarily guarantee the actuality of either the SMTP envelope sender or the RFC 2822 "From:" header. For instance, spoofing, in which one sender masquerades as someone else, is notwithstanding possible with SMTP-AUTH unless the server is configured to limit message from-addresses to addresses this AUTHed user is authorized for.
The SMTP-AUTH extension also allows one mail server to indicate to another that the sender has been authenticated when relaying mail. In general this requires the recipient server to trust the sending server, meaning that this aspect of SMTP-AUTH is rarely used on the Internet.[ citation needed ]
SMTPUTF8 [edit]
Supporting servers include:
- Postfix (version iii.0 and after)[33]
- Momentum (versions 4.1[34] and 3.half-dozen.5, and later)
- Sendmail (under development)
- Exim (experimental as of the 4.86 release)
- CommuniGate Pro every bit of version 6.2.2[35]
- Courier-MTA as of version ane.0[36]
- Halon as of version 4.0[37]
- Microsoft Commutation Server equally of protocol revision xiv.0[38]
- Haraka and other servers.[39]
- Oracle Communications Messaging Server as of release 8.0.two.[40]
Security extensions [edit]
Mail delivery tin can occur both over evidently text and encrypted connections, however the communicating parties might not know in advance of other political party's power to use secure aqueduct.
STARTTLS or "Opportunistic TLS" [edit]
The STARTTLS extensions enables supporting SMTP servers to notify connecting clients that information technology supports TLS encrypted communication and offers the opportunity for clients to upgrade their connection past sending the STARTTLS control. Servers supporting the extension practice not inherently gain any security benefits from its implementation on its ain, as upgrading to a TLS encrypted session is dependent on the connecting client deciding to exercise this selection, hence the term opportunistic TLS.
STARTTLS is effective only confronting passive observation attacks, since the STARTTLS negotiation happens in apparently text and an agile attacker can trivially remove STARTTLS commands. This type of man-in-the-eye assault is sometimes referred to equally STRIPTLS, where the encryption negotiation data sent from one end never reaches the other. In this scenario both parties take the invalid or unexpected responses every bit indication that the other does not properly back up STARTTLS, defaulting to traditional plain-text mail service transfer.[41] Annotation that STARTTLS is also defined for IMAP and POP3 in other RFCs, but these protocols serve different purposes: SMTP is used for advice between bulletin transfer agents, while IMAP and POP3 are for end clients and message transfer agents.
In 2014 the Electronic Frontier Foundation began "STARTTLS Everywhere" project that, similarly to "HTTPS Everywhere" list, allowed relying parties to detect others supporting secure advice without prior advice. The project stopped accepting submissions on 29 April 2021, and EFF recommended switching to DANE and MTA-STS for discovering information on peers' TLS support.[42]
RFC 8314 officially declared obviously text obsolete and recommend ever using TLS, adding ports with implicit TLS.
SMTP MTA Strict Transport Security [edit]
A newer 2018 RFC 8461 chosen "SMTP MTA Strict Ship Security (MTA-STS)" aims to accost the problem of active antagonist by defining a protocol for mail servers to declare their ability to use secure channels in specific files on the server and specific DNS TXT records. The relying party would regularly bank check beingness of such record, and enshroud it for the amount of time specified in the record and never communicate over insecure channels until record expires.[41] Note that MTA-STS records apply only to SMTP traffic between mail servers while communications betwixt a user's client and the postal service server are protected by Ship Layer Security with SMTP/MSA, IMAP, POP3, or HTTPS in combination with an organizational or technical policy. Essentially, MTA-STS is a means to extend such a policy to third parties.
In April 2019 Google Mail announced back up for MTA-STS.[43]
SMTP TLS Reporting [edit]
A number of protocols allows secure delivery of messages, but they can fail due to misconfigurations or deliberate active interference, leading to undelivered messages or delivery over unencrypted or unauthenticated channels. RFC 8460 "SMTP TLS Reporting" describes a reporting mechanism and format for sharing statistics and specific information nearly potential failures with recipient domains. Recipient domains tin and then use this information to both detect potential attacks and diagnose unintentional misconfigurations.
In Apr 2019 Google Mail announced support for SMTP TLS Reporting.[43]
Spoofing and spamming [edit]
The original design of SMTP had no facility to authenticate senders, or check that servers were authorized to transport on their behalf, with the result that e-mail spoofing is possible, and commonly used in email spam and phishing.
Occasional proposals are made to modify SMTP extensively or replace information technology completely. One example of this is Internet Mail 2000, but neither it, nor whatever other has made much headway in the face of the network issue of the huge installed base of classic SMTP.
Instead, postal service servers now utilise a range of techniques, such equally stricter enforcement of standards such as RFC 5322,[44] [45] DomainKeys Identified Mail, Sender Policy Framework and DMARC, DNSBLs and greylisting to pass up or quarantine suspicious emails.[46]
Implementations [edit]
[edit]
- RFC 1123 – Requirements for Internet Hosts—Awarding and Support (STD 3)
- RFC 1870 – SMTP Service Extension for Bulletin Size Announcement (оbsoletes: RFC 1653)
- RFC 2505 – Anti-Spam Recommendations for SMTP MTAs (BCP thirty)
- RFC 2821 – Simple Mail service Transfer Protocol
- RFC 2920 – SMTP Service Extension for Control Pipelining (STD 60)
- RFC 3030 – SMTP Service Extensions for Transmission of Large and Binary MIME Messages
- RFC 3207 – SMTP Service Extension for Secure SMTP over Transport Layer Security (obsoletes RFC 2487)
- RFC 3461 – SMTP Service Extension for Delivery Status Notifications (obsoletes RFC 1891)
- RFC 3463 – Enhanced Condition Codes for SMTP (obsoletes RFC 1893, updated past RFC 5248)
- RFC 3464 – An Extensible Message Format for Delivery Status Notifications (obsoletes RFC 1894)
- RFC 3798 – Message Disposition Notification (updates RFC 3461)
- RFC 3834 – Recommendations for Automatic Responses to Electronic mail
- RFC 3974 – SMTP Operational Experience in Mixed IPv4/v6 Environments
- RFC 4952 – Overview and Framework for Internationalized Email (updated past RFC 5336)
- RFC 4954 – SMTP Service Extension for Hallmark (obsoletes RFC 2554, updates RFC 3463, updated by RFC 5248)
- RFC 5068 – Email Submission Operations: Access and Accountability Requirements (BCP 134)
- RFC 5248 – A Registry for SMTP Enhanced Mail System Status Codes (BCP 138) (updates RFC 3463)
- RFC 5321 – The Simple Mail Transfer Protocol (obsoletes RFC 821 aka STD 10, RFC 974, RFC 1869, RFC 2821, updates RFC 1123)
- RFC 5322 – Internet Message Format (obsoletes RFC 822 aka STD 11, and RFC 2822)
- RFC 5504 – Downgrading Mechanism for E-mail Address Internationalization
- RFC 6409 – Message Submission for Postal service (STD 72) (obsoletes RFC 4409, RFC 2476)
- RFC 6522 – The Multipart/Report Content Type for the Reporting of Mail System Administrative Messages (obsoletes RFC 3462, and in plough RFC 1892)
- RFC 6531 – SMTP Extension for Internationalized Email Addresses (updates RFC 2821, RFC 2822, RFC 4952, and RFC 5336)
- RFC 8314 – Cleartext Considered Obsolete: Utilise of Transport Layer Security (TLS) for Electronic mail Submission and Access
See also [edit]
- Bounce address
- CRAM-MD5 (a SASL mechanism for ESMTPA) RFC 2195
- Email
- Email encryption
- DKIM
- Ident
- List of postal service server software
- List of SMTP server return codes
- Pop before SMTP / SMTP after POP
- Cyberspace Message Admission Protocol Binary Content Extension RFC 3516
- Sender Policy Framework (SPF)
- Unproblematic Authentication and Security Layer (SASL) RFC 4422
- SMTP Authentication
- Variable envelope return path
- Comparison of email clients for information virtually SMTP support
Notes [edit]
- ^ W. Richard Stevens, TCP/IP Illustrated, Volume 1: The Protocols, Addison Wesley, 1994, ISBN 0-201-63346-9.
- ^ The History of Electronic Mail, Tom Van Vleck: "It is not clear this protocol was e'er implemented"
- ^ The Showtime Network Email, Ray Tomlinson, BBN
- ^ Picture of "The First Email Figurer" by Dan Murphy, a PDP-x
- ^ Dan Spud's TENEX and TOPS-twenty Papers Archived November xviii, 2007, at the Wayback Car
- ^ RFC 2235
- ^ RFC 469 – Network Mail Meeting Summary
- ^ RFC 524 – A Proposed Postal service Protocol
- ^ "Tldp.org".
- ^ "typhoon-hairdresser-uucp-project-determination-05 – The Determination of the UUCP Mapping Projection".
- ^ The commodity about sender rewriting contains technical background info about the early SMTP history and source routing before RFC 1123.
- ^ Eric Allman (1983), Sendmail – An Internetwork Post Router (PDF), BSD UNIX documentation set, Berkeley: University of California, retrieved June 29, 2012
- ^ Craig Partridge (2008), The Technical Evolution of Internet Email (PDF), IEEE Annals of the History of Calculating, vol. 30, IEEE Computer Order, pp. iii–29, doi:10.1109/MAHC.2008.32, S2CID 206442868, archived from the original (PDF) on May 12, 2011
- ^ Paul Hoffman (February 1, 1998). "Allowing Relaying in SMTP: A Survey". Net Mail service Consortium. Retrieved May 30, 2010.
- ^ Paul Hoffman (August 2002). "Allowing Relaying in SMTP: A Series of Surveys". Internet Mail Consortium. Archived from the original on January 18, 2007. Retrieved May 30, 2010.
- ^ "In Unix, what is an open mail relay? - Knowledge Base". June 17, 2007. Archived from the original on June 17, 2007. Retrieved March xv, 2021.
- ^ "The MAIL, RCPT, and Data verbs", [D. J. Bernstein]
- ^ RFC 5321 Section-vii.2
- ^ Systems, Bulletin. "Bulletin Systems Introduces Latest Version Of Momentum With New API-Driven Capabilities". world wide web.prnewswire.com . Retrieved July xix, 2020.
- ^ Cara Garretson (2005). "ISPs Pitch In to End Spam". PC Globe . Retrieved Jan xviii, 2016.
Last month, the Anti-Spam Technical Alliance, formed concluding yr by Yahoo, America Online, EarthLink, and Microsoft, issued a list of antispam recommendations that includes filtering Port 25.
- ^ RFC 5321, Elementary Mail Transfer Protocol, J. Klensin, The Internet Lodge (October 2008)
- ^ RFC 1047
- ^ "rfc5321#section-4.5.3.2.6".
- ^ John Klensin; Ned Freed; Marshall T. Rose; Einar A. Stefferud; Dave Crocker (November 1995). SMTP Service Extensions. IETF. doi:10.17487/RFC1869. RFC 1869.
- ^ a b "Post Parameters". IANA. February 14, 2020.
- ^ Which was obsoleted in 2011 by RFC 6152 respective to the then new STD 71
- ^ Jiankang Yao (December xix, 2014). "Chinese email address". EAI (Mailing list). IETF. Retrieved May 24, 2016.
- ^ "SMTP Service Extension Parameters". IANA. Retrieved Nov five, 2013.
- ^ James Server - ChangeLog. James.apache.org. Retrieved on 2013-07-17.
- ^ 8BITMIME service advertised in response to EHLO on gmail-smtp-in.l.google.com port 25, checked 23 Nov 2011
- ^ Qmail bugs and wishlist. Home.pages.de. Retrieved on 2013-07-17.
- ^ The 8BITMIME extension. Cr.yp.to. Retrieved on 2013-07-17.
- ^ "Postfix SMTPUTF8 support is enabled by default", February 8, 2015, postfix.org
- ^ "Message Systems Introduces Latest Version Of Momentum With New API-Driven Capabilities" (Press release).
- ^ "Version 6.2 Revision History". CommuniGate.com.
- ^ Sam Varshavchik (September eighteen, 2018). "New releases of Courier packages". courier-announce (Mailing list).
- ^ "Halon MTA changelog". GitHub. November ix, 2021.
v4.0: New SMTPUTF8 support
Updated for new versions - ^ "MS-OXSMTP: Unproblematic Mail Transfer Protocol (SMTP) Extensions". July 24, 2018.
- ^ "EAI Readiness in TLDs" (PDF). February 12, 2019.
- ^ "Communications Messaging Server Release Notes". oracle.com. October 2017.
- ^ a b "Introducing MTA Strict Ship Security (MTA-STS) | Hardenize Blog". world wide web.hardenize.com . Retrieved April 25, 2019.
- ^ "STARTTLS Everywhere". EFF. Retrieved December 4, 2021.
- ^ a b Cimpanu, Catalin. "Gmail becomes showtime major email provider to support MTA-STS and TLS Reporting". ZDNet . Retrieved April 25, 2019.
- ^ "Message Non Compliant with RFC 5322".
- ^ "Message could not be delivered. Please ensure the message is RFC 5322 compliant".
- ^ "Why are the emails sent to Microsoft Account rejected for policy reasons?".
References [edit]
- Hughes, L (1998). Internet Electronic mail: Protocols, Standards and Implementation. Artech Firm Publishers. ISBN978-0-89006-939-4.
- Hunt, C (2003). sendmail Cookbook. O'Reilly Media. ISBN978-0-596-00471-2.
- Johnson, Grand (2000). Cyberspace Electronic mail Protocols: A Programmer'southward Guide. Addison-Wesley Professional. ISBN978-0-201-43288-6.
- Loshin, P (1999). Essential Email Standards: RFCs and Protocols Made Practical. John Wiley & Sons. ISBN978-0-471-34597-viii.
- Rhoton, J (1999). Programmer'southward Guide to Internet Postal service: SMTP, POP, IMAP, and LDAP. Elsevier. ISBN978-ane-55558-212-8.
- Wood, D (1999). Programming Internet Postal service . O'Reilly. ISBN978-ane-56592-479-6.
External links [edit]
- RFC 1869 SMTP Service Extensions
- RFC 5321 Simple Mail Transfer Protocol
- RFC 4954 SMTP Service Extension for Authentication (obsoletes RFC 2554)
- RFC 3848 SMTP and LMTP Transmission Types Registration (with ESMTPA)
- RFC 6409 Message Submission for Mail (obsoletes RFC 4409, which obsoletes RFC 2476)
mitchelleatentsen.blogspot.com
Source: https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
Post a Comment for "How to Read Email Body as Plane Text in C#"