dbTalk Databases Forums  

Receiving email into pl/sql

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss Receiving email into pl/sql in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Lee
 
Posts: n/a

Default Receiving email into pl/sql - 11-07-2007 , 02:39 PM






I've sent email from pl/sql with utl_smtp and with 10g's utl_mail; but
now I want to do the inverse, i.e. I want to READ email from pl/sql.

The idea is to set up a dedicated email account. Users could send
stereotyped messages to that account, and the pl/sql routine would read
the mail, parse the messages and do the needful.

As far as I can tell, utl_mail will send, but not receive email.

I can think of some Rube Golberg workarounds but can anyone point the
way to a "no fuss" way to read simple text emails?


Thanks in advance

Reply With Quote
  #2  
Old   
DA Morgan
 
Posts: n/a

Default Re: Receiving email into pl/sql - 11-07-2007 , 03:17 PM






Lee wrote:
Quote:
I've sent email from pl/sql with utl_smtp and with 10g's utl_mail; but
now I want to do the inverse, i.e. I want to READ email from pl/sql.

The idea is to set up a dedicated email account. Users could send
stereotyped messages to that account, and the pl/sql routine would read
the mail, parse the messages and do the needful.

As far as I can tell, utl_mail will send, but not receive email.

I can think of some Rube Golberg workarounds but can anyone point the
way to a "no fuss" way to read simple text emails?


Thanks in advance
If you think it is a good idea to send emails, across the web, from
some Microsoft Outlook client directly into an Oracle database I am sure
we can recommend a good 12 step program for you.

Incoming emails are stored somewhere. Find the location. Read them using
anything from UTL_FILE to whatever.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #3  
Old   
Lee
 
Posts: n/a

Default Re: Receiving email into pl/sql - 11-07-2007 , 10:39 PM



DA Morgan wrote:
Quote:
Lee wrote:

I've sent email from pl/sql with utl_smtp and with 10g's utl_mail; but
now I want to do the inverse, i.e. I want to READ email from pl/sql.

The idea is to set up a dedicated email account. Users could send
stereotyped messages to that account, and the pl/sql routine would
read the mail, parse the messages and do the needful.

As far as I can tell, utl_mail will send, but not receive email.

I can think of some Rube Golberg workarounds but can anyone point the
way to a "no fuss" way to read simple text emails?


Thanks in advance


If you think it is a good idea to send emails, across the web, from
some Microsoft Outlook client directly into an Oracle database I am sure
we can recommend a good 12 step program for you.

As you yourself point out, the email winds up as data somwhere; so why
would it be worse to send email to an automated agent than sending email
to a human agent or just reading an input file as data?

Why would reading email to drive a script from inside a stored procedure
be more dangerous than running a static batch script or a script that
takes input from a human or from a data file?

I assume you're concerned about sql injection attacks or maybe some sort
of spam and/or spoofing, or even an attempt to "flood" the system a la
DDOS attacks?

Maybe I'm not being sufficiently imaginative or paranoid, but I cant see
how the sort of scheme I'm thinking of is more dangerous than crossing
the street. Everybody and his uncle has a listserv that runs on commands
sent in by email, so why is that setting off alarm bells?

I can use an http callout to get data from anywhere on the planet. There
are "rest"-full web services, and SOAP interfaces and all sorts of ways
to have all kinds of heaven-knows-what get presented as input. A routine
that parses stereotyped email messages and deliveres canned reports in
response seems pretty benign.

Or am I living in a fools paradise?


Quote:
Incoming emails are stored somewhere. Find the location. Read them using
anything from UTL_FILE to whatever.
My Oracle server is running on a different box from my email server, so
the trick is to get the data from the mail server to the oracle box.

If I dont mind having more moving parts, there are plenty of ways to get
from there to here; but I was hoping for something with "no fuss, no
muss and no bother". Reading email seemed to fill the bill until
I realize that I dont seem to have a slick way to make that happen.

Maybe something in Java running in the database?

Of course there is that proverb about the relative velocity of fools and
fearful angels, so tell me more about why I could be stepping off a
cliff here.



