Debian Codegraph @

check_email_delivery/check_email_delivery-0.7.1b/docs/check_smtp_send.html

raw symbols SCIP
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>check_smtp_send - connects to an SMTP server and sends a message</title>
6 <link rel="stylesheet" href="plainwhite.css" type="text/css" />
7 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
8 <link rev="made" href="mailto:[email protected]" />
9 </head>
10
11 <body>
12
13
14 <!-- INDEX BEGIN -->
15 <div name="index">
16 <p><a name="__index__"></a></p>
17 <!--
18
19 <ul>
20
21 <li><a href="#name">NAME</a></li>
22 <li><a href="#synopsis">SYNOPSIS</a></li>
23 <li><a href="#options">OPTIONS</a></li>
24 <li><a href="#examples">EXAMPLES</a></li>
25 <ul>
26
27 <li><a href="#send_a_message_with_custom_headers">Send a message with custom headers</a></li>
28 </ul>
29
30 <li><a href="#exit_codes">EXIT CODES</a></li>
31 <li><a href="#nagios_plugin_notes">NAGIOS PLUGIN NOTES</a></li>
32 <li><a href="#changes">CHANGES</a></li>
33 <li><a href="#author">AUTHOR</a></li>
34 <li><a href="#copyright_and_license">COPYRIGHT AND LICENSE</a></li>
35 </ul>
36
37 -->
38
39
40 </div>
41 <!-- INDEX END -->
42
43 <p>
44 </p>
45 <hr />
46 <h1><a name="name">NAME</a></h1>
47 <p>check_smtp_send - connects to an SMTP server and sends a message</p>
48 <p>
49 </p>
50 <hr />
51 <h1><a name="synopsis">SYNOPSIS</a></h1>
52 <pre>
53 check_smtp_send -vV
54 check_smtp_send -?
55 check_smtp_send --help</pre>
56 <p>
57 </p>
58 <hr />
59 <h1><a name="options">OPTIONS</a></h1>
60 <dl>
61 <dt><strong><a name="warning_seconds" class="item">--warning &lt;seconds&gt;</a></strong></dt>
62
63 <dd>
64 <p>Warn if it takes longer than &lt;seconds&gt; to connect to the SMTP server. Default is 15 seconds.
65 Also known as: -w &lt;seconds&gt;</p>
66 </dd>
67 <dt><strong><a name="critical_seconds" class="item">--critical &lt;seconds&gt;</a></strong></dt>
68
69 <dd>
70 <p>Return a critical status if it takes longer than &lt;seconds&gt; to connect to the SMTP server. Default is 30 seconds.
71 Also known as: -c &lt;seconds&gt;</p>
72 </dd>
73 <dt><strong><a name="timeout_seconds" class="item">--timeout &lt;seconds&gt;</a></strong></dt>
74
75 <dd>
76 <p>Abort with critical status if it takes longer than &lt;seconds&gt; to connect to the SMTP server. Default is 60 seconds.
77 The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to
78 connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer
79 than 30 seconds.
80 Also known as: -t &lt;seconds&gt;</p>
81 </dd>
82 <dt><strong><a name="hostname_server" class="item">--hostname &lt;server&gt;</a></strong></dt>
83
84 <dd>
85 <p>Address or name of the SMTP server. Examples: mail.server.com, localhost, 192.168.1.100</p>
86 <p>If not provided, and if there is only one --mailto address, the script will automatically look up the MX record
87 for the --mailto address and use that as the hostname. You can use this to check that your MX records are correct.
88 When omitting the --hostname option, it doesn't really make sense to specify --port, --username, or --password
89 but you can still do so and they will have their normal effect. To look up the MX records you need to have the
90 module Net::DNS and Email::Address installed.</p>
91 <p>Also known as: -H &lt;server&gt;</p>
92 </dd>
93 <dt><strong><a name="port_number" class="item">--port &lt;number&gt;</a></strong></dt>
94
95 <dd>
96 <p>Service port on the SMTP server. Default is 25 for regular SMTP, 465 for SSL, and 587 for TLS.
97 Also known as: -p &lt;number&gt;</p>
98 </dd>
99 <dt><strong><a name="tls" class="item">--tls</a></strong></dt>
100
101 <dt><strong><a name="notls" class="item">--notls</a></strong></dt>
102
103 <dd>
104 <p>Enable TLS/AUTH protocol. Requires Net::SMTP::TLS, availble on CPAN.</p>
105 <p>When using this option, the default port is 587.
106 You can specify a port from the command line using the --port option.</p>
107 <p>Use the notls option to turn off the tls option.</p>
108 <p>Also, you may need to fix your copy of Net::SMTP::TLS. Here is the diff against version 0.12:</p>
109 <pre>
110 254c254
111 &lt; $me-&gt;_command(sprintf(&quot;AUTH PLAIN %S&quot;,
112 ---
113 &gt; $me-&gt;_command(sprintf(&quot;AUTH PLAIN %s&quot;,</pre>
114 </dd>
115 <dt><strong><a name="ssl" class="item">--ssl</a></strong></dt>
116
117 <dt><strong><a name="nossl" class="item">--nossl</a></strong></dt>
118
119 <dd>
120 <p>Enable SSL protocol. Requires Net::SMTP::SSL and Authen::SASL, availble on CPAN.</p>
121 <p>When using this option, the default port is 465. You can override with the --port option.</p>
122 <p>Use the nossl option to turn off the ssl option.</p>
123 </dd>
124 <dt><strong><a name="auth_method" class="item">--auth &lt;method&gt;</a></strong></dt>
125
126 <dd>
127 <p>Enable authentication with Net::SMTP_auth (sold separately).
128 For example, try using --auth PLAIN or --auth CRAM-MD5.</p>
129 </dd>
130 <dt><strong><a name="username_username" class="item">--username &lt;username&gt;</a></strong></dt>
131
132 <dt><strong><a name="password_password" class="item">--password &lt;password&gt;</a></strong></dt>
133
134 <dd>
135 <p>Username and password to use when connecting to SMTP server.
136 Also known as: -U &lt;username&gt; -P &lt;password&gt;</p>
137 </dd>
138 <dt><strong><a name="body_message" class="item">--body &lt;message&gt;</a></strong></dt>
139
140 <dd>
141 <p>Use this option to specify the body of the email message. If you need newlines in your message,
142 you might need to use the --stdin option instead.</p>
143 </dd>
144 <dt><strong><a name="header_header" class="item">--header &lt;header&gt;</a></strong></dt>
145
146 <dd>
147 <p>Use this option to set an arbitrary header in the message. You can use it multiple times.</p>
148 </dd>
149 <dt><strong><a name="stdin" class="item">--stdin</a></strong></dt>
150
151 <dd>
152 <p>Grab the body of the email message from stdin.</p>
153 </dd>
154 <dt><strong><a name="mailto_recipient_your_net" class="item">--mailto <a href="mailto:[email protected]">[email protected]</a></a></strong></dt>
155
156 <dd>
157 <p>You can send a message to multiple recipients by repeating this option or by separating
158 the email addresses with commas (no whitespace allowed):</p>
159 <p>$ check_smtp_send -H mail.server.net --mailto <a href="mailto:[email protected],[email protected]">[email protected],[email protected]</a> --mailfrom <a href="mailto:[email protected]">[email protected]</a></p>
160 <p>SMTP SEND OK - 1 seconds</p>
161 </dd>
162 <dt><strong><a name="mailfrom_sender_your_net" class="item">--mailfrom <a href="mailto:[email protected]">[email protected]</a></a></strong></dt>
163
164 <dd>
165 <p>Use this option to set the &quot;from&quot; address in the email.</p>
166 </dd>
167 <dt><strong><a name="template" class="item">--template</a></strong></dt>
168
169 <dt><strong><a name="notemplate" class="item">--notemplate</a></strong></dt>
170
171 <dd>
172 <p>Enable (or disable) processing of message body and headers. Requires Text::Template.</p>
173 <p>Use this option to apply special processing to your message body and headers that allows you to use the
174 results of arbitrary computations in the text. For example, you can use this feature to send a message
175 containing the hostname of the machine that sent the message without customizing the plugin configuration
176 on each machine.</p>
177 <p>When you enable the --template option, the message body and headers are parsed by
178 Text::Template. Even a message body provided using the --stdin option will be parsed.
179 See the Text::Template manual for more information, but in general any expression
180 written in Perl will work.</p>
181 <p>There is one convenience function provided to you, trim, which will remove leading and trailing whitespace
182 from its parameter. Here's an example:</p>
183 <pre>
184 check_smtp_send -H mail.server.net --mailto [email protected] --mailfrom [email protected]
185 --template --body 'hello, this message is from {use Sys::Hostname; hostname}'
186 --header 'Subject: test message from {trim(`whoami`)}'</pre>
187 </dd>
188 <dt><strong><a name="expect_response_code" class="item">--expect-response &lt;code&gt;</a></strong></dt>
189
190 <dd>
191 <p>Use this option to specify which SMTP response code should be expected from the server
192 after the SMTP dialog is complete. The default is 250 (message accepted).</p>
193 <p>Also known as: -E &lt;code&gt;</p>
194 </dd>
195 <dt><strong><a name="hires" class="item">--hires</a></strong></dt>
196
197 <dd>
198 <p>Use the Time::HiRes module to measure time, if available.</p>
199 </dd>
200 <dt><strong><a name="verbose" class="item">--verbose</a></strong></dt>
201
202 <dd>
203 <p>Display additional information. Useful for troubleshooting.</p>
204 <p>One --verbose will show extra information for OK, WARNING, and CRITICAL status.</p>
205 <p>Use one --verbose together with --version to see the default warning and critical timeout values.</p>
206 <p>Three --verbose (or -vvv) will show debug information, unless you're using --tls because Net::SMTP::TLS
207 does not have a Debug feature.</p>
208 <p>Also known as: -v</p>
209 </dd>
210 <dt><strong><a name="version" class="item">--version</a></strong></dt>
211
212 <dd>
213 <p>Display plugin version and exit.
214 Also known as: -V</p>
215 </dd>
216 <dt><strong><a name="help" class="item">--help</a></strong></dt>
217
218 <dd>
219 <p>Display this documentation and exit. Does not work in the ePN version.
220 Also known as: -h</p>
221 </dd>
222 <dt><strong><a name="usage" class="item">--usage</a></strong></dt>
223
224 <dd>
225 <p>Display a short usage instruction and exit.</p>
226 </dd>
227 </dl>
228 <p>
229 </p>
230 <hr />
231 <h1><a name="examples">EXAMPLES</a></h1>
232 <p>
233 </p>
234 <h2><a name="send_a_message_with_custom_headers">Send a message with custom headers</a></h2>
235 <p>$ check_smtp_send -H mail.server.net --mailto <a href="mailto:[email protected]">[email protected]</a> --mailfrom <a href="mailto:[email protected]">[email protected]</a>
236 --body 'Homeruns 5' --header 'Subject: Hello, world!' --header 'X-Your-Header: Yes'</p>
237 <p>SMTP SEND OK - 1 seconds</p>
238 <p>
239 </p>
240 <hr />
241 <h1><a name="exit_codes">EXIT CODES</a></h1>
242 <p><table cellspacing="0" cellpadding="0"><tr><td>Complies with the Nagios plug-in specification:
243 <tr><td> 0<td>OK<td>The plugin was able to check the service and it appeared to be functioning properly
244 <tr><td> 1<td>Warning<td>The plugin was able to check the service, but it appeared to be above some &quot;warning&quot; threshold or did not appear to be working properly
245 <tr><td> 2<td>Critical<td>The plugin detected that either the service was not running or it was above some &quot;critical&quot; threshold
246 <tr><td> 3<td>Unknown<td>Invalid command line arguments were supplied to the plugin or the plugin was unable to check the status of the given hosts/service</table></p>
247 <p>
248 </p>
249 <hr />
250 <h1><a name="nagios_plugin_notes">NAGIOS PLUGIN NOTES</a></h1>
251 <p>Nagios plugin reference: <a href="http://nagiosplug.sourceforge.net/developer-guidelines.html">http://nagiosplug.sourceforge.net/developer-guidelines.html</a></p>
252 <p>This plugin does NOT use Nagios DEFAULT_SOCKET_TIMEOUT (provided by utils.pm as $TIMEOUT) because
253 the path to utils.pm must be specified completely in this program and forces users to edit the source
254 code if their install location is different (if they realize this is the problem). You can view
255 the default timeout for this module by using the --verbose and --version options together. The
256 short form is -vV.</p>
257 <p>Other than that, it attempts to follow published guidelines for Nagios plugins.</p>
258 <p>
259 </p>
260 <hr />
261 <h1><a name="changes">CHANGES</a></h1>
262 <pre>
263 Wed Oct 29 14:05:00 PST 2005
264 + version 0.1</pre>
265 <pre>
266 Wed Nov 9 15:01:48 PST 2005
267 + now using an inline PluginReport package to generate the report
268 + added stdin option
269 + copyright notice and GNU GPL
270 + version 0.2</pre>
271 <pre>
272 Thu Apr 20 16:00:00 PST 2006 (by Geoff Crompton &lt;[email protected]&gt;)
273 + added bailing if the $smtp-&gt;to() call fails
274 + added support for mailto recipients separated by commas
275 + version 0.2.1</pre>
276 <pre>
277 Tue Apr 24 21:17:53 PDT 2007
278 + moved POD text to separate file in order to accomodate the new embedded-perl Nagios feature
279 + version 0.2.3</pre>
280 <pre>
281 Fri Apr 27 20:26:42 PDT 2007
282 + documentation now mentions every command-line option accepted by the plugin, including abbreviations
283 + version 0.3
284
285 Sun Oct 21 10:34:14 PDT 2007
286 + added support for TLS and authentication via the Net::SMTP::TLS module. see --tls option.
287 + version 0.4</pre>
288 <pre>
289 Sun Oct 21 13:54:26 PDT 2007
290 + added support for SSL via the Net::SMTP::SSL module. see --ssl option.
291 + port is no longer a required option. defaults to 25 for regular smtp, 465 for ssl, and 587 for tls.
292 + added port info to the &quot;could not connect&quot; error message
293 + version 0.4.1</pre>
294 <pre>
295 Tue Dec 4 07:42:32 PST 2007
296 + added --usage option because the official nagios plugins have both --help and --usage
297 + added --timeout option to match the official nagios plugins
298 + fixed some minor pod formatting issues for perldoc
299 + version 0.4.2</pre>
300 <pre>
301 Mon Feb 11 19:09:37 PST 2008
302 + fixed a bug for embedded perl version, variable &quot;%status&quot; will not stay shared in load_modules
303 + version 0.4.3</pre>
304 <pre>
305 Mon May 26 09:12:14 PDT 2008
306 + fixed warning and critical messages to use &quot;more than&quot; or &quot;less than&quot; instead of the angle brackets, to make them more web friendly
307 + version 0.4.4
308
309 Wed Jul 2 07:12:35 PDT 2008
310 + added --expect-response option submitted by Christian Kauhaus &lt;[email protected]&gt;
311 + added support for authentication via Net::SMTP_auth. see --auth option.
312 + version 0.4.5</pre>
313 <pre>
314 Sun Oct 5 15:18:23 PDT 2008
315 + added error handling for smtp server disconnects ungracefully during QUIT (gmail.com does)
316 + version 0.4.6</pre>
317 <pre>
318 Thu Oct 1 12:09:35 PDT 2009
319 + added --template option to allow arbitrary substitutions for body and headers, and provided one convenience function for trimming strings
320 + added performance data for use with PNP4Nagios!
321 + version 0.5.0</pre>
322 <pre>
323 Thu Oct 8 11:17:04 PDT 2009
324 + added more detailed error messages when using --verbose
325 + version 0.5.1</pre>
326 <pre>
327 Tue Feb 9 12:14:49 PST 2010
328 + added support for combining --auth with --tls using a subclass of Net::SMTP::TLS submitted by Brad Guillory; please note that to use the &quot;PLAIN&quot; authentication type you need to patch your Net::SMTP:TLS because it has a bug in sub auth_PLAIN (sprintf %S instead of %s)
329 + version 0.5.2</pre>
330 <pre>
331 Mon Jan 3 10:39:42 PST 2011
332 + added default Date and Message-ID headers; Date header uses POSIX strftime and Message-ID header uses hostname command to get localhost name
333 + version 0.7.0</pre>
334 <pre>
335 Fri May 6 08:35:09 AST 2011
336 + added --hires option to enable use of Time::Hires if available
337 + version 0.7.1</pre>
338 <pre>
339 Wed Jul 6 19:18:26 AST 2011
340 + the --hostname is now optional; if not provided the plugin will lookup the MX record for the --mailto address (requires Net::DNS)
341 + version 0.7.2</pre>
342 <pre>
343 Tue Dec 13 09:24:04 PST 2011
344 + separated authentication errors from connection errors
345 + version 0.7.3</pre>
346 <p>
347 </p>
348 <hr />
349 <h1><a name="author">AUTHOR</a></h1>
350 <p>Jonathan Buhacoff &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;</p>
351 <p>
352 </p>
353 <hr />
354 <h1><a name="copyright_and_license">COPYRIGHT AND LICENSE</a></h1>
355 <pre>
356 Copyright (C) 2005-2011 Jonathan Buhacoff</pre>
357 <pre>
358 This program is free software; you can redistribute it and/or modify
359 it under the terms of the GNU General Public License as published by
360 the Free Software Foundation; either version 3 of the License, or
361 (at your option) any later version.</pre>
362 <pre>
363 This program is distributed in the hope that it will be useful,
364 but WITHOUT ANY WARRANTY; without even the implied warranty of
365 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
366 GNU General Public License for more details.</pre>
367 <pre>
368 You should have received a copy of the GNU General Public License
369 along with this program. If not, see &lt;<a href="http://www.gnu.org/licenses/&gt">http://www.gnu.org/licenses/&gt</a>;.</pre>
370 <pre>
371 <a href="http://www.gnu.org/licenses/gpl.txt">http://www.gnu.org/licenses/gpl.txt</a></pre>
372
373 </body>
374
375 </html>