> here is my problem, my boss receives stuff via mail that he wants to be in
> a database and on the web. obviusly he forwardss it to me so I can cut an
> paste to the web interfase I made to update the database.
> is there a way to catch this email and automate the proccess??
> like setting an spacial mail box that some how delivers to msql and the a
> lite program thet stips the conten and put it in the data base?
> or am I asking to much? am I doomed to cut and paste every day?
>
>
I have implemented an automated system on a unix box which does what you
wish. In my case, we receive email from an automated voice response
system and other distribution lists. The emails are always in
the same format, although you could probably adapt this scheme to your
requirements.
The process depends on a cron job which runs every 10 minutes. The process
it invokes scans the mailbox for the user it is (/usr/spool/mail/username
or whatever) and reads it sequentially. When it finds a combination of
headers (From, From:, To:, Subject: etc.) which match the criteria for
use, it reads and parses the remainder of the message (up to a \n\nFrom
xxx header) and extracts the Message-ID: header. It looks this up in a
scoreboard file to see if the message has already been processed, and if
not, adds the message ID to the scoreboard, then connects to the database
(on a different machine, actually) and adds the record. If the message ID
was already in the scoreboard, the message is just skipped. Occasionally,
I login to the account and delete the processed mail from the mailbox.
The cron job produces an email itself, indicating the message which was
processed.
This scheme relies on permission to run a cron job, although you could run
it manually, once a day or so, if you wished. If desired, I could clean up
the code a bit and post it.
The mail is recieved on a Sun sparc Ultra-Enterprise running SunOS 5.6,
while the mSQL database resides on a HP 710 running HP-UX 9.05.
I also have a reverse mechanism where email is placed into a mSQL database
on the HP (our web server, outside the firewall), a Linux box (scondary
server, also outside) and the Sun (inside) periodically reads both tables
to see if new mail has been sent from the Web servers. If so, it retrieves
the data and constructs the emails which it send on behalf of the web
servers.
-- Regards, Stu Beal, VE3MWM, Stu.Beal@cciw.ca, National Water Research Institute, Burlington, Ontario, Canada. "We'd made it through yet another nuclear winter and the lawn had just trapped and eaten its first robin." - Kyle J. Spiller------------------------------------------------------------------------- To unsubscribe, go to http://www.Hughes.com.au/extras/email/
This archive was generated by hypermail 2b30 : Mon Mar 04 2002 - 09:03:51 EST