procmail
[Top] [All Lists]

RE: procmail help

2004-01-14 08:52:10
This is an example recipe that will give your perl script access to the mail 
header which should include the Subject line.

=======================
PERL=/bin/perl
SCRIPT=/scripts/get_number.pl
MAIL_HEADER=/tmp/mail_header.txt

:0  
* Subject: Test Email 876509
  {
    # Write the the mail header to a temporary file
    :0 hwc
    | cat > $MAIL_HEADER
    
    # Process mail
    :0 wic
    | $PERL $SCRIPT $MAIL_HEADER

  }
=========================

your perl script will then have access to the header via $_

example

while (<>)
{
  if (/Subject/)
  {
    extract number;
  }
}


Hope this helps,

-----Original Message-----
From: Kishore Kumar Gundlapuli [mailto:kishoreg(_at_)cadence(_dot_)com]
Sent: 14 January 2004 16:15
To: Anthony(_dot_)Seddon(_at_)CTBTO(_dot_)ORG
Subject: procmail help


Hi,
    could you please help me on this issue.

 i need to be able to run a script on the subject of emails ...

it can be visual basic or procmail... i don't care.. but i know procmail
and can do more in perl than learn visual basic.

what can someone suggest...

Here's what I need...

some mail needs to have the subject parsed (currently I have a outlook
filter doing this.

It needs to see the subject:

Subject: PCRNUM XXXXX etc etc etc

and get the XXXXX -- and allow me to work with that number...

Here is an example of what I need...

1. either outlook vbscrip that will parse the message and create a file
by the name XXXXX on my PC at a selected position.

2. some way for me to do this (and more) using procmail.


  You can contact me at kish_g22(_at_)yahoo(_dot_)com

thanks in advance

kishoreg





_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • RE: procmail help, Anthony Seddon <=