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
kalsterner [ Fr, 14 September 2007 20:22 ] [ ID #1820979 ]

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"
Andrzej Filip [ Fr, 14 September 2007 20:33 ] [ ID #1820980 ]
Miscellaneous » comp.mail.sendmail » Sending automatic mail

Vorheriges Thema: inbox in NFS-mounted homedir: mbox/dot-locking or Maildir?
Nächstes Thema: How to sendmail to users whose mailbox is on a different server