procmail
[Top] [All Lists]

Re: [newbie] execute script on new mail

2000-07-31 13:40:03
--------
Hi everybody,

i am searching a way to have a script executed each time a new mail arrives.
Some people in ngs have told me that is possible with procmail. Since what i
want to do is not very usual, i would lik to ask it here first.

a new mail arrives. A script needs to executed and that script has to: 1)
perform some sql commands on an external ms sql server and 2) forward the
mail, with the attachements and all the stuff... just forward it the way it
is when it arrives, well, er, i suppose that's what's called forwarding ;-)

Since i am not really familiar with programming on the Linux-OS, i would
really appreciate hints on how to do it (including tips regarding which
scripting language is most convenient for doing it... etc.)



Might be simplest to have your site admin set up a mail alias; you mentioned 
Linux so I assume you're using sendmail.

The aliases file is in either /etc or /etc/mail; its syntax is fairly 
straight-forward. You need an entry like this:
mail2news: "|/usr/local/bin/Mail2News "

and having created it, run sendmail thus:
/usr/sbin/sendmail -bi

You need to be root to do it, of course.

As someone else observed, once the mail gets to your program, it's a 
programming issue, not one for procmail or sendmail.

The best programming language to use is probably one you know;-)




_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>