电子邮件检查,然后对脚本进行响应短信 [英] email checking and then act upon script for reacting to a sms message

查看:135
本文介绍了电子邮件检查,然后对脚本进行响应短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我希望在Linux机箱上这样做。



我需要能够收到短信(毫无疑问的是通过电子邮件到达)和然后采取行动..



所以例如..一个消息带有日期,时间和名称..然后我需要将该信息导出到一个sql数据库



任何想法任何人都可以快速,轻松地解决这个..我想我现在有sms网关排序,因为我将从网关获得软件转换短信到电子邮件,但它的整体如何整合电子邮件方面的东西,给了我一个头痛..

解决方案

如果您控制自己的机器,您可以将其配置为通过过滤器管理电子邮件。最简单的是设置一个新帐户并设置一个 .forward 或别名。



以下示例适用于Sendmail ,但(所有?)Unix电子邮件程序提供类似的服务。



设置别名(选项1)



查看服务器上的目录/ etc中的别名文件。添加行:

 脚本:| /path/toyourscript/pipe.php

使用 .forward 文件(选项2) / p>

在主主目录中创建一个.forward文件。

  | /path/toyourscript/pipe.php

或:

  myemail@example.com,| /path/toyourscript/pipe.php

如果您是共享主机,那么大多数托管服务提供商也提供通过脚本收发给特定帐户的电子邮件,而不是将其存储在邮箱中的可能性。检查CPanel设置。


Ok i wish to do this on a Linux box..

I need to be able to receive a sms message (it will no doubt arrive by email) and then act upon it..

so for instance.. a message comes in with a date, time and name.. then i need to export that information to a sql database.

any ideas anyone on a quick and easy solution to this.. I think I have the sms gateway sorted now as I will get the software from the gateway to convert the sms messages to email but its the whole how to integrate with the email side of things what has given me a headache..

解决方案

If you control your own machine you can configure it to pipe the e-mail through a filter. Simplest would be to setup a new account and setup a .forward or alias.

The following examples are for Sendmail, but (all?) Unix e-mail programs offer a similar service.

Setting up an alias (option 1)

Look in the directory /etc on your server for your alias file. Add the line:

script: "|/path/toyourscript/pipe.php"

Using a .forward file (option 2)

Create a .forward file in your main home directory.

"|/path/toyourscript/pipe.php"

or:

myemail@example.com,"|/path/toyourscript/pipe.php"

If you are on shared hosting then most hosting providers also provide the possibility to "pipe" e-mails received to a particular account through a script instead of storing them in a mailbox. Check the CPanel setup.

这篇关于电子邮件检查,然后对脚本进行响应短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