我在将电子邮件传送到 PHP 脚本时遇到问题。似乎整个电子邮件都没有通过。这是我得到的那种回应:
From brian@myemailaddress.com Sun Apr 14 13:12:53 2013
Received: from mailserver.google.com ([GOOGLE.IP.ADDRESS]:41509)
by myhost.server.com with esmtps (TLSv1:RC4-SHA:128)
(Exim 4.80)
(envelope-from <brian@myemailaddress.com>)
id THE-EMAIL-ID
for brian@mysub.domain.com; Sun, 14 Apr 2013 13:12:53 -0400
Received: by mailserver.google.com with SMTP id somesmtp.id
for <brian@mysub.domain.com>; Sun, 14 Apr 2013 10:12:51 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20120113;
h=x-received:mime-version:x-originating-ip:from:date:message-id
:subject:to:content-type:x-gm-message-state;
bh=rPONCz8eaLlxJpumTQNPIEKBlWcbg53KdugbKjulvj4=;
b=Kr7ZpXKTpXDCoQHmI93Ep+CSv8BY4xT2Pgh3eJeRsz5Y0iAjomGdBQDwKMQ/myk4hz
dkReoFPGAqE3KsRo601JXzgDrvmu9oRDC3UpbwHvMUvbI+U1qjC2rUsp1fmaeohpc99T
tPVMhO9WBBqthUP4TCv/T50/popu771Mydj0YXWbEuRtViyllzTa1M1kO3DhqLC+/bA2
ED2J3wBXp47xRVjkoUNUOzyi5pUIsryDRUh9gxdSQtAGjqAdTpTwQXSX0MAdSK+PYc8Y
oB/5Sm09um8/id4d4YHUBZMbIZv0+L0GR0ZbIfa42l7+WzvKMjijNw7QsA/KDXMaYL5W
CwBQ==
X-Received: by IP.ADDR.ESS with SMTP id some.long.id; Sun,
14 Apr 2013 10:12:51 -0700 (PDT)
MIME-Version: 1.0
Received: by IP.ADDR.ESS with HTTP; Sun, 14 Apr 2013 10:12:31 -0700 (PDT)
X-Originating-IP: [MY.IP.ADDRESS]
From: Brian D. <brian@myemailaddress.com>
Date: Sun, 14 Apr 2013 12:12:31 -0500
Message-ID: <CAOb+JoxnfiaHFSG6RyQPtnmeS526JPMO4krsS96wc3FGMKWOiA@mail.gmail.com>
Subject: New Task.
To: brian@wmysub.domain.com
Content-Type: multipart/alternative; boundary=001a11c30f960b290d04ea583f19
X-Gm-Message-State: AKoCoQnquQFvVi0CYGF4sdhK0Cn2swVezCK1Yg5uXKhxBmnppYCfVX/2+EK37dX1iyV4pxBOM1cJ
管道传输的方式是使用 cPanel 的默认地址功能作为特定域的包罗万象。这是命令:
|/usr/local/bin/php /home/account/path/to/my/script.php
实际上,我必须在域的 /etc/valiases 文件中手动修改此脚本,因为它需要我在脚本顶部使用 hashbang/shebang,这会导致错误,但这(大部分)有效,但是没有显示整个消息。这是我用来阅读消息的代码:
$email = '';
$stream = fopen('php://stdin', 'r');
$i = 0;
while($line = stream_get_line($stream, 65535, PHP_EOL)) {
$email .= $line;
$i++;
}
fclose($stream);
任何想法为什么我没有收到电子邮件的正文?