Skip to content
Browse files

Implement delete_processed_mail_files yes/no option for mailfiles spo…

…ols.
  • Loading branch information...
1 parent 9a5ab95 commit 8460bbf642f93d0eb42dd3cb802e91f5f60b8748 @manitou-mail committed Nov 8, 2012
Showing with 8 additions and 0 deletions.
  1. +2 −0 lib/Manitou/Config.pm
  2. +6 −0 script/manitou-mdx
View
2 lib/Manitou/Config.pm
@@ -34,6 +34,7 @@ my %default_conf =
'auto_db_reconnect' => 'yes',
'alive_interval' => 60, # seconds
'body_format_flowed' => 'yes',
+ 'delete_processed_mail_files' => "no",
'detach_text_plain' => "yes",
'flush_word_index_interval' => 60*5,
'flush_word_index_max_queued' => 100,
@@ -61,6 +62,7 @@ my %conf_opts =
'auto_db_reconnect' => 'bool',
'body_format_flowed' => 'bool',
'db_connect_string' => 'string',
+ 'delete_processed_mail_files' => 'bool',
'detach_text_plain' => 'bool',
'exclude_contents' => 'string',
'incoming_check_interval' => 'integer',
View
6 script/manitou-mdx
@@ -289,6 +289,12 @@ sub import_mailfiles {
error_log("Failed to delete file $proc_filename: $!");
}
}
+ if ($ret>0 && $origin->{type} eq "dot-received" &&
+ getconf_bool("delete_processed_mail_files"), $mbox) {
+ if (!unlink($done)) {
+ error_log("Failed to delete file $done: $!");
+ }
+ }
}
}

0 comments on commit 8460bbf

Please sign in to comment.
Something went wrong with that request. Please try again.