Package osaf :: Package pim :: Module mail :: Class EmailAddress
[frames | no frames]

Type EmailAddress

object --+                
         |                
     CItem --+            
             |            
          Item --+        
                 |        
              Item --+    
                     |    
           ContentItem --+
                         |
                        EmailAddress


Method Summary
  __init__(self, name, parent, kind, view, clone, **kw)
  __str__(self)
  __unicode__(self)
User readable string version of this address
  emailAddressesAreEqual(cls, emailAddressOne, emailAddressTwo)
This method tests whether two email addresses are the same. (Class method)
  format(cls, emailAddress, encode)
(Class method)
  getCurrentMeEmailAddress(cls, view)
Lookup the "me" EmailAddress. (Class method)
  getEmailAddress(cls, view, nameOrAddressString, fullName, inbound)
Lookup or create an EmailAddress based on the supplied string. (Class method)
  isValidEmailAddress(cls, emailAddress)
This method tests an email address for valid syntax as defined RFC 822. (Class method)
  parseEmailAddresses(cls, view, addressesString)
Parse the email addresses in addressesString and return a tuple with: (the processed string, a list of EmailAddress items created/found for those addresses, the number of invalid addresses we found). (Class method)
Inherited from ContentItem: addToCollection, ExportItemData, getBasedAttributes, getMembershipItem, getSharedState, InitOutgoingAttributes, isAttributeModifiable, ItemAboutString, ItemBodyString, ItemWhoFromString, ItemWhoString, removeFromCollection, SetItemBodyString, StampKind
Inherited from Item: getDefaultParent, getKind, iterItems
Inherited from Item: __getitem__, __iter__, _repr_, addValue, check, clone, collectionChanged, copy, delete, dir, find, findMatch, findPath, findUUID, getACL, getAttributeValue, getItemChild, getItemCloud, getItemDisplayName, getItemDisplayString, getValue, getVersion, hasAttributeAspect, hasChild, hasChildren, hashItem, hasKey, hasLocalAttributeValue, hasValue, isAttributeDirty, isItemOf, isRemote, iterAttributeValues, iterChildren, mixinKinds, move, placeChild, printItem, refCount, removeACL, removeAttributeValue, removeValue, rename, setACL, setAttributeValue, setPinned, setValue, unwatchCollection, unwatchKind, walk, watchCollection, watchKind
Inherited from CItem: __new__, __repr__, getAttributeAspect, getDirty, isDeleted, isDeleting, isDirty, isNew, isPinned, isSchema, isStale, setDirty
Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__

Property Summary
Inherited from ContentItem: bodyString, sharedState

Instance Variable Summary
  accounts: Used as Return Address by Email Account -- Sequence(DownloadAccountBase)
  body: attribute descriptor
  collections: attribute descriptor
  contentsOwner: attribute descriptor
  createdOn: attribute descriptor
  creator: attribute descriptor
  description: attribute descriptor
  displayName: attribute descriptor
  emailAddress: Email Address -- One(Text) An RFC 822 email address.
  fullName: Full Name -- One(Text)
  importance: attribute descriptor
  inviteeOf: Invitee Of -- Sequence(AbstractCollection)
  kindExtent: attribute descriptor
  lastModified: attribute descriptor
  lastModifiedBy: attribute descriptor
  messagesBcc: Messages Bcc -- Sequence(MailMessageMixin)
  messagesCc: Messages cc -- Sequence(MailMessageMixin)
  messagesFrom: Messages From -- Sequence(MailMessageMixin)
  messagesReplyTo: Messages Reply To -- Sequence(MailMessageMixin)
  messagesTo: Messages To -- Sequence(MailMessageMixin)
  mine: attribute descriptor
  modifiedOn: attribute descriptor
  monitors: attribute descriptor
  previousStamps: attribute descriptor
  private: attribute descriptor
  read: attribute descriptor
  references: attribute descriptor
  sharedIn: attribute descriptor
  shares: attribute descriptor
  TPBDetailItemOwner: attribute descriptor
  TPBSelectedItemOwner: attribute descriptor
  vcardType: vCard type -- One(Text)
  viewContainer: attribute descriptor
  watcherDispatch: attribute descriptor
  watchers: attribute descriptor
  watches: attribute descriptor
