[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Postfix - run script from email



On 07/12/13 15:22, David Guntner wrote:
> Tony van der Hoff grabbed a keyboard and wrote:
>> Hi, list,
>>
>> I have a squeezy VPS, running Postfix to handle all my mail, plus
>> several virtual users, with which I'm entirely satisfied.
>>
>> I also have a number of remote, normally unattended, locations, with
>> dynamic IPs, containing IP cameras to keep an eye on things. I'm not
>> able to access/change the camera firmware. These cameras send me an
>> email if their IP changes, containing the new IP address.
>>
>> Up to now, I've been manually extracting the IP from the incoming mail
>> (on my workstation), and plugging it into a nsupdate script, to update
>> bind on the VPS, so that I can access the camera(s) from anywhere on the
>> net.
>>
>> So far, so good, but what I'd really like to do is intercept the
>> incoming email on the VPS, and automatically run a script to do the update.
>>
>> There's an awful lot of information about postscript on the web, even
>> some articles that look like potential answers, but googling about has
>> not been fruitful. In particular, there appear to be problems with
>> priveleges. Naturally, I don't want to do anything that upsets mail
>> delivery to the virtual users. Maybe I didn't use the right search terms.
>>
>> Longer term, I'll install raspberry Pis on the remote networks to
>> automatically send an nsupdate to the server on IP change, but in the
>> interim, I'd like to automate the manual process above.
>>
>> Does anyone know how to attach some sort of filter/trigger to postfix to
>> cause a script to be run on incoming mail with particular conditions,
>> or would anyone like to suggest a better solution?
> 
> Look into Procmail, which might already be installed as the LDA for Postfix.

Yes, thanks, it's there.


-- 
Tony van der Hoff        | mailto:tony@vanderhoff.org
Buckinghamshire, England |


Reply to: