tiki-mailin-code.php 19.3 KB
Newer Older
1
<?php
changi67's avatar
changi67 committed
2 3 4
/**
 * @package tikiwiki
 */
5
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
changi67's avatar
changi67 committed
6
// 
7 8
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
changi67's avatar
changi67 committed
9 10
// $Id$

changi67's avatar
changi67 committed
11 12
require_once ('tiki-setup.php');
$access->check_script($_SERVER["SCRIPT_NAME"], basename(__FILE__));
13
include_once ('lib/mailin/mailinlib.php');
14
require_once ("lib/webmail/net_pop3.php");
15 16
include_once ("lib/mail/mimelib.php");
include_once ("lib/webmail/tikimaillib.php");
17
include_once ('lib/wiki/wikilib.php');
18 19 20 21 22 23 24

global $prefs;

$is_html = false;
$show_inlineImages = 'n';
$can_addAttachment = 'n';

25 26 27 28 29
/**
 * @param $output
 * @param $out
 * @param $page
 * @param $user
30
 * @param $body
31
 */
32
function mailin_check_attachments(&$output, &$out, $page, $user)
33
{
34
	global $wikilib, $show_inlineImages, $can_addAttachment;
changi67's avatar
changi67 committed
35
	$cnt = 0;
36 37 38 39 40 41 42 43
	
	if ($can_addAttachment !== 'y') {
		return;
	}
	
	if (!isset($output["parts"])) {
		return;
	}
44 45
	
	for ($it = 0, $count_outputparts = count($output['parts']); $it < $count_outputparts; $it++) {
changi67's avatar
changi67 committed
46 47 48
		if (isset($output["parts"][$it]["d_parameters"]["filename"])) {
			$attachmentPart = $output["parts"][$it];
			$fileName = $attachmentPart["d_parameters"]["filename"];
49 50
			if (isset($attachmentPart["ctype_primary"])) $fileType = $attachmentPart["ctype_primary"] . "/" . $attachmentPart["ctype_secondary"];
			else $fileType = "";
changi67's avatar
changi67 committed
51
			$fileData = $attachmentPart["body"];
52 53
			$fileSize = strlen($fileData);
			$wikilib->wiki_attach_file($page, $fileName, $fileType, $fileSize, $fileData, "attached by mail", $user, "");
changi67's avatar
changi67 committed
54
			$cnt++;
55 56 57 58 59 60 61 62 63 64
			
			if($show_inlineImages === 'y') {
				$contentId = $attachmentPart['header']['content-id'];
				if (!empty($contentId)) {
					$contentId = str_replace("<", "", $contentId);
					$contentId = str_replace(">", "", $contentId);

					mailin_insert_inline_image($body, $contentId, $attId, $page);
				}
			}
changi67's avatar
changi67 committed
65 66 67 68
		}
	}
	$out.= $cnt;
	$out.= " attachment(s) added<br />";
69
}
70 71 72 73 74 75

/**
 * @param $output
 * @return string
 */
