diff --git a/vendors/shells/vault_two.php b/vendors/shells/vault_two.php index ab5d766d..e59b30b4 100755 --- a/vendors/shells/vault_two.php +++ b/vendors/shells/vault_two.php @@ -139,6 +139,11 @@ class VaultTwoShell extends Shell { //print_r($recipients); + if(!isset($this_header->subject)) { //Emails without a subject are not welcome. Skip it. + $discard[] = $this_uid; + continue; + } + $subjDecoded = imap_mime_header_decode($this_header->subject); $foundIdent = false; @@ -563,7 +568,7 @@ class VaultTwoShell extends Shell { $uuid = String::uuid(); $email_file = $email_dir.'/'.$uuid.'.eml'; imap_savebody($mailbox, $email_file, $msg_number); - $command = "$ripmime_path -i $email_file -d $email_dir/$relative_path --prefix --paranoid -v --verbose-contenttype"; + $command = "$ripmime_path -i $email_file -d $email_dir/$relative_path --prefix --paranoid -v --verbose-contenttype --recursion-max 30"; $output = array(); exec($command, $output, $status); @@ -583,10 +588,25 @@ class VaultTwoShell extends Shell { $type = explode('=', $words[1]); $name = explode('=', $words[2]); - if(count($type) < 1) { + /*echo "OUTPUT\n"; + print_r($output); + echo count($output)."\n"; + + echo "TYPE\n"; + print_r($type); + + echo count($type)."\n"; +*/ + if(count($type) != 2) { + //echo "Didnt find a proper type. Skipping it."; continue; } + if(count($name) != 2) { + //echo "Didnt find a proper name. Skipping it"; + continue; + } + $oldNamePath = $email_dir.'/'.$relative_path.'/'.$name[1]; $newNamePath = $email_dir.'/'.$relative_path.'/'.$uuid.'-'.$name[1]; $newName = $relative_path.'/'.$uuid.'-'.$name[1];