Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DBMail: users

DBmail and Django

 

 

DBMail users RSS feed   Index | Next | Previous | View Threaded


denis at carolo

Oct 12, 2009, 7:58 AM

Post #1 of 5 (961 views)
Permalink
DBmail and Django

Hi,

I'm using DBmail in a Django project (http://www.djangoproject.com).

I would like to map DBmail tables to Django models, so that I could use
Django as an interface to create users and aliases, but also to be be able
(from my Django app) to read data stored in DBmail tables.

My question is : can I add columns to DBmail tables without breaking
something in DBmail ?

Thank you.

Denis
--
Denis [at] carolo


michael.monnerie at is

Oct 12, 2009, 11:51 AM

Post #2 of 5 (901 views)
Permalink
Re: DBmail and Django [In reply to]

> My question is : can I add columns to DBmail tables without breaking something in DBmail ?

Yes, I did so for my extensions to have domains and customers in it’s own tables. I also modified the aliases table without problems.

mfg zmi



_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


paul at nfg

Oct 12, 2009, 12:30 PM

Post #3 of 5 (902 views)
Permalink
Re: DBmail and Django [In reply to]

Michael Monnerie wrote:
>> My question is : can I add columns to DBmail tables without breaking something in DBmail ?
>
> Yes, I did so for my extensions to have domains and customers in it’s own tables. I also modified the aliases table without problems.

Dbmail tries very hard not assume anything about order of fields in a
table. All columns are retrieved explicitely. So no 'select *' but
always 'select field1,field2...'.

So yes, adding columns is safe.

Building a ORM mapping for dbmail is valid for all tables, *except* for
message retrieval. That is, it'll work in 2.2 (for messageblks), but in
2.3 it is no longer a simple query.

--
________________________________________________________________
Paul Stevens paul at nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail


denis at carolo

Oct 12, 2009, 2:55 PM

Post #4 of 5 (900 views)
Permalink
Re: DBmail and Django [In reply to]

2009/10/12 Paul J Stevens <paul [at] nfg>

> Michael Monnerie wrote:
> >> My question is : can I add columns to DBmail tables without breaking
> something in DBmail ?
> >
> > Yes, I did so for my extensions to have domains and customers in it’s own
> tables. I also modified the aliases table without problems.
>
> Dbmail tries very hard not assume anything about order of fields in a
> table. All columns are retrieved explicitely. So no 'select *' but
> always 'select field1,field2...'.
>

Thank you. That's what I wanted to read. :-)


> Building a ORM mapping for dbmail is valid for all tables, *except* for
> message retrieval. That is, it'll work in 2.2 (for messageblks), but in
> 2.3 it is no longer a simple query.
>

:-/

Any pointer to that info ?

Denis
--
Denis [at] carolo


paul at nfg

Oct 13, 2009, 1:34 AM

Post #5 of 5 (888 views)
Permalink
Re: DBmail and Django [In reply to]

Denis Frère wrote:
> 2009/10/12 Paul J Stevens <paul [at] nfg <mailto:paul [at] nfg>>
>
> Michael Monnerie wrote:
> >> My question is : can I add columns to DBmail tables without
> breaking something in DBmail ?
> >
> > Yes, I did so for my extensions to have domains and customers in
> it’s own tables. I also modified the aliases table without problems.
>
> Dbmail tries very hard not assume anything about order of fields in a
> table. All columns are retrieved explicitely. So no 'select *' but
> always 'select field1,field2...'.
>
>
> Thank you. That's what I wanted to read. :-)
>
>
> Building a ORM mapping for dbmail is valid for all tables, *except* for
> message retrieval. That is, it'll work in 2.2 (for messageblks), but in
> 2.3 it is no longer a simple query.
>
>
> :-/
>
> Any pointer to that info ?

I explained some of this on the -dev list only two days ago.

I assume you already understand how users contain mailboxes which
contain messages which are pointers to physmessages. I'm talking here
about how raw message data is stored.

Basically, messages are decontructed recursively into their constituent
mimeparts. No decoding or unpacking of mime bodies is attempted. The
mimepart header and body blobs are stored as single-instance atoms. That
is: a unique blob is never stored more than once.

The location and depth of a blob in a particular message (physmessage)
is stored in the partlists table. The blobs themselves are stored in
mimeparts.

A plain/text rfc822 message will consist of two mimeparts, like the good
old messageblks storage.
1: rfc822 headers
2: rfc822 body

A message/rfc822 would result in:

1: rfc822 headers
2: mimepart headers
3: mimepart body

A multipart message with only one mimepart will result in at least 5
mimeparts:
1: rfc822 headers
2: multipart preface
3: mimepart headers
4: mimepart body
5: multipart postface

When a message/* or multipart/* message is stored, the mime-boundary is
thrown away. Such boundaries are transient in that they are not an
integral part of the container, nor of the sub-parts. Boundaries are
only remembered as part of the Content-type header of the containers.
These mime-boundaries are later added back again during message
retrieval, so no information is lost, and message integrity is maintained.

Since the storage model for dbmail has become increasingly intricate
over the years, I decided last year to start working on a dbmail-httpd
daemon that will expose the storage model through a REST-ful interface.

I'll publish that code later this week.


--
________________________________________________________________
Paul Stevens paul at nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

DBMail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.