Linux notebook / Email
Description: Documents various Linux or *nix programs and concepts, including qmail, djbdns, emacs, Perl, hardware, bash, TCP/IP, DNS, etc...
Keywords: find djbdns system dns typical bash less gdb daemontools mirrordir math tables mysql qmail isdn make http ezmlm shell pppd cftp regexps intro awk dhcp test hardware ucspi-tcp apache html perl php3 fetchmail versions emacs email peripherals

Apache Awk Bash C cftp daemontools DHCP djbdns DNS Emacs Email ezmlm Fetchmail find GDB Hardware HTML HTTP Intro ISDN less Make Math mc mirrordir MySQL Peripherals Perl PHP3 pppd qmail Regexps Shell System Tables test To do Typical ucspi-tcp Versions Index TCP/IP slides
Email |
SMTP | RFCs | Quoted-printable encoding | Base64 Content Transfer Encoding
| top

> The standard SMTP dialog

> client | server
> --- | ---
> (open socket 25 on server) | 220 host ready
> HELO myhost | 250 hello myhost
> MAIL FROM auser@myhost | 250 sender ok
> RCPT TO: destination@somehost.com | 250 recipient ok
> DATA | 354 Go ahead, end message with a . on a line by itself
> (sends the contents of the message, with a . at the end) | 250 message accepted

> RFCs of interest (summary)

> RFC 1893 - Enhanced Mail System Status Codes
> Status code index
> 2.X.X Success 4.X.X Persistent Transient Failure 5.X.X Permanent Failure X.1.0 Other address status X.1.1 Bad destination mailbox address X.1.2 Bad destination system address X.1.3 Bad destination mailbox address syntax X.1.4 Destination mailbox address ambiguous X.1.5 Destination mailbox address valid X.1.6 Mailbox has moved X.1.7 Bad sender's mailbox address syntax X.1.8 Bad sender's system address X.2.0 Other or undefined mailbox status X.2.1 Mailbox disabled, not accepting messages X.2.2 Mailbox full X.2.3 Message length exceeds administrative limit. X.2.4 Mailing list expansion problem X.3.0 Other or undefined mail system status X.3.1 Mail system full X.3.2 System not accepting network messages X.3.3 System not capable of selected features X.3.4 Message too big for system X.4.0 Other or undefined network or routing status X.4.1 No answer from host X.4.2 Bad connection | X.4.3 Routing server failure X.4.4 Unable to route X.4.5 Network congestion X.4.6 Routing loop detected X.4.7 Delivery time expired X.5.0 Other or undefined protocol status X.5.1 Invalid command X.5.2 Syntax error X.5.3 Too many recipients X.5.4 Invalid command arguments X.5.5 Wrong protocol version X.6.0 Other or undefined media error X.6.1 Media not supported X.6.2 Conversion required and prohibited X.6.3 Conversion required but not supported X.6.4 Conversion with loss performed X.6.5 Conversion failed X.7.0 Other or undefined security status X.7.1 Delivery not authorized, message refused X.7.2 Mailing list expansion prohibited X.7.3 Security conversion required but not possible X.7.4 Security features not supported X.7.5 Cryptographic failure X.7.6 Cryptographic algorithm not supported X.7.7 Message integrity failure

