1Mail::Transport::Mailx(U3s)er Contributed Perl DocumentatMiaoinl::Transport::Mailx(3)
2
3
4
6 Mail::Transport::Mailx - transmit messages using external mailx program
7
9 Mail::Transport::Mailx
10 is a Mail::Transport::Send
11 is a Mail::Transport
12 is a Mail::Reporter
13
15 my $sender = Mail::Transport::Mailx->new(...);
16 $sender->send($message);
17
19 Implements mail transport using the external programs 'mailx', "Mail",
20 or 'mail'. When instantiated, the mailer will look for any of these
21 binaries in specific system directories, and the first program found is
22 taken.
23
24 WARNING: There are many security issues with mail and mailx. DO NOT USE
25 these commands to send messages which contains data derived from any
26 external source!!!
27
28 Under Linux, freebsd, and bsdos the "mail", "Mail", and "mailx" names
29 are just links to the same binary. The implementation is very
30 primitive, pre-MIME standard, what may cause many headers to be lost.
31 For these platforms (and probably for other platforms as well), you can
32 better not use this transport mechanism.
33
34 Extends "DESCRIPTION" in Mail::Transport::Send.
35
37 Extends "METHODS" in Mail::Transport::Send.
38
39 Constructors
40 Extends "Constructors" in Mail::Transport::Send.
41
42 Mail::Transport::Mailx->new(%options)
43 -Option --Defined in --Default
44 executable Mail::Transport undef
45 hostname Mail::Transport 'localhost'
46 interval Mail::Transport 30
47 log Mail::Reporter 'WARNINGS'
48 password Mail::Transport undef
49 port Mail::Transport undef
50 proxy Mail::Transport undef
51 retry Mail::Transport <false>
52 style <autodetect>
53 timeout Mail::Transport 120
54 trace Mail::Reporter 'WARNINGS'
55 username Mail::Transport undef
56 via Mail::Transport 'mailx'
57
58 executable => FILENAME
59 hostname => HOSTNAME|ARRAY
60 interval => SECONDS
61 log => LEVEL
62 password => STRING
63 port => INTEGER
64 proxy => PATH
65 retry => NUMBER|undef
66 style => 'BSD'|'RFC822'
67 There are two version of the "mail" program. The newest accepts
68 RFC822 messages, and automagically collect information about
69 where the message is to be send to. The BSD style mail command
70 predates MIME, and expects lines which start with a '~' (tilde)
71 to specify destinations and such. This field is autodetect,
72 however on some platforms both versions of "mail" can live (like
73 various Linux distributions).
74
75 timeout => SECONDS
76 trace => LEVEL
77 username => STRING
78 via => CLASS|NAME
79
80 Sending mail
81 Extends "Sending mail" in Mail::Transport::Send.
82
83 $obj->destinations( $message, [$address|ARRAY] )
84 Inherited, see "Sending mail" in Mail::Transport::Send
85
86 $obj->putContent($message, $fh, %options)
87 Inherited, see "Sending mail" in Mail::Transport::Send
88
89 $obj->send($message, %options)
90 Inherited, see "Sending mail" in Mail::Transport::Send
91
92 $obj->trySend($message, %options)
93
94 Server connection
95 Extends "Server connection" in Mail::Transport::Send.
96
97 $obj->findBinary( $name, [@directories] )
98 Inherited, see "Server connection" in Mail::Transport
99
100 $obj->remoteHost()
101 Inherited, see "Server connection" in Mail::Transport
102
103 $obj->retry()
104 Inherited, see "Server connection" in Mail::Transport
105
106 Error handling
107 Extends "Error handling" in Mail::Transport::Send.
108
109 $obj->AUTOLOAD()
110 Inherited, see "Error handling" in Mail::Reporter
111
112 $obj->addReport($object)
113 Inherited, see "Error handling" in Mail::Reporter
114
115 $obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level,
116 $callback] )
117 Mail::Transport::Mailx->defaultTrace( [$level]|[$loglevel,
118 $tracelevel]|[$level, $callback] )
119 Inherited, see "Error handling" in Mail::Reporter
120
121 $obj->errors()
122 Inherited, see "Error handling" in Mail::Reporter
123
124 $obj->log( [$level, [$strings]] )
125 Mail::Transport::Mailx->log( [$level, [$strings]] )
126 Inherited, see "Error handling" in Mail::Reporter
127
128 $obj->logPriority($level)
129 Mail::Transport::Mailx->logPriority($level)
130 Inherited, see "Error handling" in Mail::Reporter
131
132 $obj->logSettings()
133 Inherited, see "Error handling" in Mail::Reporter
134
135 $obj->notImplemented()
136 Inherited, see "Error handling" in Mail::Reporter
137
138 $obj->report( [$level] )
139 Inherited, see "Error handling" in Mail::Reporter
140
141 $obj->reportAll( [$level] )
142 Inherited, see "Error handling" in Mail::Reporter
143
144 $obj->trace( [$level] )
145 Inherited, see "Error handling" in Mail::Reporter
146
147 $obj->warnings()
148 Inherited, see "Error handling" in Mail::Reporter
149
150 Cleanup
151 Extends "Cleanup" in Mail::Transport::Send.
152
153 $obj->DESTROY()
154 Inherited, see "Cleanup" in Mail::Reporter
155
157 Warning: Message has no destination
158 It was not possible to figure-out where the message is intended to
159 go to.
160
161 Error: Package $package does not implement $method.
162 Fatal error: the specific package (or one of its superclasses) does
163 not implement this method where it should. This message means that
164 some other related classes do implement this method however the
165 class at hand does not. Probably you should investigate this and
166 probably inform the author of the package.
167
168 Warning: Resent group does not specify a destination
169 The message which is sent is the result of a bounce (for instance
170 created with Mail::Message::bounce()), and therefore starts with a
171 "Received" header field. With the "bounce", the new destination(s)
172 of the message are given, which should be included as "Resent-To",
173 "Resent-Cc", and "Resent-Bcc".
174
175 The "To", "Cc", and "Bcc" header information is only used if no
176 "Received" was found. That seems to be the best explanation of the
177 RFC.
178
179 As alternative, you may also specify the "to" option to some of the
180 senders (for instance Mail::Transport::SMTP::send(to) to overrule
181 any information found in the message itself about the destination.
182
183 Error: Sending via mailx mailer $program failed: $! ($?)
184 Mailx (in some shape: there are many different implementations) did
185 start accepting messages, but did not succeed sending it.
186
188 This module is part of Mail-Transport distribution version 3.005, built
189 on July 22, 2020. Website: http://perl.overmeer.net/CPAN/
190
192 Copyrights 2001-2020 by [Mark Overmeer]. For other contributors see
193 ChangeLog.
194
195 This program is free software; you can redistribute it and/or modify it
196 under the same terms as Perl itself. See http://dev.perl.org/licenses/
197
198
199
200perl v5.34.0 2021-07-22 Mail::Transport::Mailx(3)