Rah. Firstpass changes

This commit is contained in:
Karl Cordes 2010-05-13 13:46:43 +10:00
parent 53446bdb76
commit 7294a73f75

View file

@ -55,11 +55,13 @@ class FirstpassShell extends Shell {
$enquiryList[$enqNumber] = $id;
}
for($i=1; $i <= $number_of_messages; $i++) {
//for($i=1; $i <= 50; $i++) {
//for($i=1; $i <= $number_of_messages; $i++) {
for($i=1; $i <= 50; $i++) {
$this_header = imap_headerinfo($mbox, $i);
$message = $this->getMessage($mbox, $i, $this_header);
@ -70,7 +72,9 @@ class FirstpassShell extends Shell {
if($enqID == false) {
echo "Deleting msg number: $i\tSubject: ".$message['subject']."\n";
imap_delete($mbox, $i);
//imap_delete($mbox, $i);
$discardArray[] = $i;
}
}
@ -78,6 +82,25 @@ class FirstpassShell extends Shell {
echo "Tidying up now.\n";
reset($discardArray);
$numberToDiscard= count($discardArray);
if($numberToDiscard > 0) {
echo "Going to discard $numberToDiscard messages\n";
$discardSet = implode(",",$discardArray);
imap_delete($mbox, $discardSet);
}
imap_expunge($mbox);
imap_close($mbox);