Reply With Quote
  #4  
Old   
shakespeare
 
Posts: n/a

Default Re: Receiving email into pl/sql - 11-08-2007 , 03:09 AM




"Lee" <Lee (AT) JamToday (DOT) com> schreef in bericht
news:fgu3sr$s28$1 (AT) reader1 (DOT) panix.com...
Quote:
DA Morgan wrote:
Lee wrote:

I've sent email from pl/sql with utl_smtp and with 10g's utl_mail; but
now I want to do the inverse, i.e. I want to READ email from pl/sql.

The idea is to set up a dedicated email account. Users could send
stereotyped messages to that account, and the pl/sql routine would read
the mail, parse the messages and do the needful.

As far as I can tell, utl_mail will send, but not receive email.

I can think of some Rube Golberg workarounds but can anyone point the
way to a "no fuss" way to read simple text emails?


Thanks in advance


If you think it is a good idea to send emails, across the web, from
some Microsoft Outlook client directly into an Oracle database I am sure
we can recommend a good 12 step program for you.

As you yourself point out, the email winds up as data somwhere; so why
would it be worse to send email to an automated agent than sending email
to a human agent or just reading an input file as data?

Why would reading email to drive a script from inside a stored procedure
be more dangerous than running a static batch script or a script that
takes input from a human or from a data file?

I assume you're concerned about sql injection attacks or maybe some sort
of spam and/or spoofing, or even an attempt to "flood" the system a la
DDOS attacks?

Maybe I'm not being sufficiently imaginative or paranoid, but I cant see
how the sort of scheme I'm thinking of is more dangerous than crossing the
street. Everybody and his uncle has a listserv that runs on commands sent
in by email, so why is that setting off alarm bells?

I can use an http callout to get data from anywhere on the planet. There
are "rest"-full web services, and SOAP interfaces and all sorts of ways to
have all kinds of heaven-knows-what get presented as input. A routine that
parses stereotyped email messages and deliveres canned reports in response
seems pretty benign.

Or am I living in a fools paradise?


Incoming emails are stored somewhere. Find the location. Read them using
anything from UTL_FILE to whatever.
My Oracle server is running on a different box from my email server, so
the trick is to get the data from the mail server to the oracle box.

If I dont mind having more moving parts, there are plenty of ways to get
from there to here; but I was hoping for something with "no fuss, no muss
and no bother". Reading email seemed to fill the bill until
I realize that I dont seem to have a slick way to make that happen.

Maybe something in Java running in the database?

Of course there is that proverb about the relative velocity of fools and
fearful angels, so tell me more about why I could be stepping off a cliff
here.

Back in the nineties, Oracle used to have a product called Oracle Mail,
which was able to receive email (and yes: in the database). It became part
of Oracle Interoffice (which died some years later). Don't know if it's
still around as a product, but it is stil there as a part of Oracle
Collaboration Suite (able to receive mail in the database). I had a customer
who installed Coll. Suite for this purpose solely: they wanted to be able to
start processes based on email.
Installing OCS is quite a fuss, keeping it running even more, but it may be
worth a try. You'll have to pay for it, though.
Oracle Interconnect had an SMTP adapter (but that was in 2001). We never got
it working, iirc it could not handle attachments.Could be part of BPEL now
(does someone know?).

Shakespeare




Reply With Quote
  #5  
Old   
shakespeare
 
Posts: n/a

Default Re: Receiving email into pl/sql (follow up) - 11-08-2007 , 03:14 AM




"shakespeare" <whatsin (AT) xs4all (DOT) nl> schreef in bericht
news:4732d249$0$244$e4fe514c (AT) news (DOT) xs4all.nl...
Quote:
"Lee" <Lee (AT) JamToday (DOT) com> schreef in bericht
news:fgu3sr$s28$1 (AT) reader1 (DOT) panix.com...
DA Morgan wrote:
Lee wrote:

I've sent email from pl/sql with utl_smtp and with 10g's utl_mail; but
now I want to do the inverse, i.e. I want to READ email from pl/sql.

