Triggering LC scripts when emails are received

Matthias Rebbe | M-R-D matthias_livecode_150811 at m-r-d.de
Tue Mar 18 06:19:24 EDT 2014


Hi jbv,

the first command i use after the <?rev is

read from stdin until EMPTY

The variable "it" then contains the complete email.

Regards,

Matthias

Am 18.03.2014 um 10:04 schrieb jbv at souslelogo.com:

> Alex & Matthias,
> 
> Thank you so much for your help.
> I have made a quick test with a php script, and when I entered the
> path of the php script, the mail forwarder detected a problem with
> the script (it needed to be made executable) and added the following
> line at the top of the script :
> #!/usr/local/bin/php -q
> Then everything worked fine : emails were forwarded and the php
> script ran fine.
> 
> Then I made a test with an .irev script; the email forwarder also
> detected an error in the script, but was unable to fix it, so the
> test failed : the email bounced and was considered as spam.
> I guess I need to follow Matthias advice and ask on-rev the path
> to the LC engine on our server.
> 
> I have one more question though : which server global do you use
> when you want to trap the content of the forwarded email (content,
> sender"s name & email, attached docs if any...) ?
> 
> I'll keep you posted on my further tests.
> 
> Best,
> jbv
> 
> 
>> Hi jbv,
>> 
>> Alex is right. It is working this way and believe it or not, i was also
>> working on this today.
>> 
>> I must admit, that i use my own instances of livecode server on On-rev.
>> It is installed under public_html/cgi-bin/livecode-server502
>> 
>> So for my configuration  i selected „Pipe to program“ and entered
>> 
>> public_html/cgi-bin/livecode-server502/livecode-server
>> /home/MyAccountname/public_html/MyLivecodeScript.lc
>> 
>> It does not work, if i just enter the path to the script. I have to enter
>> the path to the livecode-server engine and the complete path to the
>> livecode script.
>> I do not know the paths to the preinstalled livecode-server engines on
>> On-rev, but maybe someone from the list could help. If not, i am sure
>> On-Rev support team knows
>> the answer for that.
>> 
>> Please be aware, that the script must not output anything. If it outputs
>> something, even just a space or blank line, then although the script is
>> executed the incoming mail is bounced.
>> So please check your script for any blank lines or even spaces before the
>> tag <?rev and after the tag ?>. It took me some hours to find out that
>> just a small
>> space after the ?> tag caused the incoming mails bouncing.
>> 
>> Hope i could help.
>> 
>> 
>> Regards,
>> 
>> Matthias
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Am 17.03.2014 um 21:53 schrieb Alex Tweedly <alex at tweedly.net>:
>> 
>>> In cPanel, within the "Email" section, add an email forwarder.
>>>  Fill in the adddress you want to intercept, then click on "Advanced
>>> options"
>>>  Select "Pipe to a program", and fill in the program script name for
>>> your program
>>> 
>>> NB I haven't actually done this yet !!
>>> 
>>> I've been meaning to try it out for a while, just not needed it yet, and
>>> so I haven't got round to trying it out - but it *should* work.
>>> 
>>> I'll try it soon ... let me know if it works for you.
>>> -- Alex.
>>> 
>>> 
>>> On 17/03/2014 17:00, jbv at souslelogo.com wrote:
>>>> Hi list,
>>>> 
>>>> I need to trigger LC scripts (on an on-rev account or with LC server)
>>>> when an email is received on an email address. The address will be
>>>> the same but email senders will vary and according to the sender's
>>>> email, different scripts will be triggered. The idea is to process the
>>>> content of the email with the scripts...
>>>> I guess the trick is a server setting. Does anyone know how ?
>>>> 
>>>> Thanks in advance.
>>>> jbv
>>>> 
>>>> 
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode








More information about the use-livecode mailing list