Submitted by : 127.0.0.1 at: 2005-12-28T13:16:22+00:00 (11 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

Had the following problems using mailout (some existed before 0.48.0)

When subscribed to entire Wiki / all edits, received two emails: one for the user and one for "edits"

After upgrading from 0.46.0 to 0.48.0 mailout stoppped working entirely

Could not unsubscribe from entire Wiki subscription

Emails generated for NO_ADDRESS_FOR_<username> (may be an installation issue, my Zwiki is installed in the Plone product directory)


comments:

Diff of the changes I made to make it work on site -- Wed, 28 Dec 2005 13:26:29 -0800 reply
Fair notice: i'm new to Zope, Plone, Python and ZWiki, but I was desperate to get ZWiki's mailout to work in my corporate intranet. The chances that these changes are ideal is low. I've documented them in the code and hopefully this will illuminate any possible bugs.

Original is in \ZWiki\Mail.py Generated with diff -u :

 --- \ZWiki\Mail.py     Thu Dec 01 22:07:16 2005
+++ \Plone_2\Data\Products\Zwiki\Mail.py        Wed Dec 28 16:05:47 2005
@@ -171,8 +171,9 @@
         With parent flag, manage the parent folder's subscriber list instead.
         With edits flag, show only subscribers who have requested all edits.
         """
-        return [s for s in stripList(self._getSubscribers(parent)) \
+        return [s.rstrip(':edits') for s in stripList(self._getSubscribers(parent)) \
                 if s.endswith(':edits') or not edits]
+                # stripped ":edits" to keep an extra email to "edits" from being generated in lotus notes

     def subscriberCount(self, parent=0, edits=0):
         """
@@ -241,6 +242,10 @@
                 if self.emailAddressFrom(s) == subscriber:
                     BLATHER('unsubscribed',subscriber,'from',self.id())
                     sl.remove(s)
+                    break
+                elif s == subscriber: # added elif so unsubscribe worked with username specified
+                    sl.remove(s)
+                    break
             self._setSubscribers(sl,parent)
             if not parent: self.index_object()
         if REQUEST:
@@ -374,9 +379,15 @@
         if not (subscriber and type(subscriber) == StringType):
             return None
         subscriber = re.sub(r':edits$','',subscriber)
+        # brute force: when <username>:edits was the only subscriber
+        # entry (no newline for re anchor?)
+        subscriber = subscriber.rstrip(':edits')
         if isEmailAddress(subscriber):
             return string.lower(subscriber)
-        elif self.inCMF() and not self.portal_membership.isAnonymousUser():#XXX ?
+        # removed the following because this always failed after edit notify
+        #  could this be because I have this installed in plone product directory?
+        #self.inCMF() and 
+        elif not self.portal_membership.isAnonymousUser():#XXX ?
             from Products.CMFCore.utils import getToolByName
             mtool = getToolByName(self, 'portal_membership')
             member = mtool.getMemberById(subscriber)

mail.py.diff

inCMF --Encolpe Degoute, Fri, 30 Dec 2005 01:12:44 -0800 reply
Why removing inCMF method instead of fixing it ?

inCMF --John Riley, Tue, 03 Jan 2006 07:52:13 -0800 reply
Because I'm not smart enough. I'm hoping that what I did to get it working on my intranet will light some lightbulbs for the smart people and it can be fixed correctly.

inCMF --Simon Michael, Tue, 03 Jan 2006 09:36:38 -0800 reply
Thanks for the report and code John. I'll look at your fixes if noone beats me to it.

inCMF --John Riley, Tue, 03 Jan 2006 09:45:25 -0800 reply
Thanks Simon. I'm subscribed to this page, so let me know if you need anything from me.

mailhost() --d2m, Sat, 07 Jan 2006 00:45:17 -0800 reply
Plone2.1.1 appearently uses Secure Mail Host as default MailHost object; Mail.MailSupport?.mailhost() needs to be changed to include that object type; changing line #600 to :: mhosts = folder.objectValues(spec=[Maildrop Host, Mail Host, 'Secure Mail Host']?) enables mailout in plone2.1.1 again

mailhost() --John Riley, Mon, 09 Jan 2006 05:18:28 -0800 reply
Interesting... which reminds me: When I installed this on Plone 2.1, I had to create a MailHost instance in the same ZMI (via plone "site setup" ATFolder? as the ZWiki before I could make it work. I'll be interested to see the "official" solution to all of this.

mailhost() --simon, Fri, 13 Jan 2006 06:46:29 -0800 reply
Thanks d2m, I just noticed your comment (fixed recently).

A wiki page anywhere in a plone site should see the site's mailhost, with this fix that should be working again.

(property change) release blocker --simon, Fri, 13 Jan 2006 08:27:51 -0800 reply
Severity: normal => serious

mailhost() --John Riley, Fri, 13 Jan 2006 09:25:14 -0800 reply
I don't know if this is useful, but I bumped into it while looking for answers to another problem: http://thread.gmane.org/gmane.comp.web.zope.plone.devel/10160. This appears to me to be relevant and discusses Plone developer plans in this area.

(property change) -- Mon, 16 Jan 2006 17:42:40 -0800 reply
Name: #1197 Numerous mailout problems with 0.48.0 on Windows and Plone 2.1.1 => #1197 Frank Johnson

(property change) --simon, Mon, 16 Jan 2006 18:46:14 -0800 reply
Name: #1197 Frank Johnson => #1197 Numerous mailout problems with 0.48.0 on Windows and Plone 2.1.1

update --simon, Thu, 19 Jan 2006 06:20:18 -0800 reply
A number of issues here:

Thank you John! I might release soon, feedback welcome.

update --John Riley, Thu, 19 Jan 2006 07:47:05 -0800 reply
Bullet point 1:

I suspect that it's because we have Lotus Notes as an email server. Once I made sure the "edits" part was stripped out, it was fine. I'm guessing that it is interpreting the colon as a multiple adressee separator. It may only be a problem with Notes, but a lot of companies do use Lotus Notes... I don't want do go past this because it is essentialy that this work for it to be usable for me. To be clear, what I THINK is happening is that if I subscribe to edits, an edit change results in sending out to (bcc) riley:edits@domain.com. Am I wrong? That is why I had to strip out the :edits. If I just don't get it, maybe you can explain it to me, but this fix worked for me and I don't know why ":edit" should show up in any To or bcc.

I'm not sure how to answer your question about "what do you have configured for mail_to?" I have a property defined: mail_replyto which is riley@domain.com

Bullet point 3:

It might be the source of the problem. I'm a complete newbie and I don't remember the exact sequence I used to get it working when fumbling around.

Bullet point 4:

So to clarify... it is indeed NOT the correct place to install the product? I've been conditioned to install all Plone products in the Plone product directory so that each Plone instance has a separate copy. The correct place would be <plone_install_directory>\Zope\lib\python\Products?

For my test case, I was the subscriber and I do indeed have my email configured for Plone and for my user account.

As for the rest, I'll install 0.49 and work through it again and report what I find. Thanks for the support.

update --simon, Thu, 19 Jan 2006 07:52:37 -0800 reply
Oops, the subscriberList fix was wrong. Like you, I misunderstood what rstrip does:

 >>> 'test'.rstrip(':edits')
 ''

Hooray for unit tests; even a mere 90 catch a lot of bugs.

update --Simon Michael, Thu, 19 Jan 2006 08:46:13 -0800 reply

I don't know why ":edit" should show up in any To or bcc.

Hi John.. don't worry, the intent of your fix was quite right, just the method was wrong (rstrip used incorrectly). I used re.sub instead.

I'm not sure how to answer your question about "what do you have configured for mail_to?" I have a property defined: "mail_replyto" which is " riley@domain.com"

Ok, a similar situation. I would put either "noreply@domain" or the wiki mailin address in mail_replyto. These properties are documented at http://zwiki.org/HowToSetUpMailOut and we probably need an update there. Here's the latest docstring for toHeader:

        Give the appropriate To: header for mail-outs from this page.

        When sending a mail-out, we put the subscribers in Bcc for privacy.
        Something is needed in To, what should we use ?
        1. if there is a mail_to property, use that
        2. if there is a mail_replyto or mail_from property, use that.
           NB if you use a real address and also subscribe with it you may
           get duplicates; also when using the wiki mailin address a copy
           is sent quickly back to the wiki, possible cause of conflicts
           leading to slow comments ? Not recently.
        3. or use ";" which is a legal "nowhere" address but causes messy cc
           header in replies

Bullet point 3:

It might be the source of the problem.

I'm guessing so.. I believe I've fixed #1199 now.

Bullet point 4:

So to clarify... it is indeed NOT the correct place to install the product?

I don't know the directory layout you have there, but if you can see Zwiki in the ZMI then Zope found the ZWiki dir and all is well. (Unless perhaps you have multiple versions in different places; you can check the version in /Control_Panel/Products.)

I really appreciate your efforts here.

PS --simon, Thu, 19 Jan 2006 09:54:45 -0800 reply
At your convenience, add yourself to the contributor list, http://zwiki.org/DarcsRepos has instructions.

update --John Riley, Thu, 19 Jan 2006 11:26:02 -0800 reply
Thanks Simon, I'm looking forward to trying the next release (after a full backup of course :-). I'll add myself to the list. I use numerous products in Plone for our intranet, but for serious collaborative documentation projects I prefer the Wiki approach.

One of the next things I'd like to investigate is what it will take to get Kupu integrated so there is a common "look and feel" throughout my Plone site. Right now I have one Wiki using ZWiki Structured Text and the other HTML / Epoz. Let's just say that Structured Text isn't popular :-)

update --Simon Michael, Thu, 19 Jan 2006 11:58:44 -0800 reply
That would be a great area to work on. I know a lot of us want kupu support. There is an issue page already. (I want fckeditor too).

mailhost() --simon, Thu, 19 Jan 2006 14:41:23 -0800 reply
For the record: Michael Haubenwallner reported the Secure Mailhost issue here, but I didn't see it and Tracy Reed got credit in the release notes instead. Sorry! :)

(property change) presumed all resolved --simon, Wed, 08 Feb 2006 16:28:01 -0800 reply
Status: open => closed

inCMF --EmmaLaurijssens, Thu, 20 Apr 2006 05:22:52 -0700 reply
For some unknown reason the inCMF call fails with "edits" mailouts. I am having issues right now. Comments-only messages are being mailed out correctly.

inCMF --EmmaLaurijssens, Thu, 20 Apr 2006 05:35:33 -0700 reply
See #1255