Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

RE: mailtosql.pl

by le (Friar)
on Jul 21, 2000 at 16:31 UTC ( [id://23568]=note: print w/replies, xml ) Need Help??


in reply to mailtosql.pl

Sorry I had to vote -- on this one. The mail-to-database problem is one I had to fiddle with two months ago.
  1. Your script doesn't do anything with attachments, they will just be saved encoded into the body text column.
  2. Usually you know into which database you want to insert mail, so dynamically selecting it isn't necessary.
  3. Passing passwords on the command line isn't a good idea, they can be found in the shell's history (if it has one).
  4. Traversing over the header in a while loop should be faster than mapping (but this is untested).
  5. I prefer using placeholders to insert values, so I don't have to fiddle with correct quoting.
These are just my 2 cents.

Replies are listed 'Best First'.
RE: RE: mailtosql.pl
by lindex (Friar) on Jul 21, 2000 at 23:15 UTC
    1. Hmm forgot to handle attachments, Ill take care of that later today
    2. dynamiclly selecting isnt hurting anything :)
    3. Its not really meant to be used from command line, its more meant to
    be used from procmail or aliases etc etc.
    4. I think map is nifty :P~
    5. Iam weird.
    6. Thanks for the input :)



    lindex
    /****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/
      If you need a script that can parse emails and put it into a database (with all attachments and stuff), email me. (Or should I put it here??)
        Why not?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://23568]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2025-02-13 18:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found