The idea is to set up a dedicated email account. Users could send
stereotyped messages to that account, and the pl/sql routine would read
the mail, parse the messages and do the needful.

As far as I can tell, utl_mail will send, but not receive email.

I can think of some Rube Golberg workarounds but can anyone point the
way to a "no fuss" way to read simple text emails?


Thanks in advance


If you think it is a good idea to send emails, across the web, from
some Microsoft Outlook client directly into an Oracle database I am sure
we can recommend a good 12 step program for you.

As you yourself point out, the email winds up as data somwhere; so why
would it be worse to send email to an automated agent than sending email
to a human agent or just reading an input file as data?

Why would reading email to drive a script from inside a stored procedure
be more dangerous than running a static batch script or a script that
takes input from a human or from a data file?

I assume you're concerned about sql injection attacks or maybe some sort
of spam and/or spoofing, or even an attempt to "flood" the system a la
DDOS attacks?

Maybe I'm not being sufficiently imaginative or paranoid, but I cant see
how the sort of scheme I'm thinking of is more dangerous than crossing
the street. Everybody and his uncle has a listserv that runs on commands
sent in by email, so why is that setting off alarm bells?

I can use an http callout to get data from anywhere on the planet. There
are "rest"-full web services, and SOAP interfaces and all sorts of ways
to have all kinds of heaven-knows-what get presented as input. A routine
that parses stereotyped email messages and deliveres canned reports in
response seems pretty benign.

Or am I living in a fools paradise?


Incoming emails are stored somewhere. Find the location. Read them using
anything from UTL_FILE to whatever.
My Oracle server is running on a different box from my email server, so
the trick is to get the data from the mail server to the oracle box.

If I dont mind having more moving parts, there are plenty of ways to get
from there to here; but I was hoping for something with "no fuss, no muss
and no bother". Reading email seemed to fill the bill until
I realize that I dont seem to have a slick way to make that happen.

Maybe something in Java running in the database?

Of course there is that proverb about the relative velocity of fools and
fearful angels, so tell me more about why I could be stepping off a cliff
here.


Back in the nineties, Oracle used to have a product called Oracle Mail,
which was able to receive email (and yes: in the database). It became part
of Oracle Interoffice (which died some years later). Don't know if it's
still around as a product, but it is stil there as a part of Oracle
Collaboration Suite (able to receive mail in the database). I had a
customer who installed Coll. Suite for this purpose solely: they wanted to
be able to start processes based on email.
Installing OCS is quite a fuss, keeping it running even more, but it may
be worth a try. You'll have to pay for it, though.
Oracle Interconnect had an SMTP adapter (but that was in 2001). We never
got it working, iirc it could not handle attachments.Could be part of BPEL
now (does someone know?).

Shakespeare

Checked it out: there still an SMTP adapter in Oracle Application Server
Integration InterConnect. But it can only handle IMAP4, no POP3.
I think that was our problem back then......

Shakespeare




Reply With Quote
  #6  
Old   
Lee
 
Posts: n/a

Default Re: Receiving email into pl/sql - 11-08-2007 , 08:49 AM



shakespeare wrote:

Quote:
Back in the nineties, Oracle used to have a product called Oracle Mail,
which was able to receive email (and yes: in the database). It became part
of Oracle Interoffice (which died some years later). Don't know if it's
still around as a product, but it is stil there as a part of Oracle
Collaboration Suite (able to receive mail in the database). I had a customer
who installed Coll. Suite for this purpose solely: they wanted to be able to
start processes based on email.
Installing OCS is quite a fuss, keeping it running even more, but it may be
worth a try. You'll have to pay for it, though.
Oracle Interconnect had an SMTP adapter (but that was in 2001). We never got
it working, iirc it could not handle attachments.Could be part of BPEL now
(does someone know?).

Thanks for the input.

Its beginning to look as if I'm not going to be able to do any better
than my friend Rube (Golberg) after all.








Reply With Quote
  #7  
Old   
DA Morgan
 
Posts: n/a

Default Re: Receiving email into pl/sql (follow up) - 11-08-2007 , 10:18 AM



