Action: postie_file_added_pre

This action is called after Postie successfully extracts an email attachment and before it adds it as a media item to the post. At the point it is called there is only a placeholder post, e.g. the content and metadata is not set yet.

add_action('postie_file_added_pre', 'my_fileaddedpre', 10, 2);

function my_fileaddedpre($postid, $file_array) {
    error_log("file name: {$file_array['name']}");
    error_log("file type: {$file_array['type']}");
    error_log("file path: {$file_array['tmp_name']}");
    error_log("file size: {$file_array['size']}");
}