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 primi‐
30 tive, pre-MIME standard, what may cause many headers to be lost. For
31 these platforms (and probably for other platforms as well), you can
32 better not use this transport mechanism.
33
35 Constructors
36
37 Mail::Transport::Mailx->new(OPTIONS)
38
39 Option --Defined in --Default
40 executable Mail::Transport undef
41 hostname Mail::Transport 'localhost'
42 interval Mail::Transport 30
43 log Mail::Reporter 'WARNINGS'
44 password Mail::Transport undef
45 port Mail::Transport undef
46 proxy Mail::Transport undef
47 retry Mail::Transport <false>
48 style <autodetect>
49 timeout Mail::Transport 120
50 trace Mail::Reporter 'WARNINGS'
51 username Mail::Transport undef
52 via Mail::Transport 'mailx'
53
54 . executable FILENAME
55
56 . hostname HOSTNAME⎪ARRAY-OF-HOSTNAMES
57
58 . interval SECONDS
59
60 . log LEVEL
61
62 . password STRING
63
64 . port INTEGER
65
66 . proxy PATH
67
68 . retry NUMBER⎪undef
69
70 . style 'BSD'⎪'RFC822'
71
72 There are two version of the "mail" program. The newest
73 accepts RFC822 messages, and automagically collect information
74 about where the message is to be send to. The BSD style mail
75 command predates MIME, and expects lines which start with a '~'
76 (tilde) to specify destinations and such. This field is
77 autodetect, however on some platforms both versions of "mail"
78 can live (like various Linux distributions).
79
80 . timeout SECONDS
81
82 . trace LEVEL
83
84 . username STRING
85
86 . via CLASS⎪NAME
87
88 Sending mail
89
90 $obj->destinations(MESSAGE, [ADDRESS⎪ARRAY-OF-ADDRESSES])
91
92 See "Sending mail" in Mail::Transport::Send
93
94 $obj->putContent(MESSAGE, FILEHANDLE, OPTIONS)
95
96 See "Sending mail" in Mail::Transport::Send
97
98 $obj->send(MESSAGE, OPTIONS)
99
100 See "Sending mail" in Mail::Transport::Send
101
102 $obj->trySend(MESSAGE, OPTIONS)
103
104 Server connection
105
106 $obj->findBinary(NAME [, DIRECTORIES])
107
108 See "Server connection" in Mail::Transport
109
110 $obj->remoteHost
111
112 See "Server connection" in Mail::Transport
113
114 $obj->retry
115
116 See "Server connection" in Mail::Transport
117
118 Error handling
119
120 $obj->AUTOLOAD
121
122 See "Error handling" in Mail::Reporter
123
124 $obj->addReport(OBJECT)
125
126 See "Error handling" in Mail::Reporter
127
128 $obj->defaultTrace([LEVEL]⎪[LOGLEVEL, TRACELEVEL]⎪[LEVEL, CALLBACK])
129
130 Mail::Transport::Mailx->defaultTrace([LEVEL]⎪[LOGLEVEL,
131 TRACELEVEL]⎪[LEVEL, CALLBACK])
132
133 See "Error handling" in Mail::Reporter
134
135 $obj->errors
136
137 See "Error handling" in Mail::Reporter
138
139 $obj->log([LEVEL [,STRINGS]])
140
141 Mail::Transport::Mailx->log([LEVEL [,STRINGS]])
142
143 See "Error handling" in Mail::Reporter
144
145 $obj->logPriority(LEVEL)
146
147 Mail::Transport::Mailx->logPriority(LEVEL)
148
149 See "Error handling" in Mail::Reporter
150
151 $obj->logSettings
152
153 See "Error handling" in Mail::Reporter
154
155 $obj->notImplemented
156
157 See "Error handling" in Mail::Reporter
158
159 $obj->report([LEVEL])
160
161 See "Error handling" in Mail::Reporter
162
163 $obj->reportAll([LEVEL])
164
165 See "Error handling" in Mail::Reporter
166
167 $obj->trace([LEVEL])
168
169 See "Error handling" in Mail::Reporter
170
171 $obj->warnings
172
173 See "Error handling" in Mail::Reporter
174
175 Cleanup
176
177 $obj->DESTROY
178
179 See "Cleanup" in Mail::Reporter
180
181 $obj->inGlobalDestruction
182
183 See "Cleanup" in Mail::Reporter
184
186 Warning: Message has no destination
187
188 It was not possible to figure-out where the message is intended to go
189 to.
190
191 Error: Package $package does not implement $method.
192
193 Fatal error: the specific package (or one of its superclasses) does not
194 implement this method where it should. This message means that some
195 other related classes do implement this method however the class at
196 hand does not. Probably you should investigate this and probably
197 inform the author of the package.
198
199 Warning: Resent group does not specify a destination
200
201 The message which is sent is the result of a bounce (for instance cre‐
202 ated with Mail::Message::bounce()), and therefore starts with a
203 "Received" header field. With the "bounce", the new destination(s) of
204 the message are given, which should be included as "Resent-To",
205 "Resent-Cc", and "Resent-Bcc".
206
207 The "To", "Cc", and "Bcc" header information is only used if no
208 "Received" was found. That seems to be the best explanation of the
209 RFC.
210
211 As alternative, you may also specify the "to" option to some of the
212 senders (for instance Mail::Transport::SMTP::send(to) to overrule any
213 information found in the message itself about the destination.
214
215 Error: Sending via mailx mailer $program failed: $! ($?)
216
217 Mailx (in some shape: there are many different implementations) did
218 start accepting messages, but did not succeed sending it.
219
221 This module is part of Mail-Box distribution version 2.070, built on
222 March 25, 2007. Website: http://perl.overmeer.net/mailbox/
223
225 Copyrights 2001-2007 by Mark Overmeer.For other contributors see
226 ChangeLog.
227
228 This program is free software; you can redistribute it and/or modify it
229 under the same terms as Perl itself. See
230 http://www.perl.com/perl/misc/Artistic.html
231
232
233
234perl v5.8.8 2007-03-25 Mail::Transport::Mailx(3)