function mailin_get_body($output)
76
{
77 78 79 80
	if (isset($output['text'][0])) $body = $output["text"][0];
	elseif (isset($output['parts'][0]) && isset($output['parts'][0]["text"][0])) $body = $output['parts'][0]["text"][0];
	elseif (isset($output['parts'][0]) && isset($output['parts'][0]['parts'][0]) && isset($output['parts'][0]['parts'][0]["text"][0])) $body = $output['parts'][0]['parts'][0]["text"][0];
	else $body = '';
changi67's avatar
changi67 committed
81
	return $body;
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
/**
 * @param $output
 * @return HTML string
 */
function mailin_get_html($output)
{
	if (isset($output['html'][0])) {
		$html = $output["html"][0];
	} elseif (isset($output['parts'][1]) && isset($output['parts'][1]["html"][0])) {
		$html = $output['parts'][1]["html"][0];
	} elseif (isset($output['parts'][0]) && isset($output['parts'][0]['parts'][1]) && isset($output['parts'][0]['parts'][1]["html"][0])) {
		$html = $output['parts'][0]['parts'][1]["html"][0];
	} elseif (isset($output['parts'][0]) && isset($output['parts'][0]['parts'][0]) && isset($output['parts'][0]['parts'][0]['parts'][1]) && isset($output['parts'][0]['parts'][0]['parts'][1]["html"][0])) {
		$html = $output['parts'][0]['parts'][0]['parts'][1]["html"][0];
	} else {
		$html = '';
	}
	return $html;
}

/**
 * This is function mailin_extract_inline_images
 * NOTE: Will force the use the HTML source as the page body
 * HTML is required in order to be able to identify the image in the email.
 *
 * @param string $pageName The name of the wiki page
 * @param mixed $output Array of email values
 * @param string $body The email body. Will be used as the wiki page body
 * @param string $out Log output
 * @param string $user The user; for logging purposes
 * @return nothing
 *
 */
function	mailin_extract_inline_images($pageName, $output, &$body, &$out, $user)
{
	global $wikilib, $is_html, $show_inlineImages, $can_addAttachment;
	
	if($show_inlineImages !== 'y') {
		return;
	}
	if ($can_addAttachment !== 'y') {
		return;
	}
	
	$cnt = 0;
	$errCnt = 0;
	if (!isset($output["parts"])) {
		return;
	}

	// Only for HTML email
	$html = mailin_get_html($output);
	if(empty($html)) {
		$out.= "inline attachments are only supported for email in html format<br />";
		return;
	}
	
	// Replace the text version, and use use the HTML as the page body
	
	// Locate the HTML
	$matches = array();
	preg_match("/<body[^>]*>(.*?)<\/body>/is", $html, $matches);
	$htmlBody = $matches[1];
	if (empty($htmlBody)) {
		// Assume the html is the body
		$htmlBody = $html;
	}
	
	// Get rid of "id" attributes, as they may cause a failure to load the image
	$htmlBody = str_ireplace('id=', 'xid=', $htmlBody);
	
	// Assign the HTML as the new body
	$body = $htmlBody;
	$is_html = true;

	// Locate the page with inline attachments	
	$activeParts = array();
	if (isset($output["parts"][1]) && isset($output["parts"][1]['ctype_parameters']['name'])) {
		$activeParts = $output["parts"];
	} elseif (isset($output["parts"][0]['parts'][1]["type"]) && $output["parts"][0]['parts'][1]["type"] == 'text/html') {
		$activeParts = $output["parts"][0]['parts'][1];
	}
	
	// Scroll the page attachments
	for ($it = 0, $count_outputparts = count($activeParts); $it < $count_outputparts; $it++) {
		if (isset($activeParts[$it]["ctype_parameters"]["name"])) {
			$attachmentPart = $activeParts[$it];
			$fileName = $attachmentPart["ctype_parameters"]["name"];
			if (isset($attachmentPart["type"])) {
				$fileType = $attachmentPart["type"];
			} else {
				$fileType = "";
			}
			
			// Only process images
			if(strpos($fileType,'image/',0) === false) {
				$errCnt++;
				continue;
			}
			
			// Process inline image
			$fileData = $attachmentPart['body'];
			$fileSize = function_exists('mb_strlen') ? mb_strlen($fileData, '8bit') : strlen($fileData);
			$attId = $wikilib->wiki_attach_file($pageName, $fileName, $fileType, $fileSize, $fileData, "inline image by mail", $user, "");
			$cnt++;
		
			$contentId = $attachmentPart['header']['content-id'];
			if (empty($contentId)) {
				$errCnt++;
				continue;
			}
			$contentId = str_replace("<", "", $contentId);
			$contentId = str_replace(">", "", $contentId);

			mailin_insert_inline_image($body, $contentId, $attId, $pageName);
		}
	}
	$out.= $cnt;
	$out.= " inline attachment(s) added. ".$errCnt." failed<br />";
}

function mailin_insert_inline_image(&$body, $contentId, $attId, $pageName)
{
	$search = array();
	$replace = array();
	$search[] = 'cid:'.$contentId;		// This string may differ depending on the senders email client, I guess. Tested using Outlook 2010 as the sender
	$replace[] = 'tiki-download_wiki_attachment.php?attId='.$attId.'&page='.urlencode($pageName);
	
	$newBody = str_replace($search, $replace, $body);
	if($newBody == $body) {
		$errCnt++;
		continue;
	}
	$body = $newBody;
}

219 220 221 222 223
/**
 * The tiki-mailin.php script is used to get / set wiki pages or articles
 * using a POP email account.
 */
global $debugger;
changi67's avatar
changi67 committed
224
if (defined($debugger)) $debugger->msg("tiki-mailin-code.php");
225 226
// Get a list of ACTIVE emails accounts configured for mailin procedures
$accs = $mailinlib->list_active_mailin_accounts(0, -1, 'account_desc', '');
227 228 229 230 231

if (empty($accs['data'])) {
	$content = '';
	return;
}
232
$content = '<br /><br />';
233
// foreach account
234
foreach ($accs['data'] as $acc) {
235 236 237 238 239 240 241
	
	$show_inlineImages = $acc['show_inlineImages'];
	$can_addAttachment = $prefs['feature_wiki_attachments'];
	if($can_addAttachment === 'y') {
		$can_addAttachment = $acc['attachments'];
	}
	
changi67's avatar
changi67 committed
242 243 244 245
	$content.= "<b>Processing account</b><br />";
	$content.= "Account :" . $acc['account'] . "<br />";
	$content.= "Type    :" . $acc['type'] . "<br />";
	$content.= "--------------------------<br />";
246

changi67's avatar
changi67 committed
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
	$pop3 = new Net_Pop3();
	$content.= "Connecting...";
	if ($pop3->connect($acc["pop"], $acc["port"])) {
		$content.= "OK.<br />";
		$content.= "Logging in...";
		if ($status = ($pop3->login($acc["username"], $acc["pass"], "USER")) !== FALSE) {
			$content.= "OK (" . $status . ").<br />";
			if (defined($debugger)) $debugger->msg("Logged in, status " . $status);
		} else {
			$content.= "FAILED.<br />";
			if (defined($debugger)) {
				$debugger->msg("Login failed, status " . $status);
				$debugger->msg("dump of pop3:");
				$debugger->var_dump('$pop3');
			}
		}
		$mailsum = $pop3->numMsg();
		if ($mailsum === FALSE) {
			$content.= "No messages.<br />";
			if (defined($debugger)) {
				$debugger->msg("No messages.");
				$debugger->msg("dump of pop3:");
				$debugger->var_dump('$pop3');
			}
271
		} else {
changi67's avatar
changi67 committed
272 273 274 275 276 277 278 279 280 281
			$content.= "Messages:" . $mailsum . "<br />";
			for ($i = 1; $i <= $mailsum; $i++) {
				$aux = $pop3->getParsedHeaders($i);
				if ($aux === FALSE) {
					$content.= "Headers not parsed.<br />";
				} else { // else $aux not FALSE
					if (!isset($aux["From"])) $aux['From'] = $aux['Return-path'];
					preg_match('/<?([-!#$%&\'*+\.\/0-9=?A-Z^_`a-z{|}~][email protected][-!#$%&\'*+\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\.\/0-9=?A-Z^_`a-z{|}~]+)>?/', $aux["From"], $mail);
					$email_from = $mail[1];
					$aux["msgid"] = $i;
282
					$aux["realmsgid"] = preg_replace('/[<>]/', '', $aux["Message-ID"]);
changi67's avatar
changi67 committed
283 284
					$message = $pop3->getMsg($i);
					$output = mime::decode($message);
285

changi67's avatar
changi67 committed
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
					$content.= "Reading a request.<br />From: " . $aux["From"] . "<br />Subject: " . $output['header']['subject'] . "<br />";
					$content.= "sender email: " . $email_from . "<br />";
					$aux["sender"]["user"] = $userlib->get_user_by_email($email_from);
					$content.= "sender user: " . $aux["sender"]["user"] . "<br />";
					$cantUseMailIn = $acc["anonymous"] == 'n' && empty($aux["sender"]["user"]);
					if ($cantUseMailIn) {
						$content.= "Anonymous user acces denied, sending auto-reply to email address:&nbsp;" . $aux["From"] . "<br />";
						$mail = new TikiMail();
						$mail->setFrom($acc["account"]);
						$l = $prefs['language'];
						$mail->setSubject(tra('Tiki mail-in auto-reply', $l));
						$mail->setText(tra("Sorry, you can't use this feature.", $l));
						$res = $mail->send(array($email_from), 'mail');
						$content.= "Response sent<br />";
					} else {
301 302 303 304 305 306 307 308
						
						if (empty($aux["sender"]["user"])) {
							$aux["sender"]["user"] = $email_from;
						}
						if (empty($aux["sender"]["name"])) {
							$aux["sender"]["name"] = $email_from;
						}
						
changi67's avatar
changi67 committed
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
						if ($acc['type'] == 'article-put') {
							// This is used to CREATE articles
							$title = trim($output['header']['subject']);
							$msgbody = mailin_get_body($output);
							if ($msgbody && isset($acc['discard_after'])) {
								$msgbody = preg_replace("/" . $acc['discard_after'] . ".*$/s", "", $msgbody);
							}
							$heading = $msgbody;
							$topicId = $acc['article_topicId'];
							$userm = $aux['sender']['user'];
							$authorName = $userm;
							$body = '';
							$publishDate = $tikilib->now;
							$cur_time = explode(',', $tikilib->date_format('%Y,%m,%d,%H,%M,%S', $publishDate));
							$expireDate = $tikilib->make_time($cur_time[3], $cur_time[4], $cur_time[5], $cur_time[1], $cur_time[2], $cur_time[0] + 1);
							$subId = 0;
							$type = $acc['article_type'];
							$useImage = 'n';
							$image_x = '';
							$image_y = '';
							$imgname = '';
							$imgsize = '';
							$imgtype = '';
							$imgdata = '';
							$topline = '';
							$subtitle = '';
							$linkto = '';
							$image_caption = '';
							$lang = '';
							$rating = 7;
							$isfloat = 'n';
							global $artlib;
							if (!is_object($artlib)) {
								include_once ('lib/articles/artlib.php');
							}
							$subid = $artlib->replace_submission($title, $authorName, $topicId, $useImage, $imgname, $imgsize, $imgtype, $imgdata, $heading, $body, $publishDate, $expireDate, $userm, $subId, $image_x, $image_y, $type, $topline, $subtitle, $linkto, $image_caption, $lang, $rating, $isfloat);
							global $tiki_p_autoapprove_submission;
							if ($tiki_p_autoapprove_submission == 'y') {
								$artlib->approve_submission($subid);
								$content.= "Article: $title has been submitted<br />";
							} else {
								$content.= "Article: $title has been created<br />";
							}
						} else { //else if ($acc['type'] == 'article-put')
							if ($acc['type'] == 'wiki') {
								$p_page = trim($aux['Subject']);
								$parts = explode(':', $p_page);
								if (!isset($parts[1])) {
									$parts[1] = $parts[0];
									$parts[0] = 'GET';
								}
								$method = $parts[0];
								$page = $parts[1];
							} else {
								$page = trim($aux['Subject']);
							}
365 366 367 368 369 370 371
							
							// Strip invalid characters from the page name 
							$wikilib = TikiLib::lib('wiki');
							if($wikilib->contains_badchars($page)) {
								$badChars = $wikilib->get_badchars();
								
								// Replace bad characters with a '_'
372 373 374 375
								for ($j = 0; $j < strlen($badChars); $j++) { 
									$char = $badChars[$j];
									$page = str_replace($char, "_", $page);
								}
376 377
							}
							
changi67's avatar
changi67 committed
378 379 380 381 382 383
							if ($acc['type'] == 'wiki-get' || ($acc['type'] == 'wiki' && $method == "GET")) {
								// A wiki-get account sends a copy of the page to the sender
								// and also sends the source of the page
								$mail = new TikiMail();
								$mail->setFrom($acc["account"]);
								if ($tikilib->page_exists($page)) {
384 385 386 387 388 389 390 391
									
									// Check permissions
									$chkUser = $aux["sender"]["user"];
									if(!$wikilib->user_has_perm_on_object($chkUser, $page, 'wiki page', 'tiki_p_view')) {
										$content.= $chkUser." cannot view the page: ".$page."<br />";
										continue;
									}
									
changi67's avatar
changi67 committed
392 393 394 395 396 397 398 399 400 401 402 403
									$mail->setSubject($page);
									$info = $tikilib->get_page_info($page);
									$data = $tikilib->parse_data($info["data"]);
									$mail->addAttachment($info['data'], 'source.txt', 'plain/txt');
									$mail->setHTML($data, strip_tags($data));
								} else {
									$l = $prefs['language'];
									$mail_data = $smarty->fetchLang($l, "mail/mailin_reply_subject.tpl");
									$mail->setSubject($mail_data . $page);
								}
								$res = $mail->send(array($email_from), 'mail');
								$content.= "Response sent<br />";
404 405
						   //end if ($acc['type'] == 'wiki-get' || ($acc['type'] == 'wiki' && $method == "GET"))
							} elseif ($acc['type'] == 'wiki-put' || ($acc['type'] == 'wiki' && $method == "PUT")) {
406
								
changi67's avatar
changi67 committed
407
								// This is used to UPDATE wiki pages
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438

								if ($tikilib->page_exists($page)) {
									// Check permissions for page
									$chkUser = $aux["sender"]["user"];
									if (!$wikilib->user_has_perm_on_object($chkUser, $page, 'wiki page', 'tiki_p_edit')) {
										$content.= $chkUser." cannot edit the page: ".$page."<br />";
										continue;
									}
									if (!$wikilib->user_has_perm_on_object($chkUser, $page, 'wiki page', 'tiki_p_wiki_attach_files')) {
										$can_addAttachment = 'n';
										$show_inlineImages = 'n';
									}
								} else {
									// Check global permissions
									$userlib = TikiLib::lib('user');
									if (!$userlib->user_has_permission($chkUser, 'tiki_p_edit')) {
										$content.= $chkUser." cannot created the page: ".$page."<br />";
										continue;
									}
									if (!$userlib->user_has_permission($chkUser, 'tiki_p_wiki_attach_files')) {
										$can_addAttachment = 'n';
										$show_inlineImages = 'n';
									}
								}
								
								// Attempt to use HTML, if it exists
								$body = mailin_get_html($output);
								if (empty($body)) {
									$body = mailin_get_body($output);
								}
								if (!empty($acc['discard_after']) && $body) {
changi67's avatar
changi67 committed
439 440 441
									$body = preg_replace("/" . $acc['discard_after'] . ".*$/s", "", $body);
								}
								if (!empty($body)) {
442 443
									mailin_extract_inline_images($page, $output, $body, $content, $aux["sender"]["user"]);
									mailin_check_attachments($output, $content, $page, $aux["sender"]["user"], $body);
changi67's avatar
changi67 committed
444 445
									if (!$tikilib->page_exists($page)) {
										$content.= "Page: $page has been created<br />";
446
										$tikilib->create_page($page, 0, $body, $tikilib->now, "Created from " . $acc["account"], $aux["sender"]["user"], '0.0.0.0', '');
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
										
										// Assign category, if specified
										if (isset($acc['categoryId'])) {
											try {
												$categoryId = intval($acc['categoryId']);
												if ($categoryId > 0) {
													// Validate the category before adding it
													$categlib = TikiLib::lib('categ');
													$categories = $categlib->get_category($categoryId);
													if ($categories !== false && !empty($categories)) {
														$categlib->categorizePage($page, $categoryId);
														$content.= "Page: $page categorized. Id: ".$categoryId."<br />";
													} else {
														$content.= "Page: $page not categorized. Invalid categoryId: ".$categoryId."<br />";
													}
												}
											} catch (Exception $e) {
												$content.= "Failed to categorize page: $page  categoryId: ".$categoryId.". Error: ".$e->getMessage()."<br />";
											}
										}
										
changi67's avatar
changi67 committed
468
									} else {
469 470
										$tikilib->update_page($page, $body, "Created from " . $acc["account"], $aux["sender"]["user"], '0.0.0.0', '');
										$content.= "Page: $page has been updated";
changi67's avatar
changi67 committed
471 472 473
									}
								}
							} elseif ($acc['type'] == 'wiki-append' || $acc['type'] == 'wiki-prepend' || ($acc['type'] == 'wiki' && $method == "APPEND") || ($acc['type'] == 'wiki' && $method == "PREPEND")) {
474

changi67's avatar
changi67 committed
475
								// This is used to UPDATE wiki pages
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494

								// Check permissions
								$chkUser = $aux["sender"]["user"];
								if(!$wikilib->user_has_perm_on_object($chkUser, $page, 'wiki page', 'tiki_p_edit')) {
									$content.= $chkUser." cannot edit the page: ".$page."<br />";
									continue;
								}
								if(!$wikilib->user_has_perm_on_object($chkUser, $page, 'wiki page', 'tiki_p_wiki_attach_files')) {
									$can_addAttachment = 'n';
									$show_inlineImages = 'n';
								}

								// Attempt to use HTML, if it exists
								$body = mailin_get_html($output);
								if (empty($body)) {
									$body = mailin_get_body($output);
								}

								if ($body && !empty($acc['discard_after'])) {
changi67's avatar
changi67 committed
495 496 497
									$body = preg_replace("/" . $acc['discard_after'] . ".*$/s", "", $body);
								}
								if (isset($body)) {
498 499
									mailin_extract_inline_images($page, $output, $body, $content, $aux["sender"]["user"]);
									mailin_check_attachments($output, $content, $page, $aux["sender"]["user"], $body);
changi67's avatar
changi67 committed
500 501 502 503 504 505 506 507 508 509 510
									if (!$tikilib->page_exists($page)) {
										$content.= "Page: $page has been created<br />";
										$tikilib->create_page($page, 0, $body, $tikilib->now, "Created from " . $acc["account"], $aux["sender"]["user"], '0.0.0.0', '');
									} else {
										$info = $tikilib->get_page_info($page);
										if ($acc['type'] == 'wiki-append' || $acc['type'] == 'wiki' && $method == "APPEND") $body = $info['data'] . $body;
										else $body = $body . $info['data'];
										$tikilib->update_page($page, $body, "Updated from " . $acc["account"], $aux["sender"]["user"], '0.0.0.0', '');
										$content.= "Page: $page has been updated";
									}
								}
511
							} else {
changi67's avatar
changi67 committed
512 513 514 515 516 517 518 519 520 521
								$mail = new TikiMail();
								$mail->setFrom($acc["account"]);
								$l = $prefs['language'];
								$mail_data = $smarty->fetchLang($l, "mail/mailin_help_subject.tpl");
								$mail->setSubject($mail_data);
								$smarty->assign('subject', $output['header']['subject']);
								$mail_data = $smarty->fetchLang($l, "mail/mailin_help.tpl");
								$mail->setText($mail_data);
								$res = $mail->send(array($email_from), 'mail');
							}
522
						}
changi67's avatar
changi67 committed
523
						
524
					}
changi67's avatar
changi67 committed
525
					// Remove the email from the pop3 server
526
					$pop3->deleteMsg($i);
527
				}
changi67's avatar
changi67 committed
528
				
529
			}
changi67's avatar
changi67 committed
530
			
531
		}
changi67's avatar
changi67 committed
532 533 534
		
	} else {
		$content.= "FAILED.<br />";
535
	}
changi67's avatar
changi67 committed
536 537
	$pop3->disconnect();
	
538
}