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"?