Sending automatic mail
Hi all,
I have to use launch a shell script that read a mail, extract attached
file and send the attached file to another recipient.
I was wandering if there is a way to get the event for a new mail
somewhere and launch the script or, by polling the event log for the
correct event and execute the script.
I have no idea about the event number and if it's possible.
Thank you for your help
Re: Sending automatic mail [processing incoming mail]
kalsterner [at] gmail.com writes:
> I have to use launch a shell script that read a mail, extract attached
> file and send the attached file to another recipient.
>
> I was wandering if there is a way to get the event for a new mail
> somewhere and launch the script or, by polling the event log for the
> correct event and execute the script.
>
> I have no idea about the event number and if it's possible.
>
> Thank you for your help
You can use procmail program to process messages arriving to mailbox of
OS account. The procmail script may launch other programs/scripts.
See man procmail for details.
P.S. On most linuxes sendmail uses procmail as local mailer.
In such case there is no need to play with ~/.forward file, ~/.procmail
file is sufficient.
--
[pl>en: Andrew] Andrzej Adam Filip : anfi [at] priv.onet.pl : anfi [at] xl.wp.pl
Innocence ends when one is stripped of the delusion that one likes oneself.
-- Joan Didion, "On Self Respect"