> Status Codes index
> 2.X.X | Success | Success specifies that the DSN is reporting a positive delivery action. Detail sub-codes may provide notification of transformations required for delivery.
> 4.X.X | Persistent Transient Failure | A persistent transient failure is one in which the message as sent is valid, but some temporary event prevents the successful sending of the message. Sending in the future may be successful.
> 5.X.X | Permanent Failure | A permanent failure is one which is not likely to be resolved by re-sending the message in the current form. Some change to the message or the destination must be made for successful delivery.
> Subject sub-codes index
> X.0.X | Other or Undefined Status | There is no additional subject information available.
> X.1.X | Addressing Status | The address status reports on the originator or destination address. It may include address syntax or validity. These errors can generally be corrected by the sender and retried.
> X.2.X | Mailbox Status | Mailbox status indicates that something having to do with the mailbox has cause this DSN. Mailbox issues are assumed to be under the general control of the recipient.
> X.3.X | Mail System Status | Mail system status indicates that something having to do with the destination system has caused this DSN. System issues are assumed to be under the general control of the destination system administrator.
> X.4.X | Network and Routing Status | The networking or routing codes report status about the delivery system itself. These system components include any necessary infrastructure such as directory and routing services. Network issues are assumed to be under the control of the destination or intermediate system administrator.
> X.5.X | Mail Delivery Protocol Status | The mail delivery protocol status codes report failures involving the message delivery protocol. These failures include the full range of problems resulting from implementation errors or an unreliable connection. Mail delivery protocol issues may be controlled by many parties including the originating system, destination system, or intermediate system administrators.
> X.6.X | Message Content or Media Status | The message content or media status codes report failures involving the content of the message. These codes report failures due to translation, transcoding, or otherwise unsupported message media. Message content or media issues are under the control of both the sender and the receiver, both of whom must support a common set of supported content-types.
> X.7.X | Security or Policy Status | The security or policy status codes report failures involving policies such as per-recipient or per-host filtering and cryptographic operations. Security and policy status issues are assumed to be under the control of either or both the sender and recipient. Both the sender and recipient must permit the exchange of messages and arrange the exchange of necessary keys and certificates for cryptographic operations.
> Enumerated Status Codes - Other or Undefined Status index
> X.0.0 | Other undefined Status | Other undefined status is the only undefined error code. It should be used for all errors for which only the class of the error is known.
> Enumerated Status Codes - Address Status index
> X.1.0 | Other address status | Something about the address specified in the message caused this DSN.
> X.1.1 | Bad destination mailbox address | The mailbox specified in the address does not exist. For Internet mail names, this means the address portion to the left of the "@" sign is invalid. This code is only useful for permanent failures.
> X.1.2 | Bad destination system address | The destination system specified in the address does not exist or is incapable of accepting mail. For Internet mail names, this means the address portion to the right of the "@" is invalid for mail. This codes is only useful for permanent failures.
> X.1.3 | Bad destination mailbox address syntax | The destination address was syntactically invalid. This can apply to any field in the address. This code is only useful for permanent failures.
> X.1.4 | Destination mailbox address ambiguous | The mailbox address as specified matches one or more recipients on the destination system. This may result if a heuristic address mapping algorithm is used to map the specified address to a local mailbox name.
> X.1.5 | Destination address valid | This mailbox address as specified was valid. This status code should be used for positive delivery reports.
> X.1.6 | Destination mailbox has moved, No forwarding address | The mailbox address provided was at one time valid, but mail is no longer being accepted for that address. This code is only useful for permanent failures.
> X.1.7 | Bad sender's mailbox address syntax | The sender's address was syntactically invalid. This can apply to any field in the address.
> X.1.8 | Bad sender's system address | The sender's system specified in the address does not exist or is incapable of accepting return mail. For domain names, this means the address portion to the right of the "@" is invalid for mail.
> Enumerated Status Codes - Mailbox Status index
> X.2.0 | Other or undefined mailbox status | The mailbox exists, but something about the destination mailbox has caused the sending of this DSN.
> X.2.1 | Mailbox disabled, not accepting messages | The mailbox exists, but is not accepting messages. This may be a permanent error if the mailbox will never be re-enabled or a transient error if the mailbox is only temporarily disabled.
> X.2.2 | Mailbox full | The mailbox is full because the user has exceeded a per-mailbox administrative quota or physical capacity. The general semantics implies that the recipient can delete messages to make more space available. This code should be used as a persistent transient failure.
> X.2.3 | Message length exceeds administrative limit | A per-mailbox administrative message length limit has been exceeded. This status code should be used when the per-mailbox message length limit is less than the general system limit. This code should be used as a permanent failure.
> X.2.4 | Mailing list expansion problem | The mailbox is a mailing list address and the mailing list was unable to be expanded. This code may represent a permanent failure or a persistent transient failure.
> Enumerated Status Codes - Mail system status index
> X.3.0 | Other or undefined mail system status | The destination system exists and normally accepts mail, but something about the system has caused the generation of this DSN.
> X.3.1 | Mail system full | Mail system storage has been exceeded. The general semantics imply that the individual recipient may not be able to delete material to make room for additional messages. This is useful only as a persistent transient error.
> X.3.2 | System not accepting network messages | The host on which the mailbox is resident is not accepting messages. Examples of such conditions include an immanent shutdown, excessive load, or system maintenance. This is useful for both permanent and permanent transient errors.
> X.3.3 | System not capable of selected features | Selected features specified for the message are not supported by the destination system. This can occur in gateways when features from one domain cannot be mapped onto the supported feature in another.
> X.3.4 | Message too big for system | The message is larger than per-message size limit. This limit may either be for physical or administrative reasons. This is useful only as a permanent error.
> X.3.5 | System incorrectly configured | The system is not configured in a manner which will permit it to accept this message.
> Enumerated Status Codes - Network and Routing Status index
> X.4.0 | Other or undefined network or routing status | Something went wrong with the networking, but it is not clear what the problem is, or the problem cannot be well expressed with any of the other provided detail codes.
> X.4.1 | No answer from host | The outbound connection attempt was not answered, either because the remote system was busy, or otherwise unable to take a call. This is useful only as a persistent transient error.
> X.4.2 | Bad connection | The outbound connection was established, but was otherwise unable to complete the message transaction, either because of time-out, or inadequate connection quality. This is useful only as a persistent transient error.
> X.4.3 | Directory server failure | The network system was unable to forward the message, because a directory server was unavailable. This is useful only as a persistent transient error. The inability to connect to an Internet DNS server is one example of the directory server failure error.
> X.4.4 | Unable to route | The mail system was unable to determine the next hop for the message because the necessary routing information was unavailable from the directory server. This is useful for both permanent and persistent transient errors. A DNS lookup returning only an SOA (Start of Administration) record for a domain name is one example of the unable to route error.
> X.4.5 | Mail system congestion | The mail system was unable to deliver the message because the mail system was congested. This is useful only as a persistent transient error.
> X.4.6 | Routing loop detected | A routing loop caused the message to be forwarded too many times, either because of incorrect routing tables or a user forwarding loop. This is useful only as a persistent transient error.
> X.4.7 | Delivery time expired | The message was considered too old by the rejecting system, either because it remained on that host too long or because the time-to-live value specified by the sender of the message was exceeded. If possible, the code for the actual problem found when delivery was attempted should be returned rather than this code. This is useful only as a persistent transient error.
> Enumerated Status Codes - Mail Delivery Protocol Status index
> X.5.0 | Other or undefined protocol status | Something was wrong with the protocol necessary to deliver the message to the next hop and the problem cannot be well expressed with any of the other provided detail codes.
> X.5.1 | Invalid command | A mail transaction protocol command was issued which was either out of sequence or unsupported. This is useful only as a permanent error.
> X.5.2 | Syntax error | A mail transaction protocol command was issued which could not be interpreted, either because the syntax was wrong or the command is unrecognized. This is useful only as a permanent error.
> X.5.3 | Too many recipients | More recipients were specified for the message than could have been delivered by the protocol. This error should normally result in the segmentation of the message into two, the remainder of the recipients to be delivered on a subsequent delivery attempt. It is included in this list in the event that such segmentation is not possible.
> X.5.4 | Invalid command arguments | A valid mail transaction protocol command was issued with invalid arguments, either because the arguments were out of range or represented unrecognized features. This is useful only as a permanent error.
> X.5.5 | Wrong protocol version | A protocol version mismatch existed which could not be automatically resolved by the communicating parties.
> Enumerated Status Codes - Message Content or Message Media Status index
> X.6.0 | Other or undefined media error | Something about the content of a message caused it to be considered undeliverable and the problem cannot be well expressed with any of the other provided detail codes.
> X.6.1 | Media not supported | The media of the message is not supported by either the delivery protocol or the next system in the forwarding path. This is useful only as a permanent error.
> X.6.2 | Conversion required and prohibited | The content of the message must be converted before it can be delivered and such conversion is not permitted. Such prohibitions may be the expression of the sender in the message itself or the policy of the sending host.
> X.6.3 | Conversion required but not supported | The message content must be converted to be forwarded but such conversion is not possible or is not practical by a host in the forwarding path. This condition may result when an ESMTP gateway supports 8bit transport but is not able to downgrade the message to 7 bit as required for the next hop.
> X.6.4 | Conversion with loss performed | This is a warning sent to the sender when message delivery was successfully but when the delivery required a conversion in which some data was lost. This may also be a permanent error if the sender has indicated that conversion with loss is prohibited for the message.
> X.6.5 | Conversion Failed | A conversion was required but was unsuccessful. This may be useful as a permanent or persistent temporary notification.
> Enumerated Status Codes - Security or Policy Status index
> X.7.0 | Other or undefined security status | Something related to security caused the message to be returned, and the problem cannot be well expressed with any of the other provided detail codes. This status code may also be used when the condition cannot be further described because of security policies in force.
> X.7.1 | Delivery not authorized, message refused | The sender is not authorized to send to the destination. This can be the result of per-host or per-recipient filtering. This memo does not discuss the merits of any such filtering, but provides a mechanism to report such. This is useful only as a permanent error.
> X.7.2 | Mailing list expansion prohibited | The sender is not authorized to send a message to the intended mailing list. This is useful only as a permanent error.
> X.7.3 | Security conversion required but not possible | A conversion from one secure messaging protocol to another was required for delivery and such conversion was not possible. This is useful only as a permanent error.
> X.7.4 | Security features not supported | A message contained security features such as secure authentication which could not be supported on the delivery protocol. This is useful only as a permanent error.
> X.7.5 | Cryptographic failure | A transport system otherwise authorized to validate or decrypt a message in transport was unable to do so because necessary information such as key was not available or such information was invalid.
> X.7.6 | Cryptographic algorithm not supported | A transport system otherwise authorized to validate or decrypt a message was unable to do so because the necessary algorithm was not supported.
> X.7.7 | Message integrity failure | A transport system otherwise authorized to validate a message was unable to do so because the message was corrupted or altered. This may be useful as a permanent, transient persistent, or successful delivery code.

