| version 1.11, 2005/04/25 20:09:28 |
version 1.12, 2005/05/02 18:23:30 |
|
|
| <?php |
<?php |
| |
|
| // $Platon: mylist/backend/receiver/receiver.php,v 1.10 2005/04/25 19:31:15 rajo Exp $ |
// $Platon: mylist/backend/receiver/receiver.php,v 1.11 2005/04/25 20:09:28 rajo Exp $ |
| |
|
| require_once dirname(__FILE__).'/validator.php'; |
require_once dirname(__FILE__).'/validator.php'; |
| require_once dirname(__FILE__).'/../../mylist.config.php'; |
require_once dirname(__FILE__).'/../../mylist.config.php'; |
| Line 54 class CReceiver { |
|
| Line 54 class CReceiver { |
|
| |
|
| function processMessage($list_id) |
function processMessage($list_id) |
| { // {{{ |
{ // {{{ |
| $this->modifiedMessage = new CModifiedEmailMessage(); |
$tÐÒæZ|ÚÞÈÒÌÒÊÈšÊææÂÎÊ@z@ÜÊî@†šÞÈÒÌÒÊÈŠÚÂÒØšÊææÂÎÊPRvHèÐÒæZ|ÚÞÈÒÌòšÊææÂÎÊPHØÒæè¾ÒÈRvHÚÊææÂÎʾâêÊêʾÒÈ@z@HèÐÒæZ|ÒÜæÊäèšÊææÂÎÊ’ÜèÞ¢êÊêÊPHØÒæè¾ÒÈRvÎØÞÄÂØ@HÈÄÐvHæâØ@z@D¦Š˜Š†¨@̾ÂäÆÐÒìÊ@Œ¤žš@ÚòØÒæè¾ØÒæèæ@®�ФŠ@ÒÈ@z@HØÒæè¾ÒÈDvH̾ÂäÆÐÒìÊ@zL@HÈÄÐZ|ÎÊèžÜÊPHæâØRvÒÌ@PH̾ÂäÆÐÒìÊRöHÂäÆÐÒìʾÒÈ@z@HèÐÒæZ|ÂäÆÐÒìÊšÊææÂÎÊPHØÒæè¾ÒÈRvÒÌ@PHÂäÆÐÒìʾÒÈRöHèÐÒæZ|æÊè ÂäÊÜè’ˆPHÂäÆÐÒìʾÒÈRvHèÐÒæZ|ÒÜÈÊðÊä@z@ÜÊî@†’ÜÈÊðÊäPRvHèÐÒæZ|ÒÜÈÊðÊäZ|æêÄÔÊÆè@z@HèÐÒæZ|ÚÞÈÒÌÒÊÈšÊææÂÎÊZ|æêÄÔÊÆèvHèhis->indexer->header = $this->validator->emailMessage->structure->headers; |
| $this->modifyMessage($list_id); |
|
| $message_queue_id = $this->insertMessageIntoQueue($list_id); |
|
| |
|
| global $dbh; |
|
| |
|
| $sql = "SELECT f_archive FROM mylist_lists WHERE id = $list_id"; |
|
| $f_archive =& $dbh->getOne($sql); |
|
| |
|
| if ($f_archive) |
|
| { |
|
| $archive_id = $this->archiveMessage($list_id); |
|
| if ($archive_id) |
|
| { |
|
| $this->setParentID($archive_id); |
|
| |
|
| $this->indexer = new CIndexer(); |
|
| $this->indexer->subject = $this->modifiedMessage->subject; |
|
| $this->indexer->header = $this->validator->emailMessage->structure->headers; |
|
| $this->indexer->body = $this->emailMessage->plain_body; |
$this->indexer->body = $this->emailMessage->plain_body; |
| $this->indexer->attachements = ""; |
$this->indexer->attachements = ""; |
| // text attachements to db, others to filesystem |
// text attachements to db, others to filesystem |
| if ($this->messageHasAttachements()) |
if ($this->messageHasAttachements()) |
| $this->processAttachements($archive_id); |
$this->processAttachements($archive_id, $list_id); |
| |
|
| $this->indexer->indexMessage($archive_id); |
$this->indexer->indexMessage($archive_id); |
| } |
} |
| Line 390 class CReceiver { |
|
| Line 372 class CReceiver { |
|
| if (Is_Array($this->validator->emailMessage->structure->parts)) |
if (Is_Array($this->validator->emailMessage->structure->parts)) |
| return true; |
return true; |
| else |
else |
| return false; |
return false; |
| } // }}} |
} // }}} |
| |
|
| |
|
| Line 450 class CReceiver { |
|
| Line 432 class CReceiver { |
|
| } // }}} |
} // }}} |
| |
|
| |
|
| function processAttachements($id) |
function processAttachements($id,$list) |
| { // {{{ |
{ // {{{ |
| |
|
| global $dbh; |
global $dbh; |
| |
$sql = "SELECT max_attachement_size FROM mylist_lists WHERE id = '$list'"; |
| |
$row =& $dbh->getRow($sql); |
| |
if (PEAR::isError($row)) |
| |
die($row->getMessage()); |
| |
$max_size = $row['max_attachement_size'] * 1024; |
| |
|
| foreach ($this->validator->emailMessage->structure->parts as $part) |
foreach ($this->validator->emailMessage->structure->parts as $part) |
| { |
{ |
| |
|
| if (isset($part->disposition) and ($part->disposition=='attachment')) |
if (isset($part->disposition) and ($part->disposition=='attachment') and (StrLen($part->body) <= $max_size)) |
| { |
{ |
| $filename = $part->d_parameters['filename']; |
$filename = $part->d_parameters['filename']; |
| if ($filename == "") |
if ($filename == "") |