\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) { ?>
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
\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]."
\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 "
\n$i:
\n
$hrds

\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%",""$subject"",$sendmail_ok); $to2 = str_replace("<","&‹",$to); $to2 = str_replace(">","&›",$to2); $sendmail_ok = str_replace("%to%","$to2",$sendmail_ok); if ($DEBUG){ echo "message:
\n
$mail_header

\n"; } # # send mail # if(@mail($to,$subject,"",$mail_header)) { echo $sendmail_ok; } else{ echo "".$lang_text["wbm_sendmail_error"].""; } echo "
"; echo str_replace("\n","
",(htmlspecialchars($mail_content))); } else { echo $lang_text["wbm_sendmail_norecipient"]; } ?>
$from_email\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 = """.$res_abadress['name']."" <".$res_abadress['email'].">"; } elseif ($copy_to) { $writeTo = htmlspecialchars($copy_to); $writeTo = str_replace("\\","",$writeTo); } if (!$from_email_exists) { echo ltext(wmail_email); } else { ?>
\n"; } ?>

()
()
&nb sp; 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 ""; echo "\n"; } } } } ?>
$fn (".sizeFormat($ha['bytes']).")