shakespeare wrote:
Quote:
"shakespeare" <whatsin (AT) xs4all (DOT) nl> schreef in bericht
news:4732d249$0$244$e4fe514c (AT) news (DOT) xs4all.nl...
"Lee" <Lee (AT) JamToday (DOT) com> schreef in bericht
news:fgu3sr$s28$1 (AT) reader1 (DOT) panix.com...
DA Morgan wrote:
Lee wrote:

I've sent email from pl/sql with utl_smtp and with 10g's utl_mail; but
now I want to do the inverse, i.e. I want to READ email from pl/sql.

The idea is to set up a dedicated email account. Users could send
stereotyped messages to that account, and the pl/sql routine would read
the mail, parse the messages and do the needful.

As far as I can tell, utl_mail will send, but not receive email.

I can think of some Rube Golberg workarounds but can anyone point the
way to a "no fuss" way to read simple text emails?


Thanks in advance

If you think it is a good idea to send emails, across the web, from
some Microsoft Outlook client directly into an Oracle database I am sure
we can recommend a good 12 step program for you.

As you yourself point out, the email winds up as data somwhere; so why
would it be worse to send email to an automated agent than sending email
to a human agent or just reading an input file as data?

Why would reading email to drive a script from inside a stored procedure
be more dangerous than running a static batch script or a script that
takes input from a human or from a data file?

I assume you're concerned about sql injection attacks or maybe some sort
of spam and/or spoofing, or even an attempt to "flood" the system a la
DDOS attacks?

Maybe I'm not being sufficiently imaginative or paranoid, but I cant see
how the sort of scheme I'm thinking of is more dangerous than crossing
the street. Everybody and his uncle has a listserv that runs on commands
sent in by email, so why is that setting off alarm bells?

I can use an http callout to get data from anywhere on the planet. There
are "rest"-full web services, and SOAP interfaces and all sorts of ways
to have all kinds of heaven-knows-what get presented as input. A routine
that parses stereotyped email messages and deliveres canned reports in
response seems pretty benign.

Or am I living in a fools paradise?


Incoming emails are stored somewhere. Find the location. Read them using
anything from UTL_FILE to whatever.
My Oracle server is running on a different box from my email server, so
the trick is to get the data from the mail server to the oracle box.

If I dont mind having more moving parts, there are plenty of ways to get
from there to here; but I was hoping for something with "no fuss, no muss
and no bother". Reading email seemed to fill the bill until
I realize that I dont seem to have a slick way to make that happen.

Maybe something in Java running in the database?

Of course there is that proverb about the relative velocity of fools and
fearful angels, so tell me more about why I could be stepping off a cliff
here.

Back in the nineties, Oracle used to have a product called Oracle Mail,
which was able to receive email (and yes: in the database). It became part
of Oracle Interoffice (which died some years later). Don't know if it's
still around as a product, but it is stil there as a part of Oracle
Collaboration Suite (able to receive mail in the database). I had a
customer who installed Coll. Suite for this purpose solely: they wanted to
be able to start processes based on email.
Installing OCS is quite a fuss, keeping it running even more, but it may
be worth a try. You'll have to pay for it, though.
Oracle Interconnect had an SMTP adapter (but that was in 2001). We never
got it working, iirc it could not handle attachments.Could be part of BPEL
now (does someone know?).

Shakespeare


Checked it out: there still an SMTP adapter in Oracle Application Server
Integration InterConnect. But it can only handle IMAP4, no POP3.
I think that was our problem back then......

Shakespeare
Get a Collab Suite license. That's another solution.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #8  
Old   
DA Morgan
 
Posts: n/a

Default Re: Receiving email into pl/sql - 11-08-2007 , 10:30 AM



Lee wrote:
Quote:
DA Morgan wrote:
Lee wrote:

I've sent email from pl/sql with utl_smtp and with 10g's utl_mail;
but now I want to do the inverse, i.e. I want to READ email from pl/sql.

The idea is to set up a dedicated email account. Users could send
stereotyped messages to that account, and the pl/sql routine would
read the mail, parse the messages and do the needful.

