{"id":7215,"date":"2022-12-20T19:35:51","date_gmt":"2022-12-20T22:35:51","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/mimetools-man3\/"},"modified":"2022-12-20T19:35:51","modified_gmt":"2022-12-20T22:35:51","slug":"mimetools-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/mimetools-man3\/","title":{"rendered":"MIME::Tools (man3)"},"content":{"rendered":"<h1 align=\"center\">MIME::Tools<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#REQUIREMENTS\">REQUIREMENTS<\/a><br \/> <a href=\"#A QUICK TOUR\">A QUICK TOUR<\/a><br \/> <a href=\"#THINGS YOU SHOULD DO\">THINGS YOU SHOULD DO<\/a><br \/> <a href=\"#THINGS I DO THAT YOU SHOULD KNOW ABOUT\">THINGS I DO THAT YOU SHOULD KNOW ABOUT<\/a><br \/> <a href=\"#A MIME PRIMER\">A MIME PRIMER<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#SUPPORT\">SUPPORT<\/a><br \/> <a href=\"#CHANGE LOG\">CHANGE LOG<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#ACKNOWLEDGMENTS\">ACKNOWLEDGMENTS<\/a><br \/> <a href=\"#LICENSE\">LICENSE<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">MIME\u2212tools \u2212 modules for parsing (and creating!) MIME entities<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Here\u2019s some pretty basic code for <b>parsing a <small>MIME<\/small> message,<\/b> and outputting its decoded components to a given directory:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">use MIME::Parser; <br \/> ### Create parser, and set some parsing options: <br \/> my $parser = new MIME::Parser; <br \/> $parser\u2212>output_under(&#8220;$ENV{HOME}\/mimemail&#8221;); <br \/> ### Parse input: <br \/> $entity = $parser\u2212>parse(*STDIN) or die &#8220;parse failedn&#8221;; <br \/> ### Take a look at the top\u2212level entity (and any parts it has): <br \/> $entity\u2212>dump_skeleton;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Here\u2019s some code which <b>composes and sends a <small>MIME<\/small> message<\/b> containing three parts: a text file, an attached <small>GIF,<\/small> and some more text:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">use MIME::Entity; <br \/> ### Create the top\u2212level, and set up the mail headers: <br \/> $top = MIME::Entity\u2212>build(Type =>&#8221;multipart\/mixed&#8221;, <br \/> From => &#8220;me@myhost.com&#8221;, <br \/> To => &#8220;you@yourhost.com&#8221;, <br \/> Subject => &#8220;Hello, nurse!&#8221;); <br \/> ### Part #1: a simple text document: <br \/> $top\u2212>attach(Path=>&#8221;.\/testin\/short.txt&#8221;); <br \/> ### Part #2: a GIF file: <br \/> $top\u2212>attach(Path => &#8220;.\/docs\/mime\u2212sm.gif&#8221;, <br \/> Type => &#8220;image\/gif&#8221;, <br \/> Encoding => &#8220;base64&#8221;); <br \/> ### Part #3: some literal text: <br \/> $top\u2212>attach(Data=>$message); <br \/> ### Send it: <br \/> open MAIL, &#8220;| \/usr\/lib\/sendmail \u2212t \u2212oi \u2212oem&#8221; or die &#8220;open: $!&#8221;; <br \/> $top\u2212>print(*MAIL); <br \/> close MAIL;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For more examples, look at the scripts in the <b>examples<\/b> directory of the MIME-tools distribution.<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">MIME-tools is a collection of Perl5 <small>MIME::<\/small> modules for parsing, decoding, <i>and generating<\/i> single\u2212 or multipart (even nested multipart) <small>MIME<\/small> messages. (Yes, kids, that means you can send messages with attached <small>GIF<\/small> files).<\/p>\n<h2>REQUIREMENTS <a name=\"REQUIREMENTS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">You will need the following installed on your system:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">File::Path <br \/> File::Spec <br \/> IPC::Open2 (optional) <br \/> MIME::Base64 <br \/> MIME::QuotedPrint <br \/> Net::SMTP <br \/> Mail::Internet, &#8230; from the MailTools distribution.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">See the Makefile.PL in your distribution for the most-comprehensive list of prerequisite modules and their version numbers.<\/p>\n<h2>A QUICK TOUR <a name=\"A QUICK TOUR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Overview of the classes<\/b> <br \/> Here are the classes you\u2019ll generally be dealing with directly:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">(START HERE) results() .\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212. <br \/>  .\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212>| MIME:: | <br \/> .\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212. \/ | Parser::Results | <br \/> | MIME:: |\u2212\u2212&#8217; `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212&#8217; <br \/> | Parser |\u2212\u2212. .\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212. <br \/> `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212&#8217;  filer() | MIME:: | <br \/> | parse() `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212>| Parser::Filer | <br \/> | gives you `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212&#8217; <br \/> | a&#8230; | output_path() <br \/> | | determines <br \/> | | path() of&#8230; <br \/> | head() .\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212. | <br \/> | returns&#8230; | MIME:: | get() | <br \/> V .\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212>| Head | etc&#8230; | <br \/> .\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212.\/ `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212&#8217; | <br \/> .\u2212\u2212\u2212> | MIME:: | | <br \/> `\u2212\u2212\u2212\u2212\u2212| Entity | .\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212. | <br \/> parts() `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212&#8217; | MIME:: | \/ <br \/> returns `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212>| Body |<\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212' <br \/> sub\u2212entities bodyhandle() `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212&#8217; <br \/> (if any) returns&#8230; | open() <br \/> | returns&#8230; <br \/> | <br \/> V <br \/> .\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212. read() <br \/> | IO:: | getline() <br \/> | Handle | print() <br \/> `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212&#8217; etc&#8230;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To illustrate, parsing works this way:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p><b>The &#8220;parser&#8221; parses the <small>MIME<\/small> stream.<\/b> A parser is an instance of &#8220;MIME::Parser&#8221;. You hand it an input stream (like a filehandle) to parse a message from: if the parse is successful, the result is an &#8220;entity&#8221;.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p><b>A parsed message is represented by an &#8220;entity&#8221;.<\/b> An entity is an instance of &#8220;MIME::Entity&#8221; (a subclass of &#8220;Mail::Internet&#8221;). If the message had &#8220;parts&#8221; (e.g., attachments), then those parts are &#8220;entities&#8221; as well, contained inside the top-level entity. Each entity has a &#8220;head&#8221; and a &#8220;body&#8221;.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p><b>The entity\u2019s &#8220;head&#8221; contains information about the message.<\/b> A &#8220;head&#8221; is an instance of &#8220;MIME::Head&#8221; (a subclass of &#8220;Mail::Header&#8221;). It contains information from the message header: content type, sender, subject line, etc.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p><b>The entity\u2019s &#8220;body&#8221; knows where the message data is.<\/b> You can ask to &#8220;open&#8221; this data source for <i>reading<\/i> or <i>writing<\/i>, and you will get back an &#8220;I\/O handle&#8221;.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p><b>You can open() a &#8220;body&#8221; and get an &#8220;I\/O handle&#8221; to read\/write message data.<\/b> This handle is an object that is basically like an IO::Handle&#8230; it can be any class, so long as it supports a small, standard set of methods for reading from or writing to the underlying data source.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">A typical multipart message containing two parts &#8212; a textual greeting and an &#8220;attached&#8221; <small>GIF<\/small> file &#8212; would be a tree of MIME::Entity objects, each of which would have its own MIME::Head. Like this:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">.\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212. <br \/> | MIME:: | Content\u2212type: multipart\/mixed <br \/> | Entity | Subject: Happy Samhaine! <br \/> `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212&#8217; <br \/> | <br \/> `\u2212\u2212\u2212\u2212. <br \/> parts | <br \/> | .\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212. <br \/> |\u2212\u2212\u2212| MIME:: | Content\u2212type: text\/plain; charset=us\u2212ascii <br \/> | | Entity | Content\u2212transfer\u2212encoding: 7bit <br \/> | `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212&#8217; <br \/> | .\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212. <br \/> |\u2212\u2212\u2212| MIME:: | Content\u2212type: image\/gif <br \/> | Entity | Content\u2212transfer\u2212encoding: base64 <br \/> `\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212&#8217; Content\u2212disposition: inline; <br \/> filename=&#8221;hs.gif&#8221;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Parsing messages<\/b> <br \/> You usually start by creating an instance of <b>MIME::Parser<\/b> and setting up certain parsing parameters: what directory to save extracted files to, how to name the files, etc.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">You then give that instance a readable filehandle on which waits a <small>MIME<\/small> message. If all goes well, you will get back a <b>MIME::Entity<\/b> object (a subclass of <b>Mail::Internet<\/b>), which consists of&#8230;<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\">A <b>MIME::Head<\/b> (a subclass of <b>Mail::Header<\/b>) which holds the <small>MIME<\/small> header data.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"83%\">\n<p>A <b>MIME::Body<\/b>, which is a object that knows where the body data is. You ask this object to &#8220;open&#8221; itself for reading, and it will hand you back an &#8220;I\/O handle&#8221; for reading the data: this could be of any class, so long as it conforms to a subset of the <b>IO::Handle<\/b> interface.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">If the original message was a multipart document, the MIME::Entity object will have a non-empty list of &#8220;parts&#8221;, each of which is in turn a MIME::Entity (which might also be a multipart entity, etc, etc&#8230;).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Internally, the parser (in MIME::Parser) asks for instances of <b>MIME::Decoder<\/b> whenever it needs to decode an encoded file. MIME::Decoder has a mapping from supported encodings (e.g., \u2019base64\u2019) to classes whose instances can decode them. You can add to this mapping to try out new\/experiment encodings. You can also use MIME::Decoder by itself.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Composing messages<\/b> <br \/> All message composition is done via the <b>MIME::Entity<\/b> class. For single-part messages, you can use the <b>MIME::Entity\/build<\/b> constructor to create <small>MIME<\/small> entities very easily.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For multipart messages, you can start by creating a top-level &#8220;multipart&#8221; entity with <b>MIME::Entity::build()<\/b>, and then use the similar <b>MIME::Entity::attach()<\/b> method to attach parts to that message. <i>Please note:<\/i> what most people think of as &#8220;a text message with an attached <small>GIF<\/small> file&#8221; is <i>really<\/i> a multipart message with 2 parts: the first being the text message, and the second being the <small>GIF<\/small> file.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When building <small>MIME<\/small> a entity, you\u2019ll have to provide two very important pieces of information: the <i>content type<\/i> and the <i>content transfer encoding<\/i>. The type is usually easy, as it is directly determined by the file format; e.g., an <small>HTML<\/small> file is &#8220;text\/html&#8221;. The encoding, however, is trickier&#8230; for example, some <small>HTML<\/small> files are &#8220;7bit&#8221;\u2212compliant, but others might have very long lines and would need to be sent &#8220;quoted\u2212printable&#8221; for reliability.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">See the section on encoding\/decoding for more details, as well as &#8220;A <small>MIME PRIMER&#8221;<\/small> below.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Sending email<\/b> <br \/> Since MIME::Entity inherits directly from Mail::Internet, you can use the normal Mail::Internet mechanisms to send email. For example,<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">$entity\u2212>smtpsend;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Encoding\/decoding support<\/b> <br \/> The <b>MIME::Decoder<\/b> class can be used to <i>encode<\/i> as well; this is done when printing <small>MIME<\/small> entities. All the standard encodings are supported (see &#8220;A <small>MIME PRIMER&#8221;<\/small> below for details):<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Encoding: | Normally used when message contents are: <br \/> \u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212 <br \/> 7bit | 7\u2212bit data with under 1000 chars\/line, or multipart. <br \/> 8bit | 8\u2212bit data with under 1000 chars\/line. <br \/> binary | 8\u2212bit data with some long lines (or no line breaks). <br \/> quoted\u2212printable | Text files with some 8\u2212bit chars (e.g., Latin\u22121 text). <br \/> base64 | Binary files.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Which encoding you choose for a given document depends largely on (1) what you know about the document\u2019s contents (text vs binary), and (2) whether you need the resulting message to have a reliable encoding for 7\u2212bit Internet email transport.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In general, only &#8220;quoted\u2212printable&#8221; and &#8220;base64&#8221; guarantee reliable transport of all data; the other three &#8220;no-encoding&#8221; encodings simply pass the data through, and are only reliable if that data is 7bit <small>ASCII<\/small> with under 1000 characters per line, and has no conflicts with the multipart boundaries.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">I\u2019ve considered making it so that the content-type and encoding can be automatically inferred from the file\u2019s path, but that seems to be asking for trouble&#8230; or at least, for Mail::Cap&#8230;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Message-logging<\/b> <br \/> MIME-tools is a large and complex toolkit which tries to deal with a wide variety of external input. It\u2019s sometimes helpful to see what\u2019s really going on behind the scenes. There are several kinds of messages logged by the toolkit itself: <br \/> Debug messages<\/p>\n<p style=\"margin-left:17%;\">These are printed directly to the <small>STDERR,<\/small> with a prefix of &#8220;MIME\u2212tools: debug&#8221;.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Debug message are only logged if you have turned &#8220;debugging&#8221; on in the MIME::Tools configuration.<\/p>\n<p style=\"margin-left:11%;\">Warning messages<\/p>\n<p style=\"margin-left:17%;\">These are logged by the standard Perl <b>warn()<\/b> mechanism to indicate an unusual situation. They all have a prefix of &#8220;MIME\u2212tools: warning&#8221;.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Warning messages are only logged if $^W is set true and MIME::Tools is not configured to be &#8220;quiet&#8221;.<\/p>\n<p style=\"margin-left:11%;\">Error messages<\/p>\n<p style=\"margin-left:17%;\">These are logged by the standard Perl <b>warn()<\/b> mechanism to indicate that something actually failed. They all have a prefix of &#8220;MIME\u2212tools: error&#8221;.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Error messages are only logged if $^W is set true and MIME::Tools is not configured to be &#8220;quiet&#8221;.<\/p>\n<p style=\"margin-left:11%;\">Usage messages<\/p>\n<p style=\"margin-left:17%;\">Unlike &#8220;typical&#8221; warnings above, which warn about problems processing data, usage-warnings are for alerting developers of deprecated methods and suspicious invocations.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Usage messages are currently only logged if $^W is set true and MIME::Tools is not configured to be &#8220;quiet&#8221;.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When a MIME::Parser (or one of its internal helper classes) wants to report a message, it generally does so by recording the message to the <b>MIME::Parser::Results<\/b> object immediately before invoking the appropriate function above. That means each parsing run has its own trace-log which can be examined for problems.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Configuring the toolkit<\/b> <br \/> If you want to tweak the way this toolkit works (for example, to turn on debugging), use the routines in the <b>MIME::Tools<\/b> module. <br \/> debugging<\/p>\n<p style=\"margin-left:17%;\">Turn debugging on or off. Default is false (off).<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">MIME::Tools\u2212>debugging(1);<\/p>\n<p style=\"margin-left:11%;\">quiet<\/p>\n<p style=\"margin-left:17%;\">Turn the reporting of warning\/error messages on or off. Default is true, meaning that these message are silenced.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">MIME::Tools\u2212>quiet(1);<\/p>\n<p style=\"margin-left:11%;\">version<\/p>\n<p style=\"margin-left:17%;\">Return the toolkit version.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">print MIME::Tools\u2212>version, &#8220;n&#8221;;<\/p>\n<h2>THINGS YOU SHOULD DO <a name=\"THINGS YOU SHOULD DO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Take a look at the examples<\/b> <br \/> The MIME-Tools distribution comes with an &#8220;examples&#8221; directory. The scripts in there are basically just tossed-together, but they\u2019ll give you some ideas of how to use the parser.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Run with warnings enabled<\/b> <i><br \/> Always<\/i> run your Perl script with &#8220;\u2212w&#8221;. If you see a warning about a deprecated method, change your code <small>ASAP.<\/small> This will ease upgrades tremendously.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Avoid non-standard encodings<\/b> <br \/> Don\u2019t try to MIME-encode using the non-standard <small>MIME<\/small> encodings. It\u2019s just not a good practice if you want people to be able to read your messages.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Plan for thrown exceptions<\/b> <br \/> For example, if your mail-handling code absolutely must not die, then perform mail parsing like this:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">$entity = eval { $parser\u2212>parse(*INPUT) };<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Parsing is a complex process, and some components may throw exceptions if seriously-bad things happen. Since &#8220;seriously-bad&#8221; is in the eye of the beholder, you\u2019re better off <i>catching<\/i> possible exceptions instead of asking me to propagate &#8220;undef&#8221; up the stack. Use of exceptions in reusable modules is one of those religious issues we\u2019re never all going to agree upon; thankfully, that\u2019s what &#8220;eval{}&#8221; is good for.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Check the parser results for warnings\/errors<\/b> <br \/> As of 5.3xx, the parser tries extremely hard to give you a MIME::Entity. If there were any problems, it logs warnings\/errors to the underlying &#8220;results&#8221; object (see MIME::Parser::Results). Look at that object after each parse. Print out the warnings and errors, <i>especially<\/i> if messages don\u2019t parse the way you thought they would.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Don\u2019t plan on printing exactly what you parsed!<\/b> <i><br \/> Parsing is a (slightly) lossy operation.<\/i> Because of things like ambiguities in base64\u2212encoding, the following is <i>not<\/i> going to spit out its input unchanged in all cases:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">$entity = $parser\u2212>parse(*STDIN); <br \/> $entity\u2212>print(*STDOUT);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If you\u2019re using MIME::Tools to process email, remember to save the data you parse if you want to send it on unchanged. This is vital for things like PGP-signed email.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Understand how international characters are represented<\/b> <br \/> The <small>MIME<\/small> standard allows for text strings in headers to contain characters from any character set, by using special sequences which look like this:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">=?ISO\u22128859\u22121?Q?Keld_J=F8rn_Simonsen?=<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To be consistent with the existing Mail::Field classes, MIME::Tools does <i>not<\/i> automatically unencode these strings, since doing so would lose the character-set information and interfere with the parsing of fields (see &#8220;decode_headers&#8221; in MIME::Parser for a full explanation). That means you should be prepared to deal with these encoded strings.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The most common question then is, <b>how do I decode these encoded strings?<\/b> The answer depends on what you want to decode them <i>to<\/i>: <small>ASCII,<\/small> Latin1, <small>UTF\u22128,<\/small> etc. Be aware that your &#8220;target&#8221; representation may not support all possible character sets you might encounter; for example, Latin1 ( <small>ISO\u22128859\u22121<\/small> ) has no way of representing Big5 (Chinese) characters. A common practice is to represent &#8220;untranslateable&#8221; characters as &#8220;?&#8221;s, or to ignore them completely.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">To unencode the strings into some of the more-popular Western byte representations (e.g., Latin1, Latin2, etc.), you can use the decoders in MIME::WordDecoder (see MIME::WordDecoder). The simplest way is by using &#8220;unmime()&#8221;, a function wrapped around your &#8220;default&#8221; decoder, as follows:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">use MIME::WordDecoder; <br \/> &#8230; <br \/> $subject = unmime $entity\u2212>head\u2212>get(&#8216;subject&#8217;);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">One place this <i>is<\/i> done automatically is in extracting the recommended filename for a part while parsing. That\u2019s why you should start by setting up the best &#8220;default&#8221; decoder if the default target of Latin1 isn\u2019t to your liking.<\/p>\n<h2>THINGS I DO THAT YOU SHOULD KNOW ABOUT <a name=\"THINGS I DO THAT YOU SHOULD KNOW ABOUT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Fuzzing of <small>CRLF<\/small> and newline on input<\/b> <small><br \/> RFC 2045<\/small> dictates that <small>MIME<\/small> streams have lines terminated by <small>CRLF<\/small> (&#8220;rn&#8221;). However, it is extremely likely that folks will want to parse <small>MIME<\/small> streams where each line ends in the local newline character &#8220;n&#8221; instead.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">An attempt has been made to allow the parser to handle both <small>CRLF<\/small> and newline-terminated input.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Fuzzing of <small>CRLF<\/small> and newline when decoding<\/b> <br \/> The &#8220;7bit&#8221; and &#8220;8bit&#8221; decoders will decode both a &#8220;n&#8221; and a &#8220;rn&#8221; end-of-line sequence into a &#8220;n&#8221;.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The &#8220;binary&#8221; decoder (default if no encoding specified) still outputs stuff verbatim&#8230; so a <small>MIME<\/small> message with CRLFs and no explicit encoding will be output as a text file that, on many systems, will have an annoying ^M at the end of each line&#8230; <i>but this is as it should be<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Fuzzing of <small>CRLF<\/small> and newline when encoding\/composing<\/b> <small><br \/> TODO FIXME<\/small> All encoders currently output the end-of-line sequence as a &#8220;n&#8221;, with the assumption that the local mail agent will perform the conversion from newline to <small>CRLF<\/small> when sending the mail. However, there probably should be an option to output <small>CRLF<\/small> as per <small>RFC 2045<\/small><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Inability to handle multipart boundaries with embedded newlines<\/b> <br \/> Let\u2019s get something straight: this is an evil, <small>EVIL<\/small> practice. If your mailer creates multipart boundary strings that contain newlines, give it two weeks notice and find another one. If your mail robot receives <small>MIME<\/small> mail like this, regard it as syntactically incorrect, which it is.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Ignoring non-header headers<\/b> <br \/> People like to hand the parser raw messages straight from <small>POP3<\/small> or from a mailbox. There is often predictable non-header information in front of the real headers; e.g., the initial &#8220;From&#8221; line in the following message:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">From \u2212 Wed Mar 22 02:13:18 2000 <br \/> Return\u2212Path: <eryq@zeegee.com> <br \/> Subject: Hello<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The parser simply ignores such stuff quietly. Perhaps it shouldn\u2019t, but most people seem to want that behavior.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Fuzzing of empty multipart preambles<\/b> <br \/> Please note that there is currently an ambiguity in the way preambles are parsed in. The following message fragments <i>both<\/i> are regarded as having an empty preamble (where &#8220;n&#8221; indicates a newline character):<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Content\u2212type: multipart\/mixed; boundary=&#8221;xyz&#8221;n <br \/> Subject: This message (#1) has an empty preamblen <br \/> n <br \/> \u2212\u2212xyzn <br \/> &#8230; <br \/> Content\u2212type: multipart\/mixed; boundary=&#8221;xyz&#8221;n <br \/> Subject: This message (#2) also has an empty preamblen <br \/> n <br \/> n <br \/> \u2212\u2212xyzn <br \/> &#8230;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In both cases, the <i>first<\/i> completely-empty line (after the &#8220;Subject&#8221;) marks the end of the header.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">But we should clearly ignore the <i>second<\/i> empty line in message #2, since it fills the role of <i>&#8220;the newline which is only there to make sure that the boundary is at the beginning of a line&#8221;<\/i>. Such newlines are <i>never<\/i> part of the content preceding the boundary; thus, there is no preamble &#8220;content&#8221; in message #2.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">However, it seems clear that message #1 <i>also<\/i> has no preamble &#8220;content&#8221;, and is in fact merely a compact representation of an empty preamble.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Use of a temp file during parsing<\/b> <i><br \/> Why not do everything in core?<\/i> Although the amount of core available on even a modest home system continues to grow, the size of attachments continues to grow with it. I wanted to make sure that even users with small systems could deal with decoding multi-megabyte sounds and movie files. That means not being core-bound.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">As of the released 5.3xx, MIME::Parser gets by with only one temp file open per parser. This temp file provides a sort of infinite scratch space for dealing with the current message part. It\u2019s fast and lightweight, but you should know about it anyway.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Why do I assume that <small>MIME<\/small> objects are email objects?<\/b> <br \/> Achim Bohnet once pointed out that <small>MIME<\/small> headers do nothing more than store a collection of attributes, and thus could be represented as objects which don\u2019t inherit from Mail::Header.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">I agree in principle, but <small>RFC 2045<\/small> says otherwise. <small>RFC 2045<\/small> [ <small>MIME<\/small> ] headers are a syntactic subset of <small>RFC\u2212822<\/small> [email] headers. Perhaps a better name for these modules would have been <small>RFC1521::<\/small> instead of <small>MIME::,<\/small> but we\u2019re a little beyond that stage now.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When I originally wrote these modules for the <small>CPAN, I<\/small> agonized for a long time about whether or not they really should subclass from <b>Mail::Internet<\/b> (then at version 1.17). Thanks to Graham Barr, who graciously evolved MailTools 1.06 to be more MIME-friendly, unification was achieved at MIME-tools release 2.0. The benefits in reuse alone have been substantial.<\/p>\n<h2>A MIME PRIMER <a name=\"A MIME PRIMER\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">So you need to parse (or create) <small>MIME,<\/small> but you\u2019re not quite up on the specifics? No problem&#8230;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Glossary<\/b> <br \/> Here are some definitions adapted from <small>RFC 1521<\/small> (predecessor of the current <small>RFC<\/small> 204[56789] defining <small>MIME<\/small> ) explaining the terminology we use; each is accompanied by the equivalent in <small>MIME::<\/small> module terms&#8230; <br \/> attachment<\/p>\n<p style=\"margin-left:17%;\">An &#8220;attachment&#8221; is common slang for any part of a multipart message &#8212; except, perhaps, for the first part, which normally carries a user message describing the attachments that follow (e.g.: &#8220;Hey dude, here\u2019s that <small>GIF<\/small> file I promised you.&#8221;).<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">In our system, an attachment is just a <b>MIME::Entity<\/b> under the top-level entity, probably one of its parts.<\/p>\n<p style=\"margin-left:11%;\">body<\/p>\n<p style=\"margin-left:17%;\">The &#8220;body&#8221; of an entity is that portion of the entity which follows the header and which contains the real message content. For example, if your <small>MIME<\/small> message has a <small>GIF<\/small> file attachment, then the body of that attachment is the base64\u2212encoded <small>GIF<\/small> file itself.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">A body is represented by an instance of <b>MIME::Body<\/b>. You get the body of an entity by sending it a <b>bodyhandle()<\/b> message.<\/p>\n<p style=\"margin-left:11%;\">body part<\/p>\n<p style=\"margin-left:17%;\">One of the parts of the body of a multipart <b>\/entity<\/b>. A body part has a <b>\/header<\/b> and a <b>\/body<\/b>, so it makes sense to speak about the body of a body part.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Since a body part is just a kind of entity, it\u2019s represented by an instance of <b>MIME::Entity<\/b>.<\/p>\n<p style=\"margin-left:11%;\">entity<\/p>\n<p style=\"margin-left:17%;\">An &#8220;entity&#8221; means either a <b>\/message<\/b> or a <b>\/body part<\/b>. All entities have a <b>\/header<\/b> and a <b>\/body<\/b>.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">An entity is represented by an instance of <b>MIME::Entity<\/b>. There are instance methods for recovering the header (a <b>MIME::Head<\/b>) and the body (a <b>MIME::Body<\/b>).<\/p>\n<p style=\"margin-left:11%;\">header<\/p>\n<p style=\"margin-left:17%;\">This is the top portion of the <small>MIME<\/small> message, which contains the &#8220;Content-type&#8221;, &#8220;Content-transfer-encoding&#8221;, etc. Every <small>MIME<\/small> entity has a header, represented by an instance of <b>MIME::Head<\/b>. You get the header of an entity by sending it a <b>head()<\/b> message.<\/p>\n<p style=\"margin-left:11%;\">message<\/p>\n<p style=\"margin-left:17%;\">A &#8220;message&#8221; generally means the complete (or &#8220;top-level&#8221;) message being transferred on a network.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">There currently is no explicit package for &#8220;messages&#8221;; under <small>MIME::,<\/small> messages are streams of data which may be read in from files or filehandles. You can think of the <b>MIME::Entity<\/b> returned by the <b>MIME::Parser<\/b> as representing the full message.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Content types<\/b> <br \/> This indicates what kind of data is in the <small>MIME<\/small> message, usually as <i>majortype\/minortype<\/i>. The standard major types are shown below. A more-comprehensive listing may be found in <small>RFC\u22122046.<\/small> <br \/> application<\/p>\n<p style=\"margin-left:17%;\">Data which does not fit in any of the other categories, particularly data to be processed by some type of application program. &#8220;application\/octet\u2212stream&#8221;, &#8220;application\/gzip&#8221;, &#8220;application\/postscript&#8221;&#8230;<\/p>\n<p style=\"margin-left:11%;\">audio<\/p>\n<p style=\"margin-left:17%;\">Audio data. &#8220;audio\/basic&#8221;&#8230;<\/p>\n<p style=\"margin-left:11%;\">image<\/p>\n<p style=\"margin-left:17%;\">Graphics data. &#8220;image\/gif&#8221;, &#8220;image\/jpeg&#8221;&#8230;<\/p>\n<p style=\"margin-left:11%;\">message<\/p>\n<p style=\"margin-left:17%;\">A message, usually another mail or <small>MIME<\/small> message. &#8220;message\/rfc822&#8243;&#8230;<\/p>\n<p style=\"margin-left:11%;\">multipart<\/p>\n<p style=\"margin-left:17%;\">A message containing other messages. &#8220;multipart\/mixed&#8221;, &#8220;multipart\/alternative&#8221;&#8230;<\/p>\n<p style=\"margin-left:11%;\">text<\/p>\n<p style=\"margin-left:17%;\">Textual data, meant for humans to read. &#8220;text\/plain&#8221;, &#8220;text\/html&#8221;&#8230;<\/p>\n<p style=\"margin-left:11%;\">video<\/p>\n<p style=\"margin-left:17%;\">Video or video+audio data. &#8220;video\/mpeg&#8221;&#8230;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Content transfer encodings<\/b> <br \/> This is how the message body is packaged up for safe transit. There are the 5 major <small>MIME<\/small> encodings. A more-comprehensive listing may be found in <small>RFC\u22122045.<\/small> <br \/> 7bit<\/p>\n<p style=\"margin-left:17%;\">No encoding is done at all. This label simply asserts that no 8\u2212bit characters are present, and that lines do not exceed 1000 characters in length (including the <small>CRLF<\/small> ).<\/p>\n<p style=\"margin-left:11%;\">8bit<\/p>\n<p style=\"margin-left:17%;\">No encoding is done at all. This label simply asserts that the message might contain 8\u2212bit characters, and that lines do not exceed 1000 characters in length (including the <small>CRLF<\/small> ).<\/p>\n<p style=\"margin-left:11%;\">binary<\/p>\n<p style=\"margin-left:17%;\">No encoding is done at all. This label simply asserts that the message might contain 8\u2212bit characters, and that lines may exceed 1000 characters in length. Such messages are the <i>least<\/i> likely to get through mail gateways.<\/p>\n<p style=\"margin-left:11%;\">base64<\/p>\n<p style=\"margin-left:17%;\">A standard encoding, which maps arbitrary binary data to the 7bit domain. Like &#8220;uuencode&#8221;, but very well-defined. This is how you should send essentially binary information (tar files, GIFs, JPEGs, etc.).<\/p>\n<p style=\"margin-left:11%;\">quoted-printable<\/p>\n<p style=\"margin-left:17%;\">A standard encoding, which maps arbitrary line-oriented data to the 7bit domain. Useful for encoding messages which are textual in nature, yet which contain non-ASCII characters (e.g., Latin\u22121, Latin\u22122, or any other 8\u2212bit alphabet).<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">MIME::Parser, MIME::Head, MIME::Body, MIME::Entity, MIME::Decoder, Mail::Header, Mail::Internet<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">At the time of this writing, the MIME-tools homepage was <i>http:\/\/www.mimedefang.org\/static\/mime\u2212tools.php<\/i>. Check there for updates and support.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <small>MIME<\/small> format is documented in RFCs 1521\u22121522, and more recently in RFCs 2045\u22122049.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <small>MIME<\/small> header format is an outgrowth of the mail header format documented in <small>RFC 822.<\/small><\/p>\n<h2>SUPPORT <a name=\"SUPPORT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Please file support requests via rt.cpan.org.<\/p>\n<h2>CHANGE LOG <a name=\"CHANGE LOG\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Released as MIME-parser (1.0): 28 April 1996. Released as MIME-tools (2.0): Halloween 1996. Released as MIME-tools (4.0): Christmas 1997. Released as MIME-tools (5.0): Mother\u2019s Day 2000.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">See ChangeLog file for full details.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Eryq (<i>eryq@zeegee.com<\/i>), ZeeGee Software Inc (<i>http:\/\/www.zeegee.com<\/i>). Dianne Skoll (<i>dfs@roaringpenguin.com<\/i>) <i>http:\/\/www.roaringpenguin.com<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Copyright (c) 1998, 1999 by ZeeGee Software Inc (www.zeegee.com). Copyright (c) 2004 by Roaring Penguin Software Inc (www.roaringpenguin.com)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This program is free software; you can redistribute it and\/or modify it under the same terms as Perl itself.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">See the <small>COPYING<\/small> file in the distribution for details.<\/p>\n<h2>ACKNOWLEDGMENTS <a name=\"ACKNOWLEDGMENTS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>This kit would not have been possible<\/b> but for the direct contributions of the following:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Gisle Aas The MIME encoding\/decoding modules. <br \/> Laurent Amon Bug reports and suggestions. <br \/> Graham Barr The new MailTools. <br \/> Achim Bohnet Numerous good suggestions, including the I\/O model. <br \/> Kent Boortz Initial code for RFC\u22121522\u2212decoding of MIME headers. <br \/> Andreas Koenig Numerous good ideas, tons of beta testing, <br \/> and help with CPAN\u2212friendly packaging. <br \/> Igor Starovoitov Bug reports and suggestions. <br \/> Jason L Tibbitts III Bug reports, suggestions, patches.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Not to mention the Accidental Beta Test Team, whose bug reports (and comments) have been invaluable in improving the whole:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Phil Abercrombie <br \/> Mike Blazer <br \/> Brandon Browning <br \/> Kurt Freytag <br \/> Steve Kilbane <br \/> Jake Morrison <br \/> Rolf Nelson <br \/> Joel Noble <br \/> Michael W. Normandin <br \/> Tim Pierce <br \/> Andrew Pimlott <br \/> Dragomir R. Radev <br \/> Nickolay Saukh <br \/> Russell Sutherland <br \/> Larry Virden <br \/> Zyx<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Please forgive me if I\u2019ve accidentally left you out. Better yet, email me, and I\u2019ll put you in.<\/p>\n<h2>LICENSE <a name=\"LICENSE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This program is free software; you can redistribute it and\/or modify it under the same terms as Perl itself.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">See the <small>COPYING<\/small> file for more details.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  MIME\u2212tools \u2212 modules for parsing (and creating!) MIME entities <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3007,3545],"class_list":["post-7215","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-man3","tag-mimetools"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7215"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7215\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}