Thread: Getting input from email...
Hi all. I'd like to set up a DB using postgreSQL to archive a mailing list. How would I go about getting all of the mail sent to the list to be automatically entered into the database when it is sent? I assume I would need to set up an email address for the list to send to, something like "archive@blahblah.org", but what would I need to do to get it into the database? Something in sendmail? Use procmail? Any ideas? --Dan ----------------------------------------------------------------------- Daniel G. Delaney The Louisville Times Chorus Dionysos@Dionysia.org www.LouisvilleTimes.org www.Dionysia.org/~dionysos/ Dionysia Design ICQ Number: 8171285 www.Dionysia.com/design/ ----------------------------------------------------------------------- "Only two things are infinite: the universe and stupidity-- and I'm not sure about the former." --Albert Einstein
At 18:09 +0200 on 26/10/98, Dan Delaney wrote: > I'd like to set up a DB using postgreSQL to archive a > mailing list. How would I go about getting all of the mail > sent to the list to be automatically entered into the > database when it is sent? I assume I would need to set up an > email address for the list to send to, something like > "archive@blahblah.org", but what would I need to do to get > it into the database? Something in sendmail? Use procmail? > Any ideas? Procmail is supposed to be the ultimate solution in this case. Never tried it myself. However, if you are working with the common unix and sendmail, you have the possibility of creating a ".forward" file in the "archive" user's home directory, in which there is one line which reads "|command". The vertical bar has to be the first character on the line. The command can be any old script - in this case a script which parses its input (an email message) and places it in the appropriate tables of your database. That's how the "vacation" program works. Use "man forward" on your machine to see how to handle a .forward file. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma
Hi all, On Mon, 26 Oct 1998, Dan Delaney wrote: > Hi all. > I'd like to set up a DB using postgreSQL to archive a > mailing list. How would I go about getting all of the mail > sent to the list to be automatically entered into the > database when it is sent? I assume I would need to set up an > email address for the list to send to, something like > "archive@blahblah.org", but what would I need to do to get > it into the database? Something in sendmail? Use procmail? > Any ideas? > > --Dan I'm using procmail to treat some incoming mails, and i'll never though to use it to 'import' incoming mails into a database system, but this is a very great idea... :-) Procmail is very easy to use an to install. All the work is done by the script behind procmail. So, with a bit of imagination (for the SQL script), this would'nt be very hard to implement. I can provide you more info about procmail (out of this mailing list, of course). Contact me if you want more about this. Thanks for your idea...!!! :-) Cybersalutations. Benjamin Gonay --------------------------------------------------------------------------- _/ Email internet : Benjamin.Gonay@ltlg1.is.belgacom.be _/ _/ ~~ Soyons realistes, exigeons l'impossible. (E. Che Guevara) ~~ _/ _/ - - [Belgium - Liege] - - - - - - - - - - - - - - - - - - - - - - - _/ _/ linux forever...Linux Forever...LINUX Forever...LINUX FOREVER !!!!! _/ ---------------------------------------------------------------------------
I do something of that sort right now to support an email notification service. Rather than use Procmail, I use scripts written in Perl which accept a message, parse it up using the Mail::Internet and Mail::Address modules, and then insert it into the database. Works like a charm. At 08:09 AM 10/26/98 , Dan Delaney wrote: >Hi all. > I'd like to set up a DB using postgreSQL to archive a >mailing list. How would I go about getting all of the mail >sent to the list to be automatically entered into the >database when it is sent? I assume I would need to set up an >email address for the list to send to, something like >"archive@blahblah.org", but what would I need to do to get >it into the database? Something in sendmail? Use procmail? >Any ideas? > > --Dan > >----------------------------------------------------------------------- > Daniel G. Delaney The Louisville Times Chorus > Dionysos@Dionysia.org www.LouisvilleTimes.org > www.Dionysia.org/~dionysos/ Dionysia Design > ICQ Number: 8171285 www.Dionysia.com/design/ >----------------------------------------------------------------------- > "Only two things are infinite: the universe and stupidity-- > and I'm not sure about the former." > --Albert Einstein
On Mon, 26 Oct 1998, Herouth Maoz wrote: > At 18:09 +0200 on 26/10/98, Dan Delaney wrote: > > I'd like to set up a DB using postgreSQL to archive a > > mailing list. How would I go about getting all of the mail > > sent to the list to be automatically entered into the > > database when it is sent? I assume I would need to set up an > > email address for the list to send to, something like > > "archive@blahblah.org", but what would I need to do to get > > it into the database? Something in sendmail? Use procmail? > > Any ideas? > Procmail is supposed to be the ultimate solution in this case. Never tried > it myself. However, if you are working with the common unix and sendmail, > you have the possibility of creating a ".forward" file in the "archive" > user's home directory, in which there is one line which reads "|command". Procmail can do this one, but it's sort of like using a shuttle for a signal flare. Sendmail (or qmail, and probably any other Unix mail server) will handle the "|command" syntax just fine. The options are: 1) A user who recieves just that mail, with "|add-to-db" in the .forwrd file. add-to-db will get the message on standard in, and should add it to the database. 2) The shuttle signal flare solution. Set it up for your account, and use the following rule: :0 c * To:.*my-mail-list@ | add-to-db which sort out mail to the list sent to you and put that in the db, as well as delivering a copy through the rest of your .procmail. 3) Changing the mail list entry in /etc/aliases (or /etc/mail/aliase) to include the "|add-to-db" command. 4) Add the "|add-to-db" entry to the list proper. This might have security repercussions, though. I like #3 myself. It ties the list to the archive at the delivery agent, with no intermediearies. From the list archives - and my own activites - it seems that it's email database time. Anyone else want to talk about them specifically? <mike
> At 18:09 +0200 on 26/10/98, Dan Delaney wrote: > > > I'd like to set up a DB using postgreSQL to archive a > > mailing list. How would I go about getting all of the mail > > sent to the list to be automatically entered into the > > database when it is sent? I assume I would need to set up an > > email address for the list to send to, something like > > "archive@blahblah.org", but what would I need to do to get > > it into the database? Something in sendmail? Use procmail? > > Any ideas? > > Procmail is supposed to be the ultimate solution in this case. Never tried > it myself. However, if you are working with the common unix and sendmail, > you have the possibility of creating a ".forward" file in the "archive" > user's home directory, in which there is one line which reads "|command". > Also, and I don't remember how, there is a way to do something simular to what you can do in the .forward file but on a global basis. If you want to know more about Sendmail, I suggest getting O'Reilley's book on the subject called _Sendmail_...james
At 14:21 +0200 on 28/10/98, James Olin Oden wrote: > Also, and I don't remember how, there is a way to do something simular to >what > you can do in the .forward file but on a global basis. Yes, it was mentioned already - by putting the |command in the aliases file as the interpretation for the "archive" alias. So you don't actually have to define a user for it. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma