{"id":6654,"date":"2022-12-20T19:19:36","date_gmt":"2022-12-20T22:19:36","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/mailutil-man3\/"},"modified":"2022-12-20T19:19:36","modified_gmt":"2022-12-20T22:19:36","slug":"mailutil-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/mailutil-man3\/","title":{"rendered":"Mail::Util (man3)"},"content":{"rendered":"<h1 align=\"center\">Mail::Util<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#INHERITANCE\">INHERITANCE<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#FUNCTIONS\">FUNCTIONS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHORS\">AUTHORS<\/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\">Mail::Util \u2212 mail utility functions<\/p>\n<h2>INHERITANCE <a name=\"INHERITANCE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Mail::Util <br \/> is a Exporter<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">use Mail::Util qw( &#8230; );<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This package provides several mail related utility functions. Any function required must by explicitly listed on the use line to be exported into the calling package.<\/p>\n<h2>FUNCTIONS <a name=\"FUNCTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>mailaddress<\/b>( [$address] )<\/p>\n<p style=\"margin-left:17%;\">Return a guess at the current users mail address. The user can force the return value by setting the <small>MAILADDRESS<\/small> environment variable. [2.10] You may set the $address via the parameter.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><small>WARNING:<\/small> When not supplied via the environment variable, <mailaddress> looks at various configuration files and other environmental data. Although this seems to be smart behavior, this is not predictable enough ( <small>IMHO<\/small> ) to be used. Please set the <small>MAILADDRESS<\/small> explicitly, and do not trust on the &#8220;automatic detection&#8221;, even when that produces a correct address (on the moment)<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">example:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"># in your main script <br \/> $ENV{MAILADDRESS} = &#8216;me@example.com&#8217;; <br \/> # everywhere else <br \/> use Mail::Util &#8216;mailaddress&#8217;; <br \/> print mailaddress; <br \/> # since v2.10 <br \/> mailaddress &#8220;me@example.com&#8221;;<\/p>\n<p style=\"margin-left:11%;\"><b>maildomain<\/b>()<\/p>\n<p style=\"margin-left:17%;\">Attempt to determine the current user mail domain string via the following methods<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"17%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"77%\">\n<p>Look for the <small>MAILDOMAIN<\/small> environment variable, which can be set from outside the program. This is by far the best way to configure the domain.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"17%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"77%\">\n<p>Look for a sendmail.cf file and extract <small>DH<\/small> parameter<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"17%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"77%\">\n<p>Look for a smail config file and usr the first host defined in hostname(s)<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"17%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"77%\">\n<p>Try an <small>SMTP<\/small> connect (if Net::SMTP exists) first to mailhost then localhost<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"17%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"77%\">\n<p>Use value from Net::Domain::domainname (if Net::Domain exists)<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\"><small>WARNING:<\/small> On modern machines, there is only one good way to provide information to this method: the first; always explicitly configure the <small>MAILDOMAIN.<\/small><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">example:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"># in your main script <br \/> $ENV{MAILDOMAIN} = &#8216;example.com&#8217;; <br \/> # everywhere else <br \/> use Mail::Util &#8216;maildomain&#8217;; <br \/> print maildomain;<\/p>\n<p style=\"margin-left:11%;\"><b>read_mbox<\/b>($file)<\/p>\n<p style=\"margin-left:17%;\">Read $file, a binmail mailbox file, and return a list of references. Each reference is a reference to an array containing one message.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><small>WARNING:<\/small> This method does not quote lines which accidentally also start with the message separator &#8220;From&#8221;, so this implementation can be considered broken. See Mail::Box::Mbox<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This module is part of the MailTools distribution, <i>http:\/\/perl.overmeer.net\/mailtools\/<\/i>.<\/p>\n<h2>AUTHORS <a name=\"AUTHORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The MailTools bundle was developed by Graham Barr. Later, Mark Overmeer took over maintenance without commitment to further development.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Mail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by Peter Orbaek <poe@cit.dk>. Mail::Mailer and Mail::Send by Tim Bunce <Tim.Bunce@ig.co.uk>. For other contributors see ChangeLog.<\/p>\n<h2>LICENSE <a name=\"LICENSE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Copyrights 1995\u22122000 Graham Barr <gbarr@pobox.com> and 2001\u22122017 Mark Overmeer <perl@overmeer.net>.<\/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. See <i>http:\/\/www.perl.com\/perl\/misc\/Artistic.html<\/i><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Mail::Util \u2212 mail utility functions <\/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":[3034,3007],"class_list":["post-6654","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-mailutil","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6654","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=6654"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6654\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}