[wellylug] Mail processing

Jamie Dobbs jamie.dobbs at paradise.net.nz
Tue May 6 15:23:58 NZST 2003


Hi

I want to have a Linux box set up to periodically poll an email server
(using fetchmail) then when it finds and downloads emails I want to have the
body of each email saved into a uniquely named file which I will then run
some Perl scripts over before outputting the processed file via. the serial
port.
I have no problems with configuring Fetchmail, nor do I have too many
problems with writing the Perl and BASH code to massage and output the
files.
The area I am having problems with is getting each email saved into a file
as it is downloaded from the mail server. I have spent most of the day
trying to get Procmail to accomplish this but have not had any success.
Can someone give me a few pointers? The code I have attempted to use in my
.procmailrc is listed below but for some reason it does not want to work:

:0
{ #Lock the mbx_file for now
  LOCKFILE = mbx_file.$LOCKEXT

  #Save a copy of the message to the mbx_file
  #under the lock
  :0 bc
  mbx_file

  #If the save above was successful, run the test.sh program
  :0 b
  | /home/jamie/test.sh

  #Unlock mailbox in case of failure
  LOCKFILE
 }






More information about the wellylug mailing list