Font
Wiki:Tipp zum Debugging: use Data::Dumper; local $Data::Dumper::Useqq = 1; print Dumper \@var;
[thread]1753[/thread]

Confixx 3 - Webmail: Falsche Darstellung von Umlauten (page 3)

Reader: 1


<< |< 1 2 3 >| >> 26 entries, 3 pages
renee
 2005-09-09 16:07
#17564 #17564
User since
2003-08-04
14371 articles
ModeratorIn
[Homepage] [default_avatar]
stimmt... Wenn es als Variable gespeichert wird, waere meine Version nicht so hilfreich...
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
Alex
 2005-09-10 06:45
#17565 #17565
User since
2003-12-04
285 articles
BenutzerIn
[default_avatar]
Also in der email_config.php steht meines Erachtens nix von Bedeutung drin:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?
/* global Data: */
$cnf_PHP_AUTH_USER = $PHP_AUTH_USER;

/* POP3-Data: */
$cnf_server = "127.0.0.1";
$cnf_port = "110";
$cnf_user = $PHP_AUTH_USER;
$cnf_pass = $PHP_AUTH_PW;

/* DB-Data: */
$cnf_db_email = "email";
$cnf_db_ab = "webmail_ab";
$cnf_db_deffrom = "webmail_def_from";
$cnf_db_sign = "webmail_sign";
?>


