procmail
[Top] [All Lists]

Re: Directing mail to a database

2000-10-04 01:28:08
Harry Putnam wrote:

Mark Irvine <mirvine(_at_)compsoc(_dot_)com> writes:


#!/usr/bin/perl -w

open(FIFO, "< /home/mark/my.fifo") or die $!;
while (<FIFO>){
      #sort out table colums and values
      #execute sql to store in database
}
close(FIFO);

Probably a dumb thought and not sure I understand what a fifo is or
does but why not just pipe direct to the perl script leaving out the
fifo stuff?
Because if you pipe it directly then you need to establish
a connection to your sql server with every update.
The "fifo" solution lets you connect to the database once when it starts
up.
then just keeps listening on the "named pipe" updating the database much
more
efficiently.
greetings,
Christoph
-- 
---------------------------------------
  Christoph Schaper
  email :christoph(_at_)schaper(_dot_)org
  homepage http://schaper.org/christoph
           http://schaper-edv.de
---------------------------------------


_______________________________________________
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>