duanjiao6730 2013-04-14 17:29
浏览 129

整个管道电子邮件未通过

I'm having trouble with piping emails to a PHP script. It seems as if the entire email isn't coming through. This is the sort of response I get:

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

The way this is being piped is using cPanel's Default Address feature to work as a catch-all for a specific domain. This is the command:

|/usr/local/bin/php /home/account/path/to/my/script.php

I actually had to manually modify this script in the /etc/valiases file for the domain because it required I use hashbang/shebang at the top of my script and that was causing errors, but this (for the most part) works, but the entire message isn't showing up. Here is the code I'm using to read the message:

$email = '';
$stream = fopen('php://stdin', 'r');
$i = 0;
while($line = stream_get_line($stream, 65535, PHP_EOL)) {
$email .= $line;
    $i++;
}
fclose($stream);

Any ideas why I'm not getting the body of the email?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示