Inherited from Item: aliasedBy, path, typeFor, version
Inherited from CItem: itsKind, itsName, itsParent, itsPath, itsRoot, itsUUID, itsVersion, itsView

Class Variable Summary
ItemRoot __default_path__ = ItemRoot'userdata'
dict __kind_clouds__ = {'sharing': <application.schema.Cloud ...
dict __kind_info__ = {'displayName': u'Email Address Kind', '...
Inherited from ContentItem: READONLY, READWRITE, UNSHARED
Inherited from CItem: ADIRTY, CDIRTY, CMERGED, CONTAINER, COPYEXPORT, CORESCHEMA, DELETED, DELETING, DIRTY, FDIRTY, IMPORTING, MERGED, MUTATING, NDIRTY, NEW, NMERGED, NODIRTY, PINNED, RAW, RDIRTY, RMERGED, SAVEMASK, SCHEMA, STALE, VDIRTY, VMERGED, VRDIRTY

Instance Method Details

__unicode__(self)

User readable string version of this address
Overrides:
osaf.pim.items.ContentItem.__unicode__

Class Method Details

emailAddressesAreEqual(cls, emailAddressOne, emailAddressTwo)

This method tests whether two email addresses are the same. Addresses can be in the form john@jones.com or John Jones <john@jones.com>. The method strips off the username and <> brakets if they exist and just compares the actual email addresses for equality. It will not look to see if each address is RFC 822 compliant only that the strings match. Use EmailAddress.isValidEmailAddress to test for validity.
Parameters:
emailAddressOne - A string containing a email address to compare.
           (type=String)
emailAddressTwo - A string containing a email address to compare.
           (type=String)
Returns:
Boolean

getCurrentMeEmailAddress(cls, view)

Lookup the "me" EmailAddress. The "me" EmailAddress is whichever entry is the current IMAP default address.
Overrides:
osaf.pim.items.ContentItem.getCurrentMeEmailAddress

getEmailAddress(cls, view, nameOrAddressString, fullName='', inbound=False)

Lookup or create an EmailAddress based on the supplied string.

If a matching EmailAddress object is found in the repository, it is returned. If there is no match, then a new item is created and returned.

There are two ways to call this method:
  1. with something the user typed in nameOrAddressString, which will be parsed, and no fullName is needed
  2. with an plain email address in the nameOrAddressString, and a full name in the fullName field

If a match is found for both name and address then it will be used.

If there is no name specified, a match on address will be returned.

If there is no address specified, a match on name will be returned.

If both name and address are specified, but there's no entry that matches both, then a new entry is created.
Parameters:
nameOrAddressString - emailAddress string, or fullName for lookup, or both in the form "name <address>"
           (type=unicode)
fullName - optional explict fullName when not using the "name <address>" form of the nameOrAddressString parameter
           (type=unicode)
inbound - Indicates that even if the email address is not valid still save it as an EmailAddress Object. When mail enters Chandler via IMAP, POP, Sharing, etc the email address may not be valid or in a valid format ie. "name <emailaddress>". We still want to capture as much information as possible for display to the user. When sending, Chandler does not allow a user to send a message with an invalid email address.
           (type=bool)
Returns:
EmailAddress or None if not found, and nameOrAddressString is not a valid email address.
Overrides:
osaf.pim.items.ContentItem.getEmailAddress

isValidEmailAddress(cls, emailAddress)

This method tests an email address for valid syntax as defined RFC 822. The method validates addresses in the form 'John Jones <john@test.com>' and 'john@test.com'
Parameters:
emailAddress - A string containing a email address to validate.
Returns:
Boolean

parseEmailAddresses(cls, view, addressesString)

Parse the email addresses in addressesString and return a tuple with: (the processed string, a list of EmailAddress items created/found for those addresses, the number of invalid addresses we found).

Instance Variable Details

accounts

Used as Return Address by Email Account -- Sequence(DownloadAccountBase)

A list of Email Accounts that use this Email Address as the reply address for mail sent from the account.
Value:
<Role accounts of <class 'osaf.pim.mail.EmailAddress'>>                

body

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09fac>                 

collections

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09f8c>                 

contentsOwner

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09fcc>                 

createdOn

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6c9c12c>                 

creator

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09e2c>                 

description

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09fec>                 

displayName

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6c9c0ec>                 

emailAddress

Email Address -- One(Text)

An RFC 822 email address.

Examples:
   "abe@osafoundation.org"
   "Abe Lincoln {abe@osafoundation.org}" (except with ;angle brackets instead of '{' and '}')

Value:
<Role emailAddress of <class 'osaf.pim.mail.EmailAddress'>>            

fullName

Full Name -- One(Text)

A first and last name associated with this email address
Value:
<Role fullName of <class 'osaf.pim.mail.EmailAddress'>>                

importance

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6c9c04c>                 

inviteeOf

Invitee Of -- Sequence(AbstractCollection)

List of collections that the user is about to be invited to share with.
Value:
<Role inviteeOf of <class 'osaf.pim.mail.EmailAddress'>>               

kindExtent

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6c9c0ac>                 

lastModified

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6c9c10c>                 

lastModifiedBy

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09f4c>                 

messagesBcc

Messages Bcc -- Sequence(MailMessageMixin)

A list of messages with their Bcc: header referring to this address
Value:
<Role messagesBcc of <class 'osaf.pim.mail.EmailAddress'>>             

messagesCc

Messages cc -- Sequence(MailMessageMixin)

A list of messages with their cc: header referring to this address
Value:
<Role messagesCc of <class 'osaf.pim.mail.EmailAddress'>>              

messagesFrom

Messages From -- Sequence(MailMessageMixin)

A list of messages with their From: header referring to this address
Value:
<Role messagesFrom of <class 'osaf.pim.mail.EmailAddress'>>            

messagesReplyTo

Messages Reply To -- Sequence(MailMessageMixin)

A list of messages with their Reply-To: header referring to this address
Value:
<Role messagesReplyTo of <class 'osaf.pim.mail.EmailAddress'>>         

messagesTo

Messages To -- Sequence(MailMessageMixin)

A list of messages with their To: header referring to this address
Value:
<Role messagesTo of <class 'osaf.pim.mail.EmailAddress'>>              

mine

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09e4c>                 

modifiedOn

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09e0c>                 

monitors

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09ecc>                 

previousStamps

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09f0c>                 

private

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6c9c08c>                 

read

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09f6c>                 

references

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09eac>                 

sharedIn

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6c9c14c>                 

shares

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09f2c>                 

TPBDetailItemOwner

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09e8c>                 

TPBSelectedItemOwner

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6c9c06c>                 

vcardType

vCard type -- One(Text)

Typical vCard types are values like 'internet', 'x400', and 'pref'. Chandler will use this attribute when doing import/export of Contact records in vCard format.
Value:
<Role vcardType of <class 'osaf.pim.mail.EmailAddress'>>               

viewContainer

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6c9c02c>                 

watcherDispatch

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09eec>                 

watchers

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6c9c0cc>                 

watches

attribute descriptor
Value:
<chandlerdb.schema.c.CDescriptor object at 0xb6d09e6c>                 

Class Variable Details

__default_path__

Type:
ItemRoot
Value:
ItemRoot'userdata'                                                     

__kind_clouds__

Type:
dict
Value:
{'sharing': <application.schema.Cloud instance at 0xb7aabf2c>}         

__kind_info__

Type:
dict
Value:
{'description': "An item that represents a simple email address, plus \
all the info we might want to associate with it, like lists of message\
 to and from this address.\n\nExample: abe@osafoundation.org\n\nIssues\
:\n   Someday we might want to have other attributes.  One example mig\
ht be an 'is operational' flag that tells whether this address is stil\
l in service, or whether mail to this has been bouncing lately. Anothe\
r example might be a 'superceded by' attribute, which would point to a\
nother Email Address item.\n   Depending on how we end up using the 'e\
...                                                                    

Generated by Epydoc 2.1 on Mon Dec 19 13:33:40 2005 http://epydoc.sf.net