From 46bd0218b3f330c9c983dab4cbc27d6fa42180f2 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 6 Oct 2010 22:14:01 -0400 Subject: version bump, better email control --- config/countryblock/email.tmp | 127 ++++++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 59 deletions(-) mode change 100644 => 100755 config/countryblock/email.tmp (limited to 'config/countryblock/email.tmp') diff --git a/config/countryblock/email.tmp b/config/countryblock/email.tmp old mode 100644 new mode 100755 index 3b5aa3f2..e5ac6c18 --- a/config/countryblock/email.tmp +++ b/config/countryblock/email.tmp @@ -41,12 +41,12 @@ if (isset($_GET['save'])) { fwrite($fp, ";\n\$mail->Username = \"") or die("Couldn't write values to file!"); fwrite($fp, $user) or die("Couldn't write values to file!"); fwrite($fp, "\";\n\$mail->Password = \"") or die("Couldn't write values to file!"); - fwrite($fp, $pass) or die("Couldn't write values to file!"); + fwrite($fp, $pass); fwrite($fp, "\";\n\$mail->AddReplyTo(\"") or die("Couldn't write values to file!"); fwrite($fp, $from) or die("Couldn't write values to file!"); fwrite($fp, "\",\"pfsense countryblock\");\n\$mail->From = \"") or die("Couldn't write values to file!"); fwrite($fp, $from) or die("Couldn't write values to file!"); - fwrite($fp, "\";\n\$mail->Subject = \"Countryblock - pfsense\";\n\$mail->AltBody = \"To view the message, please use an HTML compatible email viewer!\";\n\$mail->WordWrap = 50;\n\$body = \"Countryblock encountered an event. A system log entry was made with details of event\";\n\$body .= \"

\" . date('l jS \of F Y h:i:s A') . \"

Current Status = \";\nob_start();\n\$results = exec(\"pfctl -s rules | grep -c countryblock\");\nob_end_clean();\nif (\$results > '0')\n\$body .= \"Running\";\nelse\n\$body .= \"Restarting\";\nob_start();\n\$results = exec(\"tail -r /usr/local/www/packages/countryblock/errorOUT.txt\");\nob_end_clean();\n\$body .= \"
\";\n\$body .= \$results;\n\$body .= \"\";\n\$body .= \"
You are blocking \";\nob_start();\n\$results = exec(\"pfctl -T show -t countryblock |grep -v -c Z\");\nob_end_clean();\n\$body .= \$results;\n\$body .= \" Networks\";\n\n\$mail->MsgHTML(\$body);\n\$mail->AddAddress(\"") or die("Couldn't write values to file!"); + fwrite($fp, "\";\n\$mail->Subject = \"" . $subject . "\";\n\$mail->AltBody = \"To view the message, please use an HTML compatible email viewer!\";\n\$mail->WordWrap = 50;\n\$body = \"Countryblock encountered an event. A system log entry was made with details of event\";\n\$body .= \"

\" . date('l jS \of F Y h:i:s A') . \"

Current Status = \";\nob_start();\n\$results = exec(\"pfctl -s rules | grep -c countryblock\");\nob_end_clean();\nif (\$results > '0')\n\$body .= \"Running\";\nelse\n\$body .= \"Restarting\";\nob_start();\n\$results = exec(\"tail -r /usr/local/www/packages/countryblock/errorOUT.txt\");\nob_end_clean();\n\$body .= \"
\";\n\$body .= \$results;\n\$body .= \"\";\n\$body .= \"
You are blocking \";\nob_start();\n\$results = exec(\"pfctl -T show -t countryblock |grep -v -c Z\");\nob_end_clean();\n\$body .= \$results;\n\$body .= \" Networks\";\n\n\$mail->MsgHTML(\$body);\n\$mail->AddAddress(\"") or die("Couldn't write values to file!"); fwrite($fp, $to) or die("Couldn't write values to file!"); fwrite($fp, "\");\n\$mail->IsHTML(") or die("Couldn't write values to file!"); fwrite($fp, $html) or die("Couldn't write values to file!"); @@ -60,13 +60,19 @@ if (isset($_GET['save'])) { $fp2 = fopen($file2, "w") or die("Couldn't open $file for writing!"); fwrite($fp2, " - - - + ") or die("Couldn't write values to file!"); + if ($smtp_auth=="true") + fwrite($fp2, "") or die("Couldn't write values to file!"); + else + fwrite($fp2, "") or die("Couldn't write values to file!"); + fwrite($fp2, " - - - + ") or die("Couldn't write values to file!"); + if ($smtp_secure=="ssl") + fwrite($fp2, "") or die("Couldn't write values to file!"); + else + fwrite($fp2, "") or die("Couldn't write values to file!"); + fwrite($fp2, " @@ -84,9 +90,12 @@ if (isset($_GET['save'])) { - - - + ") or die("Couldn't write values to file!"); + if ($html=="true") + fwrite($fp2, "") or die("Couldn't write values to file!"); + else + fwrite($fp2, "") or die("Couldn't write values to file!"); + fwrite($fp2, " @@ -177,54 +186,54 @@ if (file_exists("email_send.php")) { echo "\n"; } else { echo "
SMTP Auth
SMTP Auth
SMTP Security
SMTP Security
Host
Use HTML formatting
Use HTML formatting
From email address
\n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo " \n"; -echo "
SMTP Auth
SMTP Security
Host
Port
Username
Password
Use HTML formatting
From email address
To email address
Subject
\n"; -echo "\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo " \n"; + echo " SMTP Auth\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " SMTP Security\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " Host\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " Port\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " Username\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " Password\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " Use HTML formatting\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " From email address\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " To email address\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " Subject\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; } ?> -- cgit v1.2.3