File manager - Edit - /home/masterro/puffsbypolka.shop.subimicrotech.com/mailpipes.tar
Back
autoreply.php 0000755 00000004731 15232314431 0007307 0 ustar 00 #!/usr/local/bin/php -q <?php /** * Instant autoresponder via cPanel "pipe to a program". * Replies to EVERY inbound email. Includes the original Subject after "Client ID:". * Place this file at: /home/USERNAME/public_html/mailpipes/autoreply.php */ $FROM_ADDR = 'admin@subimicrotech.com'; // change to your mailbox $FROM_NAME = 'Sandra'; $REPLIED_HEADER = 'X-Auto-Reply-ClientID'; function build_body($subject) { return "Client ID: {$subject} Yes, we have 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"; } // Read raw email from STDIN $raw = ''; while (!feof(STDIN)) { $raw .= fgets(STDIN, 16384); } // Parse headers list($rawHeaders,) = preg_split("/\r?\n\r?\n/", $raw, 2); $lines = preg_split("/\r?\n/", $rawHeaders); $headers = []; foreach ($lines as $line) { if (!empty($headers) && preg_match('/^\s+/', $line)) $headers[count($headers)-1] .= ' '.trim($line); else $headers[] = $line; } $h = []; foreach ($headers as $line) { $p = explode(':', $line, 2); if (count($p)==2) $h[strtolower(trim($p[0]))] = trim($p[1]); } // From + Subject $fromHeader = $h['from'] ?? ''; preg_match('/<([^>]+)>/', $fromHeader, $m); $fromAddr = $m[1] ?? trim(preg_replace('/\(.*\)/','', $fromHeader)); $subjectRaw = $h['subject'] ?? '(no subject)'; $subject = function_exists('iconv_mime_decode') ? iconv_mime_decode($subjectRaw, 0, 'UTF-8') : $subjectRaw; // Loop protection (keep ON) $autoSubmitted = strtolower($h['auto-submitted'] ?? ''); $precedence = strtolower($h['precedence'] ?? ''); if (in_array($autoSubmitted, ['auto-generated','auto-replied']) || preg_match('/bulk|list|auto/', $precedence)) exit(0); if (stripos($raw, "$REPLIED_HEADER: true") !== false) exit(0); if (!$fromAddr) exit(0); // Build reply $replySubject = stripos($subject,'re:')===0 ? $subject : ('Re: '.$subject); $body = build_body($subject); // Send $out = []; $out[] = "From: {$FROM_NAME} <{$FROM_ADDR}>"; $out[] = "Reply-To: {$FROM_ADDR}"; $out[] = "MIME-Version: 1.0"; $out[] = "Content-Type: text/plain; charset=UTF-8"; $out[] = "Auto-Submitted: auto-replied"; $out[] = "X-Auto-Response-Suppress: All"; if (!empty($h['message-id'])) { $out[] = "In-Reply-To: ".$h['message-id']; $out[] = "References: ".$h['message-id']; } $out[] = "{$REPLIED_HEADER}: true"; $headersStr = implode("\r\n", $out); $encSubject = '=?UTF-8?B?'.base64_encode($replySubject).'?='; @mail($fromAddr, $encSubject, $body, $headersStr); exit(0); error_log 0000644 00000001326 15232314431 0006461 0 ustar 00 [18-Jul-2026 21:24:24 UTC] PHP Fatal error: Uncaught Error: Undefined constant "STDIN" in /home/masterro/public_html/mailpipes/autoreply.php:27 Stack trace: #0 {main} thrown in /home/masterro/public_html/mailpipes/autoreply.php on line 27 [19-Jul-2026 01:07:25 UTC] PHP Fatal error: Uncaught Error: Undefined constant "STDIN" in /home/masterro/public_html/mailpipes/autoreply.php:27 Stack trace: #0 {main} thrown in /home/masterro/public_html/mailpipes/autoreply.php on line 27 [19-Jul-2026 05:55:44 UTC] PHP Fatal error: Uncaught Error: Undefined constant "STDIN" in /home/masterro/public_html/mailpipes/autoreply.php:27 Stack trace: #0 {main} thrown in /home/masterro/public_html/mailpipes/autoreply.php on line 27
| ver. 1.4 |
Github
|
.
| PHP 8.3.31 | Generation time: 0 |
proxy
|
phpinfo
|
Settings