Thanks for your responses everyone. They are much appreciated! To answer your question Matus, We want to copy because we want to temporarily store a message with all of it's meta-data and have the option to resume processing at a later time without losing any details.
On Tue, Mar 22, 2022 at 12:48 PM Bob Proulx <b...@proulx.com> wrote: > 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" a...@example.com < 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 >