Fixed long standing bugs in the vault..

This commit is contained in:
Karl Cordes 2009-08-06 15:24:14 +10:00
parent c9fe656bfa
commit 53cd0aac60

View file

@ -13,16 +13,16 @@ class VaultShell extends Shell {
/****************************************************** /******************************************************
* Config Variables * Config Variables
* *****************************************************/ * *****************************************************/
$testing = 1; //Whether to actually move the emails. 1=test, 0=production $testing = 0; //Whether to actually move the emails. 1=test, 0=production
/* Setup Connection to the IMAP server */ /* Setup Connection to the IMAP server */
$username = 'vault'; $username = 'vault';
$password = 'xjdYOsmJWc37'; /* The password for the account to be checked */ $password = 'xjdYOsmJWc37'; /* The password for the account to be checked */
$email_dir = '/var/www/cakephp/app/emails/working'; $email_dir = '/var/www/cakephp/app/emails/working';
$temp_filename = 'temp.eml'; $temp_filename = 'temp.eml';
// if($testing == 1) { if($testing == 1) {
$email_dir = '/var/www/quotenik1.2/app/emails/working'; $email_dir = '/var/www/quotenik1.2/app/emails/working';
// } }
$mbox = imap_open("{saturn:143/novalidate-cert}INBOX", $username, $password) or die("can't connect: " . imap_last_error()); $mbox = imap_open("{saturn:143/novalidate-cert}INBOX", $username, $password) or die("can't connect: " . imap_last_error());
$MC = imap_check($mbox); $MC = imap_check($mbox);
@ -160,7 +160,7 @@ class VaultShell extends Shell {
$this_header = imap_headerinfo($mbox, $i); $this_header = imap_headerinfo($mbox, $i);
echo "Going to store: $no\t $msg\t."$this_header->subject."\n"; echo "Going to store: $no\t $msg\t".$this_header->subject."\n";
if($testing == 0) { if($testing == 0) {
imap_mail_move($mbox, $no, 'INBOX/Stored'); imap_mail_move($mbox, $no, 'INBOX/Stored');
} }
@ -170,7 +170,7 @@ class VaultShell extends Shell {
foreach($discarded_msgs as $msg) { foreach($discarded_msgs as $msg) {
$no = imap_msgno($mbox,$msg); $no = imap_msgno($mbox,$msg);
echo "Going to discard: $no\t $msg\t."$this_header->subject."\n"; echo "Going to discard: $no\t $msg\t".$this_header->subject."\n";
if($testing == 0) { if($testing == 0) {
imap_mail_move($mbox,$no, 'INBOX/Discarded'); imap_mail_move($mbox,$no, 'INBOX/Discarded');
} }