Difference between revisions of "CRLFDOT (filter)"
m |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | The ''CRLFDOT'' filter is useful for data I/O in such protocols as POP3 and SMTP. In [[MU_FILTER_ENCODE|encode]] mode, this filter replaces each LF ('\n' or ASCII 10) character by CRLF ("\r\n", ASCII 13 10) | + | The ''CRLFDOT'' filter is useful for data I/O in such protocols as POP3 and SMTP. |
− | "[[byte-stuffing|byte-stuffs]]" the | + | |
− | + | In [[MU_FILTER_ENCODE|encode]] mode, this filter replaces each LF ('\n' or ASCII 10) character by CRLF ("\r\n", ASCII 13 10), and "[[byte-stuffing|byte-stuffs]]" the output by producing an additional '.' in front of any '.' appearing at the beginning of a line in input. Upon end of input, it outputs additional ".\r\n", if the last output character was '\n', or "\r\n.\r\n" otherwise. | |
− | When [[MU_FILTER_DECODE|decoding]], the reverse is performed: each | + | |
+ | If created with the <tt>-n</tt> option, it preserves each CRLF input sequence untranslated, thereby "normalizing" the output (hence the option name). | ||
+ | |||
+ | When [[MU_FILTER_DECODE|decoding]], the reverse is performed: each CRLF is replaced by a single LF byte, and additional dots are removed from beginning of lines. A single dot on a line by itself marks the end of the stream and causes the filter to return <tt>EOF</tt>. | ||
== See also == | == See also == |
Latest revision as of 16:52, 16 December 2017
The CRLFDOT filter is useful for data I/O in such protocols as POP3 and SMTP.
In encode mode, this filter replaces each LF ('\n' or ASCII 10) character by CRLF ("\r\n", ASCII 13 10), and "byte-stuffs" the output by producing an additional '.' in front of any '.' appearing at the beginning of a line in input. Upon end of input, it outputs additional ".\r\n", if the last output character was '\n', or "\r\n.\r\n" otherwise.
If created with the -n option, it preserves each CRLF input sequence untranslated, thereby "normalizing" the output (hence the option name).
When decoding, the reverse is performed: each CRLF is replaced by a single LF byte, and additional dots are removed from beginning of lines. A single dot on a line by itself marks the end of the stream and causes the filter to return EOF.