BASE64 to Plain Text

You want to get involved in the Opencaching Network?
RVRoadTrip

Can someone familiar with the code tell me how to have all system emails sent via plain text and not BASE64?  Here in the US, we do not need BASE64 and it is causing garbled emails for users.  Thanks!

Jerry
OCUS Admin
OlofL

I've not tested this myself, but try this:
In lib/clicompatbase.inc.php around line 47 change
mb_language('uni');
to
mb_language('en');
alamostrail

Sorry I can not help

[img]http://www.terracaching.es/image/originalopencaching.jpg[/img]
oliver

[quote="RVRoadTrip"]Can someone familiar with the code tell me how to have all system emails sent via plain text and not BASE64?  Here in the US, we do not need BASE64 and it is causing garbled emails for users. [/quote]

can you look in your source code (register.php) what mail-method is used?
mb_send_mail() or mail()
sp2ong

Hi,

OC PL/US/UK/SE/JP/NL

use:

mb_send_mail
Zuletzt geändert von sp2ong am 11.12.2010, 20:12, insgesamt 1-mal geändert.
oliver

Okay, switching to simple mail() command will help in this case, i think.
However, database content is stored in UTF-8 and you will get charset troubles (instant or in near future).

Maybe this is a easy solution:
http://www.php.net/manual/de/function.mail.php#27997
(the comment from gordon at kanazawa-gu dot ac dot jp)
sp2ong

But generally our OC PL users don't report problem which exist on OC US
oliver

[quote="sp2ong"]
But generally our OC PL users don't report problem which exist on OC US
[/quote]

Here in germany we have sometimes problems with mails caught by spam filters - but when they arrive, the mails are readable ...
... maybe the charset of e-mail template is wrong?
OlofL

oc.se has occasionally got reports from users of base64 mail not being decoded by their e-mail clients. It is rare, and for the same user it nearly always works. Perhaps something is wrong in the headers? The default for mb_send_mail is to send base64, the mb_langague should switch the encoding. Unless the mb_language statement has any effect, then switching to mail() should have, but then you will probably need to encode it yourself.
RVRoadTrip

The problem is the garbled emails. We have many users who report receiving them and who knows how many receive them but simply do not notify us and they do not return to the site. We do not wish to lose any "customers" due to this.
OlofL

Which version of php are you using? There seems to be differencens between versions regarding this.

Also, it would be great if you could post the full headers from a messed up mail, to try to figure out why the clients fails to handle it.
RVRoadTrip

This is the bug report thread about it on the OCUS site: http://forum.opencaching.us/viewtopic.php?f=31&t=199

For the full info on the PHP version, etc, see this page: http://www.opencaching.us/0.php

Sample email:

From: Opencaching US <notify@opencaching.us>
Reply-To: noreply@opencaching.us
Mime-Version: 1.0
Content-Transfer-Encoding: BASE64
Message-Id: <20101119010001.E766EC21A@opencaching.us>
Date: Fri, 19 Nov 2010 01:00:01 +0000 (UTC)
Return-Path: www-data@opencaching.us
X-OriginalArrivalTime: 19 Nov 2010 01:00:01.0927 (UTC) FILETIME=[185BF170:01CB8785]

SGVsbG8gaWRyYXRoZXJiZWludGhld29vZHMhDQoNClRoZSBmb2xsb3dpbmcgbmV3IGNhY2hlIGhh
cyBiZWVuIHBsYWNlZCB3aXRoaW4geW91cg0Kbm90aWZpY2F0aW9uIHJhZGl1czoNCg0KDQoxOC4x
MS4yMDEwLCAgVGFwZSB3b3JtIHBsYWNlZCB0aGUgbmV3IGNhY2hlOiAiSC5BLkMuIC1PcmllbnRl
ZXJpbmciLg0KRGlzdGFuY2U6IDc3LjggbWkgDQpUeXBlOiBNdWx0aWNhY2hlDQpTaXplOiBOb3Jt
YWwNCg0KTGluazogaHR0cDovL3d3dy5vcGVuY2FjaGluZy51cy92aWV3Y2FjaGUucGhwP3dwPU9V
MDE3MA0KDQoNClRvIGVuYWJsZSBvciBkaXNhYmxlIG5vdGlmaWNhdGlvbnMgYW5kIHRoZSBzaXpl
IG9mIHRoZSByYWRpdXMNCmluIHlvdXIgcHJvZmlsZSwgcGxlYXNlIHZpc2l0Og0KaHR0cDovL3d3
dy5vcGVuY2FjaGluZy51cy9teXByb2ZpbGUucGhwDQoNClRoYW5rIHlvdSENClRoZSBPQyBVUyBU
ZWFtIA0KDQo=
OlofL

I can see in the souce code that there is actually a line in the email header missing for notifications. The same header from
util.sec/email_sender/email_sender.php
$headers = "Content-Type: text/plain; charset=utf-8\n";
but this header is missing in
util.sec/notification/run_notify.php

I suspect that the a missing header could mess it up for some email-clients since they don't know that it is utf-8 that will arrive.

There is actually a mb_encode_mimeheader() missing in the send_email.php, but due to another bug it doesn't make any difference.

If you've got a test environment try exchanging the line (around 102) in runnotify with this:

$email_headers = "Content-Type: text/plain; charset=utf-8\r\n";
$email_headers .= 'From: "' . mb_encode_mimeheader( $mailfrom ) . '" <' . $mailfrom . '>';
$email_headers .= "Reply-To: "' . $mailfrom . '"\r\n";

If you cannot test it yourself, I can setup a test environment for this.

Exactly the same problem exists for util.sec/watchlist/runwatch.php and also for htdocs/chowner.php, so change it there also.
DudleyGrunt

Thanks, OlofL.  RVRoadTrip will need to be the one to implement this, but I'm definitely hoping it solves our problem at OCUS.
OlofL

I'll keep my fingers crossed - but the report I got when this happened at oc.se it was when a user sent a mail to another user, and in that case the headers seem ok.

But then, if this doesn't solve the problem, we still have the option to send plain text mails (with some development). However this cannot be used by anyone but you or .uk becacuse of all our strange letters.
Antworten