Changeset b8e4ac4354d8201d78c1a9166c597998bcb3167c
- Timestamp:
- 09/07/08 05:17:30
(5 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1220764650 +0000
- git-parent:
[95f6a3eb99f73571cb5863ecdb354de2d12f85be]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1220764650 +0000
- Message:
more docs, fixups.. Better smtp options and docs. refs #21
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rdb656f3 |
rb8e4ac4 |
|
| 101 | 101 | |
|---|
| 102 | 102 | module-online.h: modules/module-online.xsl |
|---|
| 103 | | @echo "- making module-online.h (StyleSheet include" |
|---|
| | 103 | @echo "- making module-online.h (StyleSheet include)" |
|---|
| 104 | 104 | @$(XML2H) helpStyleXML < modules/module-online.xsl > $@ |
|---|
| 105 | 105 | |
|---|
| ra4c778e |
rb8e4ac4 |
|
| 1 | | -- This connects to a Varnish instance on the management port (8081) |
|---|
| 2 | | -- It issues the stats comment and translates the output into metrics |
|---|
| 3 | | |
|---|
| 4 | 1 | module(..., package.seeall) |
|---|
| 5 | 2 | |
|---|
| 6 | 3 | function onload(image) |
|---|
| | 4 | image.xml_description([=[ |
|---|
| | 5 | <module> |
|---|
| | 6 | <name>smtp</name> |
|---|
| | 7 | <description><para>Send an email via an SMTP server.</para></description> |
|---|
| | 8 | <loader>lua</loader> |
|---|
| | 9 | <object>noit.module.smtp</object> |
|---|
| | 10 | <moduleconfig /> |
|---|
| | 11 | <checkconfig> |
|---|
| | 12 | <parameter name="port" required="optional" default="25" |
|---|
| | 13 | allowed="\d+">Specifies the TCP port to connect to.</parameter> |
|---|
| | 14 | <parameter name="ehlo" required="optional" default="noit.local" |
|---|
| | 15 | allowed="\d+">Specifies the EHLO parameter.</parameter> |
|---|
| | 16 | <parameter name="from" required="optional" default="" |
|---|
| | 17 | allowed="\d+">Specifies the envelope sender.</parameter> |
|---|
| | 18 | <parameter name="to" required="required" |
|---|
| | 19 | allowed="\d+">Specifies the envelope recipient.</parameter> |
|---|
| | 20 | <parameter name="payload" required="optional" default="Subject: Testing" |
|---|
| | 21 | allowed="\d+">Specifies the payload sent (on the wire). CR LF DOT CR LF is appended automatically.</parameter> |
|---|
| | 22 | </checkconfig> |
|---|
| | 23 | <examples> |
|---|
| | 24 | <example> |
|---|
| | 25 | <title>Send an email to test SMTP service.</title> |
|---|
| | 26 | <para>The following example sends an email via 10.80.117.6 from test@omniti.com to devnull@omniti.com</para> |
|---|
| | 27 | <programlisting><![CDATA[ |
|---|
| | 28 | <noit> |
|---|
| | 29 | <modules> |
|---|
| | 30 | <loader image="lua" name="lua"> |
|---|
| | 31 | <config><directory>/opt/reconnoiter/libexec/modules-lua/?.lua</directory></config> |
|---|
| | 32 | </loader> |
|---|
| | 33 | <module loader="lua" name="smtp" object="noit.module.smtp"/> |
|---|
| | 34 | </modules> |
|---|
| | 35 | <checks> |
|---|
| | 36 | <check uuid="2d42adbc-7c7a-11dd-a48f-4f59e0b654d3" module="smtp" target="10.80.117.6"> |
|---|
| | 37 | <config> |
|---|
| | 38 | <from>test@omniti.com</from> |
|---|
| | 39 | <to>devnull@omniti.com</to> |
|---|
| | 40 | </config> |
|---|
| | 41 | </check> |
|---|
| | 42 | </checks> |
|---|
| | 43 | </noit> |
|---|
| | 44 | ]]></programlisting> |
|---|
| | 45 | </example> |
|---|
| | 46 | </examples> |
|---|
| | 47 | </module> |
|---|
| | 48 | ]=]); |
|---|
| 7 | 49 | return 0 |
|---|
| 8 | 50 | end |
|---|
| … | … | |
| 73 | 115 | end |
|---|
| 74 | 116 | |
|---|
| | 117 | local ehlo = string.format("EHLO %s", check.config.ehlo or "noit.local") |
|---|
| 75 | 118 | local mailfrom = string.format("MAIL FROM:<%s>", check.config.from or "") |
|---|
| 76 | 119 | local rcptto = string.format("RCPT TO:<%s>", check.config.to) |
|---|
| | 120 | local payload = check.config.payload or "Subject: Test\n\nHello." |
|---|
| | 121 | payload = payload:gsub("\n", "\r\n") |
|---|
| 77 | 122 | local action = mkaction(e, check) |
|---|
| 78 | 123 | if action("banner", nil, 220) |
|---|
| | 124 | and action("ehlo", ehlo, 250) |
|---|
| 79 | 125 | and action("mailfrom", mailfrom, 250) |
|---|
| 80 | 126 | and action("rcptto", rcptto, 250) |
|---|
| 81 | 127 | and action("data", "DATA", 354) |
|---|
| 82 | | and action("body", "Subject: Test\r\n\r\nHello.\r\n.", 250) |
|---|
| | 128 | and action("body", payload .. "\r\n.", 250) |
|---|
| 83 | 129 | and action("quit", "QUIT", 221) |
|---|
| 84 | 130 | then |
|---|
| r1010758 |
rb8e4ac4 |
|
| 14 | 14 | <checkconfig> |
|---|
| 15 | 15 | <parameter name="port" required="optional" default="8081" |
|---|
| 16 | | allowed="\\d+">Specifies the port on which the management interface can be reached.</parameter> |
|---|
| | 16 | allowed="\d+">Specifies the port on which the management interface can be reached.</parameter> |
|---|
| 17 | 17 | </checkconfig> |
|---|
| 18 | 18 | <examples> |
|---|