Das grep ergibt:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ grep "8bit" * 
email_attach.php:header("Content-Transfer-Encoding: 8bit");
email_attach.php: header("Content-Transfer-Encoding: 8bit");
email_functions.php: $encodings = array(ENC7BIT => '7bit', ENC8BIT => '8bit', ENCBINARY => 'binary', ENCBASE64 => 'base64',
email_neu.php: /* This ContentTypes should not be encoded with base64 - use the given encode-Type e.g. "8bit" */
email_neu.php: $encodeType["text/plain"] = "8bit";
email_neu.php: $encodeType["text/html"] = "8bit";
email_neu.php: $encodeType["message/rfc822"] = "8bit";
email_neu.php: $encodeType["message/external-body"] = "8bit";
email_neu.php: $encodeType["message/http"] = "8bit";
email_neu.php: $encodeType["message/news"] = "8bit";
email_neu.php: $encodeType["message/partial"] = "8bit";
email_neu.php: $mail_header .= "\nContent-Transfer-Encoding: 8bit";
email_neu.php: $mail_header .= "\nContent-Transfer-Encoding: 8bit";


Sieht ganz gut aus, wobei ich da viel zu viel Leie bin um eine Bewusste Veränderung vornehmen zu können.

Vorschläge?
<center>Schönen Gruß, Alex
Mit dem Computer geht alles viel schneller - es dauert nur ein bißchen länger!
</center>
Alex
 2005-09-10 07:02
#17566 #17566
User since
2003-12-04
285 articles
BenutzerIn
[default_avatar]
Glaube ich habe was gefunden, in der email_attach.php:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
include_once("auth.php");
include("email_functions.php");
include("email_config.php");

/*
echo '<pre>';
print_r($_POST);
exit;
*/

/*
if (!$content) exit;

if ($charSet[$attachmentNumber]) $contentType[$attachmentNumber] .= ";\r\n\tcharset=\"$charSet[$attachmentNumber]\"";
if (isset($name[$attachmentNumber])) $contentType[$attachmentNumber] .= ";\r\n\tname=\"$name[$attachmentNumber]\"";

if ($contentTransferEncoding[$attachmentNumber] == "quoted-printable") $content[$attachmentNumber] = quoted_printable_decode($content[$attachmentNumber]);
if ($contentTransferEncoding[$attachmentNumber] == "base64") $content[$attachmentNumber] = base64_decode($content[$attachmentNumber]);

$contentDisposition = ($inLine[$attachmentNumber] == "true") ? "inline" : "attachment";
if (isset($fileName[$attachmentNumber])) $contentDisposition .= "; filename=$fileName[$attachmentNumber]";

header("Content-Type: $contentType[$attachmentNumber]");
header("Content-Transfer-Encoding: 8bit");
header("Content-Disposition: $contentDisposition");
echo $content[$attachmentNumber];
*/

if($id && e_connect())
{
$header = imap_headerinfo($mbox, $id);
$mail_uniq = md5($header->subject . $header->date);
if($mail_uniq != $uniq)
{
imap_close($mbox);
die("error");
}

$structure = imap_fetchstructure($mbox, $id);

$ha = headerArray($structure->parts[$part]);

if($ha['parameters']['charset'])
{
$ha['type'] .= ";\r\n\tcharset=\"" . $ha['parameters']['charset'] . "\"";
}
if($ha['parameters']['name'])
{
$ha['type'] .= ";\r\n\tname=\"" . $ha['parameters']['name'] . "\"";
}

$body = imap_fetchbody($mbox, $id, ($part+1));

if($ha['encoding'] == "quoted-printable")
{
$body = quoted_printable_decode($body);
}
if($ha['encoding'] == "base64")
{
$body = base64_decode($body);
}
$contentDisposition = $inline ? "inline" : "attachment";
if($ha['dparameters']['filename'])
{
$contentDisposition .= "; filename=" . $ha['dparameters']['filename'];
}
elseif ( strlen($filename) )
{
$contentDisposition .= "; filename=$filename";
}

//echo "<pre>"; print_r($ha);
//echo $contentDisposition;

header("Content-Type: " . $ha['type']);
header("Content-Transfer-Encoding: 8bit");
header("Content-Disposition: $contentDisposition");
echo $body;

imap_close($mbox);
}

?>


Nur, was tun?
<center>Schönen Gruß, Alex
Mit dem Computer geht alles viel schneller - es dauert nur ein bißchen länger!
</center>
renee
 2005-09-10 09:56
#17567 #17567
User since
2003-08-04
14371 articles
ModeratorIn
[Homepage] [default_avatar]
Ich würde eher die Sachen in email_neu.php ändern...
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
Alex
 2005-09-10 12:20
#17568 #17568
User since
2003-12-04
285 articles
BenutzerIn
[default_avatar]
Hhmmm, hat jemand die Muse sich dies hier anzugucken?
email_neu.php:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<?
#
#
#
$DEBUG=0;
#
#
#

if ($DEBUG){
echo "email_neu.php<br>\n";
}

include_once("auth.php");
include_once( "../include/class.SQLString.php" );
include_once( "../include/class.SQLInteger.php" );
include("email_functions.php");
include("email_config.php");
include("email_header.php");

$partscount =0;
if($forwardid && e_connect()){
$structure = imap_fetchstructure($mbox, $forwardid);
$structarr = headerArray($structure);
$partscount = sizeof($structure->parts);
}
if($sendmail) {
?>
<table class="tblbgcolor" align="left" border="1" cellpadding="3" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
<tr><td>
<?
/* This ContentTypes should not be encoded with base64 - use the given encode-Type e.g. "8bit" */
$encodeType["text/plain"] = "8bit";
$encodeType["text/html"] = "8bit";
$encodeType["message/rfc822"] = "8bit";
$encodeType["message/external-body"] = "8bit";
$encodeType["message/http"] = "8bit";
$encodeType["message/news"] = "8bit";
$encodeType["message/partial"] = "8bit";

if($from != "" && $to != "") {
$to = str_replace ("\\", "", $to);
$to = str_replace (";", ",", $to);
$cc = str_replace ("\\", "", $cc);
$cc = str_replace (";", ",", $cc);
$bcc = str_replace ("\\", "", $bcc);
$bcc = str_replace (";", ",", $bcc);
if($signatur) {
$query_sign = safe_query( "SELECT * FROM $cnf_db_sign WHERE alias = ?", TRUE, new SQLString($from) );
$sign = db_fetch_array($query_sign);
$content = $content."\n".$sign['signatur'];
}

#
# To exclude superfluous blank lines
#
$mail_content='';
$lines=explode("\n",$content);
foreach ($lines as $line){
$mail_content.=wordwrap(rtrim($line),72,"\n")."\n";
}

if(preg_match("/\n\n$/",$mail_content)){ // there are last blank lines
$lines=explode("\n",$mail_content);

while(!($line = array_pop($lines)) && (count($lines)>0)){
/* pop blank lines*/
}
array_push($lines,$line);
$mail_content=implode("\n",$lines);
}

#
# end to exclude superfluous blank lines
#

$mail_header = "From: $from";
switch($priority) {
case "1":
$mail_header .= "\nX-Priority: 1\nImportance: High\nX-MSMail-Priority: High";
break;
case "3":
$mail_header .= "\nX-Priority: 3\nImportance: Normal\nX-MSMail-Priority: Normal";
break;
case "5":
$mail_header .= "\nX-Priority: 5\nImportance: Low\nX-MSMail-Priority: Low";
break;
}
if($priority){
$mail_header .= "\nX-MimeOLE: Produced by Confixx WebMail".
"\nX-Mailer: Confixx WebMail (like SquirrelMail)";
/* need for spamassassin */
}
$mail_header .= "\nCc: $cc";
$mail_header .= "\nBcc: $bcc";

if($DEBUG){
echo "attachment_name: $attachment_name<br>\n";
}
$mail_attach='';
$boundary = strtoupper(md5(uniqid(time())));
#
# forward attachment
#
for($i=0; $i<=$partscount; $i++){
if ($attachs[$i]){
if ($DEBUG){
echo "$i: ".$attachs[$i]."<br>\n";
}
$part=$structure->parts[$i];
if (is_object($part)){
$ha = headerArray($part);
$fn = '';
if($ha["dparameters"]["filename"]){
$fn = $ha["dparameters"]["filename"];
}
if($ha["parameters"]["name"]){
$fn = $ha["parameters"]["name"];
}
if(!$fn){
$fn = $lang_text["wbm_unknown"];
}
if ($fn==$attachs[$i]){
if ($body = imap_fetchbody($mbox, $forwardid, ($i+1))){
$hdrs = "\n--$boundary";
$hdrs .= "\nContent-Type: ".$ha["type"]."; name=\"$fn\"";
$hdrs .= "\nContent-Transfer-Encoding: ".$ha["encoding"];
$hdrs .= "\nContent-Disposition: attachment; filename=\"$fn\"";
$hdrs .= "\n\n";
if ($DEBUG){
print_r($ha);
echo "<br>\n$i:<br>\n<pre>$hrds</pre><br>\n";
}
$mail_attach.=$hdrs;
$mail_attach.=$body;
}
}
}
}
}

if($attachment_name != "") {
if ($fh=fopen($attachment,"r")){
$attach_content = fread($fh,filesize($attachment));
fclose($fh);
}
if($encodeType["$attachment_type"]) {
$encode = $encodeType["$attachment_type"];
} else {
$encode = "base64";
$attach_content = chunk_split(base64_encode($attach_content));
}
$mail_attach .= "\n--$boundary";
$mail_attach .= "\nContent-Type: $attachment_type; name=\"$attachment_name\"";
$mail_attach .= "\nContent-Transfer-Encoding: $encode";
$mail_attach .= "\nContent-Disposition: attachment; filename=\"$attachment_name\"";
$mail_attach .= "\n\n$attach_content";
}

if(!$mail_attach){
$mail_header .= "\nContent-Type: text/plain";
$mail_header .= "\nContent-Transfer-Encoding: 8bit";
$mail_header .= "\n$mail_content";
} else {
$mail_header .= "\nMIME-Version: 1.0";
$mail_header .= "\nContent-Type: multipart/mixed; boundary=$boundary";
$mail_header .= "\n\nThis is a multi-part message in MIME format -- Dies ist eine mehrteilige Nachricht im MIME-Format";
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: text/plain";
$mail_header .= "\nContent-Transfer-Encoding: 8bit";
$mail_header .= "\n\n$mail_content";
/* Attachment */
$mail_header .=$mail_attach;
$mail_header .= "\n--$boundary--";
}
/* Send email */
$sendmail_ok = $lang_text["wbm_sendmail_ok"];
$sendmail_ok = str_replace("%subject%","&quot;$subject&quot;",$sendmail_ok);
$to2 = str_replace("<","&‹",$to);
$to2 = str_replace(">","&›",$to2);
$sendmail_ok = str_replace("%to%","$to2",$sendmail_ok);

if ($DEBUG){
echo "message:<br>\n<pre>$mail_header</pre><br>\n";
}
#
# send mail
#
if(@mail($to,$subject,"",$mail_header)) {
echo $sendmail_ok;
} else{
echo "<b>".$lang_text["wbm_sendmail_error"]."</b>";
}

echo "<hr noshade size=1>";
echo str_replace("\n","<br>",(htmlspecialchars($mail_content)));

} else {
echo $lang_text["wbm_sendmail_norecipient"];
}
?>
</td></tr>
<tr><td align="right"><? echo std_button(ltext("wbm_buttonnext"), 'email_postfach.php'); ?></td></tr>
</table>
<?
} else {
$query_from = safe_query( "SELECT * FROM $cnf_db_email WHERE pop3 = ?", TRUE, new SQLString($cnf_PHP_AUTH_USER) );
$from_email_exists = 0;
while($from = db_fetch_array($query_from)) {
$from_email_exists = 1;
if ($from['prefix'] == "*") {
$from_email = "catchall@".$from['domain'];
} else {
$from_email = $from['prefix']."@".$from['domain']; }
$query_deffrom = safe_query( "SELECT email FROM $cnf_db_deffrom WHERE pop3 = ? AND email = ?", TRUE,
new SQLString($cnf_PHP_AUTH_USER), new SQLString($from_email) );
$deffrom = db_fetch_array($query_deffrom);
if($deffrom['email'] == $from_email) { $deffrom_select = " selected"; } else { $deffrom_select = ""; }
$from_list .= "<option value=\"$from_email\"$deffrom_select>$from_email</option>\n";
}
if($ab_id) {
$query_abadress = safe_query( "SELECT name, email FROM $cnf_db_ab WHERE ident = ?", TRUE, new SQLInteger($ab_id) );
$res_abadress = db_fetch_array($query_abadress);
$writeTo = $abadress = "&quot;".$res_abadress['name']."&quot; &lt;".$res_abadress['email']."&gt;";
} elseif ($copy_to) {
$writeTo = htmlspecialchars($copy_to);
$writeTo = str_replace("\\","",$writeTo);
}
if (!$from_email_exists) {
echo ltext(wmail_email);
} else {
?>
<form name="mail_form" method="post" enctype="multipart/form-data" action="email_neu.php">
<input type="hidden" name="sendmail" value="1">
<?php
if ($forwardid){
echo "<input type=\"hidden\" name=\"forwardid\" value=\"$forwardid\">\n";
}
?>

<table class="tblbgcolor" align="left" border="1" cellpadding="3" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
<tr>
<td valign="top"><? echo $lang_text["wbm_sender"] ?></td>
<td>
<select name="from"><? echo $from_list ?></select><br>
(<a class="data" href="javascript:setStdEmail()"><? echo $lang_text["wbm_deffrom_set"] ?></a>)</td>
</td>
</tr><tr>
<td><? echo $lang_text["wbm_recipient"] ?></td>
<td><input type="text" size="40" name="to" value="<? echo $writeTo ?>"> <a class="data" href="javascript:showAdBook('to')"><? echo $lang_text["wbm_getad"] ?></a></td>
</tr><tr>
<td><? echo $lang_text["wbm_cc"] ?></td>
<td><input type="text" size="40" name="cc" value=""> <a class="data" href="javascript:showAdBook('cc')"><? echo $lang_text["wbm_getad"] ?></a></td>
</tr><tr>
<td><? echo $lang_text["wbm_bcc"] ?></td>
<td><input type="text" size="40" name="bcc" value=""> <a class="data" href="javascript:showAdBook('bcc')"><? echo $lang_text["wbm_getad"] ?></a></td>
</tr><tr>
<td><? echo $lang_text["wbm_subject"] ?></td>
<td><input type="text" size="40" name="subject" value="<? echo $copy_subject ?>"></td>
</tr><tr>
<td><? echo $lang_text["wbm_text"] ?></td>
<td><textarea name="content" cols="58" rows="10" wrap=physical><? echo $copy_body ?></textarea></td>
</tr><tr>
<td><? echo $lang_text["wbm_sign_add"] ?></td>
<td>
<table width="100%"><tr>
<td><input type=checkbox name=signatur value=1 checked> (<a class="data" href="javascript:showSignatur()"><? echo $lang_text['wbm_sign_showedit'] ?></a>)</td>
<? if($copy_mail) { ?>
<td align="right"><? echo std_button(ltext("wmb_zitat"), 'javascript:document.mail_form.content.value += document.mail_form.copy_body.value;void(0)'); ?></td>
<? } ?>
</tr></table>
</td>
</tr><tr>
<td><? echo $lang_text["wbm_prio"] ?></td>
<td>
<select name="priority">
<option value="3"><? echo $lang_text["wbm_prio_normal"] ?></option>
<option value="1"><? echo $lang_text["wbm_prio_high"] ?></option>
<option value="5"><? echo $lang_text["wbm_prio_low"] ?></option>
</select>
</td>
</tr><tr>
<td><?php echo $lang_text["wbm_attachment"]; ?> </td>
<td>
<table> &nb
sp;
<?php
#
# forwarding of attachments
#
if( ($partscount > 1) ||
($structure->type == TYPEMULTIPART && $structarr["parameters"]["boundary"]) ){
for($i=1; $i<=$partscount; $i+=2){
for($j=$i; $j<=$i+1; $j++){
$ha = headerArray($structure->parts[$j]);
if($ha){
$fn = '';
if($ha["dparameters"]["filename"]){
$fn = $ha["dparameters"]["filename"];
}
if($ha["parameters"]["name"]){
$fn = $ha["parameters"]["name"];
}
if(!$fn){
$fn = $lang_text["wbm_unknown"];
}
echo "<tr><td><input type=\"checkbox\" name=\"attachs[$j]\" value=\"$fn\" checked> $fn </td>";
echo "<td>(".sizeFormat($ha['bytes']).")</td></tr>\n";
}
}
}
}
?>
<tr><td><input type="file" size="20" name="attachment"></td><td></td><tr>
</table>
</td>
</tr><tr>
<td>&nbsp;</td>
<td><? echo std_button(ltext("wmb_send"), 'javascript:document.forms[0].submit()'); ?></tr><tr>
</table>
<? if($copy_mail) { ?>
<input type="hidden" name="copy_body" value="<? echo $copy_body; ?>">
</form>
<? } ?>
</form>
<? } ?>

<?
}

include("email_footer.php");
?>


Ideen, Vorschläge?
<center>Schönen Gruß, Alex
Mit dem Computer geht alles viel schneller - es dauert nur ein bißchen länger!
</center>
renee
 2005-09-11 02:12
#17569 #17569
User since
2003-08-04
14371 articles
ModeratorIn
[Homepage] [default_avatar]
So gut kenne ich mich auch nicht aus, aber probier es doch einfach mal, wenn Du alle "8bit" durch das "quoted-printable"...
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
<< |< 1 2 3 >| >> 26 entries, 3 pages



View all threads created 2005-09-08 20:54.