1 |
cb7d18d5
|
Renato Botelho
|
#!/usr/local/bin/php-cgi -q
|
2 |
dd16aadf
|
jim-p
|
<?php
|
3 |
ac24dc24
|
Renato Botelho
|
/*
|
4 |
|
|
* mail.php
|
5 |
|
|
*
|
6 |
|
|
* part of pfSense (https://www.pfsense.org)
|
7 |
81299b5c
|
Renato Botelho
|
* Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
|
8 |
ac24dc24
|
Renato Botelho
|
* All rights reserved.
|
9 |
|
|
*
|
10 |
b12ea3fb
|
Renato Botelho
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
11 |
|
|
* you may not use this file except in compliance with the License.
|
12 |
|
|
* You may obtain a copy of the License at
|
13 |
ac24dc24
|
Renato Botelho
|
*
|
14 |
b12ea3fb
|
Renato Botelho
|
* http://www.apache.org/licenses/LICENSE-2.0
|
15 |
ac24dc24
|
Renato Botelho
|
*
|
16 |
b12ea3fb
|
Renato Botelho
|
* Unless required by applicable law or agreed to in writing, software
|
17 |
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
18 |
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19 |
|
|
* See the License for the specific language governing permissions and
|
20 |
|
|
* limitations under the License.
|
21 |
ac24dc24
|
Renato Botelho
|
*/
|
22 |
|
|
|
23 |
dd16aadf
|
jim-p
|
require_once("config.inc");
|
24 |
|
|
require_once("globals.inc");
|
25 |
|
|
require_once("notices.inc");
|
26 |
|
|
$options = getopt("s::");
|
27 |
|
|
|
28 |
|
|
$message = "";
|
29 |
|
|
|
30 |
7d61beba
|
Phil Davis
|
if ($options['s'] <> "") {
|
31 |
dd16aadf
|
jim-p
|
$subject = $options['s'];
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
$in = file("php://stdin");
|
36 |
9d0a71fb
|
doktornotor
|
foreach ($in as $line) {
|
37 |
dd16aadf
|
jim-p
|
$message .= "$line";
|
38 |
|
|
}
|
39 |
|
|
|
40 |
7d61beba
|
Phil Davis
|
if (!empty($subject)) {
|
41 |
dd16aadf
|
jim-p
|
send_smtp_message($message, $subject);
|
42 |
7d61beba
|
Phil Davis
|
} else {
|
43 |
dd16aadf
|
jim-p
|
send_smtp_message($message);
|
44 |
7d61beba
|
Phil Davis
|
}
|
45 |
cb7d18d5
|
Renato Botelho
|
?>
|