Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by kev (Initiate)
on Oct 25, 2002 at 11:37 UTC ( [id://207961]=note: print w/replies, xml ) Need Help??


in reply to 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

I've now worked out that to call the perl file i need to use the line
"| /home/me/Documents/webtest/mail/strip.pl < $1"
in the `.forward` file. I have also found the missing e-mails - they were in the root mail box. in the mail i have
--- The Following addresses had permanet fatal errors ---- "| /home/me/Documents/webtest/mail/strip.pl < $1" (reason : service unavailble) (expanded from : <me@localhost.localdomain>) ---- Transcript of session follows ---- 451 4.0.0 hash map "generics": missing map file /etc/mail/genericstabl +e.db: No such file or directory smrsh : strip.pl not avalible for sendmail programs 554 5.0.0 Servive Unavalible [Snip message headers, body and attachments]
How do i create "genericstable.db" and allow strip.pl to be avalible for sendmail programs?
  • Comment on 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: Newbie : Extracting Attchments from E-Mail and storing in a directory
by Corion (Patriarch) on Oct 25, 2002 at 13:46 UTC
    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
      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)
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 13:02 UTC
    I've now got the script working manually (it probably did most of the time, i just never tried it. I used evolution and saved as an .eml but as for automating it i'm at a complete loss, anybody got any ideas? It seams that sendmail can't execute perl scripts from what i gather in the failed to deliver messages.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-26 08:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found