Forums | Mahara Community

Support /
Emails 'broken' with extraneous spaces


anonymous profile picture
Account deleted
Posts: 5

05 December 2012, 1:19

Hi,

I'm not sure if this is a bug or a LAMP configuration issue so I thought I'd ask here before posting to the Bug Tracker.

Basically Mahara is sending out broken emails by which I mean that spaces are being (seemingly) 'randomly' inserted into emails sent out from Forum posts etc

This issue is occuring with both our Mahara 1.5.1 (Prod) and Mahara 1.6.2 (Test) installations. It did not occur on our previous Mahara 1.4.0 installation. 

The link below appears to relate to a similar problem (but not in Mahara).

http://www.jeremytunnell.com/posts/really-hairy-problem-with-seemingly-random-crlf-and-spaces-inserted-in-emails

I haven't found any other instance of other Mahara users reporting this issue but as the link suggests that it’s related to encoding, I’ve tried to resolve this by changing the encoding method in the email_user function in lib.user.php to "base64" but this didn't appear to make any difference.  

I've only seen it happen with Forum Post emails - presumably because they're sent as HTML?

Here's an example

For um: General discussion (ML Test Group)

Why are my emails getting broken?

R eply to this post online

Unsubscri be from this forum

Please do not reply to this mes sage.

Here’s the source HTML for the above email, illustrating that the problem appears to relate to line feeds.

<div style="padding: 0.5em 0; border-bottom: 1px solid #999;"><strong>For

um: General discussion (ML Test Group)</strong></div>

<div style="ma
rgin: 1em 0;"><p>Why are my emails getting broken?</p></div>

<div styl
e="font-size: smaller; border-top: 1px solid #999;">
<p>R
eply to this post online
</p>
<p>Unsubscri
be from this forum
</p>
</div>

<p>Please do not reply to this mes
sage.</p>

Has anyone else come across this and if so did you find a fix? We need to resolve this a.s.a.p. as it sometimes breaks the R eply to this post online and Unsubscri be from this forum hyperlinks which will affect utilisation of the forums.

Thanks in advance,

Mike

anonymous profile picture
Account deleted
Posts: 197

05 December 2012, 15:28

Hi Mike,

This looks like it's the same bug as here: https://bugs.launchpad.net/mahara/+bug/691366

We have not been able to fix that bug since we haven't been able to reproduce it; we cannot just randomly commit changes without being able to see what they do! If you can reproduce and you know how to tinker a bit with php, then you could help us fix this :)

Our developer info is at https://wiki.mahara.org/index.php/Developer_Area but the important pages are:

https://wiki.mahara.org/index.php/Developer_Area/Developer_Tools and

https://wiki.mahara.org/index.php/Developer_Area/Contributing_Code

Good luck!
Melissa

anonymous profile picture
Account deleted
Posts: 5

11 December 2012, 1:32

Melissa,

Thanks for the reply.

I do suspect that this might be more to do with LAMP server configuration than Mahara code per se, simply because not many Mahara users seem to report this problem (and you can't reproduce!). 

If we manage to resolve this we will of course update this thread to let you all know what the solution was.

Regards,

Mike

anonymous profile picture
Account deleted
Posts: 5

18 December 2012, 5:11

Just to report back that we did manage to fix this in the end.

It actually turned out to be really simple to resolve (once you know how) because basically all we needed to do was:-

(1) Log on to Mahara as Admin

(2) Go to Site Administration|Site Options|Email Settings page

(3) Populate the SMTP host field with 'localhost'

(4) Populate and SMTP port field with '25' 

(5) Click the Update Site Options button

This resolved it instantly for us. I've looked through most of the installation documents on here but didn't find anything that specifically stated that it was necessary to add these values so it might be worth updating them to that effect (assuming that this issue isn't specific to our LAMP Server configuration)?

I'd really like to have a better understanding of why, technically this has resolved the issue so if anyone can shed any more light on this it would be much appreciated but the main thing from our point of view is that it's fixed.

Regards,

Mike

 

 

Nathan Friend's profile picture
Posts: 12

28 February 2013, 0:47

Thank you Mike this helpd me out.  We were experience the same problem after upgrading  from 1.4.1 to 1.6.2, following your sugestions fixed the broken e-mails for us.

Cheers,

 

Nathan.

anonymous profile picture
Account deleted
Posts: 5

08 May 2013, 23:59

Nathan,

Really pleased the work-around worked for you. It's also useful to know that it's still present in 1.6.2.

Cheers,

Mike

Aaron Wells's profile picture
Posts: 896

28 February 2013, 14:39

Hi Mike,

I'm not sure if you're subscribed to https://bugs.launchpad.net/mahara/+bug/691366 , so I wanted to let you know I posted a comment there asking if you could provide some information about your environment, to help us solve this bug.

Also, thanks for sharing that workaround!

Cheers,

Aaron

anonymous profile picture
Account deleted
Posts: 5

08 May 2013, 23:57

Aaron,

I have updated the bugs.launchpad post with the information you requested. Apologies for the delay - I've been out of the office for a couple of months.

Regards,

Mike

 

 

Aaron Wells's profile picture
Posts: 896

21 May 2013, 15:35

Thanks for the reply, Mike. Better late than never. Laughing

Cheers,
Aaron

A post by Account deleted was deleted

12 results