Description

Due to the different linebreak characters used in MoinMoin 1.3, the subscription mails in general and the diff sections in particular are nearly unreadable at least in some mailreaders, e.g. Microsoft Outlook. Also the URL used to be recognized by the mailreader automagically and turned into a link because it was on a separate line.

Steps to reproduce

  1. use a stupid windows mailreader that does not understand unix linebreak characters and read a subscription mail from this wiki (or just see example).

Example

These are just two excerpts from subscription mails I received from this wiki:

Before (17. April 2004)

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "MoinMoin" for change notification.

The following page has been changed by ThomasWaldmann:
http://moinmoin.wikiwikiweb.de:8000/AccessControlList

The comment on the change is:
cleanup

------------------------------------------------------------------------------
   * "see-right". Even if a user is not allowed to read a wiki page, she still sees links to it on other wiki pages. This could be too much spoiler (e.g. in a Star Wars wiki, a page called EpisodeNr6/PalpatineDies). Consequences: '''censored''' (black box?) instead of wiki pagename on other pages
- 
- = Other proposals =
-  * /AlternativeProposal (adds: other syntax, expiry, page owner)
-  * /SecondAlternativeProposal (adds: nice GUI, ACLs not stored in page text)

Now

Dear Wiki user,
You have subscribed to a wiki page or wiki category on "MoinMoin" for change notification.
The following page has been changed by 193.205.82.101:http://moinmoin.wikiwikiweb.de/MacroMarket
------------------------------------------------------------------------------  || [attachment:ImageLink-1.3.1-4.py ImageLink.py] || ReimarBauer, MarcinZalewski||ReimarBauer, MarcinZalewski|| 1.3 ||n/a || /ImageLink||  || [attachment:Hits-1.3.1-2.py Hits.py] || ReimarBauer||ReimarBauer|| 1.3 ||n/a || ["/Hits"]||  || latex macro (for code see url) || JohannesBerg ||JohannesBerg || 1.3 || around patch-500 || http://johannes.sipsolutions.net/wiki/Projects/new-moinmoin-latex ||+ || [attachment:WordCount.py WordCount 0.1] || WalterAprile || WalterAprile || 1.3 || WordCount ||+     === Release 1.2 ===  ||'''Macro'''||'''Author'''||'''Email'''||'''Designed for MoinMoin Release...'''||'''... and Revision...'''||'''Sample'''||

Details

This Wiki.

Workaround

Upgrade to Outlook 2003. Or apply the patch - see below.

Discussion

Most of you developers may think "who cares", as you are free to use other operating systems or better mailreaders. However, like it or not, there is a significant part of users in the "real world" who have to use windows systems and microsoft products (e.g. due to company standards). I do not see a good reason to let them pay for the choices of their bosses. And, as it has worked "as expected" before, I believe that this can be declared as a proper bug. I will definitely have to patch it for my users during migration of our internal wiki farm, however I'd prefer to get an official patch.

I am a Windows user. I am an Outlook user. I know the RFCs. And I cannot reproduce this problem. Just to clarify this: a mail may never contain a single "unix-linebreak"1. I hope that MoinMoin does not generate such mails.

Please specifiy your Outlook version.

