You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by St...@sunlife.com on 2007/01/18 10:17:15 UTC

Extracting message_body from the database to dispkay on a web page

Hi Folks,

I'm hoping that someone will be able to point me in the right direction. I
have created several lists to distribute email to user groups. These emails
are stored in a MS SQL database. I want to be able to query the mail table
and do wild card searches on message_body column and for emails that
satisfy the search I want to show those emails on a web page. So I want to
be able to do something like this:

SELECT * FROM mail WHERE UPPER(message_body) LIKE '%TEST STRING%' ORDER BY
last_updated DESC

This should return all the content from the emails so that they can be
displayed on a web page.

Any help would be much appreciated....

Thanks in advance,

Stephen

---------------------------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Extracting message_body from the database to dispkay on a web page

Posted by Stefano Bagnara <ap...@bago.org>.
Hi Stephen,

mails are stored in their rfc2822 (MIME) message format.
MIME supports encoded messages, so you CAN'T always expect to find the 
text as is. For example it could be encoded in BASE64.

One possible approach is to integrate lucene and to change the 
mailrepository to intercept message store to update an index (by 
appropriately indexing interesting MimeMessage parts) so that you can 
later query the lucene index to obtain message keys.

Stefano

Stephen.Garvey@sunlife.com wrote:
> Hi Folks,
> 
> I'm hoping that someone will be able to point me in the right direction. I
> have created several lists to distribute email to user groups. These emails
> are stored in a MS SQL database. I want to be able to query the mail table
> and do wild card searches on message_body column and for emails that
> satisfy the search I want to show those emails on a web page. So I want to
> be able to do something like this:
> 
> SELECT * FROM mail WHERE UPPER(message_body) LIKE '%TEST STRING%' ORDER BY
> last_updated DESC
> 
> This should return all the content from the emails so that they can be
> displayed on a web page.
> 
> Any help would be much appreciated....
> 
> Thanks in advance,
> 
> Stephen



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org