As far as I can tell, utl_mail will send, but not receive email.

I can think of some Rube Golberg workarounds but can anyone point the
way to a "no fuss" way to read simple text emails?


Thanks in advance


If you think it is a good idea to send emails, across the web, from
some Microsoft Outlook client directly into an Oracle database I am sure
we can recommend a good 12 step program for you.

As you yourself point out, the email winds up as data somwhere; so why
would it be worse to send email to an automated agent than sending email
to a human agent or just reading an input file as data?
Mail systems, not the Oracle database, contain filters that trap spam
and a wide variety of diseases. In the database you would have to write
your own: Reinvent the wheel.

Quote:
Why would reading email to drive a script from inside a stored procedure
be more dangerous than running a static batch script or a script that
takes input from a human or from a data file?
Were the only issue SQL Injection your point would be valid. But there
is far more that could happen here than just that. Wouldn't be hard to
create one heck of a good denial of service attack with email. I don't
think you, and even 100 of your friends can type that fast.

Quote:
I assume you're concerned about sql injection attacks or maybe some sort
of spam and/or spoofing, or even an attempt to "flood" the system a la
DDOS attacks?
Exactly.

Quote:
Maybe I'm not being sufficiently imaginative or paranoid, but I cant see
how the sort of scheme I'm thinking of is more dangerous than crossing
the street. Everybody and his uncle has a listserv that runs on commands
sent in by email, so why is that setting off alarm bells?
When walking across the street you, perhaps, have to watch out for one
or two people trying to hit you. When you get on the internet you have
every kid with a keyboard trying to take you out. The odds are not in
your favor.

Quote:
I can use an http callout to get data from anywhere on the planet. There
are "rest"-full web services, and SOAP interfaces and all sorts of ways
to have all kinds of heaven-knows-what get presented as input. A routine
that parses stereotyped email messages and deliveres canned reports in
response seems pretty benign.
Not in 11g you can't. Oracle stuffed that security breach with the new
DBMS_NETWORK_ACL_ADMIN package (ACL = Access Control List).

Quote:
Or am I living in a fools paradise?
You know the answer to that. <g>

Quote:
Incoming emails are stored somewhere. Find the location. Read them using
anything from UTL_FILE to whatever.
My Oracle server is running on a different box from my email server, so
the trick is to get the data from the mail server to the oracle box.
Routers, hubs, switches, networks, cat5 cable. You can get there is you
are authorized to do so.

Quote:
Of course there is that proverb about the relative velocity of fools and
fearful angels, so tell me more about why I could be stepping off a
cliff here.
Look at the amount of effort put into database security by those
companies that intentionally expose their databases to the public.
Amazon.com, Ebay, etc. You want to duplicate that effort? Because
clicking on an email client is too much work?
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #9  
Old   
shakespeare
 
Posts: n/a

Default Re: Receiving email into pl/sql (follow up) - 11-08-2007 , 01:49 PM




"DA Morgan" <damorgan (AT) psoug (DOT) org> schreef in bericht
news:1194538721.437178 (AT) bubbleator (DOT) drizzle.com...
Quote:
shakespeare wrote:
"shakespeare" <whatsin (AT) xs4all (DOT) nl> schreef in bericht
news:4732d249$0$244$e4fe514c (AT) news (DOT) xs4all.nl...
"Lee" <Lee (AT) JamToday (DOT) com> schreef in bericht
news:fgu3sr$s28$1 (AT) reader1 (DOT) panix.com...
DA Morgan wrote:
Lee wrote:

I've sent email from pl/sql with utl_smtp and with 10g's utl_mail;
but now I want to do the inverse, i.e. I want to READ email from
pl/sql.

The idea is to set up a dedicated email account. Users could send
stereotyped messages to that account, and the pl/sql routine would
read the mail, parse the messages and do the needful.

As far as I can tell, utl_mail will send, but not receive email.

I can think of some Rube Golberg workarounds but can anyone point the
way to a "no fuss" way to read simple text emails?


Thanks in advance