Please attach the full source of the mails before/after as tarball/zip to this page. (I don't remember how you do this in outlook, but its possible.)

Here is the source of a mail I got from this wiki:

Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
From: wiki@wikiwikiweb.de
To: wiki@wikiwikiweb.de
Date: Thu, 17 Feb 2005 21:48:34 -0000
Message-ID: <20050217214834.28703.89230@localhost>
Subject: [MoinMoin] Update of "MoinMoinBugs/FreeParentLinksAreBroken" by
 AlexanderSchremmer



RGVhciBXaWtpIHVzZXIsCgpZb3UgaGF2ZSBzdWJzY3JpYmVkIHRvIGEgd2lraSBwYWdlIG9yIHdp
a2kgY2F0ZWdvcnkgb24gIk1vaW5Nb2luIiBmb3IgY2hhbmdlIG5vdGlmaWNhdGlvbi4KClRoZSBm
b2xsb3dpbmcgcGFnZSBoYXMgYmVlbiBjaGFuZ2VkIGJ5IEFsZXhhbmRlclNjaHJlbW1lcjoKaHR0
cDovL21vaW5tb2luLndpa2l3aWtpd2ViLmRlL01vaW5Nb2luQnVncy9GcmVlUGFyZW50TGlua3NB
cmVCcm9rZW4KCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAqIFsiLi4vIl0KICAKICBJZiBpdCB3
b3JrZWQgaW4gMS4xLCB3ZSBzaG91bGQgdHJ5IHRvIG1ha2UgaXQgd29yayBhZ2FpbiBpbiAxLjMu
IEluIDEuNCB3ZSBzaG91bGQgcmVkZXNpZ24gdGhlIHN5bnRheCwgc3BlY2lmaWNhbGx5IHRoZSBs
aW5rIHN5bnRheCB3aGljaCBpcyBhIGJpZyBtZXNzLiAtLSBOaXJTb2ZmZXIgW1tEYXRlVGltZSgy
MDA1LTAyLTE3VDIxOjIxOjA5WildXQorICBJdCB3YXMgdmVyeSBvZmZpY2lhbDogaXQgd2FzIGlu
IHRoZSBtYWluIGRvY3VtZW50YXRpb24uCiAgCiAgPSBQbGFuID0KICAjIyBUaGlzIHBhcnQgaXMg
Zm9yIE1vaW5gYE1vaW4gZGV2ZWxvcGVyczoK

Using base64 to decode this text give this result:

>>> import base64
>>> s = file('src').read()
>>> base64.decodestring(s)
'Dear Wiki user,\n\nYou have subscribed to a wiki page or wiki category on "MoinMoin" for change notification.\n\nThe following page has been changed by AlexanderSchremmer:\nhttp://moinmoin.wikiwikiweb.de/MoinMoinBugs/FreeParentLinksAreBroken\n\n------------------------------------------------------------------------------\n   * ["../"]\n  \n  If it worked in 1.1, we should try to make it work again in 1.3. In 1.4 we should redesign the syntax, specifically the link syntax which is a big mess. -- NirSoffer [[DateTime(2005-02-17T21:21:09Z)]]\n+  It was very official: it was in the main documentation.\n  \n  = Plan =\n  ## This part is for Moin``Moin developers:\n'

It seems that we do send newlines - and not CRLF.

RFC 2822 section 2.1 General description (http://www.faqs.org/rfcs/rfc2822.html) says:

   Messages are divided into lines of characters.  A line is a series of
   characters that is delimited with the two characters carriage-return
   and line-feed; that is, the carriage return (CR) character (ASCII
   value 13) followed immediately by the line feed (LF) character (ASCII
   value 10).  (The carriage-return/line-feed pair is usually written in
   this document as "CRLF".)

email.MIMEText does not change the text line endings. This looks like a bug in Python email package, as one would expect that when you create a MIMEText you will get a correct text/plain.

This patch fix the problem:

--- orig/MoinMoin/util/mail.py
+++ mod/MoinMoin/util/mail.py
@@ -37,6 +37,8 @@
     mail_from = kw.get('mail_from', '') or cfg.mail_from
 
     # Create a text/plain message
+    # Replace LF with CRLF, required by RFC2822
+    text = text.replace(u'\n', u'\r\n')
     msg = MIMEText(text.encode(config.charset), 'plain', config.charset)
     msg['From'] = mail_from
     msg['To'] = mail_from

Plan


CategoryMoinMoinBugFixed CategoryRelease1.3.4

  1. See RFC 822 or 2822. (1)

MoinMoin: MoinMoinBugs/SubscriptionMailLooksBadInOutlook (last edited 2007-10-29 19:09:28 by localhost)