Hi,
The HEADER table contains among others the "From" and "To" headers that indicates the from and to emails (see sample hereafter).

The problem is that you can have multiple To, Cc, so this would lead to a intermediate table in all cases. Now, when we need a mail, we fetch the headers based on the MESSAGE_ID, and we have all the needed info in one query. You can also create your own custom query without problem to filter and get for example "give me mails addressed to this email but without another email in cc"..

Tks,

Eric


154    Date    4    Sun, 14 Nov 2010 16:55:00 +0100
155    From    5    "[email protected]" <[email protected]>
157    MIME-Version    7    1.0
156 User-Agent 6 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101113 Thunderbird/3.3a1pre
159    Subject    9    qdsf
151    Return-Path    1 <[email protected]>
160    Content-Type    10    text/plain; charset=ISO-8859-1; format=flowed
152    Received    2    from 127.0.0.1 ([127.0.0.1])
/n          by 192.168.1.14 (JAMES SMTP Server ) with ESMTP ID 345
/n          for <[email protected]>;
/n          Sun, 14 Nov 2010 16:55:00 +0100 (CET)
153    Message-ID    3 <[email protected]>
158    To    8    [email protected]
161    Content-Transfer-Encoding    11    7bit

On 14/11/2010 16:29, Mohammad Naghavi wrote:
Hi Eric,
Thanks, is actually looked up in Header table before (and now again) but the
to and from parts are not present there. other headers are there like
Subject and Return-Path, but no to or from headers. and it was also
interesting for me to know why to store headers like this? why not to store
them in columns in message table?

Thanks
MN
________________________________________
PHP&  ASP .Net 3.5 web developer
Java&  C# desktop developer
www.mohamnag.com



On Sun, Nov 14, 2010 at 3:59 PM, Eric Charles<[email protected]>  wrote:

Hi Mohammad,

You can find the generated database schema here:

https://svn.apache.org/repos/asf/james/server/trunk/src/site/resources/images/database/james-database-schema-derby.png
(will  be on M2 web site,  with more info)

The users is in the JAMESUSER table.
Depending on your virtualHosting config, JAMESUSER.NAME is the email
address (or the user part that must be completed with a domain).

The user has MAILBOXes via the SUBSCRIPTION table.

The email are in MESSAGE (belonging to a MAILBOX via MEMBERSHIP). You have
to look in the HEADER table to get all the detailled infos (from, to, cc,
bcc,...).

Tks,

Eric



On 14/11/2010 12:16, Mohammad Naghavi wrote:

Hi every body,
I installed and worked with james 3 m1 with a mysql backend. now what I
wanted to ask is to get as much information about db structure as
possible.
for example I sent an email from server to itself using telnet and
I received the mail correctly but now I find no where in db that sender
and
receiver's email address are stored! or what I need to know is how to add
a
user directly in database?

Thanks in advance,
MN
________________________________________
PHP&   ASP .Net 3.5 web developer
Java&   C# desktop developer
www.mohamnag.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to