> Quoted-printable encoding (RFC 1521)

> Rules
> General 8-bit representation | Any octet, except those indicating a line break according to the newline convention of the canonical (standard) form of the data being encoded, may be represented by an "=" followed by a two digit hexadecimal representation of the octet's value. The digits of the hexadecimal alphabet, for this purpose, are "0123456789ABCDEF". Uppercase letters must be used when sending hexadecimal data, though a robust implementation may choose to recognize lowercase letters on receipt. Thus, for example, the value 12 (ASCII form feed) can be represented by "=0C", and the value 61 (ASCII EQUAL SIGN) can be represented by "=3D". Except when the following rules allow an alternative encoding, this rule is mandatory.
> Literal representation | Octets with decimal values of 33 through 60 inclusive, and 62 through 126, inclusive, MAY be represented as the ASCII characters which correspond to those octets (EXCLAMATION POINT through LESS THAN, and GREATER THAN through TILDE, respectively).
> White Space | Octets with values of 9 and 32 MAY be represented as ASCII TAB (HT) and SPACE characters, respectively, but MUST NOT be so represented at the end of an encoded line. Any TAB (HT) or SPACE characters on an encoded line MUST thus be followed on that line by a printable character. In particular, an "=" at the end of an encoded line, indicating a soft line break (see rule #5) may follow one or more TAB (HT) or SPACE characters. It follows that an octet with value 9 or 32 appearing at the end of an encoded line must be represented according to Rule #1. This rule is necessary because some MTAs (Message Transport Agents, programs which transport messages from one user to another, or perform a part of such transfers) are known to pad lines of text with SPACEs, and others are known to remove "white space" characters from the end of a line. Therefore, when decoding a Quoted-Printable body, any trailing white space on a line must be deleted, as it will necessarily have been added by intermediate transport agents.
> Line Breaks | A line break in a text body, independent of what its representation is following the canonical representation of the data being encoded, must be represented by a (RFC 822) line break, which is a CRLF sequence, in the Quoted-Printable encoding. Since the canonical representation of types other than text do not generally include the representation of line breaks, no hard line breaks (i.e. line breaks that are intended to be meaningful and to be displayed to the user) should occur in the quoted-printable encoding of such types. Of course, occurrences of "=0D", "=0A", "=0A=0D" and "=0D=0A" will eventually be encountered. In general, however, base64 is preferred over quoted-printable for binary data.
> Soft Line Breaks | The Quoted-Printable encoding REQUIRES that encoded lines be no more than 76 characters long. If longer lines are to be encoded with the Quoted-Printable encoding, 'soft' line breaks must be used. An equal sign as the last character on a encoded line indicates such a non-significant ('soft') line break in the encoded text. Thus if the "raw" form of the line is a single unencoded line that says: Now's the time for all folk to come to the aid of their country. This can be represented, in the Quoted-Printable encoding, as Now's the time = for all folk to come= to the aid of their country. This provides a mechanism with which long lines are encoded in such a way as to be restored by the user agent. The 76 character limit does not count the trailing CRLF, but counts all other characters, including any equal signs.

> Base64 Content Transfer Encoding (RFC 1521)

> The message to encode is broken down in 6-bit chunks, that are encoded as per the following table

> Decimal | Binary | ASCII |  | Decimal | Binary | ASCII |  | Decimal | Binary | ASCII |  | Decimal | Binary | ASCII
> 0 | 000000 | A |  | 16 | 010000 | Q |  | 32 | 100000 | g |  | 48 | 110000 | w
> 1 | 000001 | B |  | 17 | 010001 | R |  | 33 | 100001 | h |  | 49 | 110001 | x
> 2 | 000010 | C |  | 18 | 010010 | S |  | 34 | 100010 | i |  | 50 | 110010 | y
> 3 | 000011 | D |  | 19 | 010011 | T |  | 35 | 100011 | j |  | 51 | 110011 | z
> 4 | 000100 | E |  | 20 | 010100 | U |  | 36 | 100100 | k |  | 52 | 110100 | 0
> 5 | 000101 | F |  | 21 | 010101 | V |  | 37 | 100101 | l |  | 53 | 110101 | 1
> 6 | 000110 | G |  | 22 | 010110 | W |  | 38 | 100110 | m |  | 54 | 110110 | 2
> 7 | 000111 | H |  | 23 | 010111 | X |  | 39 | 100111 | n |  | 55 | 110111 | 3
> 8 | 001000 | I |  | 24 | 011000 | Y |  | 40 | 101000 | o |  | 56 | 111000 | 4
> 9 | 001001 | J |  | 25 | 011001 | Z |  | 41 | 101001 | p |  | 57 | 111001 | 5
> 10 | 001010 | K |  | 26 | 011010 | a |  | 42 | 101010 | q |  | 58 | 111010 | 6
> 11 | 001011 | L |  | 27 | 011011 | b |  | 43 | 101011 | r |  | 59 | 111011 | 7
> 12 | 001100 | M |  | 28 | 011100 | c |  | 44 | 101100 | s |  | 60 | 111100 | 8
> 13 | 001101 | N |  | 29 | 011101 | d |  | 45 | 101101 | t |  | 61 | 111101 | 9
> 14 | 001110 | O |  | 30 | 011110 | e |  | 46 | 101110 | u |  | 62 | 111110 | +
> 15 | 001111 | P |  | 31 | 011111 | f |  | 47 | 101111 | v |  | 63 | 111111 | /

Last update: Wed, 2 Nov 2005 10:16:21 GMT | top