Vault tweaks. Might work this time

This commit is contained in:
Karl Cordes 2011-03-10 19:35:42 +11:00
parent 486c83bc3c
commit f540c45258

View file

@ -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];