Edward Sandberg wrote:
> You could use inotify to monitor a directory and trigger a script to send
> the mail.
Or just poll the directory every N number of seconds. That's also
very low overhead. Since the directory contents will be cached in the
file buffer cache of the kernel. But inotify is immediate and cooler.
> If the files are valid email files with headers you could just pipe them to
> sendmail.
Or if not but are plain text one could use "mailx" to send them as the
body of the message.
mailx -s "some subject here" [email protected] < filenamehere
The POSIX standard mailx program will format the mail headers
correctly and then pass the message on to /usr/sbin/sendmail for
transport and delivery.
Bob