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 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥15 树莓派5怎么用camera module 3啊
  • ¥20 java在应用程序里获取不到扬声器设备
  • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。
  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事: