Submitted by : dejongm at: 2008-01-24T13:27:58+00:00 (13 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

When setting out the mail-out feature, and subscribing to either the entire wiki or a wiki page, mail does not get sent to the subscriber if the subscriber is a CMF member and only their username is in the subscriber_list. ie: johndoe

However, if email addresses are added to the subscriber_list, email is sent out to those email addresses. ie:

No logs show up in event.log.


... --dejongm, Thu, 24 Jan 2008 13:28:45 +0000 reply

Category: general => user-mail Severity: normal => serious

... --dejongm, Thu, 24 Jan 2008 13:33:14 +0000 reply

Name: '#1400 Email-out to CMF (Plone) members not working' => '#1400 Email-out to Plone members not working'

Versions --EmmaLaurijssens, Thu, 24 Jan 2008 13:35:13 +0000 reply

Which versions (Zope/Plone/Zwiki) are you using? The issue looks an awful lot like #1255.

Version Info --dejongm, Fri, 25 Jan 2008 07:31:20 +0000 reply

Sorry. Guess that would be helpful:

  • Plone 3.0.5
  • CMF-2.1.0
  • Zope (Zope 2.10.5-final, python 2.4.3, linux2)
  • Python 2.4.3 (#1, Mar 14 2007, 18:51:08) [GCC 4.1.1 20070105 (Red Hat 4.1.1-52)]?
  • ZWiki ZWiki-0-60-0

Note that there is no attempt by zwiki to contact the mail server. There are no maillogs nor network traffic as verified by tcpdump.

more data --simon, Fri, 25 Jan 2008 08:02:14 +0000 reply

Looking at emailAddressFrom in, I see this is supposed to work. Are you saying that including a username in the subscriber list breaks mail sending ?

You might see more error details by setting your event.log severity to BLATHER or running zopectl fg.

More info --dejongm, Fri, 25 Jan 2008 13:20:43 -0800 reply

Including a username does not break mail sending. The user just doesn't receive email.

When updating the wiki while a username exists in the subscriber list I get the following while running zopectl fg:

/usr/lib/zope/lib/python/OFS/ DeprecationWarning: Products.ZWiki.ZWikiPage.ZWikiPage.manage_afterAdd is discouraged. You should use event subscribers instead.

I don't see this when there's just an email address.

I'll get BLATHER output to you a little later.

More info --dejongm, Fri, 25 Jan 2008 18:26:57 -0800 reply

After setting log level to BLATHER and updating the wiki, no logs were written to event.log. Anything else I can check?

fix (probably) --kcleong, Thu, 31 Jan 2008 02:18:40 -0800 reply

I had the same problem in ZWiki 0.59 using Plone 2.5.3. After debugging in ZWiki, I think I've got it fixed (at least for me). The function "emailAddressFrom" (line 378) retrieves the address using:

email = getattr(member,'email','') # line 409 in

The getattr returned nothing, getProperty returned a e-mail address from the member.:

email = member.getProperty('email','') # works!!

correction --kcleong, Thu, 31 Jan 2008 02:24:05 -0800 reply

"email = getattr(member,'email','')" located on line 401 not on line 409.

fix (probably) --kcleong, Thu, 31 Jan 2008 02:51:37 -0800 reply

Here's a modified version of that I used for debugging, it logs more info. It also uses the getProperty.

Fix --dejongm, Thu, 31 Jan 2008 19:47:38 -0800 reply

kcleong. Thanks for your fix. Works like a charm. Here's the patch for anyone who's looking:


Patch --dejongm, Thu, 31 Jan 2008 20:17:49 -0800 reply

Ok.. try again... ;)


but, --simon, Thu, 27 Mar 2008 09:13:59 -0700 reply

Something's wrong here. I've just had another report of this on #zwiki, with zwiki 0.58, and confirmation that the above fix resolved it. But, the Zwiki repo shows the code has been this way since 0.53. Also I haven't found a version with the "getProperty" usage shown in the diff above, also the line numbers above don't exactly match 0.60.

but, --Simon Michael, Thu, 27 Mar 2008 09:47:25 -0700 reply

Ugh, I need to read the full issue page. I see the diff was against a patched version, not Zwiki 0.60. Here's what happened I think:

Here is the fix I would like to use. Since I don't have time to test this on older or even current plone, this version is dumb and hopefully robust.:

~/src/ZWiki$ darcs diff -u
diff -rN -u old-ZWiki/ new-ZWiki/
--- old-ZWiki/ 2008-03-27 10:06:50.000000000 -0700
+++ new-ZWiki/ 2008-03-27 10:06:51.000000000 -0700
@@ -397,7 +397,11 @@
                 # NB doesn't work with CMFMember
                 if safe_hasattr(memberdata,'_members'):
                     member = memberdata._members.get(subscriber,None)
-            email = getattr(member,'email','')
+            # dumb robust fix for
+            try:
+                email = member.getProperty('email',getattr(member,'email',''))
+            except AttributeError:
+                email = getattr(member,'email','')
             email = ''
         return email.lower() or None

Now, how to get this into a release ? Remember that Zwiki <=0.59 supports only Plone <=2.5 and Zwiki >=0.60 supports only Plone >=3. Also, in RoadMap2008 discussions we decided we are dropping Plone support in Zwiki 2. This would seem to imply that we need a Zwiki-plone2.5 and Zwiki-plone3 branch for legacy fixes like this. Yikes, complications. What to do ?

fixed --simon, Thu, 01 May 2008 18:56:23 -0700 reply

Status: open => closed

dejongm: I see this was committed. To get the fix, please . Confirmation of this fix from people on different Plone versions would be helpful.