[Dev] Re: EmailAddress weirdness

Brian Kirsch bkirsch at osafoundation.org
Tue Jan 3 11:35:38 PST 2006


Hi Bryan,
 >The comments on Mail.EmailAddress' kindInfo suggest that the 
emailAddress attribute is allowed to contain the fullname as well as  
 >address itself;

Yes the comments are wrong and are legacy from an earlier version of the 
EmailAddress item. Only an email address should be in the emailAddress 
attribute ie. stearns at osafoundation.org. The fullName attribute will 
contain the users name if one is present i.e. Bryan Stearns. The two 
together form the complete address for sending 'Bryan Stearns 
<stearns at osafoundation.org>'.

Regarding the __unicode__ change. I am fine with it. But doing that 
would break the current detail view logic for detecting the 'me' address.

I think that having the 'me' calculation in the EmailAddress is the 
wrong place since 'me' is a Chandler concept and not related to the 
actual sending or storing of mail or any RFC.

So if you want to move the 'me' calculation to CPIA I  am very much +1.

There is currently an alternate method on EmailAddress which I use in 
the mail code since I need to bypass the 'me' calculation.
the method is:

 >>> formatedAddress = EmailAddress.format(emailAddressInstance)
 >>> print formatedAddress.encode('utf8')
 >>> 'Bryan Stearns <stearns at osafoundation.org>'


-Brian

Brian Kirsch - Email Framework Engineer
Open Source Applications Foundation
543 Howard St. 5th Floor
San Francisco, CA 94105
(415) 946-3056
http://www.osafoundation.org



Bryan Stearns wrote:

> Hi Brian,
>
> (I'm doing a bit of work on autocompletion of email addresses... I 
> build the match list by looking for EmailAddress items whose 
> emailAddress or fullName attributes start with what the user typed so 
> far.)
>
> The comments on Mail.EmailAddress's kindInfo suggest that the 
> emailAddress attribute is allowed to contain the fullname as well as 
> the address itself; this doesn't seem to work with the way 
> EmailAddress.__unicode__() is implemented: if this happens to be the 
> address returned by getCurrentMeEmailAddress, you end up with "me 
> <Bryan Stearns <stearns at osafoundation.org>>".
>
> Also, if I only put the address itself in emailAddress, and 'Bryan 
> Stearns' in fullName, I find that the getCurrentMeEmailAddress's 
> display string is always 'me <stearns at osafoundation.org>'. This looks 
> weird when I type 'Bryan' in the box and it matches 'me 
> <stearns at osafoundation.org>'.
>
> So, I'd like to suggest that EmailAddress.emailAddress should only be 
> a 'raw' address ('stearns at osafoundation.org'), and also that 
> __unicode__() be changed to only use messages.ME if both emailAddress 
> and fullName are u''.
>
> What do you think?
> ...Bryan


-- 
Brian Kirsch - Email Framework Engineer
Open Source Applications Foundation
543 Howard St. 5th Floor
San Francisco, CA 94105
(415) 946-3056
http://www.osafoundation.org



More information about the Dev mailing list