Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: Re: Re: Re: Newbie : Extracting Attchments from E-Mail and storing in a directory

by Corion (Patriarch)
on Oct 25, 2002 at 13:46 UTC ( [id://207992]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: Newbie : Extracting Attchments from E-Mail and storing in a directory
in thread Newbie : Extracting Attchments from E-Mail and storing in a directory

You are almost there. The line in .forward that is | /home/me/Documents/webtest/mail/strip.pl < $1 means that the script already gets its input from STDIN, so the redirection part is unnecessary. Change it to : | /home/me/Documents/webtest/mail/strip.pl and everything should work, or at least, this error should be eliminated. The error in the mail to root meant that the "recipient" /home/me/Documents/webtest/mail/strip.pl > $1(almost your script) had errors. This means that either your script did not compile properly (make sure you check this every time you modify the script!!!!) or that sendmail could not start it with the redirection (I guess the error in this case).
A good idea is to dry-run a check against your script every night with some known good input so the mail does not get silently discarded. I do this with my home-made spamfilter (maybe soon to be replaced with a serious solution).
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
  • Comment on Re: Re: Re: Re: Re: Re: Newbie : Extracting Attchments from E-Mail and storing in a directory
  • Select or Download Code

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Re: Newbie : Extracting Attchments from E-Mail and storing in a directory
by kev (Initiate) on Oct 25, 2002 at 16:07 UTC
    I've done the change and this is the new message delivered to root:
    --- The Following addresses had permanet fatal errors ---- "| /home/me/Documents/webtest/mail/strip.pl (reason : service unavailble) (expanded from : <me@localhost.localdomain>) ---- Transcript of session follows ---- smrsh : strip.pl not avalible for sendmail programs 554 5.0.0 Service Unavalible
    by compile properly do you mean run it and as long as theres no errors / warnings it's okay or do you actually have to compile it? it does work fine from the command line This is a standalone laptop so it doesn't matter if mail is lost, but the idea is good if i ever get the thing to work! O/T : p.s. This might be my last reply until after the weekend which starts in 25 minutes, and finishes one hour later than normal because of the clocks falling back :o)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-25 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found