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

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.
  • Comment on Re: Re: Newbie : Extracting Attchments from E-Mail and storing in a directory
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: Newbie : Extracting Attchments from E-Mail and storing in a directory
by dada (Chaplain) on Oct 25, 2002 at 09:25 UTC
    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"?
        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?