User:DavidA

  • Revision slug: User:DavidA
  • Revision title: User:DavidA
  • Revision id: 136177
  • Created:
  • Creator: DavidA
  • Is current revision? No
  • Comment 653 words added, 10 words removed

Revision Content

 

Thunderbird development requires understanding a bunch of concepts.  Luckily, you may only need to learn a few depending on the specific tasks that you're trying to accomplish with your extension.

Accounts

Thunderbird users configure usually several Accounts.  There are accounts for incoming messages (POP, IMAP, News,etc.), and accounts for outgoing messages (SMTP).  (News accounts also do sending).  Accounts are also called Servers in much of the code. 

Things you can do with accounts:

- iterate over all known accounts [link to sample code]

- introspect the details of particular accounts (names, parameters, etc.) [link to sample code]

- iterate over the folders in an account [ sample code]

Folders

Servers contain folders.  Folders contain either folders or messages.  Folders are a key data structure in Thundebird, and much of the user interface reflects this -- selecting a folder displays the messages in that folder, very fast.  This speed is possible by having a specialized database per folder.  (see nsIMsgDbFolder).  These databases stores information about the "header" of the messages, so lists of messages in folders can be sorted/displayed very fast, even if the messages themselves are large.  These headers are nsIMsgDbHdr objects.  There is a separate database per folder called the off-line cache [link to some IDL], which stores the complete messages (including headers, bodies and attachments) that have already been downloaded from the server.

Things you can do with folders (nsIMsgFolder):

- iterate over all messages in a folder

- etc.

 

Message headers

Things you can do with nsIMsgHdrs:

 

Address Book

Thunderbird's main address book management functions are built on a few key concepts:

- a Contact is an entry corresponding to a person or equivalent, including email address, phone number, etc.

- a List is a set of email addresses, which can be referred to with a single nickname, so that e.g. you can send N people the same email.

- an Address Book is a collection of contacts and lists.  Thunderbird by default creates two -- a personal address book, which is completely up to the user's control, and a Collected address book, where Thunderbird stores addresses of people you reply to (CHECK).  On the mac, there's also a Mac OS X address book, which lets you read the system address book (but not write).  If the user configures an LDAP server, that will also result in another address book, although it's one that you can search, but not

Global database: moving beyond per-folder databases

The folder-centric structure described above is great for many things, but it makes it hard to do manipulations on sets of messages that span different folders (multiple folder databases need to be open and kept in memory at the same time, indices can't be maintained efficiently, etc).  To deal with this, we've built a new system in TB3 called Gloda, which is layered on top of the folder databases, but provides new capabilities, such as ...

 

Gloda defines a few concepts which are: GlodaMessage, GlodaCollection, GlodaContact, GlodaIdentity, etc. 

[i'll skip gloda details for now cause asuth can write that well]

 

Password Manager

[hopefully just point to firefox stuff mostly?]

 

What happens to a message when it's being received

 

What happens to a message when it's being sent

 

 

 

 

 

Revision Source

<p> </p>
<p>Thunderbird development requires understanding a bunch of concepts.  Luckily, you may only need to learn a few depending on the specific tasks that you're trying to accomplish with your extension.</p>
<p><strong>Accounts</strong></p>
<p>Thunderbird users configure usually several Accounts.  There are accounts for incoming messages (POP, IMAP, News,etc.), and accounts for outgoing messages (SMTP).  (News accounts also do sending).  Accounts are also called Servers in much of the code.  </p>
<p>Things you can do with accounts:</p>
<p>- iterate over all known accounts [link to sample code]</p>
<p>- introspect the details of particular accounts (names, parameters, etc.) [link to sample code]</p>
<p>- iterate over the folders in an account [ sample code]</p>
<p><strong>Folders</strong></p>
<p>Servers contain folders.  Folders contain either folders or messages.  Folders are a key data structure in Thundebird, and much of the user interface reflects this -- selecting a folder displays the messages in that folder, very fast.  This speed is possible by having a specialized database per folder.  (see nsIMsgDbFolder).  These databases stores information about the "header" of the messages, so lists of messages in folders can be sorted/displayed very fast, even if the messages themselves are large.  These headers are nsIMsgDbHdr objects.  There is a separate database per folder called the off-line cache [link to some IDL], which stores the complete messages (including headers, bodies and attachments) that have already been downloaded from the server. </p>
<p>Things you can do with folders (nsIMsgFolder):</p>
<p>- iterate over all messages in a folder</p>
<p>- etc.</p>
<p> </p>
<p><strong>Message headers</strong></p>
<p>Things you can do with nsIMsgHdrs:</p>
<p> </p>
<p><strong>Address Book<br>
</strong></p>
<p>Thunderbird's main address book management functions are built on a few key concepts:</p>
<p>- a Contact is an entry corresponding to a person or equivalent, including email address, phone number, etc.</p>
<p>- a List is a set of email addresses, which can be referred to with a single nickname, so that e.g. you can send N people the same email.</p>
<p>- an Address Book is a collection of contacts and lists.  Thunderbird by default creates two -- a personal address book, which is completely up to the user's control, and a Collected address book, where Thunderbird stores addresses of people you reply to (CHECK).  On the mac, there's also a Mac OS X address book, which lets you read the system address book (but not write).  If the user configures an LDAP server, that will also result in another address book, although it's one that you can search, but not </p>
<p><strong>Global database: moving beyond per-folder databases<br>
</strong></p>
<p>The folder-centric structure described above is great for many things, but it makes it hard to do manipulations on sets of messages that span different folders (multiple folder databases need to be open and kept in memory at the same time, indices can't be maintained efficiently, etc).  To deal with this, we've built a new system in TB3 called Gloda, which is layered on top of the folder databases, but provides new capabilities, such as ...</p>
<p> </p>
<p>Gloda defines a few concepts which are: GlodaMessage, GlodaCollection, GlodaContact, GlodaIdentity, etc.  </p>
<p>[i'll skip gloda details for now cause asuth can write that well]</p>
<p> </p>
<p><strong>Password Manager</strong></p>
<p>[hopefully just point to firefox stuff mostly?]</p>
<p> </p>
<p><strong>What happens to a message when it's being received</strong></p>
<p> </p>
<p><strong>What happens to a message when it's being sent</strong></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
Revert to this revision