[plug] Mail Filtering

I am the LinuxAlien linuxalien at optusnet.com.au
Wed Aug 28 15:26:19 WST 2002


Ok, some time back I asked for help getting an  email to replace a file in 
my public-html folder. The solution is below.
-------------------------------------
#!/usr/bin/perl

#read the _whole_ file from stdin into $_;
undef $/;
$_=<STDIN>;

#get rid of the email headers
# headers are seperated from the body of the message by a blank line.
s/^.*?\n\n//gs;

open(DATA, ">public_html/registered_names.txt") or
         die "failed to open public_html/registered_names.txt: $!\n";
print DATA $_;
close(DATA);
--------

Then in ~/.procmailrc do something like:
---
:0
* ^From:.*callen at corpus.wa.edu.au
| /path/to/script
---
-------------------------------------------------------
What i now need is for it to work differently, i need it to split into 2 
different files.
The email will look something like this
---------------------
Matthew Whocare
Sarah Wile
Katlen Minkle
Mill Nasf
---------------------
The that i need are below
---------------------
registered.txt
----
Matthew Whocare
Sarah Wile
Katlen Minkle
Mill Nasf
---------------------
registered_flash.txt
----
names=Matthew Whocare<br>Sarah Wile<br>Katlen Minkle<br>Mill Nasf
----
I don't no how to script other than simple stuff.
Thanks,
Tim


LinuxAlien
Riverton, Perth, WA

Australian Linux Technical Conference, Perth 2003 http://linux.conf.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20020828/71d5a617/attachment.html>


More information about the plug mailing list