Mailfromd |
|
General-Purpose Mail Filter |
Sergey Poznyakoff |
Mailfromd Manual (split by node): | ? |
Encode text in accordance with RFC 2047. Optional arguments:
Encoding to use. Valid values are ‘quoted-printable’, or ‘Q’ (the default) and ‘base64’, or ‘B’.
Character set. By default ‘UTF-8’.
If the function is unable to encode the string, it raises the
exception e_failure
.
For example:
set string "Keld Jørn Simonsen <keld@dkuug.dk>" message_header_encode(%string, "ISO-8859-1") ⇒ "=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>" |
text must be a header value encoded in accordance with RFC
2047. The function returns the decoded string. If the decoding fails,
it raises e_failure
exception. The optional argument
charset specifies the character set to use (default –
‘UTF-8’).
set string "=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>" message_header_decode(%string) ⇒ "Keld Jørn Simonsen <keld@dkuug.dk>" |
If text is a “folded” multi-line RFC 2822 header value, unfold it. If text is a single-line string, return its unchanged copy.
For example, suppose that the message being processed contained the following header:
List-Id: Sent bugreports to <some-address@some.net> |
Then, applying unfold
to its value(17) will produce:
Sent bugreports to <some-address@some.net> |
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.