email checking and then act upon script for reacting to a sms message

后端 未结 1 1491
一个人的身影
一个人的身影 2021-01-16 05:53

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..

相关标签:
1条回答
  • 2021-01-16 06:14

    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.

    0 讨论(0)
提交回复
热议问题