473,804 Members | 3,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Search your email using SQL!

Dear PostgreSQL people,

I thought that some of you might be interested to know about Decimail, a
new IMAP mail server that I've written that uses PostgreSQL to implement
its message store.

Decimail's unique feature is that mailboxes are defined using SQL
queries. So for example you can match all messages to this list with
this query:

select msg_id from to_addrs where ad************* ****@postgresql .org'

But it's better than that. You can have a table of mailing lists that
stores the list name and its address:

list_name | submit_addr
--------------------+------------------------------
PostgreSQL SQL | pg*******@postg resql.org
Wget | wg**@sunsite.dk
PostgreSQL General | pg***********@p ostgresql.org

Then you can create a view that generates a query like the one above for
each of these lists:

-[ RECORD 1 ] --------------------------------------------------------
mailbox | Lists/PostgreSQL SQL
query | select msg_id from to_addrs where addr='pgsql-sql@postgresql
-[ RECORD 2 ]---------------------------------------------------------
mailbox | Lists/Wget
query | select msg_id from to_addrs where addr='wg**@suns ite.dk'
-[ RECORD 3 ]---------------------------------------------------------
mailbox | Lists/PostgreSQL General
query | select msg_id from to_addrs where addr='pgsql-general@postgr

Now combine (UNION) this with similar views generated from your address
book (you keep that in a PostgreSQL table as well don't you?), for
chronological filtering, and so on. Each of the queries that you define
is visible as a mailbox within your IMAP email clients (note the level
of hierarchy defined in the mailbox names above).

Decimail is GPLed and has just been announced to the world at large in
the last few days; I'm probably still the only person who's using it.
So it's not exactly suitable for use in a "production " environment. But
if you're an experimenter and you like the idea of searching and
categorising your email using SQL, it could be just what you're looking
for. I've been using it for several months and it has never lost any
email. The hard and boring part is the IMAP server code but that's
done; the fun bit is getting the database to present clever and useful
views of the messages.

Have a look at the web page: http://decimail.org/

Thanks to all you PostgreSQL people for making this possible.

Regards,

--Phil.
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
0 1206

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1607
by: middletree | last post by:
Intranet tech support system using ASP/VBScript running on W2000 Server, IIS, and using SQL Server 2000. I need to add a search engine. The problem with using a regular SQL query is that if you put a phrase, say "red car" in the text box, to hit submit, my SQL qurey would only look for that phrase, and would leave out other items where the words red and car appeared separately. I guess what I am saying is that I would like something like...
6
7206
by: Rizyak | last post by:
******************** alt.php.sql,comp databases.ms-sqlserver microsoft.public.sqlserver.programming *********************************** Why doesn't this work: SELECT * FROM 'Events'
3
2159
by: RiceGuy | last post by:
Hi! I'm looking for ideas on what would the best approach to design a search system for a RSS feeds. I will have some 50 RSS feeds (all RSS 2.0 compliant) stored locally on the web server. Now I'm wondering what would the best method to allow searching of these RSS files. Since the search will cater to multiple users the search system has to be robust and efficient. Some ideas that I have for the RSS search system are: 1. Store all RSS...
3
1578
by: huzz | last post by:
I've a table filed holds keywords seperated by comma, and a web search form where a user can type one of multiple keywords in the search text field seperated by comma aswell. How do i create a sql statement to bring results that matches one or more keywords in the database? Many thanks in advance.. huzz
83
5972
by: D. Dante Lorenso | last post by:
Trying to use the 'search' in the docs section of PostgreSQL.org is extremely SLOW. Considering this is a website for a database and databases are supposed to be good for indexing content, I'd expect a much faster performance. I submitted my search over two minutes ago. I just finished this email to the list. The results have still not come back. I only searched for: SECURITY INVOKER
2
2239
by: misschristalee | last post by:
I'm having a brain blockage day.... Scenario: Search Form with 6 text boxes Query has same six fields Each has this IIF: IIf(IsNull(!!),"",!!) with each dictating the correct text box of course. SQL dictates... If text box 1 isNull do nothing or do this OR if text
6
3334
by: DC | last post by:
Hi, I am programming a search catalogue with 200000 items (and growing). I am currently using the SQL Server 2000 fulltext engine for this task but it does not fit the requirements anymore. The products typically do have a verbose name, "canadian superapples: red tasty juicy macintosh apple from toronto" and the like. If a customer is looking for "canadian apple" this product needs to match, but also if he is looking for "juicy mac".
2
1623
by: correo | last post by:
Hello, I've built a search engine that queries a MySQL database. However, if I enter "foo bar", the engine will search for that phrase exactly, and will not find "bar foo" nor "foo something bar". How do you separate words so that the engine finds them individually? I'm thinking something like $tokenized = strtok($query, " ") mysql_query(" SELECT ... FROM ...
4
3077
by: EvoEight | last post by:
I'm writing a search for our site and I'm running into a few problems. When I run the query like this, it runs just fine: Declare @Keywords varchar(2000) Select @Keywords = 'modern trial advocacy canada' Select product_id, name, count(name) hits FROM estore_products INNER JOIN sequence ON estore_products.name like '%' + Substring(' ' + @keywords + ' ',seq,
12
2348
by: iahamed | last post by:
Hi Everyone, I got two parts of my advance search to work, I am running out of Logic to connect the third. My mind is in swing! Pleaseeeeeeeee Help me. I have 3 Fiels to search, the First two works, thats: 1. Category to search from the (Drop down name: ASPDBCatSearch) is working with the Input Text Box Field (name: keyword), based on Whatever selection on the Drop down value selection:
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9588
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10589
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.