所以我通过https://help.ubuntu.com/community/PostfixBasicSetupHowto正确设置了postfix / imap的所有内容,并且能够发送邮件到[email protected] / [email protected]
然而,我试图发送一封电子邮件到[email protected]然后使用/etc/aliases将该电子邮件转换为php标准input,而我的电子邮件则由邮政[email protected]返回。
我在框上设置的唯一帐户是root和fmaster 。 我是否需要创build一个test帐户,如果我只使用testing的别名pipe道输出到PHP? 我不确定我哪里出了问题。
我的/etc/aliases :
# Required aliases postmaster: root MAILER-DAEMON: postmaster # Common aliases abuse: postmaster spam: postmaster # PIPE OUTPUT TO PHP from [email protected] test: "| php -q /root/scripts/readmail.php
在我的/etc/postfix/main.cg的重要的东西(与域隐晦)
myhostname = XYZ.members.linode.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = mail.ME1.com, localhost, ME1.com, ME1.it relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 #mailbox_command = mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all home_mailbox = Maildir/
那么我的/root/scripts/readmail.php只是:
$data = file_get_contents('php://stdin'); error_log($data); // just to see if it was successful
任何人都看到我要去哪里错了?
对于初学者来说:确保你在pipe道别名“|”中提供了完整的phppath / usr / bin / php -q … etc' – 第二:你确定你运行了newaliases?
该pipe道命令应该工作,因为我使用的东西完全相同的path部分。