Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 09-25-2007, 05:40 AM   #1
LQ Newbie
Registered: Sep 2007
Posts: 4

Rep: Reputation: 0
Can a mailbox be stored in a database?

Hello All,

I have been thinking about this for many years, and could not find a good way to do this. I wonder now, if any software already exists for this purpose.

Okay, basically a POP3/IMAP/SMTP server which fully uses a database, for example MySQL. When mail is send to the server via SMTP, the user is checked via MySQL, and the mail is then stored in a database table following a strict configuration layout the user chooses when he/she sets up the server. Now this is where is gets fun... The POP3/IMAP server would fetch the mail from the database table. A configuration can be set for this as well. Now, the mail can also be accessed by a MySQL-enabled language. For example Perl or PHP, to create a webmail interface which communicates directly with the database instead of through a network protocol. Ultimately creating a fully customized mail server/webmail system.

As in customization, the server owner can add flags into the database for special purposes, such as letting a user flag specific Email for download, or flag specific Email as webmail only, or even download only, making a type of next-gen mail server.

Does anyone know of any software which can do this natively or even through a plug-in system? Would anyone know how I can create this type of system through either from scratch or by modifying an existing mail server?

Thank you, any information on this would be most helpful.
Old 09-25-2007, 06:15 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
yeah there are plenty of ways to do this, fairly common too....

for example

Last edited by acid_kewpie; 09-25-2007 at 06:17 AM.
Old 09-25-2007, 07:01 AM   #3
LQ Newbie
Registered: Sep 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Hmm, close but not quite

I want the mail spool to be stored in a database. The link you provided explains how enable username/password lookups via a database, but it does not store the mail itself in the database. I already have my mail server set-up to retrieve username/passwords from a database.

For example, when mail is sent to SMTP, it would do a query like this:
insert into mailspool values ($UID,$Headers,$Message,$etc,$etc)

When mail is retrieved using POP3/IMAP, it would do a query like this:
select * from mailspool where uid=$UID

I hope this provides a better understand of what I would like to attempt.

Old 09-25-2007, 09:49 PM   #4
Senior Member
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Here is something.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
(my)sql: drop database doesn't remove database kpachopoulos Programming 3 09-19-2007 01:32 PM
Database Programming (database to database transaction) johncsl82 Programming 7 02-02-2007 08:20 AM
LXer: A database solution is more than database software LXer Syndicated Linux News 0 09-25-2006 08:54 AM
DHCP database stored in ldap marvin00001 Linux - Networking 2 10-18-2005 10:51 AM
(!) can a root password be stored on server database? leduytien Linux - Software 3 10-28-2004 04:10 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:28 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration