[plug] Receiving emails to a script
Russell Steicke
r.steicke at bom.gov.au
Tue Apr 6 17:13:42 WST 2004
On Tue, Apr 06, 2004 at 04:11:29PM +0800, Randal Adamson wrote:
> Hi,
>
> Has anyone played with receiving emails into a script? I am after some
> pointers. I hope to do a script in Perl. From what I can gather I need
> to run it in the ~/.forward file with some code like this:
>
> |/path/to/my/script.pl
Sort of off-topic (and others have answered your question), but I spent
some time on a ship where we had limited bandwidth for email access (via
inmarsat, very expensive). Email transfers were done twice a day and we
were told explicitly not to forward our work email to the ship. So
you'd be cut off from "normal" email for the duration. Tragic, I know.
So I had my email back at work processed by a script before it landed in
the inbox. The script looked for certain headers[0] and if they were
present, grabbed delimited parts of the body to be processed as commands
by a shell. Then I sent commands in email from the ship to get nmh
(command line mail reader) to scan my work email and send me a list of
the senders, subjects and message sizes when I felt like looking. I
could then get anything interesting forwarded to me the same way.
The most fun part about this was explaining to people that I could
selectively read my email remotely like that, and that this "Linux" [1]
(this was 1998) could be bent to do really interesting things like that.
[0] Nowadays I would use a gpg key pair to authenticate the commands,
but secret headers was secure enough at the time.
[1] I had been told by someone in charge of the network earlier that "we
don't support obsolete systems", in reference to Linux on my laptop.
--
Russell Steicke
-- Fortune says:
The better the state is established, the fainter is humanity.
To make the individual uncomfortable, that is my task.
-- Nietzsche
More information about the plug
mailing list