If you think it is a good idea to send emails, across the web, from
some Microsoft Outlook client directly into an Oracle database I am
sure
we can recommend a good 12 step program for you.

As you yourself point out, the email winds up as data somwhere; so why
would it be worse to send email to an automated agent than sending
email to a human agent or just reading an input file as data?

Why would reading email to drive a script from inside a stored
procedure be more dangerous than running a static batch script or a
script that takes input from a human or from a data file?

I assume you're concerned about sql injection attacks or maybe some
sort of spam and/or spoofing, or even an attempt to "flood" the system
a la DDOS attacks?

Maybe I'm not being sufficiently imaginative or paranoid, but I cant
see how the sort of scheme I'm thinking of is more dangerous than
crossing the street. Everybody and his uncle has a listserv that runs
on commands sent in by email, so why is that setting off alarm bells?

I can use an http callout to get data from anywhere on the planet.
There are "rest"-full web services, and SOAP interfaces and all sorts
of ways to have all kinds of heaven-knows-what get presented as input.
A routine that parses stereotyped email messages and deliveres canned
reports in response seems pretty benign.

Or am I living in a fools paradise?


Incoming emails are stored somewhere. Find the location. Read them
using
anything from UTL_FILE to whatever.
My Oracle server is running on a different box from my email server, so
the trick is to get the data from the mail server to the oracle box.

If I dont mind having more moving parts, there are plenty of ways to
get from there to here; but I was hoping for something with "no fuss,
no muss and no bother". Reading email seemed to fill the bill until
I realize that I dont seem to have a slick way to make that happen.

Maybe something in Java running in the database?

Of course there is that proverb about the relative velocity of fools
and fearful angels, so tell me more about why I could be stepping off a
cliff here.

Back in the nineties, Oracle used to have a product called Oracle Mail,
which was able to receive email (and yes: in the database). It became
part of Oracle Interoffice (which died some years later). Don't know if
it's still around as a product, but it is stil there as a part of Oracle
Collaboration Suite (able to receive mail in the database). I had a
customer who installed Coll. Suite for this purpose solely: they wanted
to be able to start processes based on email.
Installing OCS is quite a fuss, keeping it running even more, but it may
be worth a try. You'll have to pay for it, though.
Oracle Interconnect had an SMTP adapter (but that was in 2001). We never
got it working, iirc it could not handle attachments.Could be part of
BPEL now (does someone know?).

Shakespeare


Checked it out: there still an SMTP adapter in Oracle Application Server
Integration InterConnect. But it can only handle IMAP4, no POP3.
I think that was our problem back then......

Shakespeare

Get a Collab Suite license. That's another solution.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Yes, like I already pointed out... Quite a lot of overhead for just
receiving mail, but what the ... ,right?

Shakespeare




Reply With Quote
  #10  
Old   
Ana C. Dent
 
Posts: n/a

Default Re: Receiving email into pl/sql - 11-09-2007 , 09:07 PM



Lee <leeh (AT) panix (DOT) com> wrote in news:fgv7lr$er1$1 (AT) reader1 (DOT) panix.com:

Quote:
shakespeare wrote:


Back in the nineties, Oracle used to have a product called Oracle
Mail, which was able to receive email (and yes: in the database). It
became part of Oracle Interoffice (which died some years later).
Don't know if it's still around as a product, but it is stil there as
a part of Oracle Collaboration Suite (able to receive mail in the
database). I had a customer who installed Coll. Suite for this
purpose solely: they wanted to be able to start processes based on
email. Installing OCS is quite a fuss, keeping it running even more,
but it may be worth a try. You'll have to pay for it, though.
Oracle Interconnect had an SMTP adapter (but that was in 2001). We
never got it working, iirc it could not handle attachments.Could be
part of BPEL now (does someone know?).


Thanks for the input.

Its beginning to look as if I'm not going to be able to do any
better
than my friend Rube (Golberg) after all.







If you don't mind reinventing the wheel, it would be possible to
write a POP3 or IMAP client in PL/SQL using UTL_TCP.
Both protocols are well defined standards.
This would allow you to pull messages directly into a store procedure.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.