Help - Search - Members - Calendar
Full Version: Script run at receiving EMail?
Linuxhelp > Support > Technical Support
Hi, all!

I've set up my new server at home, and I thought of a feature that should be easy to implement with a simple bash or perl script. BUT: I have not yet found where to hook that script into the system.

What I want to do is to run a script every time a mail is received on a certain account. I would check the emails source (it would only act on locally (as in local network) sent mail), scan the mails body for an URL and act on it.

The final application is that I can use the "Send link" feature of the browser to send a youtube URL to the media server account, which should extract the URL, download the video with youtube-dl, put the file on the media server, and send a confirmation mail back to me stating that it is done (or reporting errors).

Digging the net I found myriad of things about sending mails from scripts, but so far nothing that would allow to send mail TO a script. I am fully aware of the security implications of running a script on receiving a mail loacally, and I'm confident that I can handle this (there is no mail-in from outside the net on the server).

Pointers, anybody?

Yours, Christian
There are existing solutions out there that may meet your needs. I suggest searching for procmail or mailagent.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.