DISQUS

DISQUS Hello! techniQal support is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

techniQal support

the Q stands for quality
Jump to original thread »
Author

How to Run a Script from Email

Started by Daniel · 10 months ago

Got a little idea to write this up after seeing a question over on Photo Matt. He asked about having a script that could take commands sent by email and execute them remotely, then return the results via email.
So I decided to hack something up in Python, and give it a try. Read the [...] ... Continue reading »

2 comments

  • Can you think of a way to have a bash script check email and then do something if it sees keywords in the email?
  • Sorry -just caught this Kyle. Depending on where the mail lives, you could always schedule a cron job to script to go fetch mail, and based on content of the mail, run a command. The script would just use existing *nix tools for text matching/processing(grep,sed/awk).

    The benefit to the method I describe here, is that you don't have to worry about the mail handling piece in you script. The script takes the mail content as stdin, and works with it as it comes in.

    If you are comfortable with perl, python, or php, all 3 have fairly mature email libraries that would allow you to fetch and parse the emails from some other server source (IMAP, POP3, etc.) .

    Hope that helps.

Add New Comment

Returning? Login