Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.