Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What's the best option to trigger a script every time I receive a new email? I'm using pine on linux. I want to feed the email to my script and do some processing. I don't have root rights on the server.

share|improve this question
How is pine getting your email? Local email? IMAP? Pop? – Doug Harris Jun 5 '12 at 21:05
@Doug Harris: I'm not shure how to check. In configuration menu, there's nothing that indicates imap/pop, so I guess it's local. – zzz Jun 5 '12 at 21:09
up vote 1 down vote accepted

If it's local (as Doug asked) you can try a .forward file.

Most Mail Delivery Agents look for $HOME/.forward files. If $HOME/.forward simply contains an email address, it will forward your mail to that email address. There is also a file format for .forward that will send your mail to a script. You need to figure out not only whether you are using local or remote (IMAP, POP3) delivery, but what kind of local delivery program (qmail, sendmail) your system is using.

Oddly, a quick google search didn't find any comprehensive tutorials for .forward files. The best I could find for it is this kind of complicated tutorial which has a lot of details about procmail which you probably can ignore.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .