HistoryPurge: Clearing 219 old commits
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
if (empty($_POST)) {
|
||||
echo 'Usage: curl -d "subject=email subject&sender=SENDER@DOMAIN.TLD&recipient=RECIPIENT@DOMAIN.TLD&message=$(base64 /tmp/mailbody.txt)" -X POST https://racker.pro/mailapi/';
|
||||
exit();
|
||||
} else {
|
||||
|
||||
$to = $_POST['recipient'];
|
||||
$subject = $_POST['subject'];
|
||||
$headers = "From: " . $_POST['sender'] . "\r\n";
|
||||
$headers .= "MIME-Version: 1.0\r\n";
|
||||
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
|
||||
$message = str_replace(" ", " ", base64_decode($_POST['message']));
|
||||
$message2 = "<span style=\"font-family: monospace; font-size: small;\">" . str_replace("\n", "<br />\n", $message) . "</span>";
|
||||
|
||||
if (mail($to, $subject, $message2, $headers)) {
|
||||
echo 'Your message has been sent.';
|
||||
} else {
|
||||
echo 'There was a problem sending the email.';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
// The message
|
||||
$message = "Line 1\nLine 2\nLine 3";
|
||||
|
||||
// In case any of our lines are larger than 70 characters, we should use wordwrap()
|
||||
$message = wordwrap($message, 70);
|
||||
|
||||
// Send
|
||||
mail('test@headdesk.me', 'Test from phpmail.php', $message);
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"Type" : "SnsMessage",
|
||||
"MessageId" : "165545c9-2a5c-472c-8df2-7ff2be2b3b1b",
|
||||
"Token" : "2336412f37f...",
|
||||
"TopicArn" : "arn:aws:sns:us-west-2:123456789012:MyTopic",
|
||||
"Message" : "Test message",
|
||||
"SubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=ConfirmSubscription&TopicArn=arn:aws:sns:us-west-2:123456789012:MyTopic&Token=2336412f37...",
|
||||
"Timestamp" : "2012-04-26T20:45:04.751Z",
|
||||
"SignatureVersion" : "1",
|
||||
"Signature" : "EXAMPLEpH+...",
|
||||
"SigningCertURL" : "https://sns.us-west-2.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
// Fetch the raw POST body containing the message
|
||||
$postBody = file_get_contents('php://input');
|
||||
|
||||
// JSON decode the body to an array of message data
|
||||
$message = json_decode($postBody, true);
|
||||
if ($message) {
|
||||
// Do something with the data
|
||||
// echo $message['Message'];
|
||||
if ($message['Type'] == "SubscriptionConfirmation") {
|
||||
echo "Now needs to reply to " . $message['SubscribeURL'];
|
||||
} else {
|
||||
$to = "sns@racker.pro";
|
||||
$subject = "SNS alert from AWS";
|
||||
$headers = "From: sns@racker.pro\r\n";
|
||||
$headers .= "MIME-Version: 1.0\r\n";
|
||||
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
|
||||
|
||||
if (mail($to, $subject, $message['Message'], $headers)) {
|
||||
echo 'Your message has been sent.';
|
||||
} else {
|
||||
echo 'There was a problem sending the email.';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"Type" : "SubscriptionConfirmation",
|
||||
"MessageId" : "165545c9-2a5c-472c-8df2-7ff2be2b3b1b",
|
||||
"Token" : "2336412f37f...",
|
||||
"TopicArn" : "arn:aws:sns:us-west-2:123456789012:MyTopic",
|
||||
"Message" : "You have chosen to subscribe to the topic arn:aws:sns:us-west-2:123456789012:MyTopic.\nTo confirm the subscription, visit the SubscribeURL included in this message.",
|
||||
"SubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=ConfirmSubscription&TopicArn=arn:aws:sns:us-west-2:123456789012:MyTopic&Token=2336412f37...",
|
||||
"Timestamp" : "2012-04-26T20:45:04.751Z",
|
||||
"SignatureVersion" : "1",
|
||||
"Signature" : "EXAMPLEpH+...",
|
||||
"SigningCertURL" : "https://sns.us-west-2.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem"
|
||||
}
|
||||
Reference in New Issue
Block a user