1Mail::Util(3) User Contributed Perl Documentation Mail::Util(3)
2
3
4
6 Mail::Util - mail utility functions
7
9 Mail::Util
10 is a Exporter
11
13 use Mail::Util qw( ... );
14
16 This package provides several mail related utility functions. Any
17 function required must by explicitly listed on the use line to be
18 exported into the calling package.
19
21 mailaddress
22
23 Return a guess at the current users mail address. The user can
24 force the return value by setting the MAILADDRESS environment
25 variable.
26
27 WARNING: When not supplied via the environment variable,
28 <mailaddress> looks at various configuration files and other
29 environmental data. Although this seems to be smart behavior, this
30 is not predictable enough (IMHO) to be used. Please set the
31 MAILADDRESS explicitly, and do not trust on the "automatic
32 detection", even when that produces a correct address (on the
33 moment)
34
35 example:
36
37 # in your main script
38 $ENV{MAILADDRESS} = 'me@example.com';
39
40 # everywhere else
41 use Mail::Util 'mailaddress';
42 print mailaddress;
43
44 maildomain
45
46 Attempt to determine the current uers mail domain string via the
47 following methods
48
49 · Look for the MAILDOMAIN enviroment variable, which can be set
50 from outside the program. This is by far the best way to
51 configure the domain.
52
53 · Look for a sendmail.cf file and extract DH parameter
54
55 · Look for a smail config file and usr the first host defined in
56 hostname(s)
57
58 · Try an SMTP connect (if Net::SMTP exists) first to mailhost
59 then localhost
60
61 · Use value from Net::Domain::domainname (if Net::Domain exists)
62
63 WARNING: On modern machines, there is only one good way to provide
64 information to this method: the first; always explicitly configure
65 the MAILDOMAIN.
66
67 example:
68
69 # in your main script
70 $ENV{MAILDOMAIN} = 'example.com';
71
72 # everywhere else
73 use Mail::Util 'maildomain';
74 print maildomain;
75
76 read_mbox(FILE)
77
78 Read FILE, a binmail mailbox file, and return a list of
79 references. Each reference is a reference to an array containg one
80 message.
81
82 WARNING: This method does not quote lines which accidentally also
83 start with the message separator "From", so this implementation can
84 be considered broken. See Mail::Box::Mbox
85
87 This module is part of the MailTools distribution,
88 http://perl.overmeer.net/mailtools/.
89
91 The MailTools bundle was developed by Graham Barr. Later, Mark
92 Overmeer took over maintenance without commitment to further
93 development.
94
95 Mail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by
96 Peter Orbaek <poe@cit.dk>. Mail::Mailer and Mail::Send by Tim Bunce
97 <Tim.Bunce@ig.co.uk>. For other contributors see ChangeLog.
98
100 Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2007 Mark
101 Overmeer <perl@overmeer.net>.
102
103 This program is free software; you can redistribute it and/or modify it
104 under the same terms as Perl itself. See
105 http://www.perl.com/perl/misc/Artistic.html
106
107
108
109perl v5.10.1 2008-07-29 Mail::Util(3)