I can process my mail!
From: Gregory L. Hansen (glhansen_at_steel.ucs.indiana.edu)
Date: 12/03/03
- Previous message: Ed Morton: "Re: SUID Linux script does not work"
- Next in thread: Alan Connor: "Re: I can process my mail!"
- Maybe reply: Alan Connor: "Re: I can process my mail!"
- Reply: Barry Margolin: "Re: I can process my mail!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 3 Dec 2003 17:03:46 +0000 (UTC)
I figured out how to pipe mail to my own scripts! I'd tried it before,
with a .forward that looks like
"| /N/fs17/glhansen/Steel/mailincrement"
"| grep -i Subject: > a2"
"| /usr/local/nmh/lib/slocal -verbose -user glhansen"
Nothing happened, although grep saved subject lines to the file a2
reliably.
The secret was not to pipe it to my script, but pipe it to a shell with
the script as an argument.
"| /bin/bash /N/fs17/glhansen/Steel/mailincrement"
And that works! I got nine messages in about the past half hour, although
eight of them were deleted by the slocal filter.
The first thing I want to do is kill any messages with a particular 109 KB
virus attached, which I've saved in its encoded form, a sample for
comparison. But between those messages and test messages I've sent
myself, I'm having trouble figuring out the rules for finding the
boundaries that begin each new attachment. Although the end boundary
follows from the begin. And my book Inside Unix says things about
uuencoded attachments that don't look like anything I see in my mail.
It's easy to find by eye, but I'm not sure how to automate that in a way
that won't confuse boundaries for message text.
Is there any good reading material on mail? I know O'Reilly has a book on
sendmail, but I'm not that interested in sendmail in particular. I more
want something about all things mail, for people whose responsibilities
are a little lighter than setting up and administering the company
servers.
-- "The polhode rolls without slipping on the herpolhode lying in the invarible plane." -- Goldstein, Classical Mechanics 2nd. ed., p207.
- Previous message: Ed Morton: "Re: SUID Linux script does not work"
- Next in thread: Alan Connor: "Re: I can process my mail!"
- Maybe reply: Alan Connor: "Re: I can process my mail!"
- Reply: Barry Margolin: "Re: I can process my mail!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|