douxiajia6309 2013-07-30 04:15
浏览 39
已采纳

电子邮件回复PHP脚本过程

I'm making a Purchase Order system. All of our POs go out to our vendors via gmail SMTP server in PHP. I'm using Perl Mail for that.

Currently the reply-to is set to the from email, which is of course the gmail address. My goal, is to let vendors Reply To that PO email, and me grab that data and put it into my database.

I tried grabbing the IMAP Inbox via PHP and looking for the messages. But encrypted messages are unreadable, and I feel like it's hacky.

Is there a way, to make the reply-to email go back to my server, instead of gmail. And then have some light mail server running on my server to catch all email, or email with something in the from address (or subject) and then process the contents?

Thanks!

  • 写回答

1条回答 默认 最新

  • dtdt0454 2013-07-30 13:46
    关注

    Thanks to Dragon for pointing me in the right direction.

    Add this to your /etc/aliases file (if you have postfix installed)

    process | "/path/to/php/script.php"
    

    Then run

    newaliases
    

    Then run

    /etc/init.d/postfix reload
    

    The PHP script looks like this

    $data = file_get_contents("php://stdin");
    $data = mysql_real_escape_string($data);
    mysql_query("INSERT INTO test SET thing = '$data'");
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