Chris,

Thank you for the suggestion but when I say "process" I mean that I need to
read the "reply", grep for user id and a confirmation number, update my
database to say that the email I send was "replied to" as requested, and
that the email address I was given was correct... I am registering users for
access to web ap. and need(require) a good email address (initially!).

Plus I am not an admin but a developer and "procmail" is not a product I
believe I can use... (at least I can't find it on this UNIX box)

Anyone else?

jwm

-----Original Message-----
From: Chris Devers [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 15, 2005 9:03 AM
To: Moon, John
Cc: Perl Beginners
Subject: Re: How to read and delete mail from a cron job

On Tue, 15 Mar 2005, Moon, John wrote:

> Can someone please give me some suggestions (or pointers) as to how to 
> read and delete emails from a cron job. I will be receiving 
> conformation email and need to process it once then delete it - not 
> process it again.

Is procmail not an option?

This is exactly the sort of thing it's good at.

Procmail sits watching your incoming mail, then handles it in some way. 
This usually means transferring the message to a specific folder, but it 
could also mean running a program that transforms the contents of the 
message (adding or modifying headers, etc), or  doing something else -- 
as, in this case, you're trying to do.

For example, my Procmail rule to run SpamAssassin on incoming mail is:

    :0fw: spamassassin.lock
    | /usr/local/bin/spamc

If I just wanted to filter certain messages, I might do this:

    :0fw: spamassassin.lock
    * ^Subject:.*confirmation
    | /usr/local/bin/spamc

You should be able to adapt this to your needs, and it should be much 
more flexible than using a cron job.

(Note though that setting up Procmail, if it isn't there already, 
requires some overhead. A lot of [Unix] mail servers are already set up 
for it, and all you have to do is enable it for your account, but you'll 
have to sort out what to do if you're starting from scratch. There's a 
lot of good tutorials out there that a Google search will uncover.)



-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to