Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Simple .forward email parse

by rhesa (Vicar)
on Sep 16, 2008 at 16:38 UTC ( #711740=note: print w/replies, xml ) Need Help??


in reply to Simple .forward email parse

Email::Filter rocks!
my $mail = Email::Filter->new; say "sent by: ", $mail->from; say "about: ", $mail->subject;

Replies are listed 'Best First'.
Re^2: Simple .forward email parse
by docster (Novice) on Sep 16, 2008 at 20:17 UTC
    Thank you both. It appears that Email::Filter has replaced Email::Audit. So I tried it and the following works! Thank you.
    #!/usr/bin/perl use Email::Filter; my $mail = Email::Filter->new; my $myFrom = $mail->from; my $mySubject = $mail->subject; exec "echo \"From: $myFrom \nSubject: $mySubject\" > temp.log";

      Unless Email::Filter is making the results taint-safe, you are passing unvalidated data directly to a shell. Big time security no-no. It is better to open the file from within perl, and write escaped data to the file.

      Depending on your mailer, you could also have a race condition on temp.log. Might be better to lock that file prior to writing to it.

      --MidLifeXis

        Hey there. This was just an example of getting the address and subject and certainly nothing that I would use in production! ;)

        The goal is for people to email reports@domain.com and get a report back on their email account. All I really care for is the email address to reply to and all the rest of the email is ignored. After this I can generate a report for that email account and email it back to the address.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://711740]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2020-09-21 13:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (126 votes). Check out past polls.

    Notices?