Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

by dada (Chaplain)
on Oct 25, 2002 at 08:54 UTC ( #207931=note: print w/replies, xml ) Need Help??


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

if this is your whole script, I think you need to add this line at the end:
read_email();
you defined a subroutine, but never actually called it. no surprise the script does nothing at all :-)

cheers,
Aldo

King of Laziness, Wizard of Impatience, Lord of Hubris

  • Comment on Re: Newbie : Extracting Attchments from E-Mail and storing in a directory
  • Download Code

Replies are listed 'Best First'.
Re: Re: Newbie : Extracting Attchments from E-Mail and storing in a directory
by kev (Initiate) on Oct 25, 2002 at 09:09 UTC
    Thanks, something happens now, but not what is expected It starts and justs sits there with a rectangular blob on a line of its own. No attchements stripped, nor messages altered. BTW i've also added the line
    #!usr/bin/perl -w
    to the top of strip.pl and no warnings are generated.
      ok, we are one step further :-)

      what your script is doing is: waiting for something to come on input (STDIN). this means you're supposed to call your script like this:

      perl strip.pl < file.msg
      supposing that file.msg is a file that contains the mail you are going to process.

      cheers,
      Aldo

      King of Laziness, Wizard of Impatience, Lord of Hubris

        Okay, I understand that. But what i don't understand is how do I access the mail messages to run this on them? e-mail is sent to me@localhost.localdomain and sendmail is running. typing mail at the command prompt (or whatever the Linux version is called) says I have n messages. (where n is a number) Also I read someware else that you can create a `.forward` file in the root of your home directory to automate this. (the desired operation as there will be a dedicated e-mail server for this - currently being tested on a standalone laptop)
        "|IFS=' '&&exec perl /home/kev/Documents/webtest/mail/strip.pl||exit 7 +5"
        (modified from another one) This just loses the mail (Evolution or mail can't find it). I'm guessing I would probably need to change this to something along the lines of
        "|IFS=' '&&exec perl /home/kev/Documents/webtest/mail/strip.pl < file. +msg ||exit 75"
        Is this along the right lines?, and what would i need to put in the place of "file.msg"?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2022-05-22 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (80 votes). Check out past polls.

    Notices?